From jlaskey at apple.com Mon Jan 29 09:09:51 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 09:09:51 -0600 Subject: [llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj Message-ID: <200701291509.l0TF9pkt029698@zion.cs.uiuc.edu> Changes in directory llvm/Xcode/LLVM.xcodeproj: project.pbxproj updated: 1.29 -> 1.30 --- Log message: Update project. --- Diffs of the changes: (+4 -6) project.pbxproj | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.29 llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.30 --- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.29 Tue Jan 23 21:42:03 2007 +++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj Mon Jan 29 09:09:35 2007 @@ -123,9 +123,9 @@ CF65281209D1BA3800C4B521 /* SparcSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcSubtarget.h; path = ../lib/Target/Sparc/SparcSubtarget.h; sourceTree = SOURCE_ROOT; }; CF65281309D1BA3800C4B521 /* SparcTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcTargetMachine.cpp; path = ../lib/Target/Sparc/SparcTargetMachine.cpp; sourceTree = SOURCE_ROOT; }; CF65281409D1BA3800C4B521 /* SparcTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcTargetMachine.h; path = ../lib/Target/Sparc/SparcTargetMachine.h; sourceTree = SOURCE_ROOT; }; - CF6529A6095B21A8007F884E /* MachineDebugInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachineDebugInfo.cpp; sourceTree = ""; }; + CF6529A6095B21A8007F884E /* MachineModuleInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachineModuleInfo.cpp; sourceTree = ""; }; CF6B5AFD095C82C300D1EA42 /* DAGCombiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DAGCombiner.cpp; sourceTree = ""; }; - CF6F487109505E1500BC9E82 /* MachineDebugInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineDebugInfo.h; sourceTree = ""; }; + CF6F487109505E1500BC9E82 /* MachineModuleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineModuleInfo.h; sourceTree = ""; }; CF71B60F0AC45EDA0007F57C /* SmallVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallVector.h; sourceTree = ""; }; CF73C0A2098A4FDF00627152 /* InlineAsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineAsm.h; sourceTree = ""; }; CF73C0A3098A4FDF00627152 /* TypeSymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSymbolTable.h; sourceTree = ""; }; @@ -1257,7 +1257,7 @@ DE66ED7508ABEC2B00323D32 /* LiveVariables.cpp */, CF32AF5C0AEE6A4E00D24CD4 /* LLVMTargetMachine.cpp */, DE66ED7608ABEC2B00323D32 /* MachineBasicBlock.cpp */, - CF6529A6095B21A8007F884E /* MachineDebugInfo.cpp */, + CF6529A6095B21A8007F884E /* MachineModuleInfo.cpp */, DE66ED7808ABEC2B00323D32 /* MachineFunction.cpp */, DE66ED7908ABEC2B00323D32 /* MachineInstr.cpp */, CF4F27F60A7B6FA3004359F6 /* MachinePassRegistry.cpp */, @@ -2030,7 +2030,7 @@ DE66F23B08ABF03100323D32 /* MachineBasicBlock.h */, DE66F23C08ABF03100323D32 /* MachineCodeEmitter.h */, DE66F23D08ABF03100323D32 /* MachineConstantPool.h */, - CF6F487109505E1500BC9E82 /* MachineDebugInfo.h */, + CF6F487109505E1500BC9E82 /* MachineModuleInfo.h */, DE66F23E08ABF03100323D32 /* MachineFrameInfo.h */, DE66F23F08ABF03100323D32 /* MachineFunction.h */, DE66F24008ABF03100323D32 /* MachineFunctionPass.h */, @@ -2543,12 +2543,10 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = DE66EC5008ABE78900323D32 /* Build configuration list for PBXProject "LLVM" */; - compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* LLVM */; projectDirPath = ""; projectRoot = ""; - shouldCheckCompatibility = 1; targets = ( D28A88AD04BDD90700651E21 /* LLVM */, CF0329B608D1BE110030FD33 /* LLVM lib */, From reid at x10sys.com Mon Jan 29 11:40:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 11:40:05 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/IntrinsicLowering.h Message-ID: <200701291740.l0THe5wu032301@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: IntrinsicLowering.h updated: 1.12 -> 1.13 --- Log message: IntrinsicLowering now requires TargetData. --- Diffs of the changes: (+3 -1) IntrinsicLowering.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/IntrinsicLowering.h diff -u llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.12 llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.13 --- llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.12 Sun Jan 28 16:26:42 2007 +++ llvm/include/llvm/CodeGen/IntrinsicLowering.h Mon Jan 29 11:39:50 2007 @@ -21,10 +21,12 @@ namespace llvm { class CallInst; class Module; + class TargetData; class IntrinsicLowering { + const TargetData& TD; public: - IntrinsicLowering() {} + IntrinsicLowering(const TargetData &td) : TD(td) {} /// AddPrototypes - This method, if called, causes all of the prototypes /// that might be needed by an intrinsic lowering implementation to be From reid at x10sys.com Mon Jan 29 11:42:22 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 11:42:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200701291742.l0THgMCC032454@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.60 -> 1.61 --- Log message: Use TargetData to obtain the correct size of the "size_t" argument for functions like memcpy, memmove and memset. Ensure only one prototype is used for these functions and that it matches the system definition by using the appropriate type for the size argument. --- Diffs of the changes: (+24 -9) IntrinsicLowering.cpp | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.60 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.61 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.60 Sun Jan 28 16:28:00 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon Jan 29 11:42:06 2007 @@ -18,6 +18,7 @@ #include "llvm/Type.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Support/Streams.h" +#include "llvm/Target/TargetData.h" using namespace llvm; template @@ -79,22 +80,21 @@ case Intrinsic::memcpy_i64: M.getOrInsertFunction("memcpy", PointerType::get(Type::Int8Ty), PointerType::get(Type::Int8Ty), - PointerType::get(Type::Int8Ty), Type::Int32Ty, - (Type *)0); + PointerType::get(Type::Int8Ty), + TD.getIntPtrType(), (Type *)0); break; case Intrinsic::memmove_i32: case Intrinsic::memmove_i64: M.getOrInsertFunction("memmove", PointerType::get(Type::Int8Ty), PointerType::get(Type::Int8Ty), - PointerType::get(Type::Int8Ty), Type::Int32Ty, - (Type *)0); + PointerType::get(Type::Int8Ty), + TD.getIntPtrType(), (Type *)0); break; case Intrinsic::memset_i32: case Intrinsic::memset_i64: M.getOrInsertFunction("memset", PointerType::get(Type::Int8Ty), - PointerType::get(Type::Int8Ty), - Type::Int32Ty, (--(--I->arg_end()))->getType(), - (Type *)0); + PointerType::get(Type::Int8Ty), Type::Int32Ty, + TD.getIntPtrType(), (Type *)0); break; case Intrinsic::sqrt_f32: case Intrinsic::sqrt_f64: @@ -358,6 +358,9 @@ case Intrinsic::memcpy_i32: { static Constant *MemcpyFCache = 0; + Value * Size = cast(CI->op_end()-1); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new ZExtInst(Size, TD.getIntPtrType())); ReplaceCallWith("memcpy", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemcpyFCache); break; @@ -365,31 +368,43 @@ case Intrinsic::memcpy_i64: { static Constant *MemcpyFCache = 0; Value * Size = cast(CI->op_end()-1); - if (Size->getType() != Type::Int32Ty) - Size->replaceAllUsesWith(new TruncInst(Size, Type::Int32Ty)); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new TruncInst(Size, TD.getIntPtrType())); ReplaceCallWith("memcpy", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemcpyFCache); break; } case Intrinsic::memmove_i32: { static Constant *MemmoveFCache = 0; + Value * Size = cast(CI->op_end()-1); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new ZExtInst(Size, TD.getIntPtrType())); ReplaceCallWith("memmove", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemmoveFCache); break; } case Intrinsic::memmove_i64: { static Constant *MemmoveFCache = 0; + Value * Size = cast(CI->op_end()-1); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new TruncInst(Size, TD.getIntPtrType())); ReplaceCallWith("memmove", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemmoveFCache); break; } case Intrinsic::memset_i32: { static Constant *MemsetFCache = 0; + Value * Size = cast(CI->op_end()-1); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new ZExtInst(Size, TD.getIntPtrType())); ReplaceCallWith("memset", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemsetFCache); } case Intrinsic::memset_i64: { static Constant *MemsetFCache = 0; + Value * Size = cast(CI->op_end()-1); + if (Size->getType() != TD.getIntPtrType()) + Size->replaceAllUsesWith(new TruncInst(Size, TD.getIntPtrType())); ReplaceCallWith("memset", CI, CI->op_begin()+1, CI->op_end()-1, (*(CI->op_begin()+1))->getType(), MemsetFCache); break; From reid at x10sys.com Mon Jan 29 11:50:45 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 11:50:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200701291750.l0THojAx000722@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.321 -> 1.322 --- Log message: Implement use of new IntrinsicLowering interface. --- Diffs of the changes: (+9 -4) CBackend.cpp | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.321 llvm/lib/Target/CBackend/CBackend.cpp:1.322 --- llvm/lib/Target/CBackend/CBackend.cpp:1.321 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Mon Jan 29 11:50:30 2007 @@ -32,6 +32,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetData.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GetElementPtrTypeIterator.h" @@ -70,16 +71,18 @@ /// module to a C translation unit. class CWriter : public FunctionPass, public InstVisitor { std::ostream &Out; - IntrinsicLowering IL; + IntrinsicLowering *IL; Mangler *Mang; LoopInfo *LI; const Module *TheModule; const TargetAsmInfo* TAsm; + const TargetData* TD; std::map TypeNames; std::map FPConstantMap; public: - CWriter(std::ostream &o) : Out(o), TAsm(0) {} + CWriter(std::ostream &o) : Out(o), IL(0), Mang(0), LI(0), TheModule(0), + TAsm(0), TD(0) {} virtual const char *getPassName() const { return "C backend"; } @@ -1416,7 +1419,9 @@ // Initialize TheModule = &M; - IL.AddPrototypes(M); + TD = new TargetData(&M); + IL = new IntrinsicLowering(*TD); + IL->AddPrototypes(M); // Ensure that all structure types have names... Mang = new Mangler(M); @@ -2348,7 +2353,7 @@ if (CI != &BB->front()) Before = prior(BasicBlock::iterator(CI)); - IL.LowerIntrinsicCall(CI); + IL->LowerIntrinsicCall(CI); if (Before) { // Move iterator to instruction after call I = Before; ++I; } else { From reid at x10sys.com Mon Jan 29 11:51:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 11:51:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Message-ID: <200701291751.l0THpH3p000742@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Interpreter.cpp updated: 1.34 -> 1.35 --- Log message: Implement use of new IntrinsicLowering interface. --- Diffs of the changes: (+1 -1) Interpreter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.34 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.35 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.34 Fri Jan 26 02:11:39 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Mon Jan 29 11:51:02 2007 @@ -66,7 +66,7 @@ initializeExternalFunctions(); emitGlobals(); - IL = new IntrinsicLowering(); + IL = new IntrinsicLowering(TD); } Interpreter::~Interpreter() { From reid at x10sys.com Mon Jan 29 11:56:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 11:56:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Message-ID: <200701291756.l0THu6b5000938@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Interpreter.cpp updated: 1.35 -> 1.36 --- Log message: Remove tabs. --- Diffs of the changes: (+2 -2) Interpreter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.35 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.36 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.35 Mon Jan 29 11:51:02 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Mon Jan 29 11:55:50 2007 @@ -46,8 +46,8 @@ bool isLittleEndian = (Test == 1); DataLayout.append(isLittleEndian ? "e" : "E"); - bool Ptr64 = sizeof(void*) == 8; - DataLayout.append(Ptr64 ? "-p:64:64" : "-p:32:32"); + bool Ptr64 = sizeof(void*) == 8; + DataLayout.append(Ptr64 ? "-p:64:64" : "-p:32:32"); M->setDataLayout(DataLayout); From jlaskey at apple.com Mon Jan 29 12:45:30 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:45:30 -0600 Subject: [llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj Message-ID: <200701291845.l0TIjUEu005108@zion.cs.uiuc.edu> Changes in directory llvm/Xcode/LLVM.xcodeproj: project.pbxproj updated: 1.30 -> 1.31 --- Log message: Update project --- Diffs of the changes: (+0 -6) project.pbxproj | 6 ------ 1 files changed, 6 deletions(-) Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.30 llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.31 --- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.30 Mon Jan 29 09:09:35 2007 +++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj Mon Jan 29 12:45:08 2007 @@ -154,13 +154,11 @@ CF8F1B420B64F70B00BB4199 /* PassManagers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassManagers.h; sourceTree = ""; }; CF8F1B430B64F74400BB4199 /* Allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Allocator.h; sourceTree = ""; }; CF8F1B440B64F74400BB4199 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; - CF8F1B450B64F74400BB4199 /* Disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Disassembler.h; sourceTree = ""; }; CF8F1B460B64F74400BB4199 /* ManagedStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedStatic.h; sourceTree = ""; }; CF8F1B470B64F74400BB4199 /* OutputBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutputBuffer.h; sourceTree = ""; }; CF8F1B490B64F7AB00BB4199 /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = ""; }; CF8F1B4D0B64F80700BB4199 /* AliasDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AliasDebugger.cpp; sourceTree = ""; }; CF8F1B4E0B64F86A00BB4199 /* CStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CStringMap.cpp; sourceTree = ""; }; - CF8F1B4F0B64F86A00BB4199 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Disassembler.cpp; sourceTree = ""; }; CF8F1B500B64F86A00BB4199 /* ManagedStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManagedStatic.cpp; sourceTree = ""; }; CF8F1B510B64F86A00BB4199 /* Streams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Streams.cpp; sourceTree = ""; }; CF8F1B530B64F8C000BB4199 /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = ""; }; @@ -396,7 +394,6 @@ DE66ECA508ABEB8000323D32 /* ArchiveWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArchiveWriter.cpp; sourceTree = ""; }; DE66ECB708ABEB8000323D32 /* SlotCalculator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SlotCalculator.cpp; sourceTree = ""; }; DE66ECB808ABEB8000323D32 /* SlotCalculator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SlotCalculator.h; sourceTree = ""; }; - DE66ECB908ABEB8000323D32 /* SlotTable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SlotTable.h; sourceTree = ""; }; DE66ECBA08ABEB8000323D32 /* Writer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Writer.cpp; sourceTree = ""; }; DE66ECBB08ABEB8000323D32 /* WriterInternals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WriterInternals.h; sourceTree = ""; }; DE66ECBE08ABEC0700323D32 /* AliasAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasAnalysis.cpp; sourceTree = ""; }; @@ -1182,7 +1179,6 @@ children = ( DE66ECB708ABEB8000323D32 /* SlotCalculator.cpp */, DE66ECB808ABEB8000323D32 /* SlotCalculator.h */, - DE66ECB908ABEB8000323D32 /* SlotTable.h */, DE66ECBA08ABEB8000323D32 /* Writer.cpp */, DE66ECBB08ABEB8000323D32 /* WriterInternals.h */, ); @@ -1368,7 +1364,6 @@ DE66EE1E08ABEDE600323D32 /* Compressor.cpp */, CF8F1B4E0B64F86A00BB4199 /* CStringMap.cpp */, DE66EE3D08ABEDE600323D32 /* Debug.cpp */, - CF8F1B4F0B64F86A00BB4199 /* Disassembler.cpp */, CF79495D09B326D4005ADFCA /* Dwarf.cpp */, DE66EE3E08ABEDE600323D32 /* FileUtilities.cpp */, CF42B6C40AF2512000D5D47C /* FoldingSet.cpp */, @@ -2107,7 +2102,6 @@ CF73C0AD098A519400627152 /* DataTypes.h */, DE66F27908ABF03200323D32 /* DataTypes.h.in */, DE66F27A08ABF03200323D32 /* Debug.h */, - CF8F1B450B64F74400BB4199 /* Disassembler.h */, DE66F27B08ABF03200323D32 /* DOTGraphTraits.h */, DE66F27C08ABF03200323D32 /* DynamicLinker.h */, DE66F27D08ABF03200323D32 /* ELF.h */, From jlaskey at apple.com Mon Jan 29 12:51:37 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/DwarfWriter.h Message-ID: <200701291851.l0TIpbYr005270@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: DwarfWriter.h updated: 1.44 -> 1.45 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+12 -7) DwarfWriter.h | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CodeGen/DwarfWriter.h diff -u llvm/include/llvm/CodeGen/DwarfWriter.h:1.44 llvm/include/llvm/CodeGen/DwarfWriter.h:1.45 --- llvm/include/llvm/CodeGen/DwarfWriter.h:1.44 Fri Jan 26 15:22:27 2007 +++ llvm/include/llvm/CodeGen/DwarfWriter.h Mon Jan 29 12:51:14 2007 @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// // -// This file contains support for writing Dwarf debug info into asm files. For -// Details on the Dwarf 3 specfication see DWARF Debugging Information Format -// V.3 reference manual http://dwarf.freestandards.org , +// This file contains support for writing Dwarf debug and exception info into +// asm files. For Details on the Dwarf 3 specfication see DWARF Debugging +// Information Format V.3 reference manual http://dwarf.freestandards.org , // -// The role of the Dwarf Writer class is to extract debug information from the +// The role of the Dwarf Writer class is to extract information from the // MachineModuleInfo object, organize it in Dwarf form and then emit it into asm // the current asm file using data and high level Dwarf directives. // @@ -25,7 +25,8 @@ namespace llvm { class AsmPrinter; -class Dwarf; +class DwarfDebug; +class DwarfException; class MachineModuleInfo; class MachineFunction; class Module; @@ -37,9 +38,13 @@ class DwarfWriter { private: - /// DM - Provides the DwarfWriter implementation. + /// DD - Provides the DwarfWriter debug implementation. /// - Dwarf *DW; + DwarfDebug *DD; + + /// DE - Provides the DwarfWriter exception implementation. + /// + DwarfException *DE; public: From jlaskey at apple.com Mon Jan 29 12:51:40 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200701291851.l0TIpe4g005275@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.16 -> 1.17 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+2 -0) TargetAsmInfo.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.16 llvm/lib/Target/TargetAsmInfo.cpp:1.17 --- llvm/lib/Target/TargetAsmInfo.cpp:1.16 Wed Jan 17 19:12:56 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Mon Jan 29 12:51:14 2007 @@ -59,6 +59,7 @@ FourByteConstantSection(0), EightByteConstantSection(0), SixteenByteConstantSection(0), + GlobalDirective(0), SetDirective(0), LCOMMDirective(0), COMMDirective("\t.comm\t"), @@ -70,6 +71,7 @@ HasLEB128(false), HasDotLoc(false), HasDotFile(false), + SupportsExceptionHandling(false), DwarfRequiresFrameSection(true), DwarfAbbrevSection(".debug_abbrev"), DwarfInfoSection(".debug_info"), From jlaskey at apple.com Mon Jan 29 12:51:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:41 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200701291851.l0TIpfJe005281@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.23 -> 1.24 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+14 -0) TargetAsmInfo.h | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.23 llvm/include/llvm/Target/TargetAsmInfo.h:1.24 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.23 Wed Jan 17 19:12:56 2007 +++ llvm/include/llvm/Target/TargetAsmInfo.h Mon Jan 29 12:51:14 2007 @@ -202,6 +202,10 @@ //===--- Global Variable Emission Directives --------------------------===// + /// GlobalDirective - This is the directive used to declare a global entity. + /// + const char *GlobalDirective; // Defaults to NULL. + /// SetDirective - This is the name of a directive that can be used to tell /// the assembler to set the value of a variable to some expression. const char *SetDirective; // Defaults to null. @@ -250,6 +254,10 @@ /// bool HasDotFile; // Defaults to false. + /// SupportsExceptionHandling - True if target supports exception handling. + /// + bool SupportsExceptionHandling; // Defaults to false. + /// RequiresFrameSection - true if the Dwarf2 output needs a frame section /// bool DwarfRequiresFrameSection; // Defaults to true. @@ -440,6 +448,9 @@ const char *getSixteenByteConstantSection() const { return SixteenByteConstantSection; } + const char *getGlobalDirective() const { + return GlobalDirective; + } const char *getSetDirective() const { return SetDirective; } @@ -473,6 +484,9 @@ bool hasDotFile() const { return HasDotFile; } + bool getSupportsExceptionHandling() const { + return SupportsExceptionHandling; + } bool getDwarfRequiresFrameSection() const { return DwarfRequiresFrameSection; } From jlaskey at apple.com Mon Jan 29 12:51:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200701291851.l0TIpfej005289@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.198 -> 1.199 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+3 -4) X86RegisterInfo.cpp | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.198 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.199 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.198 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Mon Jan 29 12:51:14 2007 @@ -997,8 +997,7 @@ MachineInstr *MI; MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - // Prepare for debug frame info. - bool hasDebugInfo = MMI && MMI->hasDebugInfo(); + // Prepare for frame info. unsigned FrameLabelId = 0; // Get the number of bytes to allocate from the FrameInfo @@ -1023,7 +1022,7 @@ } } - if (hasDebugInfo) { + if (MMI) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId); @@ -1053,7 +1052,7 @@ MBB.insert(MBBI, MI); } - if (hasDebugInfo) { + if (MMI) { std::vector &Moves = MMI->getFrameMoves(); if (NumBytes) { From jlaskey at apple.com Mon Jan 29 12:51:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCTargetAsmInfo.cpp Message-ID: <200701291851.l0TIpfro005298@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.101 -> 1.102 PPCTargetAsmInfo.cpp updated: 1.14 -> 1.15 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+5 -4) PPCRegisterInfo.cpp | 7 +++---- PPCTargetAsmInfo.cpp | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.101 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.102 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.101 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Jan 29 12:51:14 2007 @@ -756,8 +756,7 @@ MachineFrameInfo *MFI = MF.getFrameInfo(); MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - // Prepare for debug frame info. - bool hasDebugInfo = MMI && MMI->hasDebugInfo(); + // Prepare for frame info. unsigned FrameLabelId = 0; // Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it, @@ -819,7 +818,7 @@ unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); unsigned MaxAlign = MFI->getMaxAlignment(); - if (hasDebugInfo) { + if (MMI) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId); @@ -870,7 +869,7 @@ } } - if (hasDebugInfo) { + if (MMI) { std::vector &Moves = MMI->getFrameMoves(); if (NegFrameSize) { Index: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.14 llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.15 --- llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.14 Wed Jan 17 19:15:58 2007 +++ llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Mon Jan 29 12:51:14 2007 @@ -51,12 +51,14 @@ PrivateGlobalPrefix = "L"; ConstantPoolSection = "\t.const\t"; JumpTableDataSection = ".const"; + GlobalDirective = "\t.globl\t"; CStringSection = "\t.cstring"; StaticCtorsSection = ".mod_init_func"; StaticDtorsSection = ".mod_term_func"; UsedDirective = "\t.no_dead_strip\t"; WeakRefDirective = "\t.weak_reference\t"; HiddenDirective = "\t.private_extern\t"; + SupportsExceptionHandling = true; // In non-PIC modes, emit a special label before jump tables so that the // linker can perform more accurate dead code stripping. From jlaskey at apple.com Mon Jan 29 12:51:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 12:51:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701291851.l0TIpfZR005286@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.117 -> 1.118 --- Log message: Landing pad-less eh for PPC. --- Diffs of the changes: (+198 -114) DwarfWriter.cpp | 312 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 198 insertions(+), 114 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.117 llvm/lib/CodeGen/DwarfWriter.cpp:1.118 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.117 Fri Jan 26 15:22:28 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Jan 29 12:51:14 2007 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file contains support for writing dwarf debug info into asm files. +// This file contains support for writing dwarf info into asm files. // //===----------------------------------------------------------------------===// @@ -180,7 +180,7 @@ /// Emit - Print the abbreviation using the specified Dwarf writer. /// - void Emit(const Dwarf &DW) const; + void Emit(const DwarfDebug &DD) const; #ifndef NDEBUG void print(std::ostream *O) { @@ -313,11 +313,11 @@ /// EmitValue - Emit value via the Dwarf writer. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const = 0; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const = 0; /// SizeOf - Return the size of a value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const = 0; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const = 0; /// Profile - Used to gather unique data for the value folding set. /// @@ -363,11 +363,11 @@ /// EmitValue - Emit integer of appropriate size. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of integer value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. /// @@ -400,11 +400,11 @@ /// EmitValue - Emit string value. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of string value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const { + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const { return String.size() + sizeof(char); // sizeof('\0'); } @@ -439,11 +439,11 @@ /// EmitValue - Emit label value. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of label value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. /// @@ -477,11 +477,11 @@ /// EmitValue - Emit label value. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of label value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. /// @@ -515,11 +515,11 @@ /// EmitValue - Emit delta value. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of delta value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. /// @@ -557,11 +557,11 @@ /// EmitValue - Emit debug information entry offset. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of debug information entry in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const { + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const { return sizeof(int32_t); } @@ -609,7 +609,7 @@ /// ComputeSize - calculate the size of the block. /// - unsigned ComputeSize(Dwarf &DW); + unsigned ComputeSize(DwarfDebug &DD); /// BestForm - Choose the best form for data. /// @@ -622,11 +622,11 @@ /// EmitValue - Emit block data. /// - virtual void EmitValue(const Dwarf &DW, unsigned Form) const; + virtual void EmitValue(const DwarfDebug &DD, unsigned Form) const; /// SizeOf - Determine size of block data in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; + virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. @@ -720,14 +720,14 @@ /// getDieMapSlotFor - Returns the debug information entry map slot for the /// specified debug descriptor. - DIE *&getDieMapSlotFor(DebugInfoDesc *DD) { - return DescToDieMap[DD]; + DIE *&getDieMapSlotFor(DebugInfoDesc *DID) { + return DescToDieMap[DID]; } /// getDIEntrySlotFor - Returns the debug information entry proxy slot for the /// specified debug descriptor. - DIEntry *&getDIEntrySlotFor(DebugInfoDesc *DD) { - return DescToDIEntryMap[DD]; + DIEntry *&getDIEntrySlotFor(DebugInfoDesc *DID) { + return DescToDIEntryMap[DID]; } /// AddDie - Adds or interns the DIE to the compile unit. @@ -750,14 +750,14 @@ }; //===----------------------------------------------------------------------===// -/// Dwarf - Emits Dwarf debug and exception handling directives. +/// Dwarf - Emits general Dwarf directives. /// class Dwarf { -private: +protected: //===--------------------------------------------------------------------===// - // Core attributes used by the Dwarf writer. + // Core attributes used by the Dwarf writer. // // @@ -802,6 +802,41 @@ /// unsigned SubprogramCount; + Dwarf(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) + : O(OS) + , Asm(A) + , TAI(T) + , TD(Asm->TM.getTargetData()) + , RI(Asm->TM.getRegisterInfo()) + , M(NULL) + , MF(NULL) + , MMI(NULL) + , didInitial(false) + , shouldEmit(false) + , SubprogramCount(0) + { + } + +public: + + //===--------------------------------------------------------------------===// + // Accessors. + // + AsmPrinter *getAsm() const { return Asm; } + const TargetAsmInfo *getTargetAsmInfo() const { return TAI; } + + /// ShouldEmitDwarf - Returns true if Dwarf declarations should be made. + /// + bool ShouldEmitDwarf() const { return shouldEmit; } + +}; + +//===----------------------------------------------------------------------===// +/// DwarfDebug - Emits Dwarf debug directives. +/// +class DwarfDebug : public Dwarf { + +private: //===--------------------------------------------------------------------===// // Attributes used to construct specific Dwarf sections. // @@ -845,11 +880,6 @@ public: - //===--------------------------------------------------------------------===// - // Accessors. - // - AsmPrinter *getAsm() const { return Asm; } - /// PrintLabelName - Print label name in form used by Dwarf writer. /// void PrintLabelName(DWLabel Label) const { @@ -2466,26 +2496,12 @@ } } - /// ShouldEmitDwarf - Returns true if Dwarf declarations should be made. - /// - bool ShouldEmitDwarf() const { return shouldEmit; } - public: //===--------------------------------------------------------------------===// // Main entry points. // - Dwarf(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) - : O(OS) - , Asm(A) - , TAI(T) - , TD(Asm->TM.getTargetData()) - , RI(Asm->TM.getRegisterInfo()) - , M(NULL) - , MF(NULL) - , MMI(NULL) - , didInitial(false) - , shouldEmit(false) - , SubprogramCount(0) + DwarfDebug(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) + : Dwarf(OS, A, T) , CompileUnits() , AbbreviationsSet(InitAbbreviationsSetSize) , Abbreviations() @@ -2497,17 +2513,13 @@ , SectionSourceLines() { } - virtual ~Dwarf() { + virtual ~DwarfDebug() { for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) delete CompileUnits[i]; for (unsigned j = 0, M = Values.size(); j < M; ++j) delete Values[j]; } - // Accessors. - // - const TargetAsmInfo *getTargetAsmInfo() const { return TAI; } - /// SetModuleInfo - Set machine module information when it's known that pass /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { @@ -2539,14 +2551,12 @@ this->M = M; if (!ShouldEmitDwarf()) return; - Asm->EOL("Dwarf Begin Module"); } /// EndModule - Emit all Dwarf sections that should come after the content. /// void EndModule() { if (!ShouldEmitDwarf()) return; - Asm->EOL("Dwarf End Module"); // Standard sections final addresses. Asm->SwitchToTextSection(TAI->getTextSection()); @@ -2597,7 +2607,6 @@ this->MF = MF; if (!ShouldEmitDwarf()) return; - Asm->EOL("Dwarf Begin Function"); // Begin accumulating function debug information. MMI->BeginFunction(MF); @@ -2605,15 +2614,20 @@ // Assumes in correct section after the entry point. EmitLabel("func_begin", ++SubprogramCount); } + + /// PreExceptionEndFunction - Close off function before exception handling + /// tables. + void PreExceptionEndFunction() { + if (!ShouldEmitDwarf()) return; + + // Define end label for subprogram. + EmitLabel("func_end", SubprogramCount); + } /// EndFunction - Gather and emit post-function debug information. /// void EndFunction() { if (!ShouldEmitDwarf()) return; - Asm->EOL("Dwarf End Function"); - - // Define end label for subprogram. - EmitLabel("func_end", SubprogramCount); // Get function line info. const std::vector &LineInfos = MMI->getSourceLines(); @@ -2642,37 +2656,99 @@ } }; +//===----------------------------------------------------------------------===// +/// DwarfException - Emits Dwarf exception handling directives. +/// +class DwarfException : public Dwarf { + +public: + //===--------------------------------------------------------------------===// + // Main entry points. + // + DwarfException(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) + : Dwarf(OS, A, T) + {} + + virtual ~DwarfException() {} + + /// SetModuleInfo - Set machine module information when it's known that pass + /// manager has created it. Set by the target AsmPrinter. + void SetModuleInfo(MachineModuleInfo *mmi) { + // Make sure initial declarations are made. + if (!MMI && TAI->getSupportsExceptionHandling()) { + MMI = mmi; + shouldEmit = true; + } + } + + /// BeginModule - Emit all exception information that should come prior to the + /// content. + void BeginModule(Module *M) { + this->M = M; + + if (!ShouldEmitDwarf()) return; + } + + /// EndModule - Emit all exception information that should come after the + /// content. + void EndModule() { + if (!ShouldEmitDwarf()) return; + } + + /// BeginFunction - Gather pre-function exception information. Assumes being + /// emitted immediately after the function entry point. + void BeginFunction(MachineFunction *MF) { + this->MF = MF; + + if (!ShouldEmitDwarf()) return; + } + + /// EndFunction - Gather and emit post-function exception information. + /// + void EndFunction() { + if (!ShouldEmitDwarf()) return; + + if (const char *GlobalDirective = TAI->getGlobalDirective()) + O << GlobalDirective << getAsm()->CurrentFnName << ".eh\n"; + + O << getAsm()->CurrentFnName << ".eh = 0\n"; + + if (const char *UsedDirective = TAI->getUsedDirective()) + O << UsedDirective << getAsm()->CurrentFnName << ".eh\n"; + } +}; + } // End of namespace llvm //===----------------------------------------------------------------------===// /// Emit - Print the abbreviation using the specified Dwarf writer. /// -void DIEAbbrev::Emit(const Dwarf &DW) const { +void DIEAbbrev::Emit(const DwarfDebug &DD) const { // Emit its Dwarf tag type. - DW.getAsm()->EmitULEB128Bytes(Tag); - DW.getAsm()->EOL(TagString(Tag)); + DD.getAsm()->EmitULEB128Bytes(Tag); + DD.getAsm()->EOL(TagString(Tag)); // Emit whether it has children DIEs. - DW.getAsm()->EmitULEB128Bytes(ChildrenFlag); - DW.getAsm()->EOL(ChildrenString(ChildrenFlag)); + DD.getAsm()->EmitULEB128Bytes(ChildrenFlag); + DD.getAsm()->EOL(ChildrenString(ChildrenFlag)); // For each attribute description. for (unsigned i = 0, N = Data.size(); i < N; ++i) { const DIEAbbrevData &AttrData = Data[i]; // Emit attribute type. - DW.getAsm()->EmitULEB128Bytes(AttrData.getAttribute()); - DW.getAsm()->EOL(AttributeString(AttrData.getAttribute())); + DD.getAsm()->EmitULEB128Bytes(AttrData.getAttribute()); + DD.getAsm()->EOL(AttributeString(AttrData.getAttribute())); // Emit form type. - DW.getAsm()->EmitULEB128Bytes(AttrData.getForm()); - DW.getAsm()->EOL(FormEncodingString(AttrData.getForm())); + DD.getAsm()->EmitULEB128Bytes(AttrData.getForm()); + DD.getAsm()->EOL(FormEncodingString(AttrData.getForm())); } // Mark end of abbreviation. - DW.getAsm()->EmitULEB128Bytes(0); DW.getAsm()->EOL("EOM(1)"); - DW.getAsm()->EmitULEB128Bytes(0); DW.getAsm()->EOL("EOM(2)"); + DD.getAsm()->EmitULEB128Bytes(0); DD.getAsm()->EOL("EOM(1)"); + DD.getAsm()->EmitULEB128Bytes(0); DD.getAsm()->EOL("EOM(2)"); } #ifndef NDEBUG @@ -2708,26 +2784,26 @@ /// EmitValue - Emit integer of appropriate size. /// -void DIEInteger::EmitValue(const Dwarf &DW, unsigned Form) const { +void DIEInteger::EmitValue(const DwarfDebug &DD, unsigned Form) const { switch (Form) { case DW_FORM_flag: // Fall thru case DW_FORM_ref1: // Fall thru - case DW_FORM_data1: DW.getAsm()->EmitInt8(Integer); break; + case DW_FORM_data1: DD.getAsm()->EmitInt8(Integer); break; case DW_FORM_ref2: // Fall thru - case DW_FORM_data2: DW.getAsm()->EmitInt16(Integer); break; + case DW_FORM_data2: DD.getAsm()->EmitInt16(Integer); break; case DW_FORM_ref4: // Fall thru - case DW_FORM_data4: DW.getAsm()->EmitInt32(Integer); break; + case DW_FORM_data4: DD.getAsm()->EmitInt32(Integer); break; case DW_FORM_ref8: // Fall thru - case DW_FORM_data8: DW.getAsm()->EmitInt64(Integer); break; - case DW_FORM_udata: DW.getAsm()->EmitULEB128Bytes(Integer); break; - case DW_FORM_sdata: DW.getAsm()->EmitSLEB128Bytes(Integer); break; + case DW_FORM_data8: DD.getAsm()->EmitInt64(Integer); break; + case DW_FORM_udata: DD.getAsm()->EmitULEB128Bytes(Integer); break; + case DW_FORM_sdata: DD.getAsm()->EmitSLEB128Bytes(Integer); break; default: assert(0 && "DIE Value form not supported yet"); break; } } /// SizeOf - Determine size of integer value in bytes. /// -unsigned DIEInteger::SizeOf(const Dwarf &DW, unsigned Form) const { +unsigned DIEInteger::SizeOf(const DwarfDebug &DD, unsigned Form) const { switch (Form) { case DW_FORM_flag: // Fall thru case DW_FORM_ref1: // Fall thru @@ -2738,8 +2814,8 @@ case DW_FORM_data4: return sizeof(int32_t); case DW_FORM_ref8: // Fall thru case DW_FORM_data8: return sizeof(int64_t); - case DW_FORM_udata: return DW.getAsm()->SizeULEB128(Integer); - case DW_FORM_sdata: return DW.getAsm()->SizeSLEB128(Integer); + case DW_FORM_udata: return DD.getAsm()->SizeULEB128(Integer); + case DW_FORM_sdata: return DD.getAsm()->SizeSLEB128(Integer); default: assert(0 && "DIE Value form not supported yet"); break; } return 0; @@ -2749,72 +2825,72 @@ /// EmitValue - Emit string value. /// -void DIEString::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.getAsm()->EmitString(String); +void DIEString::EmitValue(const DwarfDebug &DD, unsigned Form) const { + DD.getAsm()->EmitString(String); } //===----------------------------------------------------------------------===// /// EmitValue - Emit label value. /// -void DIEDwarfLabel::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.EmitReference(Label); +void DIEDwarfLabel::EmitValue(const DwarfDebug &DD, unsigned Form) const { + DD.EmitReference(Label); } /// SizeOf - Determine size of label value in bytes. /// -unsigned DIEDwarfLabel::SizeOf(const Dwarf &DW, unsigned Form) const { - return DW.getTargetAsmInfo()->getAddressSize(); +unsigned DIEDwarfLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const { + return DD.getTargetAsmInfo()->getAddressSize(); } //===----------------------------------------------------------------------===// /// EmitValue - Emit label value. /// -void DIEObjectLabel::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.EmitReference(Label); +void DIEObjectLabel::EmitValue(const DwarfDebug &DD, unsigned Form) const { + DD.EmitReference(Label); } /// SizeOf - Determine size of label value in bytes. /// -unsigned DIEObjectLabel::SizeOf(const Dwarf &DW, unsigned Form) const { - return DW.getTargetAsmInfo()->getAddressSize(); +unsigned DIEObjectLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const { + return DD.getTargetAsmInfo()->getAddressSize(); } //===----------------------------------------------------------------------===// /// EmitValue - Emit delta value. /// -void DIEDelta::EmitValue(const Dwarf &DW, unsigned Form) const { +void DIEDelta::EmitValue(const DwarfDebug &DD, unsigned Form) const { bool IsSmall = Form == DW_FORM_data4; - DW.EmitDifference(LabelHi, LabelLo, IsSmall); + DD.EmitDifference(LabelHi, LabelLo, IsSmall); } /// SizeOf - Determine size of delta value in bytes. /// -unsigned DIEDelta::SizeOf(const Dwarf &DW, unsigned Form) const { +unsigned DIEDelta::SizeOf(const DwarfDebug &DD, unsigned Form) const { if (Form == DW_FORM_data4) return 4; - return DW.getTargetAsmInfo()->getAddressSize(); + return DD.getTargetAsmInfo()->getAddressSize(); } //===----------------------------------------------------------------------===// /// EmitValue - Emit debug information entry offset. /// -void DIEntry::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.getAsm()->EmitInt32(Entry->getOffset()); +void DIEntry::EmitValue(const DwarfDebug &DD, unsigned Form) const { + DD.getAsm()->EmitInt32(Entry->getOffset()); } //===----------------------------------------------------------------------===// /// ComputeSize - calculate the size of the block. /// -unsigned DIEBlock::ComputeSize(Dwarf &DW) { +unsigned DIEBlock::ComputeSize(DwarfDebug &DD) { if (!Size) { const std::vector &AbbrevData = Abbrev.getData(); for (unsigned i = 0, N = Values.size(); i < N; ++i) { - Size += Values[i]->SizeOf(DW, AbbrevData[i].getForm()); + Size += Values[i]->SizeOf(DD, AbbrevData[i].getForm()); } } return Size; @@ -2822,31 +2898,31 @@ /// EmitValue - Emit block data. /// -void DIEBlock::EmitValue(const Dwarf &DW, unsigned Form) const { +void DIEBlock::EmitValue(const DwarfDebug &DD, unsigned Form) const { switch (Form) { - case DW_FORM_block1: DW.getAsm()->EmitInt8(Size); break; - case DW_FORM_block2: DW.getAsm()->EmitInt16(Size); break; - case DW_FORM_block4: DW.getAsm()->EmitInt32(Size); break; - case DW_FORM_block: DW.getAsm()->EmitULEB128Bytes(Size); break; + case DW_FORM_block1: DD.getAsm()->EmitInt8(Size); break; + case DW_FORM_block2: DD.getAsm()->EmitInt16(Size); break; + case DW_FORM_block4: DD.getAsm()->EmitInt32(Size); break; + case DW_FORM_block: DD.getAsm()->EmitULEB128Bytes(Size); break; default: assert(0 && "Improper form for block"); break; } const std::vector &AbbrevData = Abbrev.getData(); for (unsigned i = 0, N = Values.size(); i < N; ++i) { - DW.getAsm()->EOL(""); - Values[i]->EmitValue(DW, AbbrevData[i].getForm()); + DD.getAsm()->EOL(""); + Values[i]->EmitValue(DD, AbbrevData[i].getForm()); } } /// SizeOf - Determine size of block data in bytes. /// -unsigned DIEBlock::SizeOf(const Dwarf &DW, unsigned Form) const { +unsigned DIEBlock::SizeOf(const DwarfDebug &DD, unsigned Form) const { switch (Form) { case DW_FORM_block1: return Size + sizeof(int8_t); case DW_FORM_block2: return Size + sizeof(int16_t); case DW_FORM_block4: return Size + sizeof(int32_t); - case DW_FORM_block: return Size + DW.getAsm()->SizeULEB128(Size); + case DW_FORM_block: return Size + DD.getAsm()->SizeULEB128(Size); default: assert(0 && "Improper form for block"); break; } return 0; @@ -2941,39 +3017,47 @@ DwarfWriter::DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) { - DW = new Dwarf(OS, A, T); + DE = new DwarfException(OS, A, T); + DD = new DwarfDebug(OS, A, T); } DwarfWriter::~DwarfWriter() { - delete DW; + delete DE; + delete DD; } /// SetModuleInfo - Set machine module info when it's known that pass manager /// has created it. Set by the target AsmPrinter. void DwarfWriter::SetModuleInfo(MachineModuleInfo *MMI) { - DW->SetModuleInfo(MMI); + DE->SetModuleInfo(MMI); + DD->SetModuleInfo(MMI); } /// BeginModule - Emit all Dwarf sections that should come prior to the /// content. void DwarfWriter::BeginModule(Module *M) { - DW->BeginModule(M); + DE->BeginModule(M); + DD->BeginModule(M); } /// EndModule - Emit all Dwarf sections that should come after the content. /// void DwarfWriter::EndModule() { - DW->EndModule(); + DE->EndModule(); + DD->EndModule(); } /// BeginFunction - Gather pre-function debug information. Assumes being /// emitted immediately after the function entry point. void DwarfWriter::BeginFunction(MachineFunction *MF) { - DW->BeginFunction(MF); + DE->BeginFunction(MF); + DD->BeginFunction(MF); } /// EndFunction - Gather and emit post-function debug information. /// void DwarfWriter::EndFunction() { - DW->EndFunction(); + DD->PreExceptionEndFunction(); + DE->EndFunction(); + DD->EndFunction(); } From reid at x10sys.com Mon Jan 29 13:07:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 13:07:34 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y Message-ID: <200701291907.l0TJ7YYX005590@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.y updated: 1.52 -> 1.53 --- Log message: For PR1142: http://llvm.org/PR1142 : When an unresolved definition is found, check to see if it is only unresolved because the csretcc was upgraded to the sret param attribute. Such changes change the function type and lead to unresolved definitions. In such cases, just cast the function to the type expected by the CallInst. That is, cast to the version of the function that has the sret param attribute. --- Diffs of the changes: (+39 -4) UpgradeParser.y | 43 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 39 insertions(+), 4 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.52 llvm/tools/llvm-upgrade/UpgradeParser.y:1.53 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.52 Sun Jan 28 23:41:09 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Mon Jan 29 13:07:18 2007 @@ -505,6 +505,25 @@ // and back patchs after we are done. // +/// This function determines if two function types differ only in their use of +/// the sret parameter attribute in the first argument. If they are identical +/// in all other respects, it returns true. Otherwise, it returns false. +bool FuncTysDifferOnlyBySRet(const FunctionType *F1, + const FunctionType *F2) { + if (F1->getReturnType() != F2->getReturnType() || + F1->getNumParams() != F2->getNumParams() || + F1->getParamAttrs(0) != F2->getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + for (unsigned i = 0; i < F1->getNumParams(); ++i) { + if (F1->getParamType(i) != F2->getParamType(i) || + unsigned(F1->getParamAttrs(i+1)) & SRetMask != + unsigned(F2->getParamAttrs(i+1)) & SRetMask) + return false; + } + return true; +} + // ResolveDefinitions - If we could not resolve some defs at parsing // time (forward branches, phi functions for loops, etc...) resolve the // defs now... @@ -537,10 +556,26 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) { - error("Reference to an invalid definition: '" +DID.getName()+ - "' of type '" + V->getType()->getDescription() + "'", - PHI->second.second); - return; + // The upgrade of csretcc to sret param attribute may have caused a + // function to not be found because the param attribute changed the + // type of the called function. Detect this situation and insert a + // cast as necessary. + bool fixed = false; + if (const PointerType *PTy = dyn_cast(V->getType())) + if (const FunctionType *FTy = + dyn_cast(PTy->getElementType())) + if (Function *OtherF = + CurModule.CurrentModule->getNamedFunction(DID.getName())) + if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { + V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); + fixed = true; + } + if (!fixed) { + error("Reference to an invalid definition: '" +DID.getName()+ + "' of type '" + V->getType()->getDescription() + "'", + PHI->second.second); + return; + } } else { error("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + From reid at x10sys.com Mon Jan 29 13:09:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 13:09:02 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y.cvs Message-ID: <200701291909.l0TJ92ne005624@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.51 -> 1.52 UpgradeParser.h.cvs updated: 1.38 -> 1.39 UpgradeParser.y.cvs updated: 1.50 -> 1.51 --- Log message: Regenerate. --- Diffs of the changes: (+342 -272) UpgradeParser.cpp.cvs | 569 ++++++++++++++++++++++++++------------------------ UpgradeParser.h.cvs | 2 UpgradeParser.y.cvs | 43 +++ 3 files changed, 342 insertions(+), 272 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.51 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.52 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.51 Sun Jan 28 23:41:34 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Mon Jan 29 13:08:46 2007 @@ -865,6 +865,25 @@ // and back patchs after we are done. // +/// This function determines if two function types differ only in their use of +/// the sret parameter attribute in the first argument. If they are identical +/// in all other respects, it returns true. Otherwise, it returns false. +bool FuncTysDifferOnlyBySRet(const FunctionType *F1, + const FunctionType *F2) { + if (F1->getReturnType() != F2->getReturnType() || + F1->getNumParams() != F2->getNumParams() || + F1->getParamAttrs(0) != F2->getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + for (unsigned i = 0; i < F1->getNumParams(); ++i) { + if (F1->getParamType(i) != F2->getParamType(i) || + unsigned(F1->getParamAttrs(i+1)) & SRetMask != + unsigned(F2->getParamAttrs(i+1)) & SRetMask) + return false; + } + return true; +} + // ResolveDefinitions - If we could not resolve some defs at parsing // time (forward branches, phi functions for loops, etc...) resolve the // defs now... @@ -897,10 +916,26 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) { - error("Reference to an invalid definition: '" +DID.getName()+ - "' of type '" + V->getType()->getDescription() + "'", - PHI->second.second); - return; + // The upgrade of csretcc to sret param attribute may have caused a + // function to not be found because the param attribute changed the + // type of the called function. Detect this situation and insert a + // cast as necessary. + bool fixed = false; + if (const PointerType *PTy = dyn_cast(V->getType())) + if (const FunctionType *FTy = + dyn_cast(PTy->getElementType())) + if (Function *OtherF = + CurModule.CurrentModule->getNamedFunction(DID.getName())) + if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { + V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); + fixed = true; + } + if (!fixed) { + error("Reference to an invalid definition: '" +DID.getName()+ + "' of type '" + V->getType()->getDescription() + "'", + PHI->second.second); + return; + } } else { error("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + @@ -1781,7 +1816,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1405 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1824,7 +1859,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1828 "UpgradeParser.tab.c" +#line 1863 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1836,7 +1871,7 @@ /* Line 219 of yacc.c. */ -#line 1840 "UpgradeParser.tab.c" +#line 1875 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2194,37 +2229,37 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1545, 1545, 1546, 1554, 1555, 1565, 1565, 1565, 1565, - 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1569, 1569, 1569, - 1573, 1573, 1573, 1573, 1573, 1573, 1577, 1577, 1578, 1578, - 1579, 1579, 1580, 1580, 1581, 1581, 1585, 1585, 1586, 1586, - 1587, 1587, 1588, 1588, 1589, 1589, 1590, 1590, 1591, 1591, - 1592, 1593, 1596, 1596, 1596, 1596, 1600, 1600, 1600, 1600, - 1600, 1600, 1600, 1601, 1601, 1601, 1601, 1601, 1601, 1607, - 1607, 1607, 1607, 1611, 1611, 1611, 1611, 1615, 1615, 1619, - 1619, 1624, 1627, 1632, 1633, 1634, 1635, 1636, 1637, 1638, - 1639, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1660, - 1661, 1669, 1670, 1678, 1687, 1688, 1695, 1696, 1700, 1704, - 1720, 1721, 1728, 1729, 1736, 1744, 1744, 1744, 1744, 1744, - 1744, 1744, 1745, 1745, 1745, 1745, 1745, 1750, 1754, 1758, - 1763, 1772, 1793, 1799, 1812, 1821, 1825, 1836, 1840, 1853, - 1857, 1864, 1865, 1871, 1878, 1890, 1920, 1933, 1956, 1984, - 2006, 2017, 2039, 2050, 2059, 2064, 2122, 2129, 2137, 2144, - 2151, 2155, 2159, 2168, 2183, 2196, 2205, 2233, 2246, 2255, - 2261, 2267, 2276, 2282, 2288, 2299, 2300, 2309, 2310, 2322, - 2331, 2332, 2333, 2334, 2335, 2351, 2371, 2373, 2375, 2375, - 2382, 2382, 2389, 2389, 2396, 2396, 2404, 2406, 2408, 2413, - 2427, 2428, 2432, 2435, 2443, 2447, 2454, 2458, 2462, 2466, - 2474, 2474, 2478, 2479, 2483, 2491, 2496, 2504, 2505, 2512, - 2519, 2523, 2638, 2638, 2642, 2652, 2652, 2656, 2660, 2662, - 2663, 2667, 2667, 2679, 2680, 2685, 2686, 2687, 2688, 2689, - 2690, 2691, 2692, 2693, 2714, 2717, 2732, 2733, 2738, 2738, - 2746, 2755, 2758, 2767, 2777, 2782, 2791, 2802, 2802, 2805, - 2808, 2811, 2815, 2821, 2836, 2842, 2898, 2901, 2907, 2917, - 2930, 2959, 2967, 2975, 2979, 2986, 2987, 2991, 2994, 3000, - 3017, 3033, 3047, 3059, 3071, 3082, 3091, 3100, 3109, 3116, - 3137, 3161, 3167, 3173, 3179, 3195, 3273, 3281, 3282, 3286, - 3287, 3291, 3297, 3303, 3309, 3315, 3322, 3334, 3348 + 0, 1580, 1580, 1581, 1589, 1590, 1600, 1600, 1600, 1600, + 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1604, 1604, 1604, + 1608, 1608, 1608, 1608, 1608, 1608, 1612, 1612, 1613, 1613, + 1614, 1614, 1615, 1615, 1616, 1616, 1620, 1620, 1621, 1621, + 1622, 1622, 1623, 1623, 1624, 1624, 1625, 1625, 1626, 1626, + 1627, 1628, 1631, 1631, 1631, 1631, 1635, 1635, 1635, 1635, + 1635, 1635, 1635, 1636, 1636, 1636, 1636, 1636, 1636, 1642, + 1642, 1642, 1642, 1646, 1646, 1646, 1646, 1650, 1650, 1654, + 1654, 1659, 1662, 1667, 1668, 1669, 1670, 1671, 1672, 1673, + 1674, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1695, + 1696, 1704, 1705, 1713, 1722, 1723, 1730, 1731, 1735, 1739, + 1755, 1756, 1763, 1764, 1771, 1779, 1779, 1779, 1779, 1779, + 1779, 1779, 1780, 1780, 1780, 1780, 1780, 1785, 1789, 1793, + 1798, 1807, 1828, 1834, 1847, 1856, 1860, 1871, 1875, 1888, + 1892, 1899, 1900, 1906, 1913, 1925, 1955, 1968, 1991, 2019, + 2041, 2052, 2074, 2085, 2094, 2099, 2157, 2164, 2172, 2179, + 2186, 2190, 2194, 2203, 2218, 2231, 2240, 2268, 2281, 2290, + 2296, 2302, 2311, 2317, 2323, 2334, 2335, 2344, 2345, 2357, + 2366, 2367, 2368, 2369, 2370, 2386, 2406, 2408, 2410, 2410, + 2417, 2417, 2424, 2424, 2431, 2431, 2439, 2441, 2443, 2448, + 2462, 2463, 2467, 2470, 2478, 2482, 2489, 2493, 2497, 2501, + 2509, 2509, 2513, 2514, 2518, 2526, 2531, 2539, 2540, 2547, + 2554, 2558, 2673, 2673, 2677, 2687, 2687, 2691, 2695, 2697, + 2698, 2702, 2702, 2714, 2715, 2720, 2721, 2722, 2723, 2724, + 2725, 2726, 2727, 2728, 2749, 2752, 2767, 2768, 2773, 2773, + 2781, 2790, 2793, 2802, 2812, 2817, 2826, 2837, 2837, 2840, + 2843, 2846, 2850, 2856, 2871, 2877, 2933, 2936, 2942, 2952, + 2965, 2994, 3002, 3010, 3014, 3021, 3022, 3026, 3029, 3035, + 3052, 3068, 3082, 3094, 3106, 3117, 3126, 3135, 3144, 3151, + 3172, 3196, 3202, 3208, 3214, 3230, 3308, 3316, 3317, 3321, + 3322, 3326, 3332, 3338, 3344, 3350, 3357, 3369, 3383 }; #endif @@ -3626,7 +3661,7 @@ switch (yyn) { case 3: -#line 1546 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3635,7 +3670,7 @@ break; case 5: -#line 1555 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -3644,226 +3679,226 @@ break; case 26: -#line 1577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1578 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1578 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1579 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1579 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1587 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1587 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1588 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1588 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1591 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1591 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1592 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1627 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1593 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1628 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1627 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1632 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1633 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1668 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1634 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1669 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 1635 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 1636 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1671 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 1637 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 1638 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1673 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1639 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1674 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1643 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1678 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} break; case 92: -#line 1644 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1679 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} break; case 93: -#line 1645 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1680 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 1646 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1681 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 1647 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1682 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 1648 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1683 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 1649 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1684 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 1650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1685 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -3872,12 +3907,12 @@ break; case 99: -#line 1660 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1695 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 1661 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1696 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3886,12 +3921,12 @@ break; case 101: -#line 1669 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 1670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1705 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3900,7 +3935,7 @@ break; case 103: -#line 1678 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1713 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -3910,27 +3945,27 @@ break; case 104: -#line 1687 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 1688 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 1695 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1730 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 107: -#line 1696 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 108: -#line 1700 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1735 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3938,7 +3973,7 @@ break; case 109: -#line 1704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1739 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -3948,7 +3983,7 @@ break; case 111: -#line 1721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1756 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; @@ -3956,7 +3991,7 @@ break; case 113: -#line 1729 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; @@ -3964,7 +3999,7 @@ break; case 114: -#line 1736 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).T)->getDescription()); @@ -3973,7 +4008,7 @@ break; case 127: -#line 1750 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1785 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = (yyvsp[0].PrimType).S; @@ -3981,7 +4016,7 @@ break; case 128: -#line 1754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1789 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S = Signless; @@ -3989,7 +4024,7 @@ break; case 129: -#line 1758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... const Type* tmp = getType((yyvsp[0].ValIDVal)); (yyval.TypeVal).T = new PATypeHolder(tmp); @@ -3998,7 +4033,7 @@ break; case 130: -#line 1763 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1798 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); @@ -4011,7 +4046,7 @@ break; case 131: -#line 1772 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1807 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? std::vector Params; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -4036,7 +4071,7 @@ break; case 132: -#line 1793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1828 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).T->get(), (unsigned)(yyvsp[-3].UInt64Val)))); @@ -4046,7 +4081,7 @@ break; case 133: -#line 1799 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1834 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).T->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -4063,7 +4098,7 @@ break; case 134: -#line 1812 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1847 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -4076,7 +4111,7 @@ break; case 135: -#line 1821 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).S = Signless; @@ -4084,7 +4119,7 @@ break; case 136: -#line 1825 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1860 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), @@ -4099,7 +4134,7 @@ break; case 137: -#line 1836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector(),true)); (yyval.TypeVal).S = Signless; @@ -4107,7 +4142,7 @@ break; case 138: -#line 1840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1875 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).T->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); @@ -4118,7 +4153,7 @@ break; case 139: -#line 1853 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1888 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4126,14 +4161,14 @@ break; case 140: -#line 1857 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1892 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 1865 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1900 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; VoidTI.T = new PATypeHolder(Type::VoidTy); @@ -4143,7 +4178,7 @@ break; case 143: -#line 1871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1906 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; @@ -4154,14 +4189,14 @@ break; case 144: -#line 1878 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); ;} break; case 145: -#line 1890 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (ATy == 0) @@ -4195,7 +4230,7 @@ break; case 146: -#line 1920 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1955 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (ATy == 0) @@ -4212,7 +4247,7 @@ break; case 147: -#line 1933 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1968 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (ATy == 0) @@ -4239,7 +4274,7 @@ break; case 148: -#line 1956 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1991 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (PTy == 0) @@ -4271,7 +4306,7 @@ break; case 149: -#line 1984 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2019 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (STy == 0) @@ -4297,7 +4332,7 @@ break; case 150: -#line 2006 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2041 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (STy == 0) @@ -4312,7 +4347,7 @@ break; case 151: -#line 2017 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal).T->get()); if (STy == 0) @@ -4338,7 +4373,7 @@ break; case 152: -#line 2039 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2074 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-4].TypeVal).T->get()); if (STy == 0) @@ -4353,7 +4388,7 @@ break; case 153: -#line 2050 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2085 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (PTy == 0) @@ -4366,7 +4401,7 @@ break; case 154: -#line 2059 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).T->get()); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; @@ -4375,7 +4410,7 @@ break; case 155: -#line 2064 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (Ty == 0) @@ -4437,7 +4472,7 @@ break; case 156: -#line 2122 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2157 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).T->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); @@ -4448,7 +4483,7 @@ break; case 157: -#line 2129 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2164 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -4460,7 +4495,7 @@ break; case 158: -#line 2137 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4471,7 +4506,7 @@ break; case 159: -#line 2144 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2179 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4482,7 +4517,7 @@ break; case 160: -#line 2151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S = Unsigned; @@ -4490,7 +4525,7 @@ break; case 161: -#line 2155 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2190 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S = Unsigned; @@ -4498,7 +4533,7 @@ break; case 162: -#line 2159 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2194 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4508,7 +4543,7 @@ break; case 163: -#line 2168 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2203 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); const Type* DstTy = (yyvsp[-1].TypeVal).T->get(); @@ -4527,7 +4562,7 @@ break; case 164: -#line 2183 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2218 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa(Ty)) @@ -4544,7 +4579,7 @@ break; case 165: -#line 2196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2231 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4557,7 +4592,7 @@ break; case 166: -#line 2205 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2240 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4589,7 +4624,7 @@ break; case 167: -#line 2233 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2268 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4606,7 +4641,7 @@ break; case 168: -#line 2246 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2281 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4619,7 +4654,7 @@ break; case 169: -#line 2255 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2290 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4629,7 +4664,7 @@ break; case 170: -#line 2261 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2296 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4639,7 +4674,7 @@ break; case 171: -#line 2267 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2302 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) @@ -4652,7 +4687,7 @@ break; case 172: -#line 2276 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2311 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -4662,7 +4697,7 @@ break; case 173: -#line 2282 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -4672,7 +4707,7 @@ break; case 174: -#line 2288 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2323 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -4682,12 +4717,12 @@ break; case 175: -#line 2299 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2300 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -4695,17 +4730,17 @@ break; case 177: -#line 2309 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2310 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -4713,27 +4748,27 @@ break; case 180: -#line 2331 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2366 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2333 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -4749,7 +4784,7 @@ break; case 185: -#line 2351 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2386 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -4773,19 +4808,19 @@ break; case 186: -#line 2371 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2406 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2373 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2408 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2375 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2410 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -4794,14 +4829,14 @@ break; case 189: -#line 2379 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2414 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2382 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2417 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0); @@ -4810,14 +4845,14 @@ break; case 191: -#line 2386 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2421 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2389 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2424 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0); @@ -4826,14 +4861,14 @@ break; case 193: -#line 2393 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2428 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2396 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2431 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = @@ -4843,32 +4878,32 @@ break; case 195: -#line 2401 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2404 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2439 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2406 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2441 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2408 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2443 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2413 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2448 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4883,24 +4918,24 @@ break; case 200: -#line 2427 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2462 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2428 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2463 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2432 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2467 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2435 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2470 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -4912,7 +4947,7 @@ break; case 204: -#line 2443 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2478 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4920,7 +4955,7 @@ break; case 205: -#line 2447 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4928,7 +4963,7 @@ break; case 207: -#line 2458 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2493 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4936,7 +4971,7 @@ break; case 208: -#line 2462 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2497 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4944,17 +4979,17 @@ break; case 209: -#line 2466 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2501 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2479 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2514 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2483 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2518 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).T->get() == Type::VoidTy) error("void typed arguments are invalid"); @@ -4963,7 +4998,7 @@ break; case 215: -#line 2491 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2526 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -4972,7 +5007,7 @@ break; case 216: -#line 2496 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2531 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -4981,12 +5016,12 @@ break; case 217: -#line 2504 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2539 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2505 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2540 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; @@ -4997,7 +5032,7 @@ break; case 219: -#line 2512 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2547 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; @@ -5008,12 +5043,12 @@ break; case 220: -#line 2519 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2554 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2523 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2558 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -5129,7 +5164,7 @@ break; case 224: -#line 2642 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2677 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5140,29 +5175,29 @@ break; case 227: -#line 2656 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2691 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 229: -#line 2662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2697 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} break; case 230: -#line 2663 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2698 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;} break; case 231: -#line 2667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 232: -#line 2667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5171,57 +5206,57 @@ break; case 233: -#line 2679 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 234: -#line 2680 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2715 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 235: -#line 2685 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2720 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; case 236: -#line 2686 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; case 237: -#line 2687 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; case 238: -#line 2688 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;} break; case 239: -#line 2689 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2724 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;} break; case 240: -#line 2690 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2725 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; case 241: -#line 2691 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2726 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; case 242: -#line 2692 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2727 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; case 243: -#line 2693 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2728 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5246,14 +5281,14 @@ break; case 244: -#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2749 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); ;} break; case 245: -#line 2717 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2752 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5266,17 +5301,17 @@ break; case 246: -#line 2732 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); ;} break; case 247: -#line 2733 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2768 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); ;} break; case 250: -#line 2746 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2781 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.ValueVal).S = (yyvsp[-1].TypeVal).S; @@ -5286,21 +5321,21 @@ break; case 251: -#line 2755 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2790 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 252: -#line 2758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 253: -#line 2767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); InsertValue((yyvsp[0].TermInstVal)); @@ -5311,7 +5346,7 @@ break; case 254: -#line 2777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2812 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5320,7 +5355,7 @@ break; case 255: -#line 2782 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2817 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the @@ -5333,7 +5368,7 @@ break; case 256: -#line 2791 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2826 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5346,21 +5381,21 @@ break; case 259: -#line 2805 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).V); ;} break; case 260: -#line 2808 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2843 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); ;} break; case 261: -#line 2811 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2846 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal) = new BranchInst(tmpBB); @@ -5368,7 +5403,7 @@ break; case 262: -#line 2815 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2850 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); @@ -5378,7 +5413,7 @@ break; case 263: -#line 2821 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); @@ -5397,7 +5432,7 @@ break; case 264: -#line 2836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); @@ -5407,7 +5442,7 @@ break; case 265: -#line 2843 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2878 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -5466,21 +5501,21 @@ break; case 266: -#line 2898 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2933 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnwindInst(); ;} break; case 267: -#line 2901 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2936 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnreachableInst(); ;} break; case 268: -#line 2907 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2942 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5494,7 +5529,7 @@ break; case 269: -#line 2917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2952 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5508,7 +5543,7 @@ break; case 270: -#line 2930 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2965 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -5540,7 +5575,7 @@ break; case 271: -#line 2959 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2994 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list >(); (yyval.PHIList).S = (yyvsp[-5].TypeVal).S; @@ -5552,7 +5587,7 @@ break; case 272: -#line 2967 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3002 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList).P->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -5562,7 +5597,7 @@ break; case 273: -#line 2975 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3010 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -5570,7 +5605,7 @@ break; case 274: -#line 2979 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -5578,26 +5613,26 @@ break; case 276: -#line 2987 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3022 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; case 277: -#line 2991 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3026 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 278: -#line 2994 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3029 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 279: -#line 3000 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3035 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].TypeVal).T->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa(Ty)) @@ -5618,7 +5653,7 @@ break; case 280: -#line 3017 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (!Ty->isInteger()) { @@ -5638,7 +5673,7 @@ break; case 281: -#line 3033 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3068 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].TypeVal).T->get(); if(isa(Ty)) @@ -5656,7 +5691,7 @@ break; case 282: -#line 3047 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3082 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (isa(Ty)) @@ -5672,7 +5707,7 @@ break; case 283: -#line 3059 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (isa(Ty)) @@ -5688,7 +5723,7 @@ break; case 284: -#line 3071 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3106 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -5703,7 +5738,7 @@ break; case 285: -#line 3082 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3117 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) @@ -5716,7 +5751,7 @@ break; case 286: -#line 3091 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3126 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *DstTy = (yyvsp[0].TypeVal).T->get(); if (!DstTy->isFirstClassType()) @@ -5729,7 +5764,7 @@ break; case 287: -#line 3100 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3135 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -5742,7 +5777,7 @@ break; case 288: -#line 3109 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3144 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); NewVarArgs = true; @@ -5753,7 +5788,7 @@ break; case 289: -#line 3116 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).T->get(); @@ -5778,7 +5813,7 @@ break; case 290: -#line 3137 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).T->get(); @@ -5806,7 +5841,7 @@ break; case 291: -#line 3161 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -5816,7 +5851,7 @@ break; case 292: -#line 3167 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3202 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -5826,7 +5861,7 @@ break; case 293: -#line 3173 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3208 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -5836,7 +5871,7 @@ break; case 294: -#line 3179 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3214 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5856,7 +5891,7 @@ break; case 295: -#line 3195 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3230 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax @@ -5938,34 +5973,34 @@ break; case 296: -#line 3273 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3308 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; case 297: -#line 3281 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3316 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; case 298: -#line 3282 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 299: -#line 3286 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3321 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 300: -#line 3287 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 301: -#line 3291 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3326 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -5975,7 +6010,7 @@ break; case 302: -#line 3297 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; @@ -5985,7 +6020,7 @@ break; case 303: -#line 3303 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3338 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -5995,7 +6030,7 @@ break; case 304: -#line 3309 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; @@ -6005,7 +6040,7 @@ break; case 305: -#line 3315 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3350 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa(PTy)) @@ -6016,7 +6051,7 @@ break; case 306: -#line 3322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -6032,7 +6067,7 @@ break; case 307: -#line 3334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (!PTy) @@ -6050,7 +6085,7 @@ break; case 308: -#line 3348 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-2].TypeVal).T->get(); if (!isa(Ty)) @@ -6072,7 +6107,7 @@ } /* Line 1126 of yacc.c. */ -#line 6076 "UpgradeParser.tab.c" +#line 6111 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6340,7 +6375,7 @@ } -#line 3364 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3399 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.38 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.39 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.38 Sun Jan 28 23:41:34 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Mon Jan 29 13:08:46 2007 @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1405 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.50 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.51 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.50 Sun Jan 28 23:41:34 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Mon Jan 29 13:08:46 2007 @@ -505,6 +505,25 @@ // and back patchs after we are done. // +/// This function determines if two function types differ only in their use of +/// the sret parameter attribute in the first argument. If they are identical +/// in all other respects, it returns true. Otherwise, it returns false. +bool FuncTysDifferOnlyBySRet(const FunctionType *F1, + const FunctionType *F2) { + if (F1->getReturnType() != F2->getReturnType() || + F1->getNumParams() != F2->getNumParams() || + F1->getParamAttrs(0) != F2->getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + for (unsigned i = 0; i < F1->getNumParams(); ++i) { + if (F1->getParamType(i) != F2->getParamType(i) || + unsigned(F1->getParamAttrs(i+1)) & SRetMask != + unsigned(F2->getParamAttrs(i+1)) & SRetMask) + return false; + } + return true; +} + // ResolveDefinitions - If we could not resolve some defs at parsing // time (forward branches, phi functions for loops, etc...) resolve the // defs now... @@ -537,10 +556,26 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) { - error("Reference to an invalid definition: '" +DID.getName()+ - "' of type '" + V->getType()->getDescription() + "'", - PHI->second.second); - return; + // The upgrade of csretcc to sret param attribute may have caused a + // function to not be found because the param attribute changed the + // type of the called function. Detect this situation and insert a + // cast as necessary. + bool fixed = false; + if (const PointerType *PTy = dyn_cast(V->getType())) + if (const FunctionType *FTy = + dyn_cast(PTy->getElementType())) + if (Function *OtherF = + CurModule.CurrentModule->getNamedFunction(DID.getName())) + if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { + V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); + fixed = true; + } + if (!fixed) { + error("Reference to an invalid definition: '" +DID.getName()+ + "' of type '" + V->getType()->getDescription() + "'", + PHI->second.second); + return; + } } else { error("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + From jlaskey at apple.com Mon Jan 29 14:01:57 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 14:01:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701292001.l0TK1vgj006535@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.118 -> 1.119 --- Log message: Disable zero landing pads for now. --- Diffs of the changes: (+2 -1) DwarfWriter.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.118 llvm/lib/CodeGen/DwarfWriter.cpp:1.119 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.118 Mon Jan 29 12:51:14 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Jan 29 14:01:41 2007 @@ -2707,7 +2707,7 @@ /// void EndFunction() { if (!ShouldEmitDwarf()) return; - +#if 0 if (const char *GlobalDirective = TAI->getGlobalDirective()) O << GlobalDirective << getAsm()->CurrentFnName << ".eh\n"; @@ -2715,6 +2715,7 @@ if (const char *UsedDirective = TAI->getUsedDirective()) O << UsedDirective << getAsm()->CurrentFnName << ".eh\n"; +#endif } }; From dpatel at apple.com Mon Jan 29 14:06:42 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 14:06:42 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200701292006.l0TK6gxC006661@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.4 -> 1.5 --- Log message: Move TimingInfo into PassManagers.h so that other libs can use it. --- Diffs of the changes: (+49 -0) PassManagers.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.4 llvm/include/llvm/PassManagers.h:1.5 --- llvm/include/llvm/PassManagers.h:1.4 Mon Jan 15 20:00:38 2007 +++ llvm/include/llvm/PassManagers.h Mon Jan 29 14:06:26 2007 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/PassManager.h" +#include "llvm/Support/Timer.h" using namespace llvm; class llvm::PMDataManager; @@ -323,5 +324,53 @@ } }; +//===----------------------------------------------------------------------===// +// TimingInfo Class - This class is used to calculate information about the +// amount of time each pass takes to execute. This only happens when +// -time-passes is enabled on the command line. +// + +class TimingInfo { + std::map TimingData; + TimerGroup TG; + +public: + // Use 'create' member to get this. + TimingInfo() : TG("... Pass execution timing report ...") {} + + // TimingDtor - Print out information about timing information + ~TimingInfo() { + // Delete all of the timers... + TimingData.clear(); + // TimerGroup is deleted next, printing the report. + } + + // createTheTimeInfo - This method either initializes the TheTimeInfo pointer + // to a non null value (if the -time-passes option is enabled) or it leaves it + // null. It may be called multiple times. + static void createTheTimeInfo(); + + void passStarted(Pass *P) { + + if (dynamic_cast(P)) + return; + + std::map::iterator I = TimingData.find(P); + if (I == TimingData.end()) + I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; + I->second.startTimer(); + } + void passEnded(Pass *P) { + + if (dynamic_cast(P)) + return; + + std::map::iterator I = TimingData.find(P); + assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); + I->second.stopTimer(); + } +}; + +extern TimingInfo *getTheTimeInfo(); } From dpatel at apple.com Mon Jan 29 14:06:44 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 14:06:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200701292006.l0TK6iqa006666@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.129 -> 1.130 --- Log message: Move TimingInfo into PassManagers.h so that other libs can use it. --- Diffs of the changes: (+5 -53) PassManager.cpp | 58 ++++---------------------------------------------------- 1 files changed, 5 insertions(+), 53 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.129 llvm/lib/VMCore/PassManager.cpp:1.130 --- llvm/lib/VMCore/PassManager.cpp:1.129 Wed Jan 17 15:19:23 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Jan 29 14:06:26 2007 @@ -14,7 +14,6 @@ #include "llvm/PassManagers.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Timer.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/Support/Streams.h" @@ -259,60 +258,13 @@ }; -} // End of llvm namespace - -namespace { - -//===----------------------------------------------------------------------===// -// TimingInfo Class - This class is used to calculate information about the -// amount of time each pass takes to execute. This only happens when -// -time-passes is enabled on the command line. -// - -class VISIBILITY_HIDDEN TimingInfo { - std::map TimingData; - TimerGroup TG; - -public: - // Use 'create' member to get this. - TimingInfo() : TG("... Pass execution timing report ...") {} - - // TimingDtor - Print out information about timing information - ~TimingInfo() { - // Delete all of the timers... - TimingData.clear(); - // TimerGroup is deleted next, printing the report. - } - - // createTheTimeInfo - This method either initializes the TheTimeInfo pointer - // to a non null value (if the -time-passes option is enabled) or it leaves it - // null. It may be called multiple times. - static void createTheTimeInfo(); - - void passStarted(Pass *P) { - - if (dynamic_cast(P)) - return; - - std::map::iterator I = TimingData.find(P); - if (I == TimingData.end()) - I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; - I->second.startTimer(); - } - void passEnded(Pass *P) { - - if (dynamic_cast(P)) - return; - - std::map::iterator I = TimingData.find(P); - assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); - I->second.stopTimer(); - } -}; - static TimingInfo *TheTimeInfo; -} // End of anon namespace +TimingInfo *getTheTimeInfo() { + return TheTimeInfo; +} + +} // End of llvm namespace //===----------------------------------------------------------------------===// // PMTopLevelManager implementation From dpatel at apple.com Mon Jan 29 14:08:18 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 14:08:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200701292008.l0TK8IvN006710@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.14 -> 1.15 --- Log message: Measure timings. --- Diffs of the changes: (+3 -2) CallGraphSCCPass.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.14 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.15 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.14 Thu Jan 25 19:08:18 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon Jan 29 14:08:03 2007 @@ -92,7 +92,8 @@ initializeAnalysisImpl(P); - // if (TheTimeInfo) TheTimeInfo->passStarted(P); + TimingInfo *TheTimeInfo = llvm::getTheTimeInfo(); + if (TheTimeInfo) TheTimeInfo->passStarted(P); if (CallGraphSCCPass *CGSP = dynamic_cast(P)) Changed |= CGSP->runOnSCC(*I); // TODO : What if CG is changed ? else { @@ -107,7 +108,7 @@ Changed |= FPP->runOnFunction(*F); } } - // if (TheTimeInfo) TheTimeInfo->passEnded(MP); + if (TheTimeInfo) TheTimeInfo->passEnded(P); if (Changed) dumpPassInfo(P, Msg3, Msg2); From jlaskey at apple.com Mon Jan 29 14:48:50 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 14:48:50 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetOptions.h Message-ID: <200701292048.l0TKmoQZ007595@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetOptions.h updated: 1.13 -> 1.14 --- Log message: Flag to control exception handling. --- Diffs of the changes: (+5 -0) TargetOptions.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Target/TargetOptions.h diff -u llvm/include/llvm/Target/TargetOptions.h:1.13 llvm/include/llvm/Target/TargetOptions.h:1.14 --- llvm/include/llvm/Target/TargetOptions.h:1.13 Wed Jan 17 04:40:54 2007 +++ llvm/include/llvm/Target/TargetOptions.h Mon Jan 29 14:48:32 2007 @@ -59,6 +59,11 @@ /// .bss section. This flag disables such behaviour (necessary, e.g. for /// crt*.o compiling). extern bool NoZerosInBSS; + + /// ExceptionHandling - This flag indicates that exception information should + /// be emitted. + extern bool ExceptionHandling; + } // End llvm namespace #endif From jlaskey at apple.com Mon Jan 29 14:48:51 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 14:48:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701292048.l0TKmp42007600@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.119 -> 1.120 --- Log message: Flag to control exception handling. --- Diffs of the changes: (+3 -2) DwarfWriter.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.119 llvm/lib/CodeGen/DwarfWriter.cpp:1.120 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.119 Mon Jan 29 14:01:41 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Jan 29 14:48:32 2007 @@ -29,8 +29,9 @@ #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include #include using namespace llvm; @@ -2675,7 +2676,7 @@ /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { // Make sure initial declarations are made. - if (!MMI && TAI->getSupportsExceptionHandling()) { + if (!MMI && ExceptionHandling && TAI->getSupportsExceptionHandling()) { MMI = mmi; shouldEmit = true; } From jlaskey at apple.com Mon Jan 29 14:48:52 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 14:48:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Message-ID: <200701292048.l0TKmq16007605@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.59 -> 1.60 --- Log message: Flag to control exception handling. --- Diffs of the changes: (+6 -0) TargetMachine.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.59 llvm/lib/Target/TargetMachine.cpp:1.60 --- llvm/lib/Target/TargetMachine.cpp:1.59 Wed Jan 17 04:33:08 2007 +++ llvm/lib/Target/TargetMachine.cpp Mon Jan 29 14:48:32 2007 @@ -29,6 +29,7 @@ bool FiniteOnlyFPMathOption; bool UseSoftFloat; bool NoZerosInBSS; + bool ExceptionHandling; Reloc::Model RelocationModel; CodeModel::Model CMModel; } @@ -67,6 +68,11 @@ cl::desc("Don't place zero-initialized symbols into bss section"), cl::location(NoZerosInBSS), cl::init(false)); + cl::opt + EnableExceptionHandling("exception-handling", + cl::desc("Exception handling should be emitted."), + cl::location(ExceptionHandling), + cl::init(false)); cl::opt DefRelocationModel( From natebegeman at mac.com Mon Jan 29 15:21:03 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 15:21:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200701292121.l0TLL34R008443@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp updated: 1.20 -> 1.21 --- Log message: Properly support cstrings --- Diffs of the changes: (+8 -3) MachOWriter.cpp | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.20 llvm/lib/CodeGen/MachOWriter.cpp:1.21 --- llvm/lib/CodeGen/MachOWriter.cpp:1.20 Fri Jan 26 16:39:48 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Mon Jan 29 15:20:42 2007 @@ -245,7 +245,7 @@ const Type *Ty = CP[i].getType(); unsigned Size = TM.getTargetData()->getTypeSize(Ty); - MachOWriter::MachOSection *Sec = MOW.getConstSection(Ty); + MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal); OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian); CPLocations.push_back(Sec->SectionData.size()); @@ -390,7 +390,8 @@ // Scalar read-only data goes in a literal section if the scalar is 4, 8, or // 16 bytes, or a cstring. Other read only data goes into a regular const // section. Read-write data goes in the data section. - MachOSection *Sec = GV->isConstant() ? getConstSection(Ty) : getDataSection(); + MachOSection *Sec = GV->isConstant() ? getConstSection(GV->getInitializer()) : + getDataSection(); AddSymbolToSection(Sec, GV); InitMem(GV->getInitializer(), &Sec->SectionData[0], GVOffset[GV], TM.getTargetData(), Sec->Relocations); @@ -716,7 +717,11 @@ intptr_t Offset = GVOffset[GV]; Scattered = TargetSection != 0; - assert(MOSPtr && "Trying to relocate unknown global!"); + if (!MOSPtr) { + cerr << "Trying to relocate unknown global " << *GV << '\n'; + continue; + //abort(); + } TargetSection = MOSPtr->Index; MR.setResultPointer((void*)Offset); From natebegeman at mac.com Mon Jan 29 15:21:03 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 15:21:03 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200701292121.l0TLL3EJ008442@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.17 -> 1.18 --- Log message: Properly support cstrings --- Diffs of the changes: (+8 -2) MachOWriter.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.17 llvm/include/llvm/CodeGen/MachOWriter.h:1.18 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.17 Fri Jan 26 16:39:48 2007 +++ llvm/include/llvm/CodeGen/MachOWriter.h Mon Jan 29 15:20:42 2007 @@ -14,6 +14,7 @@ #ifndef LLVM_CODEGEN_MACHOWRITER_H #define LLVM_CODEGEN_MACHOWRITER_H +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineRelocation.h" @@ -486,8 +487,13 @@ MachOSection *getDataSection() { return getSection("__DATA", "__data"); } - MachOSection *getConstSection(const Type *Ty) { - // FIXME: support cstring literals and pointer literal + MachOSection *getConstSection(Constant *C) { + const ConstantArray *CVA = dyn_cast(C); + if (CVA && CVA->isCString()) + return getSection("__TEXT", "__cstring", + MachOSection::S_CSTRING_LITERALS); + + const Type *Ty = C->getType(); if (Ty->isPrimitiveType() || Ty->isInteger()) { unsigned Size = TM.getTargetData()->getTypeSize(Ty); switch(Size) { From natebegeman at mac.com Mon Jan 29 15:21:38 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 15:21:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt Message-ID: <200701292121.l0TLLcUu008471@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: README.txt updated: 1.107 -> 1.108 --- Log message: Update some of the llvm in the readme --- Diffs of the changes: (+23 -25) README.txt | 48 +++++++++++++++++++++++------------------------- 1 files changed, 23 insertions(+), 25 deletions(-) Index: llvm/lib/Target/PowerPC/README.txt diff -u llvm/lib/Target/PowerPC/README.txt:1.107 llvm/lib/Target/PowerPC/README.txt:1.108 --- llvm/lib/Target/PowerPC/README.txt:1.107 Thu Jan 18 01:34:57 2007 +++ llvm/lib/Target/PowerPC/README.txt Mon Jan 29 15:21:22 2007 @@ -277,18 +277,16 @@ into "if x.high == 0", not: _test: - addi r2, r3, -1 - cntlzw r2, r2 - cntlzw r3, r3 + cntlzw r2, r3 + xori r3, r3, 1 + cmplwi cr0, r3, 0 srwi r2, r2, 5 - srwi r4, r3, 5 li r3, 0 - cmpwi cr0, r2, 0 - bne cr0, LBB1_2 ; -LBB1_1: - or r3, r4, r4 -LBB1_2: - blr + beq cr0, LBB1_2 ;entry +LBB1_1: ;entry + mr r3, r2 +LBB1_2: ;entry + blr noticed in 2005-05-11-Popcount-ffs-fls.c. @@ -487,23 +485,23 @@ ===-------------------------------------------------------------------------=== -%struct.B = type { ubyte, [3 x ubyte] } +%struct.B = type { i8, [3 x i8] } -void %foo(%struct.B* %b) { +define void @bar(%struct.B* %b) { entry: - %tmp = cast %struct.B* %b to uint* ; [#uses=1] - %tmp = load uint* %tmp ; [#uses=1] - %tmp3 = cast %struct.B* %b to uint* ; [#uses=1] - %tmp4 = load uint* %tmp3 ; [#uses=1] - %tmp8 = cast %struct.B* %b to uint* ; [#uses=2] - %tmp9 = load uint* %tmp8 ; [#uses=1] - %tmp4.mask17 = shl uint %tmp4, ubyte 1 ; [#uses=1] - %tmp1415 = and uint %tmp4.mask17, 2147483648 ; [#uses=1] - %tmp.masked = and uint %tmp, 2147483648 ; [#uses=1] - %tmp11 = or uint %tmp1415, %tmp.masked ; [#uses=1] - %tmp12 = and uint %tmp9, 2147483647 ; [#uses=1] - %tmp13 = or uint %tmp12, %tmp11 ; [#uses=1] - store uint %tmp13, uint* %tmp8 + %tmp = bitcast %struct.B* %b to i32* ; [#uses=1] + %tmp = load i32* %tmp ; [#uses=1] + %tmp3 = bitcast %struct.B* %b to i32* ; [#uses=1] + %tmp4 = load i32* %tmp3 ; [#uses=1] + %tmp8 = bitcast %struct.B* %b to i32* ; [#uses=2] + %tmp9 = load i32* %tmp8 ; [#uses=1] + %tmp4.mask17 = shl i32 %tmp4, i8 1 ; [#uses=1] + %tmp1415 = and i32 %tmp4.mask17, 2147483648 ; [#uses=1] + %tmp.masked = and i32 %tmp, 2147483648 ; [#uses=1] + %tmp11 = or i32 %tmp1415, %tmp.masked ; [#uses=1] + %tmp12 = and i32 %tmp9, 2147483647 ; [#uses=1] + %tmp13 = or i32 %tmp12, %tmp11 ; [#uses=1] + store i32 %tmp13, i32* %tmp8 ret void } From asl at math.spbu.ru Mon Jan 29 15:28:17 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 29 Jan 2007 15:28:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86JITInfo.cpp Message-ID: <200701292128.l0TLSHmA008641@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86JITInfo.cpp updated: 1.33 -> 1.34 --- Log message: Save all registers by default, as they can be used to pass parameters for "inreg" calls --- Diffs of the changes: (+11 -13) X86JITInfo.cpp | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) Index: llvm/lib/Target/X86/X86JITInfo.cpp diff -u llvm/lib/Target/X86/X86JITInfo.cpp:1.33 llvm/lib/Target/X86/X86JITInfo.cpp:1.34 --- llvm/lib/Target/X86/X86JITInfo.cpp:1.33 Mon Dec 4 22:01:03 2006 +++ llvm/lib/Target/X86/X86JITInfo.cpp Mon Jan 29 15:28:01 2007 @@ -118,10 +118,9 @@ ASMPREFIX "X86CompilationCallback:\n" "pushl %ebp\n" "movl %esp, %ebp\n" // Standard prologue -#if FASTCC_NUM_INT_ARGS_INREGS > 0 "pushl %eax\n" - "pushl %edx\n" // Save EAX/EDX -#endif + "pushl %edx\n" // Save EAX/EDX/ECX + "pushl %ecx\n" #if defined(__APPLE__) "andl $-16, %esp\n" // Align ESP on 16-byte boundary #endif @@ -131,11 +130,10 @@ "movl %ebp, (%esp)\n" "call " ASMPREFIX "X86CompilationCallback2\n" "movl %ebp, %esp\n" // Restore ESP -#if FASTCC_NUM_INT_ARGS_INREGS > 0 - "subl $8, %esp\n" + "subl $12, %esp\n" + "popl %ecx\n" "popl %edx\n" "popl %eax\n" -#endif "popl %ebp\n" "ret\n"); @@ -148,10 +146,9 @@ ASMPREFIX "X86CompilationCallback_SSE:\n" "pushl %ebp\n" "movl %esp, %ebp\n" // Standard prologue -#if FASTCC_NUM_INT_ARGS_INREGS > 0 "pushl %eax\n" - "pushl %edx\n" // Save EAX/EDX -#endif + "pushl %edx\n" // Save EAX/EDX/ECX + "pushl %ecx\n" "andl $-16, %esp\n" // Align ESP on 16-byte boundary // Save all XMM arg registers "subl $64, %esp\n" @@ -170,11 +167,10 @@ "movaps 16(%esp), %xmm1\n" "movaps (%esp), %xmm0\n" "movl %ebp, %esp\n" // Restore ESP -#if FASTCC_NUM_INT_ARGS_INREGS > 0 - "subl $8, %esp\n" + "subl $12, %esp\n" + "popl %ecx\n" "popl %edx\n" "popl %eax\n" -#endif "popl %ebp\n" "ret\n"); #else @@ -184,7 +180,9 @@ __asm { push eax push edx + push ecx call X86CompilationCallback2 + pop ecx pop edx pop eax ret @@ -208,7 +206,7 @@ extern "C" void X86CompilationCallback2() { assert(sizeof(size_t) == 4); // FIXME: handle Win64 unsigned *RetAddrLoc = (unsigned *)_AddressOfReturnAddress(); - RetAddrLoc += 3; // skip over ret addr, edx, eax + RetAddrLoc += 4; // skip over ret addr, edx, eax, ecx unsigned RetAddr = *RetAddrLoc; #else extern "C" void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) { From clattner at apple.com Mon Jan 29 16:12:21 2007 From: clattner at apple.com (clattner at apple.com) Date: Mon, 29 Jan 2007 22:12:21 GMT Subject: [llvm-commits] [svnlog-fsf-gcc] r123085 - apple-local/branches/llvm/gcc Message-ID: <20070129221221.6564817A1C88@src> User: clattner Date: 2007/01/29 02:12 PM Modified: /apple-local/branches/llvm/gcc/ llvm-convert.cpp Log: This is a test of the llvm-commits mailing system. File Changes: Directory: /apple-local/branches/llvm/gcc/ ========================================== File [modified]: llvm-convert.cpp Delta lines: +1 -1 =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-01-29 21:06:20 UTC (rev 123084) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-01-29 22:12:20 UTC (rev 123085) @@ -1,6 +1,6 @@ /* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ /* High-level LLVM backend interface -Copyright (C) 2005 Free Software Foundation, Inc. +Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) This file is part of GCC. From evan.cheng at apple.com Mon Jan 29 16:22:46 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 16:22:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMMachineFunctionInfo.h ARMRegisterInfo.cpp Message-ID: <200701292222.l0TMMkEb011808@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMMachineFunctionInfo.h updated: 1.3 -> 1.4 ARMRegisterInfo.cpp updated: 1.42 -> 1.43 --- Log message: Remember if LR register has been spilled in this function. --- Diffs of the changes: (+17 -5) ARMMachineFunctionInfo.h | 16 ++++++++++++---- ARMRegisterInfo.cpp | 6 +++++- 2 files changed, 17 insertions(+), 5 deletions(-) Index: llvm/lib/Target/ARM/ARMMachineFunctionInfo.h diff -u llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.3 llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.4 --- llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.3 Wed Jan 24 21:07:27 2007 +++ llvm/lib/Target/ARM/ARMMachineFunctionInfo.h Mon Jan 29 16:22:24 2007 @@ -36,6 +36,10 @@ /// processFunctionBeforeCalleeSavedScan(). bool HasStackFrame; + /// LRSpilled - True if the LR register has been spilled. + /// + bool LRSpilled; + /// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer /// spill stack offset. unsigned FramePtrSpillOffset; @@ -71,14 +75,14 @@ public: ARMFunctionInfo() : isThumb(false), - VarArgsRegSaveSize(0), HasStackFrame(false), FramePtrSpillOffset(0), - GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), + VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false), + FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {} ARMFunctionInfo(MachineFunction &MF) : isThumb(MF.getTarget().getSubtarget().isThumb()), - VarArgsRegSaveSize(0), HasStackFrame(false), FramePtrSpillOffset(0), - GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), + VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false), + FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {} bool isThumbFunction() const { return isThumb; } @@ -88,6 +92,10 @@ bool hasStackFrame() const { return HasStackFrame; } void setHasStackFrame(bool s) { HasStackFrame = s; } + + bool isLRSpilled() const { return LRSpilled; } + void setLRIsSpilled(bool s) { LRSpilled = s; } + unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; } void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; } Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.42 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.43 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.42 Fri Jan 26 15:33:19 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Jan 29 16:22:24 2007 @@ -769,13 +769,14 @@ } } + ARMFunctionInfo *AFI = MF.getInfo(); if (!CanEliminateFrame) { - ARMFunctionInfo *AFI = MF.getInfo(); AFI->setHasStackFrame(true); // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled. // Spill LR as well so we can fold BX_RET to the registers restore (LDM). if (!LRSpilled && CS1Spilled) { + LRSpilled = true; MF.changePhyRegUsed(ARM::LR, true); NumGPRSpills++; UnspilledCS1GPRs.erase(std::find(UnspilledCS1GPRs.begin(), @@ -798,6 +799,9 @@ MF.changePhyRegUsed(UnspilledCS2GPRs.front(), true); } } + + // Remembe if LR has been spilled. + AFI->setLRIsSpilled(LRSpilled); } /// Move iterator pass the next bunch of callee save load / store ops for From evan.cheng at apple.com Mon Jan 29 16:23:20 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 16:23:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.td Message-ID: <200701292223.l0TMNKNs011833@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.td updated: 1.9 -> 1.10 --- Log message: Comment. --- Diffs of the changes: (+1 -1) ARMRegisterInfo.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.td diff -u llvm/lib/Target/ARM/ARMRegisterInfo.td:1.9 llvm/lib/Target/ARM/ARMRegisterInfo.td:1.10 --- llvm/lib/Target/ARM/ARMRegisterInfo.td:1.9 Mon Jan 22 18:52:44 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.td Mon Jan 29 16:23:02 2007 @@ -97,7 +97,7 @@ }]; // FIXME: We are reserving r12 in case the PEI needs to use it to // generate large stack offset. Make it available once we have register - // scavenging. + // scavenging. Similarly r3 is reserved in Thumb mode for now. let MethodBodies = [{ // FP is R11, R9 is available. static const unsigned ARM_GPR_AO_1[] = { From jlaskey at apple.com Mon Jan 29 16:40:26 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 16:40:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Message-ID: <200701292240.l0TMeQYj012388@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.60 -> 1.61 --- Log message: rename flag --- Diffs of the changes: (+1 -1) TargetMachine.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.60 llvm/lib/Target/TargetMachine.cpp:1.61 --- llvm/lib/Target/TargetMachine.cpp:1.60 Mon Jan 29 14:48:32 2007 +++ llvm/lib/Target/TargetMachine.cpp Mon Jan 29 16:40:03 2007 @@ -69,7 +69,7 @@ cl::location(NoZerosInBSS), cl::init(false)); cl::opt - EnableExceptionHandling("exception-handling", + EnableExceptionHandling("enable-eh", cl::desc("Exception handling should be emitted."), cl::location(ExceptionHandling), cl::init(false)); From jlaskey at apple.com Mon Jan 29 16:40:38 2007 From: jlaskey at apple.com (jlaskey at apple.com) Date: Mon, 29 Jan 2007 22:40:38 GMT Subject: [llvm-commits] [svnlog-fsf-gcc] r123086 - apple-local/branches/llvm/gcc Message-ID: <20070129224038.B4D6B17C024E@src> User: jlaskey Date: 2007/01/29 02:40 PM Modified: /apple-local/branches/llvm/gcc/ llvm-backend.cpp Log: rename flag File Changes: Directory: /apple-local/branches/llvm/gcc/ ========================================== File [modified]: llvm-backend.cpp Delta lines: +1 -1 =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-01-29 22:12:20 UTC (rev 123085) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-01-29 22:40:36 UTC (rev 123086) @@ -102,7 +102,7 @@ if (!flag_zero_initialized_in_bss) Args.push_back("--nozero-initialized-in-bss"); if (flag_exceptions) - Args.push_back("--exception-handling"); + Args.push_back("--enable-eh"); // If there are options that should be passed through to the LLVM backend // directly from the command line, do so now. This is mainly for debugging From jlaskey at apple.com Mon Jan 29 16:44:37 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 18:44:37 -0400 Subject: [llvm-commits] [llvm-gcc]Rename flag. Message-ID: <8B16DB5B-70F5-431A-ABEC-44F95EF5289D@apple.com> Index: gcc/llvm-backend.cpp =================================================================== --- gcc/llvm-backend.cpp (revision 123085) +++ gcc/llvm-backend.cpp (working copy) @@ -102,7 +102,7 @@ if (!flag_zero_initialized_in_bss) Args.push_back("--nozero-initialized-in-bss"); if (flag_exceptions) - Args.push_back("--exception-handling"); + Args.push_back("--enable-eh"); // If there are options that should be passed through to the LLVM backend // directly from the command line, do so now. This is mainly for debugging -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070129/9f859a6b/attachment.bin From natebegeman at mac.com Mon Jan 29 16:58:07 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:58:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td Message-ID: <200701292258.l0TMw7tT012716@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.td updated: 1.43 -> 1.44 --- Log message: We'd still like to register allocate r2 on darwin before the callee-save regs. --- Diffs of the changes: (+6 -6) PPCRegisterInfo.td | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.43 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.44 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.43 Thu Dec 21 14:26:09 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Mon Jan 29 16:57:48 2007 @@ -209,9 +209,9 @@ // Allocate volatiles first // then nonvolatiles in reverse order since stmw/lmw save from rN to r31 def GPRC : RegisterClass<"PPC", [i32], 32, - [R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, + [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17, - R16, R15, R14, R2, R13, R31, R0, R1, LR]> + R16, R15, R14, R13, R31, R0, R1, LR]> { let MethodProtos = [{ iterator allocation_order_begin(const MachineFunction &MF) const; @@ -220,14 +220,14 @@ let MethodBodies = [{ GPRCClass::iterator GPRCClass::allocation_order_begin(const MachineFunction &MF) const { + // In Linux, r2 is reserved for the OS. + if (!MF.getTarget().getSubtarget().isDarwin()) + return begin()+1; + return begin(); } GPRCClass::iterator GPRCClass::allocation_order_end(const MachineFunction &MF) const { - // In Linux, r2 is reserved for the OS. - if (!MF.getTarget().getSubtarget().isDarwin()) - return end()-6; - // On PPC64, r13 is the thread pointer. Never allocate this register. // Note that this is overconservative, as it also prevents allocation of // R31 when the FP is not needed. From natebegeman at mac.com Mon Jan 29 16:59:22 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.cpp IA64ISelLowering.h Message-ID: <200701292259.l0TMxMJc012796@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelLowering.cpp updated: 1.52 -> 1.53 IA64ISelLowering.h updated: 1.8 -> 1.9 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+4 -11) IA64ISelLowering.cpp | 11 ++++------- IA64ISelLowering.h | 4 ---- 2 files changed, 4 insertions(+), 11 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.52 llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.53 --- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.52 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/IA64/IA64ISelLowering.cpp Mon Jan 29 16:58:52 2007 @@ -532,13 +532,6 @@ return std::make_pair(RetVal, Chain); } -std::pair IA64TargetLowering:: -LowerFrameReturnAddress(bool isFrameAddress, SDOperand Chain, unsigned Depth, - SelectionDAG &DAG) { - assert(0 && "LowerFrameReturnAddress unimplemented"); - abort(); -} - SDOperand IA64TargetLowering:: LowerOperation(SDOperand Op, SelectionDAG &DAG) { switch (Op.getOpcode()) { @@ -594,5 +587,9 @@ return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV->getValue(), SV->getOffset()); } + // Frame & Return address. Currently unimplemented + case ISD::RETURNADDR: break; + case ISD::FRAMEADDR: break; } + return SDOperand(); } Index: llvm/lib/Target/IA64/IA64ISelLowering.h diff -u llvm/lib/Target/IA64/IA64ISelLowering.h:1.8 llvm/lib/Target/IA64/IA64ISelLowering.h:1.9 --- llvm/lib/Target/IA64/IA64ISelLowering.h:1.8 Sat Dec 30 23:55:36 2006 +++ llvm/lib/Target/IA64/IA64ISelLowering.h Mon Jan 29 16:58:52 2007 @@ -66,10 +66,6 @@ /// (currently, only "ret void") virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); - virtual std::pair - LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth, - SelectionDAG &DAG); - // XXX virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, // XXX MachineBasicBlock *MBB); }; From natebegeman at mac.com Mon Jan 29 16:59:21 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200701292259.l0TMxL3b012789@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.248 -> 1.249 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+4 -0) PPCISelLowering.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.248 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.249 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.248 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Jan 29 16:58:52 2007 @@ -2634,6 +2634,10 @@ case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG); case ISD::SCALAR_TO_VECTOR: return LowerSCALAR_TO_VECTOR(Op, DAG); case ISD::MUL: return LowerMUL(Op, DAG); + + // Frame & Return address. Currently unimplemented + case ISD::RETURNADDR: break; + case ISD::FRAMEADDR: break; } return SDOperand(); } From natebegeman at mac.com Mon Jan 29 16:59:25 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200701292259.l0TMxPKo012801@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.5 -> 1.6 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+3 -0) ARMISelLowering.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.5 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.6 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.5 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Jan 29 16:58:52 2007 @@ -1130,7 +1130,10 @@ case ISD::SRA: return LowerSRx(Op, DAG, Subtarget); case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG); + case ISD::RETURNADDR: break; + case ISD::FRAMEADDR: break; } + return SDOperand(); } //===----------------------------------------------------------------------===// From natebegeman at mac.com Mon Jan 29 16:59:26 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGISel.cpp Message-ID: <200701292259.l0TMxQIh012811@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.461 -> 1.462 SelectionDAG.cpp updated: 1.378 -> 1.379 SelectionDAGISel.cpp updated: 1.349 -> 1.350 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+20 -24) LegalizeDAG.cpp | 10 ++++++++++ SelectionDAG.cpp | 2 ++ SelectionDAGISel.cpp | 32 ++++++++------------------------ 3 files changed, 20 insertions(+), 24 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.461 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.462 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.461 Sun Jan 28 10:04:40 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 29 16:58:52 2007 @@ -652,6 +652,16 @@ break; } break; + case ISD::FRAMEADDR: + case ISD::RETURNADDR: + // The only option for these nodes is to custom lower them. If the target + // does not custom lower them, then return zero. + Tmp1 = TLI.LowerOperation(Op, DAG); + if (Tmp1.Val) + Result = Tmp1; + else + Result = DAG.getConstant(0, TLI.getPointerTy()); + break; case ISD::AssertSext: case ISD::AssertZext: Tmp1 = LegalizeOp(Node->getOperand(0)); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.378 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.379 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.378 Fri Jan 26 08:34:51 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 29 16:58:52 2007 @@ -2665,6 +2665,8 @@ case ISD::FrameIndex: return "FrameIndex"; case ISD::JumpTable: return "JumpTable"; case ISD::GLOBAL_OFFSET_TABLE: return "GLOBAL_OFFSET_TABLE"; + case ISD::RETURNADDR: return "RETURNADDR"; + case ISD::FRAMEADDR: return "FRAMEADDR"; case ISD::ConstantPool: return "ConstantPool"; case ISD::ExternalSymbol: return "ExternalSymbol"; case ISD::INTRINSIC_WO_CHAIN: { Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.349 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.350 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.349 Sun Jan 28 12:01:49 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 29 16:58:52 2007 @@ -570,7 +570,6 @@ void visitVAArg(VAArgInst &I); void visitVAEnd(CallInst &I); void visitVACopy(CallInst &I); - void visitFrameReturnAddress(CallInst &I, bool isFrameAddress); void visitMemIntrinsic(CallInst &I, unsigned Op); @@ -1932,8 +1931,14 @@ case Intrinsic::vastart: visitVAStart(I); return 0; case Intrinsic::vaend: visitVAEnd(I); return 0; case Intrinsic::vacopy: visitVACopy(I); return 0; - case Intrinsic::returnaddress: visitFrameReturnAddress(I, false); return 0; - case Intrinsic::frameaddress: visitFrameReturnAddress(I, true); return 0; + case Intrinsic::returnaddress: + setValue(&I, DAG.getNode(ISD::RETURNADDR, TLI.getPointerTy(), + getValue(I.getOperand(1)))); + return 0; + case Intrinsic::frameaddress: + setValue(&I, DAG.getNode(ISD::FRAMEADDR, TLI.getPointerTy(), + getValue(I.getOperand(1)))); + return 0; case Intrinsic::setjmp: return "_setjmp"+!TLI.usesUnderscoreSetJmp(); break; @@ -3207,19 +3212,6 @@ return std::make_pair(ResVal, Res.getValue(Res.Val->getNumValues()-1)); } - - -// It is always conservatively correct for llvm.returnaddress and -// llvm.frameaddress to return 0. -// -// FIXME: Change this to insert a FRAMEADDR/RETURNADDR node, and have that be -// expanded to 0 if the target wants. -std::pair -TargetLowering::LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, - unsigned Depth, SelectionDAG &DAG) { - return std::make_pair(DAG.getConstant(0, getPointerTy()), Chain); -} - SDOperand TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { assert(0 && "LowerOperation not implemented for this target!"); abort(); @@ -3233,14 +3225,6 @@ return SDOperand(); } -void SelectionDAGLowering::visitFrameReturnAddress(CallInst &I, bool isFrame) { - unsigned Depth = (unsigned)cast(I.getOperand(1))->getZExtValue(); - std::pair Result = - TLI.LowerFrameReturnAddress(isFrame, getRoot(), Depth, DAG); - setValue(&I, Result.first); - DAG.setRoot(Result.second); -} - /// getMemsetValue - Vectorized representation of the memset value /// operand. static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT, From natebegeman at mac.com Mon Jan 29 16:59:27 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200701292259.l0TMxRqN012816@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.118 -> 1.119 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+4 -0) SparcISelDAGToDAG.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.118 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.119 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.118 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Mon Jan 29 16:58:52 2007 @@ -868,7 +868,11 @@ } return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1)); } + // Frame & Return address. Currently unimplemented + case ISD::RETURNADDR: break; + case ISD::FRAMEADDR: break; } + return SDOperand(); } MachineBasicBlock * From natebegeman at mac.com Mon Jan 29 16:59:27 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h Message-ID: <200701292259.l0TMxRt8012823@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.318 -> 1.319 X86ISelLowering.h updated: 1.84 -> 1.85 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+24 -23) X86ISelLowering.cpp | 41 ++++++++++++++++++++++------------------- X86ISelLowering.h | 6 ++---- 2 files changed, 24 insertions(+), 23 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.318 llvm/lib/Target/X86/X86ISelLowering.cpp:1.319 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.318 Sun Jan 28 09:39:16 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Jan 29 16:58:52 2007 @@ -1940,25 +1940,6 @@ -std::pair X86TargetLowering:: -LowerFrameReturnAddress(bool isFrameAddress, SDOperand Chain, unsigned Depth, - SelectionDAG &DAG) { - SDOperand Result; - if (Depth) // Depths > 0 not supported yet! - Result = DAG.getConstant(0, getPointerTy()); - else { - SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG); - if (!isFrameAddress) - // Just load the return address - Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), RetAddrFI, - NULL, 0); - else - Result = DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, - DAG.getConstant(4, getPointerTy())); - } - return std::make_pair(Result, Chain); -} - /// translateX86CC - do a one to one translation of a ISD::CondCode to the X86 /// specific condition code. It returns a false if it cannot do a direct /// translation. X86CC is the translated CondCode. LHS/RHS are modified as @@ -4621,6 +4602,26 @@ } } +SDOperand X86TargetLowering::LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) { + // Depths > 0 not supported yet! + if (cast(Op.getOperand(0))->getValue() > 0) + return SDOperand(); + + // Just load the return address + SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG); + return DAG.getLoad(getPointerTy(), DAG.getEntryNode(), RetAddrFI, NULL, 0); +} + +SDOperand X86TargetLowering::LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG) { + // Depths > 0 not supported yet! + if (cast(Op.getOperand(0))->getValue() > 0) + return SDOperand(); + + SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG); + return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, + DAG.getConstant(4, getPointerTy())); +} + /// LowerOperation - Provide custom lowering hooks for some operations. /// SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { @@ -4654,6 +4655,8 @@ case ISD::READCYCLECOUNTER: return LowerREADCYCLCECOUNTER(Op, DAG); case ISD::VASTART: return LowerVASTART(Op, DAG); case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG); + case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG); + case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG); } } Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.84 llvm/lib/Target/X86/X86ISelLowering.h:1.85 --- llvm/lib/Target/X86/X86ISelLowering.h:1.84 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Mon Jan 29 16:58:52 2007 @@ -292,10 +292,6 @@ /// virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); - virtual std::pair - LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth, - SelectionDAG &DAG); - virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, @@ -406,6 +402,8 @@ SDOperand LowerREADCYCLCECOUNTER(SDOperand Op, SelectionDAG &DAG); SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG); SDOperand LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG); }; } From natebegeman at mac.com Mon Jan 29 16:59:27 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:27 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200701292259.l0TMxRUg012828@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.103 -> 1.104 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+0 -8) TargetLowering.h | 8 -------- 1 files changed, 8 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.103 llvm/include/llvm/Target/TargetLowering.h:1.104 --- llvm/include/llvm/Target/TargetLowering.h:1.103 Sun Jan 28 07:31:35 2007 +++ llvm/include/llvm/Target/TargetLowering.h Mon Jan 29 16:58:52 2007 @@ -739,14 +739,6 @@ bool isVarArg, unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); - /// LowerFrameReturnAddress - This hook lowers a call to llvm.returnaddress or - /// llvm.frameaddress (depending on the value of the first argument). The - /// return values are the result pointer and the resultant token chain. If - /// not implemented, both of these intrinsics will return null. - virtual std::pair - LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth, - SelectionDAG &DAG); - /// LowerOperation - This callback is invoked for operations that are /// unsupported by the target, which are registered to use 'custom' lowering, /// and whose defined values are all legal. From natebegeman at mac.com Mon Jan 29 16:59:28 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp Message-ID: <200701292259.l0TMxSMK012835@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.78 -> 1.79 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+3 -0) AlphaISelLowering.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.78 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.79 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.78 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jan 29 16:58:52 2007 @@ -544,6 +544,9 @@ return DAG.getTruncStore(S1, DAG.getConstant(VarArgsOffset, MVT::i64), SA2, NULL, 0, MVT::i32); } + // Frame & Return address. Currently unimplemented + case ISD::RETURNADDR: break; + case ISD::FRAMEADDR: break; } return SDOperand(); From natebegeman at mac.com Mon Jan 29 16:59:28 2007 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 29 Jan 2007 16:59:28 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200701292259.l0TMxSAq012831@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAGNodes.h updated: 1.166 -> 1.167 --- Log message: Finish off bug 680: http://llvm.org/PR680 , allowing targets to custom lower frame and return address nodes. --- Diffs of the changes: (+7 -0) SelectionDAGNodes.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.166 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.167 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.166 Sun Jan 28 07:31:35 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 29 16:58:52 2007 @@ -84,6 +84,13 @@ // The address of the GOT GLOBAL_OFFSET_TABLE, + + // FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and + // llvm.returnaddress on the DAG. These nodes take one operand, the index + // of the frame or return address to return. An index of zero corresponds + // to the current function's frame or return address, an index of one to the + // parent's frame or return address, and so on. + FRAMEADDR, RETURNADDR, // TargetConstant* - Like Constant*, but the DAG does not do any folding or // simplification of the constant. From llvm at cs.uiuc.edu Mon Jan 29 17:03:28 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 29 Jan 2007 17:03:28 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/ Message-ID: <200701292303.l0TN3SSE012920@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: --- Log message: Directory /var/cvs/llvm/llvm-test/SingleSource/UnitTests/Integer/APInt added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Mon Jan 29 17:07:48 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 17:07:48 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile arith.cpp bigint.cpp Message-ID: <200701292307.l0TN7mmm013022@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: Makefile added (r1.1) arith.cpp added (r1.1) bigint.cpp added (r1.1) --- Log message: Add some tests for the upcoming APInt class. --- Diffs of the changes: (+151 -0) Makefile | 7 +++++ arith.cpp | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bigint.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.1 *** /dev/null Mon Jan 29 17:07:42 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile Mon Jan 29 17:07:32 2007 *************** *** 0 **** --- 1,7 ---- + # SingleSource/UnitTests/Integer/Makefile + LEVEL = ../../../.. + + include $(LEVEL)/SingleSource/Makefile.singlesrc + + LDFLAGS += -L$(LLVM_OBJ_ROOT)/Debug/lib -lLLVMSupport -lLLVMSystem -lstdc++ + CXXFLAGS += -I$(LLVM_SRC_ROOT)/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__NO_MATH_INLINES Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.1 *** /dev/null Mon Jan 29 17:07:48 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Mon Jan 29 17:07:32 2007 *************** *** 0 **** --- 1,84 ---- + //===--- arith.c --- Test Cases for Bit Accurate Types --------------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for arithmetic operations. + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/APInt.h" + #include + + using namespace llvm; + + APInt x(21,0x1fffff); + + APInt y(21,0x0fffff); + + int my_test() + { + APInt i(10,uint64_t(0)); + APInt j(10); + APInt k(10); + APInt l(10); + APInt result(21); + short temp; + int i_temp; + unsigned int ui_x; + unsigned int ui_y; + j = i; + j -= 1; + temp = (short)j; + printf( "temp = %hd\n", temp); + k = i; + k += 1; + temp = k; + printf( "temp = %hd\n", temp); + k = j * k; + temp = k; + printf( "temp = %hd\n", temp); + j *= 120; + l = j / k; + temp = l; + printf( "temp = %hd\n", temp); + j *= (-176); // after truncation, the value should be -384 + l = j / k; + temp = l; + printf( "temp = %hd\n", temp); + l = 120; + l = (j * l); + l %= 4; + temp = l; + printf( "temp = %hd\n", temp); + l = -217; + l = (j * l); + l = l / (++i); + temp = l; + printf( "temp = %hd\n", temp); + result = ++x; + + i_temp = result; + printf( "i_temp = %x\n", i_temp); + x--; + + result = x + y; + i_temp = result; + printf("i_temp = %x\n", i_temp); + ui_x = x; + ui_y = y; + i_temp = ui_x - ui_y; + printf("i_temp = %x\n", i_temp); + + return 0; + + } + + int main() + { + my_test(); + return 0; + } + Index: llvm-test/SingleSource/UnitTests/Integer/APInt/bigint.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/bigint.cpp:1.1 *** /dev/null Mon Jan 29 17:07:48 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/bigint.cpp Mon Jan 29 17:07:32 2007 *************** *** 0 **** --- 1,60 ---- + //===--- bigint.c --- Test Cases for Bit Accurate Types -------------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for big integer type. + // + //===----------------------------------------------------------------------===// + #include + #include + + using namespace llvm; + + const APInt bnd(10,1023); + + + APInt x(169, 0xffffffffULL); + APInt y(169, -0xabcdefdeULL); + + int my_test() + { + APInt i(10,uint64_t(0)); + APInt result(169); + APInt l_result(32); + long long rem; + long long rem2; + { + ; + for ( ; ; ) { + bool ssdm_tmp_1 = (i < bnd); + if (!ssdm_tmp_1) break; + if (i % 2 == 0) + x = x + 1; + else + y = y - x; + + ++i; + } + } + result = x*y; + l_result = result % 0x37015; + rem = l_result; + printf("rem = %lld\n", rem); + + l_result = result % -198721; + rem2 = l_result; + printf("rem2 = %lld\n", rem2); + return 0; + } + + int main() + { + my_test(); + return 0; + } + + + From dpatel at apple.com Mon Jan 29 17:10:54 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 17:10:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200701292310.l0TNAsWO013103@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.130 -> 1.131 --- Log message: - Undo previous check-in (i.e. Do not export TimingInfo class through PassManagers.h). - Add StopPassTimer() and StartPassTimer() to expose TimingInfo to CallGraphPassManager - Use these two APIs in CalLgraphPassManager to measure timings. --- Diffs of the changes: (+65 -5) PassManager.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 65 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.130 llvm/lib/VMCore/PassManager.cpp:1.131 --- llvm/lib/VMCore/PassManager.cpp:1.130 Mon Jan 29 14:06:26 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Jan 29 17:10:37 2007 @@ -14,6 +14,7 @@ #include "llvm/PassManagers.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Timer.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/Support/Streams.h" @@ -258,13 +259,60 @@ }; -static TimingInfo *TheTimeInfo; +} // End of llvm namespace -TimingInfo *getTheTimeInfo() { - return TheTimeInfo; -} +namespace { -} // End of llvm namespace +//===----------------------------------------------------------------------===// +// TimingInfo Class - This class is used to calculate information about the +// amount of time each pass takes to execute. This only happens when +// -time-passes is enabled on the command line. +// + +class VISIBILITY_HIDDEN TimingInfo { + std::map TimingData; + TimerGroup TG; + +public: + // Use 'create' member to get this. + TimingInfo() : TG("... Pass execution timing report ...") {} + + // TimingDtor - Print out information about timing information + ~TimingInfo() { + // Delete all of the timers... + TimingData.clear(); + // TimerGroup is deleted next, printing the report. + } + + // createTheTimeInfo - This method either initializes the TheTimeInfo pointer + // to a non null value (if the -time-passes option is enabled) or it leaves it + // null. It may be called multiple times. + static void createTheTimeInfo(); + + void passStarted(Pass *P) { + + if (dynamic_cast(P)) + return; + + std::map::iterator I = TimingData.find(P); + if (I == TimingData.end()) + I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; + I->second.startTimer(); + } + void passEnded(Pass *P) { + + if (dynamic_cast(P)) + return; + + std::map::iterator I = TimingData.find(P); + assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); + I->second.stopTimer(); + } +}; + +static TimingInfo *TheTimeInfo; + +} // End of anon namespace //===----------------------------------------------------------------------===// // PMTopLevelManager implementation @@ -1084,6 +1132,18 @@ TheTimeInfo = &*TTI; } +/// If TimingInfo is enabled then start pass timer. +void StartPassTimer(Pass *P) { + if (TheTimeInfo) + TheTimeInfo->passStarted(P); +} + +/// If TimingInfo is enabled then stop pass timer. +void StopPassTimer(Pass *P) { + if (TheTimeInfo) + TheTimeInfo->passEnded(P); +} + //===----------------------------------------------------------------------===// // PMStack implementation // From dpatel at apple.com Mon Jan 29 17:10:55 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 17:10:55 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200701292310.l0TNAtjL013108@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.5 -> 1.6 --- Log message: - Undo previous check-in (i.e. Do not export TimingInfo class through PassManagers.h). - Add StopPassTimer() and StartPassTimer() to expose TimingInfo to CallGraphPassManager - Use these two APIs in CalLgraphPassManager to measure timings. --- Diffs of the changes: (+2 -49) PassManagers.h | 51 ++------------------------------------------------- 1 files changed, 2 insertions(+), 49 deletions(-) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.5 llvm/include/llvm/PassManagers.h:1.6 --- llvm/include/llvm/PassManagers.h:1.5 Mon Jan 29 14:06:26 2007 +++ llvm/include/llvm/PassManagers.h Mon Jan 29 17:10:37 2007 @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/PassManager.h" -#include "llvm/Support/Timer.h" using namespace llvm; class llvm::PMDataManager; @@ -324,53 +323,7 @@ } }; -//===----------------------------------------------------------------------===// -// TimingInfo Class - This class is used to calculate information about the -// amount of time each pass takes to execute. This only happens when -// -time-passes is enabled on the command line. -// - -class TimingInfo { - std::map TimingData; - TimerGroup TG; - -public: - // Use 'create' member to get this. - TimingInfo() : TG("... Pass execution timing report ...") {} - - // TimingDtor - Print out information about timing information - ~TimingInfo() { - // Delete all of the timers... - TimingData.clear(); - // TimerGroup is deleted next, printing the report. - } - - // createTheTimeInfo - This method either initializes the TheTimeInfo pointer - // to a non null value (if the -time-passes option is enabled) or it leaves it - // null. It may be called multiple times. - static void createTheTimeInfo(); - - void passStarted(Pass *P) { - - if (dynamic_cast(P)) - return; - - std::map::iterator I = TimingData.find(P); - if (I == TimingData.end()) - I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; - I->second.startTimer(); - } - void passEnded(Pass *P) { - - if (dynamic_cast(P)) - return; - - std::map::iterator I = TimingData.find(P); - assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); - I->second.stopTimer(); - } -}; - -extern TimingInfo *getTheTimeInfo(); } +extern void StartPassTimer(Pass *); +extern void StopPassTimer(Pass *); From jlaskey at apple.com Mon Jan 29 17:20:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:20:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200701292320.l0TNKfqN013396@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.102 -> 1.103 --- Log message: Only gather frame info if debug or eh. --- Diffs of the changes: (+2 -2) PPCRegisterInfo.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.102 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.103 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.102 Mon Jan 29 12:51:14 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Jan 29 17:20:22 2007 @@ -818,7 +818,7 @@ unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); unsigned MaxAlign = MFI->getMaxAlignment(); - if (MMI) { + if (MMI && MMI->needsFrameInfo()) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId); @@ -869,7 +869,7 @@ } } - if (MMI) { + if (MMI && MMI->needsFrameInfo()) { std::vector &Moves = MMI->getFrameMoves(); if (NegFrameSize) { From jlaskey at apple.com Mon Jan 29 17:20:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:20:41 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineModuleInfo.h Message-ID: <200701292320.l0TNKfSI013402@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineModuleInfo.h updated: 1.1 -> 1.2 --- Log message: Only gather frame info if debug or eh. --- Diffs of the changes: (+5 -0) MachineModuleInfo.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.1 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.2 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.1 Fri Jan 26 15:38:26 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Mon Jan 29 17:20:22 2007 @@ -36,6 +36,7 @@ #include "llvm/ADT/UniqueVector.h" #include "llvm/GlobalValue.h" #include "llvm/Pass.h" +#include "llvm/Target/TargetOptions.h" namespace llvm { @@ -1025,6 +1026,10 @@ /// bool hasDebugInfo() const { return !CompileUnits.empty(); } + /// needsFrameInfo - Returns true if we need to gather callee-saved register + /// move info for the frame. + bool needsFrameInfo() const { return hasDebugInfo() || ExceptionHandling; } + /// NextLabelID - Return the next unique label id. /// unsigned NextLabelID() { From jlaskey at apple.com Mon Jan 29 17:20:41 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:20:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701292320.l0TNKfmq013405@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.120 -> 1.121 --- Log message: Only gather frame info if debug or eh. --- Diffs of the changes: (+0 -1) DwarfWriter.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.120 llvm/lib/CodeGen/DwarfWriter.cpp:1.121 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.120 Mon Jan 29 14:48:32 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Jan 29 17:20:22 2007 @@ -31,7 +31,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetOptions.h" #include #include using namespace llvm; From jlaskey at apple.com Mon Jan 29 17:20:44 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:20:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200701292320.l0TNKigu013412@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.199 -> 1.200 --- Log message: Only gather frame info if debug or eh. --- Diffs of the changes: (+2 -2) X86RegisterInfo.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.199 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.200 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.199 Mon Jan 29 12:51:14 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Mon Jan 29 17:20:22 2007 @@ -1022,7 +1022,7 @@ } } - if (MMI) { + if (MMI && MMI->needsFrameInfo()) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId); @@ -1052,7 +1052,7 @@ MBB.insert(MBBI, MI); } - if (MMI) { + if (MMI && MMI->needsFrameInfo()) { std::vector &Moves = MMI->getFrameMoves(); if (NumBytes) { From dpatel at apple.com Mon Jan 29 17:30:10 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 29 Jan 2007 17:30:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200701292330.l0TNUATL013659@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.15 -> 1.16 --- Log message: Use StartPassTimer() and StopPassManager() --- Diffs of the changes: (+2 -3) CallGraphSCCPass.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.15 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.16 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.15 Mon Jan 29 14:08:03 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon Jan 29 17:29:54 2007 @@ -92,8 +92,7 @@ initializeAnalysisImpl(P); - TimingInfo *TheTimeInfo = llvm::getTheTimeInfo(); - if (TheTimeInfo) TheTimeInfo->passStarted(P); + StartPassTimer(P); if (CallGraphSCCPass *CGSP = dynamic_cast(P)) Changed |= CGSP->runOnSCC(*I); // TODO : What if CG is changed ? else { @@ -108,7 +107,7 @@ Changed |= FPP->runOnFunction(*F); } } - if (TheTimeInfo) TheTimeInfo->passEnded(P); + StopPassTimer(P); if (Changed) dumpPassInfo(P, Msg3, Msg2); From jlaskey at apple.com Mon Jan 29 17:40:52 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:40:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp MachineModuleInfo.cpp Message-ID: <200701292340.l0TNeq4E014066@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.121 -> 1.122 MachineModuleInfo.cpp updated: 1.1 -> 1.2 --- Log message: Out of line function. --- Diffs of the changes: (+8 -0) DwarfWriter.cpp | 1 + MachineModuleInfo.cpp | 7 +++++++ 2 files changed, 8 insertions(+) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.121 llvm/lib/CodeGen/DwarfWriter.cpp:1.122 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.121 Mon Jan 29 17:20:22 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Jan 29 17:40:33 2007 @@ -31,6 +31,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include #include using namespace llvm; Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.1 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.2 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.1 Fri Jan 26 15:38:26 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Mon Jan 29 17:40:33 2007 @@ -15,6 +15,7 @@ #include "llvm/CodeGen/MachineLocation.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" #include "llvm/Intrinsics.h" @@ -1527,6 +1528,12 @@ SetupCompileUnits(M); } +/// needsFrameInfo - Returns true if we need to gather callee-saved register +/// move info for the frame. +bool MachineModuleInfo::needsFrameInfo() const { + return hasDebugInfo() || ExceptionHandling; +} + /// SetupCompileUnits - Set up the unique vector of compile units. /// void MachineModuleInfo::SetupCompileUnits(Module &M) { From jlaskey at apple.com Mon Jan 29 17:40:52 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 29 Jan 2007 17:40:52 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineModuleInfo.h Message-ID: <200701292340.l0TNeq4V014071@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineModuleInfo.h updated: 1.2 -> 1.3 --- Log message: Out of line function. --- Diffs of the changes: (+1 -2) MachineModuleInfo.h | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.2 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.3 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.2 Mon Jan 29 17:20:22 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Mon Jan 29 17:40:33 2007 @@ -36,7 +36,6 @@ #include "llvm/ADT/UniqueVector.h" #include "llvm/GlobalValue.h" #include "llvm/Pass.h" -#include "llvm/Target/TargetOptions.h" namespace llvm { @@ -1028,7 +1027,7 @@ /// needsFrameInfo - Returns true if we need to gather callee-saved register /// move info for the frame. - bool needsFrameInfo() const { return hasDebugInfo() || ExceptionHandling; } + bool needsFrameInfo() const; /// NextLabelID - Return the next unique label id. /// From sabre at nondot.org Mon Jan 29 17:45:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 29 Jan 2007 17:45:21 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll Message-ID: <200701292345.l0TNjL1h014283@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-01-29-lbrx-asm.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+7 -0) 2007-01-29-lbrx-asm.ll | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.1 *** /dev/null Mon Jan 29 17:45:13 2007 --- llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll Mon Jan 29 17:45:03 2007 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 && + ; RUN: llvm-as < %s | llc -march=ppc64 + + define i16 @test(i8* %data, i16* %data) { + %tmp237 = call i16 asm "lhbrx $0, $2, $1", "=r,r,bO,m"( i8* %data, i32 0, i16* %data ) ; [#uses=1] + ret i16 %tmp237 + } From sabre at nondot.org Mon Jan 29 17:45:32 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 29 Jan 2007 17:45:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200701292345.l0TNjWe2014298@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.350 -> 1.351 --- Log message: add initial support for handling inline asms with multiple constraints. This doesn't do the "right thing" but will probably work in most cases. This implements CodeGen/PowerPC/2007-01-29-lbrx-asm.ll. --- Diffs of the changes: (+42 -4) SelectionDAGISel.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 42 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.350 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.351 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.350 Mon Jan 29 16:58:52 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 29 17:45:14 2007 @@ -2433,6 +2433,44 @@ return RegsForValue(); } +/// getConstraintGenerality - Return an integer indicating how general CT is. +static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) { + switch (CT) { + default: assert(0 && "Unknown constraint type!"); + case TargetLowering::C_Other: + case TargetLowering::C_Unknown: + return 0; + case TargetLowering::C_Register: + return 1; + case TargetLowering::C_RegisterClass: + return 2; + case TargetLowering::C_Memory: + return 3; + } +} + +static std::string GetMostGeneralConstraint(std::vector &C, + const TargetLowering &TLI) { + assert(!C.empty() && "Must have at least one constraint"); + if (C.size() == 1) return C[0]; + + std::string *Current = &C[0]; + // If we have multiple constraints, try to pick the most general one ahead + // of time. This isn't a wonderful solution, but handles common cases. + TargetLowering::ConstraintType Flavor = TLI.getConstraintType(Current[0][0]); + for (unsigned j = 1, e = C.size(); j != e; ++j) { + TargetLowering::ConstraintType ThisFlavor = TLI.getConstraintType(C[j][0]); + if (getConstraintGenerality(ThisFlavor) > + getConstraintGenerality(Flavor)) { + // This constraint letter is more general than the previous one, + // use it. + Flavor = ThisFlavor; + Current = &C[j]; + } + } + return *Current; +} + /// visitInlineAsm - Handle a call to an InlineAsm object. /// @@ -2462,8 +2500,8 @@ std::set OutputRegs, InputRegs; unsigned OpNum = 1; for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { - assert(Constraints[i].Codes.size() == 1 && "Only handles one code so far!"); - std::string &ConstraintCode = Constraints[i].Codes[0]; + std::string ConstraintCode = + GetMostGeneralConstraint(Constraints[i].Codes, TLI); MVT::ValueType OpVT; @@ -2527,8 +2565,8 @@ OpNum = 1; for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { - assert(Constraints[i].Codes.size() == 1 && "Only handles one code so far!"); - std::string &ConstraintCode = Constraints[i].Codes[0]; + std::string ConstraintCode = + GetMostGeneralConstraint(Constraints[i].Codes, TLI); switch (Constraints[i].Type) { case InlineAsm::isOutput: { From evan.cheng at apple.com Mon Jan 29 17:45:35 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 17:45:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMInstrInfo.h ARMInstrInfo.cpp Message-ID: <200701292345.l0TNjZBF014308@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.11 -> 1.12 ARMInstrInfo.h updated: 1.6 -> 1.7 ARMInstrInfo.cpp updated: 1.12 -> 1.13 --- Log message: Factor GetInstSize() out of constpool island pass. --- Diffs of the changes: (+84 -70) ARMConstantIslandPass.cpp | 73 ++-------------------------------------------- ARMInstrInfo.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++ ARMInstrInfo.h | 10 ++++++ 3 files changed, 84 insertions(+), 70 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.11 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.12 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.11 Fri Jan 26 20:29:45 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Jan 29 17:45:17 2007 @@ -20,8 +20,6 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineJumpTableInfo.h" -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Compiler.h" @@ -91,7 +89,6 @@ std::vector ImmBranches; const TargetInstrInfo *TII; - const TargetAsmInfo *TAI; public: virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -110,7 +107,6 @@ bool BBIsInBranchRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned D); bool FixUpImmediateBranch(MachineFunction &Fn, ImmBranch &Br); - unsigned GetInstSize(MachineInstr *MI) const; unsigned GetOffsetOf(MachineInstr *MI) const; unsigned GetOffsetOf(MachineBasicBlock *MBB) const; }; @@ -126,7 +122,6 @@ MachineConstantPool &MCP = *Fn.getConstantPool(); TII = Fn.getTarget().getInstrInfo(); - TAI = Fn.getTarget().getTargetAsmInfo(); // Renumber all of the machine basic blocks in the function, guaranteeing that // the numbers agree with the position of the block in the function. @@ -229,7 +224,7 @@ for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { // Add instruction size to MBBSize. - MBBSize += GetInstSize(I); + MBBSize += ARM::GetInstSize(I); int Opc = I->getOpcode(); if (TII->isBranch(Opc)) { @@ -318,66 +313,6 @@ } } -/// FIXME: Works around a gcc miscompilation with -fstrict-aliasing -static unsigned getNumJTEntries(const std::vector &JT, - unsigned JTI) DISABLE_INLINE; -static unsigned getNumJTEntries(const std::vector &JT, - unsigned JTI) { - return JT[JTI].MBBs.size(); -} - -/// GetInstSize - Return the size of the specified MachineInstr. -/// -unsigned ARMConstantIslands::GetInstSize(MachineInstr *MI) const { - // Basic size info comes from the TSFlags field. - unsigned TSFlags = MI->getInstrDescriptor()->TSFlags; - - switch ((TSFlags & ARMII::SizeMask) >> ARMII::SizeShift) { - default: - // If this machine instr is an inline asm, measure it. - if (MI->getOpcode() == ARM::INLINEASM) - return TAI->getInlineAsmLength(MI->getOperand(0).getSymbolName()); - if (MI->getOpcode() == ARM::LABEL) - return 0; - assert(0 && "Unknown or unset size field for instr!"); - break; - case ARMII::Size8Bytes: return 8; // Arm instruction x 2. - case ARMII::Size4Bytes: return 4; // Arm instruction. - case ARMII::Size2Bytes: return 2; // Thumb instruction. - case ARMII::SizeSpecial: { - switch (MI->getOpcode()) { - case ARM::CONSTPOOL_ENTRY: - // If this machine instr is a constant pool entry, its size is recorded as - // operand #2. - return MI->getOperand(2).getImm(); - case ARM::BR_JTr: - case ARM::BR_JTm: - case ARM::BR_JTadd: - case ARM::tBR_JTr: { - // These are jumptable branches, i.e. a branch followed by an inlined - // jumptable. The size is 4 + 4 * number of entries. - unsigned JTI = MI->getOperand(MI->getNumOperands()-2).getJumpTableIndex(); - const MachineFunction *MF = MI->getParent()->getParent(); - MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); - const std::vector &JT = MJTI->getJumpTables(); - assert(JTI < JT.size()); - // Thumb instructions are 2 byte aligned, but JT entries are 4 byte - // 4 aligned. The assembler / linker may add 2 byte padding just before - // the JT entries. Use + 4 even for tBR_JTr to purposely over-estimate - // the size the jumptable. - // FIXME: If we know the size of the function is less than (1 << 16) *2 - // bytes, we can use 16-bit entries instead. Then there won't be an - // alignment issue. - return getNumJTEntries(JT, JTI) * 4 + 4; - } - default: - // Otherwise, pseudo-instruction sizes are zero. - return 0; - } - } - } -} - /// GetOffsetOf - Return the current offset of the specified machine instruction /// from the start of the function. This offset changes as stuff is moved /// around inside the function. @@ -397,7 +332,7 @@ for (MachineBasicBlock::iterator I = MBB->begin(); ; ++I) { assert(I != MBB->end() && "Didn't find MI in its own basic block?"); if (&*I == MI) return Offset; - Offset += GetInstSize(I); + Offset += ARM::GetInstSize(I); } } @@ -482,7 +417,7 @@ unsigned NewBBSize = 0; for (MachineBasicBlock::iterator I = NewBB->begin(), E = NewBB->end(); I != E; ++I) - NewBBSize += GetInstSize(I); + NewBBSize += ARM::GetInstSize(I); // Set the size of NewBB in BBSizes. BBSizes[NewBB->getNumber()] = NewBBSize; @@ -668,6 +603,6 @@ MI->eraseFromParent(); // Increase the size of MBB to account for the new unconditional branch. - BBSizes[MBB->getNumber()] += GetInstSize(&MBB->back()); + BBSizes[MBB->getNumber()] += ARM::GetInstSize(&MBB->back()); return true; } Index: llvm/lib/Target/ARM/ARMInstrInfo.h diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.6 llvm/lib/Target/ARM/ARMInstrInfo.h:1.7 --- llvm/lib/Target/ARM/ARMInstrInfo.h:1.6 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.h Mon Jan 29 17:45:17 2007 @@ -104,6 +104,16 @@ virtual bool ReverseBranchCondition(std::vector &Cond) const; }; + // Utility routines + namespace ARM { + /// GetInstSize - Returns the size of the specified MachineInstr. + /// + unsigned GetInstSize(MachineInstr *MI); + + /// GetFunctionSize - Returns the size of the specified MachineFunction. + /// + unsigned GetFunctionSize(MachineFunction &MF); + } } #endif Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.12 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.13 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.12 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Mon Jan 29 17:45:17 2007 @@ -17,8 +17,10 @@ #include "ARMAddressingModes.h" #include "ARMGenInstrInfo.inc" #include "ARMMachineFunctionInfo.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/LiveVariables.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineJumpTableInfo.h" +#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Support/CommandLine.h" using namespace llvm; @@ -416,3 +418,70 @@ Cond[0].setImm(ARMCC::getOppositeCondition(CC)); return false; } + + +/// FIXME: Works around a gcc miscompilation with -fstrict-aliasing +static unsigned getNumJTEntries(const std::vector &JT, + unsigned JTI) DISABLE_INLINE; +static unsigned getNumJTEntries(const std::vector &JT, + unsigned JTI) { + return JT[JTI].MBBs.size(); +} + +/// GetInstSize - Return the size of the specified MachineInstr. +/// +unsigned ARM::GetInstSize(MachineInstr *MI) { + MachineBasicBlock &MBB = *MI->getParent(); + const MachineFunction *MF = MBB.getParent(); + const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo(); + + // Basic size info comes from the TSFlags field. + unsigned TSFlags = MI->getInstrDescriptor()->TSFlags; + + switch ((TSFlags & ARMII::SizeMask) >> ARMII::SizeShift) { + default: + // If this machine instr is an inline asm, measure it. + if (MI->getOpcode() == ARM::INLINEASM) + return TAI->getInlineAsmLength(MI->getOperand(0).getSymbolName()); + assert(0 && "Unknown or unset size field for instr!"); + break; + case ARMII::Size8Bytes: return 8; // Arm instruction x 2. + case ARMII::Size4Bytes: return 4; // Arm instruction. + case ARMII::Size2Bytes: return 2; // Thumb instruction. + case ARMII::SizeSpecial: { + switch (MI->getOpcode()) { + case ARM::CONSTPOOL_ENTRY: + // If this machine instr is a constant pool entry, its size is recorded as + // operand #2. + return MI->getOperand(2).getImm(); + case ARM::BR_JTr: + case ARM::BR_JTm: + case ARM::BR_JTadd: { + // These are jumptable branches, i.e. a branch followed by an inlined + // jumptable. The size is 4 + 4 * number of entries. + unsigned JTI = MI->getOperand(MI->getNumOperands()-2).getJumpTableIndex(); + MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); + const std::vector &JT = MJTI->getJumpTables(); + assert(JTI < JT.size()); + return getNumJTEntries(JT, JTI) * 4 + 4; + } + default: + // Otherwise, pseudo-instruction sizes are zero. + return 0; + } + } + } +} + +/// GetFunctionSize - Returns the size of the specified MachineFunction. +/// +unsigned ARM::GetFunctionSize(MachineFunction &MF) { + unsigned FnSize = 0; + for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end(); + MBBI != E; ++MBBI) { + MachineBasicBlock &MBB = *MBBI; + for (MachineBasicBlock::iterator I = MBB.begin(),E = MBB.end(); I != E; ++I) + FnSize += ARM::GetInstSize(I); + } + return FnSize; +} From reid at x10sys.com Mon Jan 29 17:46:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 17:46:07 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/override.reference_output Message-ID: <200701292346.l0TNk7NZ014347@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: override.reference_output updated: 1.1 -> 1.2 --- Log message: This test case now works so update the reference output to match. --- Diffs of the changes: (+2 -1) override.reference_output | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Integer/override.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/override.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/override.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/override.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/override.reference_output Mon Jan 29 17:45:51 2007 @@ -1,2 +1,3 @@ -call func with int31 +call func with int31: 1 +call func with int32: 2 exit 0 From sabre at nondot.org Mon Jan 29 17:55:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 29 Jan 2007 17:55:35 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll Message-ID: <200701292355.l0TNtZdQ014550@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-01-29-InlineAsm-ir.ll added (r1.1) --- Log message: test that the 'ir' constraint works. --- Diffs of the changes: (+7 -0) 2007-01-29-InlineAsm-ir.ll | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll diff -c /dev/null llvm/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll:1.1 *** /dev/null Mon Jan 29 17:55:30 2007 --- llvm/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll Mon Jan 29 17:55:20 2007 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s | llc -march=x86 + ; Test 'ri' constraint. + + define void @run_init_process() { + %tmp = call i32 asm sideeffect "push %ebx ; movl $2,%ebx ; int $$0x80 ; pop %ebx", "={ax},0,ri,{cx},{dx},~{dirflag},~{fpsr},~{flags},~{memory}"( i32 11, i32 0, i32 0, i32 0 ) + unreachable + } From reid at x10sys.com Mon Jan 29 18:49:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 18:49:00 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp cppfield2.reference_output cppfield.cpp cppfield.reference_output Message-ID: <200701300049.l0U0n0rK015480@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: cppfield2.cpp added (r1.1) cppfield2.reference_output added (r1.1) cppfield.cpp updated: 1.4 -> 1.5 cppfield.reference_output updated: 1.1 -> 1.2 --- Log message: Update the cppfield tests to be correct. bit-accurate inteers are not the same as bit fields when used in a struct. --- Diffs of the changes: (+106 -20) cppfield.cpp | 49 +++++++++++++++++++++-------------- cppfield.reference_output | 8 +++++ cppfield2.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++ cppfield2.reference_output | 7 +++++ 4 files changed, 106 insertions(+), 20 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp:1.1 *** /dev/null Mon Jan 29 18:48:54 2007 --- llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp Mon Jan 29 18:48:44 2007 *************** *** 0 **** --- 1,62 ---- + //===-- cppfield.cpp - Test C++ Fields With Bit Accurate Types ------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // This is a test for conversion between different int types. + // + //===----------------------------------------------------------------------===// + + + #include + + typedef unsigned char __attribute__ ((bitwidth(7))) int7; + typedef unsigned int __attribute__ ((bitwidth(17))) int17; + typedef unsigned int __attribute__ ((bitwidth(32))) int32; + typedef unsigned int __attribute__ ((bitwidth(8))) int8; + + class bitFieldStruct { + public: + int i; + unsigned char c:7; + int s:17; + char c2; + }; + + class bitAccurateStruct { + public: + int32 i; + int7 c : 7; + int17 s : 17; + int8 c2; + }; + + int main() + { + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); + printf("sizeof(bitAccurateStruct) == %d\n", sizeof(bitAccurateStruct)); + + if (sizeof(bitAccurateStruct) != 2 * sizeof(int)) + printf("bitAccurrateStruct should be %d but is %d \n", + 2 * sizeof(int), sizeof(bitAccurateStruct)); + + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) + printf("bitFieldStruct should be %d but is %d \n", + 2 * sizeof(int), sizeof(bitAccurateStruct)); + + bitFieldStruct x; + bitAccurateStruct y; + + char* yip = (char*) &y.i; + char* yc2p = (char*) &y.c2; + printf("Offset bitAccurateStruct.i = %d\n", yip - yip); + printf("Offset bitAccurateStruct.c2 = %d\n", yc2p - yip); + + char* xip = (char*) &x.i; + char* xc2p = (char*) &x.c2; + printf("Offset bitFieldStruct.i = %d\n", xip - xip); + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/cppfield2.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/cppfield2.reference_output:1.1 *** /dev/null Mon Jan 29 18:49:00 2007 --- llvm-test/SingleSource/UnitTests/Integer/cppfield2.reference_output Mon Jan 29 18:48:44 2007 *************** *** 0 **** --- 1,7 ---- + sizeof(bitFieldStruct) == 8 + sizeof(bitAccurateStruct) == 8 + Offset bitAccurateStruct.i = 0 + Offset bitAccurateStruct.c2 = 7 + Offset bitFieldStruct.i = 0 + Offset bitFieldStruct.c2 = 7 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.4 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp Mon Jan 29 18:48:44 2007 @@ -11,12 +11,12 @@ #include -typedef unsigned int __attribute__ ((bitwidth(7))) int7; +typedef unsigned char __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(17))) int17; typedef unsigned int __attribute__ ((bitwidth(32))) int32; typedef unsigned int __attribute__ ((bitwidth(8))) int8; -class myStruct{ +class bitFieldStruct { public: int i; unsigned char c:7; @@ -24,7 +24,7 @@ char c2; }; -class myStruct2{ +class bitAccurateStruct { public: int32 i; int7 c; @@ -34,24 +34,33 @@ int main() { - myStruct x; - myStruct2 y; + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); + printf("sizeof(bitAccurateStruct) == %d\n", sizeof(bitAccurateStruct)); - char* ptrc, *ptrc1, *ptrc2, *ptrc3; - unsigned int offset, offset1; - - ptrc = (char*)&(x.i); - ptrc1 = (char*)&(x.c2); - - ptrc2 = (char*)&(y.i); - ptrc3 = (char*)&(y.c2); - - offset = ptrc1 - ptrc; - offset1 = ptrc3 - ptrc2; - - - if(offset != offset1 || sizeof(myStruct) != sizeof(myStruct2)) - printf("error\n"); + if (sizeof(bitAccurateStruct) != 4 * sizeof(int)) + printf("bitAccurrateStruct should be %d but is %d \n", + 4 * sizeof(int), sizeof(bitAccurateStruct)); + + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) + printf("bitFieldStruct should be %d but is %d \n", + 2 * sizeof(int), sizeof(bitAccurateStruct)); + + bitFieldStruct x; + bitAccurateStruct y; + + char* yip = (char*) &y.i; + char* ycp = (char*) &y.c; + char* ysp = (char*) &y.s; + char* yc2p = (char*) &y.c2; + printf("Offset bitAccurateStruct.i = %d\n", yip - yip); + printf("Offset bitAccurateStruct.c = %d\n", ycp - yip); + printf("Offset bitAccurateStruct.s = %d\n", ysp - yip); + printf("Offset bitAccurateStruct.c2 = %d\n", yc2p - yip); + + char* xip = (char*) &x.i; + char* xc2p = (char*) &x.c2; + printf("Offset bitFieldStruct.i = %d\n", xip - xip); + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/cppfield.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/cppfield.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/cppfield.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield.reference_output Mon Jan 29 18:48:44 2007 @@ -1 +1,9 @@ +sizeof(bitFieldStruct) == 8 +sizeof(bitAccurateStruct) == 16 +Offset bitAccurateStruct.i = 0 +Offset bitAccurateStruct.c = 4 +Offset bitAccurateStruct.s = 8 +Offset bitAccurateStruct.c2 = 12 +Offset bitFieldStruct.i = 0 +Offset bitFieldStruct.c2 = 7 exit 0 From reid at x10sys.com Mon Jan 29 19:09:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 19:09:08 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/sign.cpp Message-ID: <200701300109.l0U1986v015813@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: sign.cpp added (r1.1) --- Log message: Add a new test case. --- Diffs of the changes: (+63 -0) sign.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/sign.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/sign.cpp:1.1 *** /dev/null Mon Jan 29 19:09:02 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/sign.cpp Mon Jan 29 19:08:52 2007 *************** *** 0 **** --- 1,63 ---- + //===--- sign.c --- Test Cases for Bit Accurate Types --------------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for arithmetic operations with signed and + // unsigned operands. + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/APInt.h" + #include + + using namespace llvm; + + int + main ( int argc, char** argv) + { + int num, r; + APInt x(24), y(24), z(24); + APInt ux(24), uy(24), uz(24); + + r = rand(); + r = r - 1804289384; // -1 + + y = r; // -1 + uy = r; // 0xffffff + + if (argc > 1) + num = atoi(argv[1]); + + + num = num - 0xdf5e75; //0x1000001 + + x = num; + ux = num; + printf("x = %d, ux = %u, y=%d, uy = %u\n", int(x), (unsigned int)ux, + int(y), (unsigned int)uy); + + z = x * y; // 0x1000001 * (-1) + uz = ux * uy; + printf("z=%d, uz=%u\n", int(z), (unsigned int)uz); + + z = x % 314; + uz = ux % 314; + printf("z=%d, uz=%u\n", int(z), (unsigned int)uz); + + z = x / 314; + uz = ux / 314; + printf("z=%d, uz=%u\n", int(z), (unsigned int)uz); + + z = (x+0xf28) / 314; + uz = (ux + 0xf28) / 314; + printf("z=%d, uz=%u\n", int(z), (unsigned int)uz); + + z = (x - 580) / 314; + uz = (((ux - 580)) / 314); + printf("z=%d, uz=%u\n", int(z), (unsigned int)uz); + + return 0; + } From reid at x10sys.com Mon Jan 29 19:10:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 29 Jan 2007 19:10:59 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/bitlogic.cpp Message-ID: <200701300110.l0U1AxIR015857@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: bitlogic.cpp added (r1.1) --- Log message: Add a new test case. --- Diffs of the changes: (+56 -0) bitlogic.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/bitlogic.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/bitlogic.cpp:1.1 *** /dev/null Mon Jan 29 19:10:53 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/bitlogic.cpp Mon Jan 29 19:10:43 2007 *************** *** 0 **** --- 1,56 ---- + //===--- bitlogic.c --- Test Cases for Bit Accurate Types -----------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for logical operations. + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/APInt.h" + #include + + using namespace llvm; + + int my_test() + { + APInt x(1,0x1); + APInt y(1); + APInt z(9,0x1ff); + APInt uz(9,0x1ff); + APInt temp(9); + y = x; + y -= 1; + if (!y) + printf("ok\n"); + else + printf("fail\n"); + + if (y > x) + printf("fail\n"); + else + printf("ok\n"); + + if (z != uz) + printf("ok\n"); + else + printf("fail\n"); + + temp = z; + if (temp <= uz) + printf("ok\n"); + else + printf("fail\n"); + + return 0; + + } + + int main() + { + my_test(); + return 0; + } + From evan.cheng at apple.com Mon Jan 29 19:13:53 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 19:13:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td Message-ID: <200701300113.l0U1DrXI015914@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.7 -> 1.8 --- Log message: Use BL to implement Thumb far jumps. --- Diffs of the changes: (+3 -0) ARMInstrThumb.td | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.7 llvm/lib/Target/ARM/ARMInstrThumb.td:1.8 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.7 Fri Jan 26 20:29:45 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Mon Jan 29 19:13:37 2007 @@ -195,6 +195,9 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1 in { def tB : TI<(ops brtarget:$dst), "b $dst", [(br bb:$dst)]>; + // Far jump + def tBfar : TIx2<(ops brtarget:$dst), "bl $dst\t@ far jump", []>; + def tBR_JTr : TJTI<(ops GPR:$dst, jtblock_operand:$jt, i32imm:$id), "cpy pc, $dst \n\t.align\t2\n$jt", [(ARMbrjt GPR:$dst, tjumptable:$jt, imm:$id)]>; From evan.cheng at apple.com Mon Jan 29 19:18:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 19:18:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMMachineFunctionInfo.h ARMRegisterInfo.cpp Message-ID: <200701300118.l0U1Iskr016004@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.12 -> 1.13 ARMMachineFunctionInfo.h updated: 1.4 -> 1.5 ARMRegisterInfo.cpp updated: 1.43 -> 1.44 --- Log message: - In thumb mode, if size of MachineFunction is >= 2048, force LR to be spilled (if it is not already). - If LR is spilled, use BL to implement far jumps. LR is not used as a GPR in thumb mode so it can be clobbered if it is properly spilled / restored in prologue / epilogue. - If LR is force spilled but no far jump has been emitted, try undo'ing the spill by: push lr -> delete pop pc -> bx lr --- Diffs of the changes: (+123 -41) ARMConstantIslandPass.cpp | 130 +++++++++++++++++++++++++++++++++++----------- ARMMachineFunctionInfo.h | 14 ++-- ARMRegisterInfo.cpp | 20 ++++++- 3 files changed, 123 insertions(+), 41 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.12 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.13 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.12 Mon Jan 29 17:45:17 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Jan 29 19:18:38 2007 @@ -29,7 +29,9 @@ #include using namespace llvm; -STATISTIC(NumSplit, "Number of uncond branches inserted"); +STATISTIC(NumSplit, "Number of uncond branches inserted"); +STATISTIC(NumCBrFixed, "Number of cond branches fixed"); +STATISTIC(NumUBrFixed, "Number of uncond branches fixed"); namespace { /// ARMConstantIslands - Due to limited pc-relative displacements, ARM @@ -88,7 +90,16 @@ /// std::vector ImmBranches; + /// PushPopMIs - Keep track of all the Thumb push / pop instructions. + /// + std::vector PushPopMIs; + + /// HasFarJump - True if any far jump instruction has been emitted during + /// the branch fix up pass. + bool HasFarJump; + const TargetInstrInfo *TII; + const ARMFunctionInfo *AFI; public: virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -105,7 +116,10 @@ void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB); bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); bool BBIsInBranchRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned D); - bool FixUpImmediateBranch(MachineFunction &Fn, ImmBranch &Br); + bool FixUpImmediateBr(MachineFunction &Fn, ImmBranch &Br); + bool FixUpConditionalBr(MachineFunction &Fn, ImmBranch &Br); + bool FixUpUnconditionalBr(MachineFunction &Fn, ImmBranch &Br); + bool UndoLRSpillRestore(); unsigned GetOffsetOf(MachineInstr *MI) const; unsigned GetOffsetOf(MachineBasicBlock *MBB) const; @@ -122,7 +136,10 @@ MachineConstantPool &MCP = *Fn.getConstantPool(); TII = Fn.getTarget().getInstrInfo(); - + AFI = Fn.getInfo(); + + HasFarJump = false; + // Renumber all of the machine basic blocks in the function, guaranteeing that // the numbers agree with the position of the block in the function. Fn.RenumberBlocks(); @@ -142,22 +159,31 @@ InitialFunctionScan(Fn, CPEMIs); CPEMIs.clear(); - // Iteratively place constant pool entries until there is no change. - bool MadeChange; - do { - MadeChange = false; + // Iteratively place constant pool entries and fix up branches until there + // is no change. + bool MadeChange = false; + while (true) { + bool Change = false; for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) - MadeChange |= HandleConstantPoolUser(Fn, CPUsers[i]); + Change |= HandleConstantPoolUser(Fn, CPUsers[i]); for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) - MadeChange |= FixUpImmediateBranch(Fn, ImmBranches[i]); - } while (MadeChange); + Change |= FixUpImmediateBr(Fn, ImmBranches[i]); + if (!Change) + break; + MadeChange = true; + } + // If LR has been forced spilled and no far jumps (i.e. BL) has been issued. + // Undo the spill / restore of LR if possible. + if (!HasFarJump && AFI->isLRForceSpilled() && AFI->isThumbFunction()) + MadeChange |= UndoLRSpillRestore(); + BBSizes.clear(); WaterList.clear(); CPUsers.clear(); ImmBranches.clear(); - - return true; + + return MadeChange; } /// DoInitialPlacement - Perform the initial placement of the constant pool @@ -258,6 +284,9 @@ ImmBranches.push_back(ImmBranch(I, MaxDisp, isCond, UOpc)); } + if (Opc == ARM::tPUSH || Opc == ARM::tPOP_RET) + PushPopMIs.push_back(I); + // Scan the instructions for constant pool operands. for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) if (I->getOperand(op).isConstantPoolIndex()) { @@ -380,7 +409,6 @@ /// account for this change. void ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) { MachineBasicBlock *OrigBB = MI->getParent(); - const ARMFunctionInfo *AFI = OrigBB->getParent()->getInfo(); bool isThumb = AFI->isThumbFunction(); // Create a new MBB for the code after the OrigBB. @@ -524,32 +552,53 @@ return false; } +/// FixUpImmediateBr - Fix up an immediate branch whose destination is too far +/// away to fit in its displacement field. +bool ARMConstantIslands::FixUpImmediateBr(MachineFunction &Fn, ImmBranch &Br) { + MachineInstr *MI = Br.MI; + MachineBasicBlock *DestBB = MI->getOperand(0).getMachineBasicBlock(); + + if (BBIsInBranchRange(MI, DestBB, Br.MaxDisp)) + return false; + + if (!Br.isCond) + return FixUpUnconditionalBr(Fn, Br); + return FixUpConditionalBr(Fn, Br); +} + +/// FixUpUnconditionalBr - Fix up an unconditional branches whose destination is +/// too far away to fit in its displacement field. If LR register has been +/// spilled in the epilogue, then we can use BL to implement a far jump. +/// Otherwise, add a intermediate branch instruction to to a branch. +bool +ARMConstantIslands::FixUpUnconditionalBr(MachineFunction &Fn, ImmBranch &Br) { + MachineInstr *MI = Br.MI; + MachineBasicBlock *MBB = MI->getParent(); + assert(AFI->isThumbFunction() && "Expected a Thumb function!"); + + // Use BL to implement far jump. + Br.MaxDisp = (1 << 21) * 2; + MI->setInstrDescriptor(TII->get(ARM::tBfar)); + BBSizes[MBB->getNumber()] += 2; + HasFarJump = true; + NumUBrFixed++; + return true; +} + static inline unsigned getUncondBranchDisp(int Opc) { return (Opc == ARM::tB) ? (1<<10)*2 : (1<<23)*4; } -/// FixUpImmediateBranch - Fix up immediate branches whose destination is too -/// far away to fit in its displacement field. If it is a conditional branch, -/// then it is converted to an inverse conditional branch + an unconditional -/// branch to the destination. If it is an unconditional branch, then it is -/// converted to a branch to a branch. +/// FixUpConditionalBr - Fix up a conditional branches whose destination is too +/// far away to fit in its displacement field. It is converted to an inverse +/// conditional branch + an unconditional branch to the destination. bool -ARMConstantIslands::FixUpImmediateBranch(MachineFunction &Fn, ImmBranch &Br) { +ARMConstantIslands::FixUpConditionalBr(MachineFunction &Fn, ImmBranch &Br) { MachineInstr *MI = Br.MI; MachineBasicBlock *DestBB = MI->getOperand(0).getMachineBasicBlock(); - if (BBIsInBranchRange(MI, DestBB, Br.MaxDisp)) - return false; - - if (!Br.isCond) { - // Unconditional branch. We have to insert a branch somewhere to perform - // a two level branch (branch to branch). FIXME: not yet implemented. - assert(false && "Can't handle unconditional branch yet!"); - return false; - } - - // Otherwise, add a unconditional branch to the destination and - // invert the branch condition to jump over it: + // Add a unconditional branch to the destination and invert the branch + // condition to jump over it: // blt L1 // => // bge L2 @@ -565,6 +614,7 @@ MachineInstr *BackMI = &MBB->back(); bool NeedSplit = (BackMI != MI) || !BBHasFallthrough(MBB); + NumCBrFixed++; if (BackMI != MI) { if (next(MachineBasicBlock::iterator(MI)) == MBB->back() && BackMI->getOpcode() == Br.UncondBr) { @@ -606,3 +656,21 @@ BBSizes[MBB->getNumber()] += ARM::GetInstSize(&MBB->back()); return true; } + + +/// UndoLRSpillRestore - Remove Thumb push / pop instructions that only spills +/// LR / restores LR to pc. +bool ARMConstantIslands::UndoLRSpillRestore() { + bool MadeChange = false; + for (unsigned i = 0, e = PushPopMIs.size(); i != e; ++i) { + MachineInstr *MI = PushPopMIs[i]; + if (MI->getNumOperands() == 1) { + if (MI->getOpcode() == ARM::tPOP_RET && + MI->getOperand(0).getReg() == ARM::PC) + BuildMI(MI->getParent(), TII->get(ARM::tBX_RET)); + MI->eraseFromParent(); + MadeChange = true; + } + } + return MadeChange; +} Index: llvm/lib/Target/ARM/ARMMachineFunctionInfo.h diff -u llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.4 llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.5 --- llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.4 Mon Jan 29 16:22:24 2007 +++ llvm/lib/Target/ARM/ARMMachineFunctionInfo.h Mon Jan 29 19:18:38 2007 @@ -36,9 +36,9 @@ /// processFunctionBeforeCalleeSavedScan(). bool HasStackFrame; - /// LRSpilled - True if the LR register has been spilled. - /// - bool LRSpilled; + /// LRSForceSpilled - True if the LR register has been for spilled to enable + /// far jump. + bool LRForceSpilled; /// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer /// spill stack offset. @@ -75,13 +75,13 @@ public: ARMFunctionInfo() : isThumb(false), - VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false), + VarArgsRegSaveSize(0), HasStackFrame(false), LRForceSpilled(false), FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {} ARMFunctionInfo(MachineFunction &MF) : isThumb(MF.getTarget().getSubtarget().isThumb()), - VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false), + VarArgsRegSaveSize(0), HasStackFrame(false), LRForceSpilled(false), FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0), GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {} @@ -93,8 +93,8 @@ bool hasStackFrame() const { return HasStackFrame; } void setHasStackFrame(bool s) { HasStackFrame = s; } - bool isLRSpilled() const { return LRSpilled; } - void setLRIsSpilled(bool s) { LRSpilled = s; } + bool isLRForceSpilled() const { return LRForceSpilled; } + void setLRIsForceSpilled(bool s) { LRForceSpilled = s; } unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; } void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; } Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.43 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.44 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.43 Mon Jan 29 16:22:24 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Jan 29 19:18:38 2007 @@ -770,17 +770,29 @@ } ARMFunctionInfo *AFI = MF.getInfo(); + bool ForceLRSpill = false; + if (!LRSpilled && AFI->isThumbFunction()) { + unsigned FnSize = ARM::GetFunctionSize(MF); + // Force LR spill if the Thumb function size is > 2048. This enables the + // use of BL to implement far jump. If it turns out that it's not needed + // the branch fix up path will undo it. + if (FnSize >= (1 << 11)) { + CanEliminateFrame = false; + ForceLRSpill = true; + } + } + if (!CanEliminateFrame) { AFI->setHasStackFrame(true); // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled. // Spill LR as well so we can fold BX_RET to the registers restore (LDM). if (!LRSpilled && CS1Spilled) { - LRSpilled = true; MF.changePhyRegUsed(ARM::LR, true); NumGPRSpills++; UnspilledCS1GPRs.erase(std::find(UnspilledCS1GPRs.begin(), UnspilledCS1GPRs.end(), (unsigned)ARM::LR)); + ForceLRSpill = false; } if (STI.isTargetDarwin()) { @@ -800,8 +812,10 @@ } } - // Remembe if LR has been spilled. - AFI->setLRIsSpilled(LRSpilled); + if (ForceLRSpill) { + MF.changePhyRegUsed(ARM::LR, true); + AFI->setLRIsForceSpilled(true); + } } /// Move iterator pass the next bunch of callee save load / store ops for From evan.cheng at apple.com Mon Jan 29 20:35:48 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 20:35:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td ARMISelDAGToDAG.cpp ARMAsmPrinter.cpp Message-ID: <200701300235.l0U2ZmYG017164@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.8 -> 1.9 ARMISelDAGToDAG.cpp updated: 1.103 -> 1.104 ARMAsmPrinter.cpp updated: 1.51 -> 1.52 --- Log message: Change the operand orders to t_addrmode_s* to make it easier to morph instructions that use these address modes to instructions that use t_addrmode_sp. --- Diffs of the changes: (+26 -32) ARMAsmPrinter.cpp | 22 ++++++++-------------- ARMISelDAGToDAG.cpp | 30 +++++++++++++++--------------- ARMInstrThumb.td | 6 +++--- 3 files changed, 26 insertions(+), 32 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.8 llvm/lib/Target/ARM/ARMInstrThumb.td:1.9 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.8 Mon Jan 29 19:13:37 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Mon Jan 29 20:35:32 2007 @@ -124,7 +124,7 @@ def t_addrmode_s4 : Operand, ComplexPattern { let PrintMethod = "printThumbAddrModeS4Operand"; - let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); + let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg); } // t_addrmode_s2 := reg + reg @@ -133,7 +133,7 @@ def t_addrmode_s2 : Operand, ComplexPattern { let PrintMethod = "printThumbAddrModeS2Operand"; - let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); + let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg); } // t_addrmode_s1 := reg + reg @@ -142,7 +142,7 @@ def t_addrmode_s1 : Operand, ComplexPattern { let PrintMethod = "printThumbAddrModeS1Operand"; - let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); + let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg); } // t_addrmode_sp := sp + imm8 * 4 Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.103 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.104 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.103 Wed Jan 24 02:53:17 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Jan 29 20:35:32 2007 @@ -72,14 +72,14 @@ bool SelectThumbAddrModeRR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); bool SelectThumbAddrModeRI5(SDOperand Op, SDOperand N, unsigned Scale, - SDOperand &Base, SDOperand &Offset, - SDOperand &OffImm); + SDOperand &Base, SDOperand &OffImm, + SDOperand &Offset); bool SelectThumbAddrModeS1(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset, SDOperand &OffImm); + SDOperand &OffImm, SDOperand &Offset); bool SelectThumbAddrModeS2(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset, SDOperand &OffImm); + SDOperand &OffImm, SDOperand &Offset); bool SelectThumbAddrModeS4(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset, SDOperand &OffImm); + SDOperand &OffImm, SDOperand &Offset); bool SelectThumbAddrModeSP(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &OffImm); @@ -375,7 +375,7 @@ bool ARMDAGToDAGISel::SelectThumbAddrModeRI5(SDOperand Op, SDOperand N, unsigned Scale, SDOperand &Base, - SDOperand &Offset, SDOperand &OffImm) { + SDOperand &OffImm, SDOperand &Offset) { if (Scale == 4) { SDOperand TmpBase, TmpOffImm; if (SelectThumbAddrModeSP(Op, N, TmpBase, TmpOffImm)) @@ -413,21 +413,21 @@ } bool ARMDAGToDAGISel::SelectThumbAddrModeS1(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset, - SDOperand &OffImm) { - return SelectThumbAddrModeRI5(Op, N, 1, Base, Offset, OffImm); + SDOperand &Base, SDOperand &OffImm, + SDOperand &Offset) { + return SelectThumbAddrModeRI5(Op, N, 1, Base, OffImm, Offset); } bool ARMDAGToDAGISel::SelectThumbAddrModeS2(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset, - SDOperand &OffImm) { - return SelectThumbAddrModeRI5(Op, N, 2, Base, Offset, OffImm); + SDOperand &Base, SDOperand &OffImm, + SDOperand &Offset) { + return SelectThumbAddrModeRI5(Op, N, 2, Base, OffImm, Offset); } bool ARMDAGToDAGISel::SelectThumbAddrModeS4(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset, - SDOperand &OffImm) { - return SelectThumbAddrModeRI5(Op, N, 4, Base, Offset, OffImm); + SDOperand &Base, SDOperand &OffImm, + SDOperand &Offset) { + return SelectThumbAddrModeRI5(Op, N, 4, Base, OffImm, Offset); } bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDOperand Op, SDOperand N, Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.51 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.52 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.51 Fri Jan 26 20:29:44 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Mon Jan 29 20:35:32 2007 @@ -523,7 +523,8 @@ ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op, unsigned Scale) { const MachineOperand &MO1 = MI->getOperand(Op); - const MachineOperand &MO2 = MI->getOperand(Op+2); + const MachineOperand &MO2 = MI->getOperand(Op+1); + const MachineOperand &MO3 = MI->getOperand(Op+2); if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right. printOperand(MI, Op); @@ -531,7 +532,9 @@ } O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; - if (unsigned ImmOffs = MO2.getImm()) { + if (MO3.getReg()) + O << ", " << TM.getRegisterInfo()->get(MO3.getReg()).Name; + else if (unsigned ImmOffs = MO2.getImm()) { O << ", #" << ImmOffs; if (Scale > 1) O << " * " << Scale; @@ -541,24 +544,15 @@ void ARMAsmPrinter::printThumbAddrModeS1Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 1); + printThumbAddrModeRI5Operand(MI, Op, 1); } void ARMAsmPrinter::printThumbAddrModeS2Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 2); + printThumbAddrModeRI5Operand(MI, Op, 2); } void ARMAsmPrinter::printThumbAddrModeS4Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 4); + printThumbAddrModeRI5Operand(MI, Op, 4); } void ARMAsmPrinter::printThumbAddrModeSPOperand(const MachineInstr *MI,int Op) { From evan.cheng at apple.com Mon Jan 29 20:36:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 20:36:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701300236.l0U2aHFP017185@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.44 -> 1.45 --- Log message: Thumb eliminateFrameIndex fixes. --- Diffs of the changes: (+27 -8) ARMRegisterInfo.cpp | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.44 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.45 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.44 Mon Jan 29 19:18:38 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Jan 29 20:36:01 2007 @@ -336,22 +336,27 @@ bool isMul4 = (Bytes & 3) == 0; bool isTwoAddr = false; unsigned NumBits = 1; + unsigned Scale = 1; unsigned Opc = 0; unsigned ExtraOpc = 0; if (DestReg == BaseReg && BaseReg == ARM::SP) { assert(isMul4 && "Thumb sp inc / dec size must be multiple of 4!"); - Bytes >>= 2; // Implicitly multiplied by 4. NumBits = 7; + Scale = 4; Opc = isSub ? ARM::tSUBspi : ARM::tADDspi; isTwoAddr = true; } else if (!isSub && BaseReg == ARM::SP) { + // r1 = add sp, 403 + // => + // r1 = add sp, 100 * 4 + // r1 = add r1, 3 if (!isMul4) { Bytes &= ~3; ExtraOpc = ARM::tADDi3; } - Bytes >>= 2; // Implicitly multiplied by 4. NumBits = 8; + Scale = 4; Opc = ARM::tADDrSPi; } else { if (DestReg != BaseReg) { @@ -372,10 +377,11 @@ isTwoAddr = true; } - unsigned Chunk = (1 << NumBits) - 1; + unsigned Chunk = ((1 << NumBits) - 1) * Scale; while (Bytes) { unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes; - Bytes -= ThisVal; + Bytes -= ThisVal; + ThisVal /= Scale; // Build the new tADD / tSUB. if (isTwoAddr) BuildMI(MBB, MBBI, TII.get(Opc), DestReg).addReg(DestReg).addImm(ThisVal); @@ -388,6 +394,8 @@ // r4 = add r4, imm // ... NumBits = 8; + Scale = 1; + Chunk = ((1 << NumBits) - 1) * Scale; Opc = isSub ? ARM::tSUBi8 : ARM::tADDi8; isTwoAddr = true; } @@ -636,6 +644,13 @@ } // Otherwise, it didn't fit. Pull in what we can to simplify the immediate. + if (AddrMode == ARMII::AddrModeTs) { + // Thumb tLDRspi, tSTRspi. These will change to instructions that use a + // different base register. + NumBits = 5; + Mask = (1 << NumBits) - 1; + } + ImmedOffset = ImmedOffset & Mask; if (isSub) ImmedOffset |= 1 << NumBits; @@ -654,7 +669,9 @@ unsigned TmpReg = MI.getOperand(0).getReg(); emitThumbRegPlusImmediate(MBB, II, TmpReg, FrameReg, isSub ? -Offset : Offset, TII); + MI.setInstrDescriptor(TII.get(ARM::tLDR)); MI.getOperand(i).ChangeToRegister(TmpReg, false); + MI.addRegOperand(0, false); // tLDR has an extra register operand. } else if (TII.isStore(Opcode)) { // FIXME! This is horrific!!! We need register scavenging. // Our temporary workaround has marked r3 unavailable. Of course, r3 is @@ -664,16 +681,18 @@ // Use r2 to materialize sp + offset // str r12, r2 // r2 = r12 - unsigned DestReg = MI.getOperand(0).getReg(); + unsigned ValReg = MI.getOperand(0).getReg(); unsigned TmpReg = ARM::R3; - if (DestReg == ARM::R3) { + if (ValReg == ARM::R3) { BuildMI(MBB, II, TII.get(ARM::tMOVrr), ARM::R12).addReg(ARM::R2); TmpReg = ARM::R2; } emitThumbRegPlusImmediate(MBB, II, TmpReg, FrameReg, isSub ? -Offset : Offset, TII); - MI.getOperand(i).ChangeToRegister(DestReg, false); - if (DestReg == ARM::R3) + MI.setInstrDescriptor(TII.get(ARM::tSTR)); + MI.getOperand(i).ChangeToRegister(TmpReg, false); + MI.addRegOperand(0, false); // tSTR has an extra register operand. + if (ValReg == ARM::R3) BuildMI(MBB, II, TII.get(ARM::tMOVrr), ARM::R2).addReg(ARM::R12); } else assert(false && "Unexpected opcode!"); From evan.cheng at apple.com Mon Jan 29 20:57:18 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 20:57:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701300257.l0U2vI1N017529@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.45 -> 1.46 --- Log message: In thumb mode, round up stack frame size to multiple of 4 since add/sub sp, imm instructions implicitly multiply the offset by 4. --- Diffs of the changes: (+129 -120) ARMRegisterInfo.cpp | 249 ++++++++++++++++++++++++++-------------------------- 1 files changed, 129 insertions(+), 120 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.45 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.46 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.45 Mon Jan 29 20:36:01 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Jan 29 20:57:02 2007 @@ -884,93 +884,100 @@ unsigned NumBytes = MFI->getStackSize(); const std::vector &CSI = MFI->getCalleeSavedInfo(); + if (isThumb) { + // Thumb add/sub sp, imm8 instructions implicitly multiply the offset by 4. + NumBytes = (NumBytes + 3) & ~3; + MFI->setStackSize(NumBytes); + } + // Determine the sizes of each callee-save spill areas and record which frame // belongs to which callee-save spill areas. unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0; int FramePtrSpillFI = 0; - if (AFI->hasStackFrame()) { - if (VARegSaveSize) - emitSPUpdate(MBB, MBBI, -VARegSaveSize, isThumb, TII); - - for (unsigned i = 0, e = CSI.size(); i != e; ++i) { - unsigned Reg = CSI[i].getReg(); - int FI = CSI[i].getFrameIdx(); - switch (Reg) { - case ARM::R4: - case ARM::R5: - case ARM::R6: - case ARM::R7: - case ARM::LR: - if (Reg == FramePtr) - FramePtrSpillFI = FI; + if (!AFI->hasStackFrame()) { + if (NumBytes != 0) + emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); + return; + } + + if (VARegSaveSize) + emitSPUpdate(MBB, MBBI, -VARegSaveSize, isThumb, TII); + + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { + unsigned Reg = CSI[i].getReg(); + int FI = CSI[i].getFrameIdx(); + switch (Reg) { + case ARM::R4: + case ARM::R5: + case ARM::R6: + case ARM::R7: + case ARM::LR: + if (Reg == FramePtr) + FramePtrSpillFI = FI; + AFI->addGPRCalleeSavedArea1Frame(FI); + GPRCS1Size += 4; + break; + case ARM::R8: + case ARM::R9: + case ARM::R10: + case ARM::R11: + if (Reg == FramePtr) + FramePtrSpillFI = FI; + if (STI.isTargetDarwin()) { + AFI->addGPRCalleeSavedArea2Frame(FI); + GPRCS2Size += 4; + } else { AFI->addGPRCalleeSavedArea1Frame(FI); GPRCS1Size += 4; - break; - case ARM::R8: - case ARM::R9: - case ARM::R10: - case ARM::R11: - if (Reg == FramePtr) - FramePtrSpillFI = FI; - if (STI.isTargetDarwin()) { - AFI->addGPRCalleeSavedArea2Frame(FI); - GPRCS2Size += 4; - } else { - AFI->addGPRCalleeSavedArea1Frame(FI); - GPRCS1Size += 4; - } - break; - default: - AFI->addDPRCalleeSavedAreaFrame(FI); - DPRCSSize += 8; } + break; + default: + AFI->addDPRCalleeSavedAreaFrame(FI); + DPRCSSize += 8; } + } - if (Align == 8 && (GPRCS1Size & 7) != 0) - // Pad CS1 to ensure proper alignment. - GPRCS1Size += 4; - - if (!isThumb) { - // Build the new SUBri to adjust SP for integer callee-save spill area 1. - emitSPUpdate(MBB, MBBI, -GPRCS1Size, isThumb, TII); - movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 1, STI); - } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH) - ++MBBI; - - // Point FP to the stack slot that contains the previous FP. - if (STI.isTargetDarwin()) - BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri), FramePtr) - .addFrameIndex(FramePtrSpillFI).addImm(0); - - if (!isThumb) { - // Build the new SUBri to adjust SP for integer callee-save spill area 2. - emitSPUpdate(MBB, MBBI, -GPRCS2Size, false, TII); - - // Build the new SUBri to adjust SP for FP callee-save spill area. - movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 2, STI); - emitSPUpdate(MBB, MBBI, -DPRCSSize, false, TII); - } + if (Align == 8 && (GPRCS1Size & 7) != 0) + // Pad CS1 to ensure proper alignment. + GPRCS1Size += 4; + + if (!isThumb) { + // Build the new SUBri to adjust SP for integer callee-save spill area 1. + emitSPUpdate(MBB, MBBI, -GPRCS1Size, isThumb, TII); + movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 1, STI); + } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH) + ++MBBI; + + // Point FP to the stack slot that contains the previous FP. + if (STI.isTargetDarwin()) + BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri), FramePtr) + .addFrameIndex(FramePtrSpillFI).addImm(0); + + if (!isThumb) { + // Build the new SUBri to adjust SP for integer callee-save spill area 2. + emitSPUpdate(MBB, MBBI, -GPRCS2Size, false, TII); + + // Build the new SUBri to adjust SP for FP callee-save spill area. + movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 2, STI); + emitSPUpdate(MBB, MBBI, -DPRCSSize, false, TII); } // Determine starting offsets of spill areas. - if (AFI->hasStackFrame()) { - unsigned DPRCSOffset = NumBytes - (GPRCS1Size + GPRCS2Size + DPRCSSize); - unsigned GPRCS2Offset = DPRCSOffset + DPRCSSize; - unsigned GPRCS1Offset = GPRCS2Offset + GPRCS2Size; - AFI->setFramePtrSpillOffset(MFI->getObjectOffset(FramePtrSpillFI) + NumBytes); - AFI->setGPRCalleeSavedArea1Offset(GPRCS1Offset); - AFI->setGPRCalleeSavedArea2Offset(GPRCS2Offset); - AFI->setDPRCalleeSavedAreaOffset(DPRCSOffset); + unsigned DPRCSOffset = NumBytes - (GPRCS1Size + GPRCS2Size + DPRCSSize); + unsigned GPRCS2Offset = DPRCSOffset + DPRCSSize; + unsigned GPRCS1Offset = GPRCS2Offset + GPRCS2Size; + AFI->setFramePtrSpillOffset(MFI->getObjectOffset(FramePtrSpillFI) + NumBytes); + AFI->setGPRCalleeSavedArea1Offset(GPRCS1Offset); + AFI->setGPRCalleeSavedArea2Offset(GPRCS2Offset); + AFI->setDPRCalleeSavedAreaOffset(DPRCSOffset); - NumBytes = DPRCSOffset; - if (NumBytes) { - // Insert it after all the callee-save spills. - if (!isThumb) - movePastCSLoadStoreOps(MBB, MBBI, ARM::FSTD, 3, STI); - emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); - } - } else + NumBytes = DPRCSOffset; + if (NumBytes) { + // Insert it after all the callee-save spills. + if (!isThumb) + movePastCSLoadStoreOps(MBB, MBBI, ARM::FSTD, 3, STI); emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); + } AFI->setGPRCalleeSavedArea1Size(GPRCS1Size); AFI->setGPRCalleeSavedArea2Size(GPRCS2Size); @@ -1005,58 +1012,60 @@ bool isThumb = AFI->isThumbFunction(); unsigned VARegSaveSize = AFI->getVarArgsRegSaveSize(); int NumBytes = (int)MFI->getStackSize(); - if (AFI->hasStackFrame()) { - // Unwind MBBI to point to first LDR / FLDD. - const unsigned *CSRegs = getCalleeSavedRegs(); - if (MBBI != MBB.begin()) { - do - --MBBI; - while (MBBI != MBB.begin() && isCSRestore(MBBI, CSRegs)); - if (!isCSRestore(MBBI, CSRegs)) - ++MBBI; - } - - // Move SP to start of FP callee save spill area. - NumBytes -= (AFI->getGPRCalleeSavedArea1Size() + - AFI->getGPRCalleeSavedArea2Size() + - AFI->getDPRCalleeSavedAreaSize()); - if (isThumb) + if (!AFI->hasStackFrame()) { + if (NumBytes != 0) emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); - else { - if (STI.isTargetDarwin()) { - NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; - // Reset SP based on frame pointer only if the stack frame extends beyond - // frame pointer stack slot. - if (AFI->getGPRCalleeSavedArea2Size() || - AFI->getDPRCalleeSavedAreaSize() || - AFI->getDPRCalleeSavedAreaOffset()) - if (NumBytes) - BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr) - .addImm(NumBytes); - else - BuildMI(MBB, MBBI, TII.get(ARM::MOVrr), ARM::SP).addReg(FramePtr); - } else if (NumBytes) { - emitSPUpdate(MBB, MBBI, NumBytes, false, TII); - } + return; + } - // Move SP to start of integer callee save spill area 2. - movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI); - emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), false, TII); - - // Move SP to start of integer callee save spill area 1. - movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 2, STI); - emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea2Size(), false, TII); - - // Move SP to SP upon entry to the function. - movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 1, STI); - emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea1Size(), false, TII); - } + // Unwind MBBI to point to first LDR / FLDD. + const unsigned *CSRegs = getCalleeSavedRegs(); + if (MBBI != MBB.begin()) { + do + --MBBI; + while (MBBI != MBB.begin() && isCSRestore(MBBI, CSRegs)); + if (!isCSRestore(MBBI, CSRegs)) + ++MBBI; + } - if (VARegSaveSize) - emitSPUpdate(MBB, MBBI, VARegSaveSize, isThumb, TII); - } else if (NumBytes != 0) { + // Move SP to start of FP callee save spill area. + NumBytes -= (AFI->getGPRCalleeSavedArea1Size() + + AFI->getGPRCalleeSavedArea2Size() + + AFI->getDPRCalleeSavedAreaSize()); + if (isThumb) emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); + else { + if (STI.isTargetDarwin()) { + NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; + // Reset SP based on frame pointer only if the stack frame extends beyond + // frame pointer stack slot. + if (AFI->getGPRCalleeSavedArea2Size() || + AFI->getDPRCalleeSavedAreaSize() || + AFI->getDPRCalleeSavedAreaOffset()) + if (NumBytes) + BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr) + .addImm(NumBytes); + else + BuildMI(MBB, MBBI, TII.get(ARM::MOVrr), ARM::SP).addReg(FramePtr); + } else if (NumBytes) { + emitSPUpdate(MBB, MBBI, NumBytes, false, TII); + } + + // Move SP to start of integer callee save spill area 2. + movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI); + emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), false, TII); + + // Move SP to start of integer callee save spill area 1. + movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 2, STI); + emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea2Size(), false, TII); + + // Move SP to SP upon entry to the function. + movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 1, STI); + emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea1Size(), false, TII); } + + if (VARegSaveSize) + emitSPUpdate(MBB, MBBI, VARegSaveSize, isThumb, TII); } unsigned ARMRegisterInfo::getRARegister() const { From evan.cheng at apple.com Mon Jan 29 21:06:34 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 29 Jan 2007 21:06:34 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/stack-frame.ll spaddsub.ll Message-ID: <200701300306.l0U36YXD017703@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: stack-frame.ll added (r1.1) spaddsub.ll (r1.1) removed --- Log message: Add / merge tests. --- Diffs of the changes: (+15 -0) stack-frame.ll | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/test/CodeGen/ARM/stack-frame.ll diff -c /dev/null llvm/test/CodeGen/ARM/stack-frame.ll:1.1 *** /dev/null Mon Jan 29 21:06:29 2007 --- llvm/test/CodeGen/ARM/stack-frame.ll Mon Jan 29 21:06:19 2007 *************** *** 0 **** --- 1,15 ---- + ; RUN: llvm-as < %s | llc -march=arm && + ; RUN: llvm-as < %s | llc -march=arm | grep add | wc -l | grep 1 && + ; RUN: llvm-as < %s | llc -march=arm -enable-thumb && + ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep add | wc -l | grep 1 + + define void @f1() { + %c = alloca i8, align 1 + ret void + } + + define i32 @f2() { + ret i32 1 + } + + From reid at x10sys.com Tue Jan 30 00:32:41 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 00:32:41 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll Message-ID: <200701300632.l0U6Wf5c021429@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-01-29-lbrx-asm.ll updated: 1.1 -> 1.2 --- Log message: Make the input legal. --- Diffs of the changes: (+2 -2) 2007-01-29-lbrx-asm.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll diff -u llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.1 llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.2 --- llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.1 Mon Jan 29 17:45:03 2007 +++ llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll Tue Jan 30 00:32:25 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -march=ppc32 && ; RUN: llvm-as < %s | llc -march=ppc64 -define i16 @test(i8* %data, i16* %data) { - %tmp237 = call i16 asm "lhbrx $0, $2, $1", "=r,r,bO,m"( i8* %data, i32 0, i16* %data ) ; [#uses=1] +define i16 @test(i8* %d1, i16* %d2) { + %tmp237 = call i16 asm "lhbrx $0, $2, $1", "=r,r,bO,m"( i8* %d1, i32 0, i16* %d2 ) ; [#uses=1] ret i16 %tmp237 } From evan.cheng at apple.com Tue Jan 30 02:03:22 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 02:03:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp Message-ID: <200701300803.l0U83M4l022799@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.cpp updated: 1.13 -> 1.14 --- Log message: Misseed thumb jumptable branch. --- Diffs of the changes: (+1 -0) ARMInstrInfo.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.13 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.14 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.13 Mon Jan 29 17:45:17 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Tue Jan 30 02:03:06 2007 @@ -404,6 +404,7 @@ switch (MBB.back().getOpcode()) { case ARM::B: case ARM::tB: // Uncond branch. + case ARM::tBR_JTr: case ARM::BR_JTr: // Jumptable branch. case ARM::BR_JTm: // Jumptable branch through mem. case ARM::BR_JTadd: // Jumptable branch add to pc. From evan.cheng at apple.com Tue Jan 30 02:05:13 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 02:05:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMTargetAsmInfo.cpp Message-ID: <200701300805.l0U85DWn022861@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.52 -> 1.53 ARMTargetAsmInfo.cpp updated: 1.9 -> 1.10 --- Log message: Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections. --- Diffs of the changes: (+16 -3) ARMAsmPrinter.cpp | 10 +++++++++- ARMTargetAsmInfo.cpp | 9 +++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.52 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.53 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.52 Mon Jan 29 20:35:32 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Tue Jan 30 02:04:53 2007 @@ -714,8 +714,16 @@ if (!I->hasInitializer()) // External global require no code continue; - if (EmitSpecialLLVMGlobal(I)) + if (EmitSpecialLLVMGlobal(I)) { + if (Subtarget->isTargetDarwin() && + TM.getRelocationModel() == Reloc::Static) { + if (I->getName() == "llvm.global_ctors") + O << ".reference .constructors_used\n"; + else if (I->getName() == "llvm.global_dtors") + O << ".reference .destructors_used\n"; + } continue; + } std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.9 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.10 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.9 Fri Jan 26 17:24:43 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Tue Jan 30 02:04:53 2007 @@ -28,8 +28,13 @@ JumpTableDataSection = ".const"; CStringSection = "\t.cstring"; HasDotTypeDotSizeDirective = false; - StaticCtorsSection = ".mod_init_func"; - StaticDtorsSection = ".mod_term_func"; + if (TM.getRelocationModel() == Reloc::Static) { + StaticCtorsSection = ".constructor"; + StaticDtorsSection = ".destructor"; + } else { + StaticCtorsSection = ".mod_init_func"; + StaticDtorsSection = ".mod_term_func"; + } // In non-PIC modes, emit a special label before jump tables so that the // linker can perform more accurate dead code stripping. From evan.cheng at apple.com Tue Jan 30 02:05:14 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 02:05:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp X86TargetAsmInfo.cpp Message-ID: <200701300805.l0U85EYV022868@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.233 -> 1.234 X86TargetAsmInfo.cpp updated: 1.30 -> 1.31 --- Log message: Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections. --- Diffs of the changes: (+16 -3) X86AsmPrinter.cpp | 10 +++++++++- X86TargetAsmInfo.cpp | 9 +++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.233 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.234 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.233 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Tue Jan 30 02:04:53 2007 @@ -134,8 +134,16 @@ continue; // External global require no code // Check to see if this is a special global used by LLVM, if so, emit it. - if (EmitSpecialLLVMGlobal(I)) + if (EmitSpecialLLVMGlobal(I)) { + if (Subtarget->isTargetDarwin() && + TM.getRelocationModel() == Reloc::Static) { + if (I->getName() == "llvm.global_ctors") + O << ".reference .constructors_used\n"; + else if (I->getName() == "llvm.global_dtors") + O << ".reference .destructors_used\n"; + } continue; + } std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.30 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.31 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.30 Wed Jan 17 19:15:58 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Jan 30 02:04:53 2007 @@ -59,8 +59,13 @@ LCOMMDirective = "\t.lcomm\t"; COMMDirectiveTakesAlignment = false; HasDotTypeDotSizeDirective = false; - StaticCtorsSection = ".mod_init_func"; - StaticDtorsSection = ".mod_term_func"; + if (TM.getRelocationModel() == Reloc::Static) { + StaticCtorsSection = ".constructor"; + StaticDtorsSection = ".destructor"; + } else { + StaticCtorsSection = ".mod_init_func"; + StaticDtorsSection = ".mod_term_func"; + } InlineAsmStart = "# InlineAsm Start"; InlineAsmEnd = "# InlineAsm End"; SetDirective = "\t.set"; From evan.cheng at apple.com Tue Jan 30 02:05:14 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 02:05:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCTargetAsmInfo.cpp Message-ID: <200701300805.l0U85EIk022875@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.230 -> 1.231 PPCTargetAsmInfo.cpp updated: 1.15 -> 1.16 --- Log message: Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections. --- Diffs of the changes: (+15 -3) PPCAsmPrinter.cpp | 9 ++++++++- PPCTargetAsmInfo.cpp | 9 +++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.230 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.231 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.230 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Jan 30 02:04:53 2007 @@ -855,8 +855,15 @@ if (!I->hasInitializer()) continue; // External global require no code // Check to see if this is a special global used by LLVM, if so, emit it. - if (EmitSpecialLLVMGlobal(I)) + if (EmitSpecialLLVMGlobal(I)) { + if (TM.getRelocationModel() == Reloc::Static) { + if (I->getName() == "llvm.global_ctors") + O << ".reference .constructors_used\n"; + else if (I->getName() == "llvm.global_dtors") + O << ".reference .destructors_used\n"; + } continue; + } std::string name = Mang->getValueName(I); Index: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.15 llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.16 --- llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.15 Mon Jan 29 12:51:14 2007 +++ llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Jan 30 02:04:53 2007 @@ -53,8 +53,13 @@ JumpTableDataSection = ".const"; GlobalDirective = "\t.globl\t"; CStringSection = "\t.cstring"; - StaticCtorsSection = ".mod_init_func"; - StaticDtorsSection = ".mod_term_func"; + if (TM.getRelocationModel() == Reloc::Static) { + StaticCtorsSection = ".constructor"; + StaticDtorsSection = ".destructor"; + } else { + StaticCtorsSection = ".mod_init_func"; + StaticDtorsSection = ".mod_term_func"; + } UsedDirective = "\t.no_dead_strip\t"; WeakRefDirective = "\t.weak_reference\t"; HiddenDirective = "\t.private_extern\t"; From evan.cheng at apple.com Tue Jan 30 02:22:49 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 02:22:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp Message-ID: <200701300822.l0U8MnWL031941@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.cpp updated: 1.14 -> 1.15 --- Log message: Copy and paste bug. --- Diffs of the changes: (+11 -1) ARMInstrInfo.cpp | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.14 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.15 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.14 Tue Jan 30 02:03:06 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Tue Jan 30 02:22:33 2007 @@ -444,6 +444,8 @@ // If this machine instr is an inline asm, measure it. if (MI->getOpcode() == ARM::INLINEASM) return TAI->getInlineAsmLength(MI->getOperand(0).getSymbolName()); + if (MI->getOpcode() == ARM::LABEL) + return 0; assert(0 && "Unknown or unset size field for instr!"); break; case ARMII::Size8Bytes: return 8; // Arm instruction x 2. @@ -457,13 +459,21 @@ return MI->getOperand(2).getImm(); case ARM::BR_JTr: case ARM::BR_JTm: - case ARM::BR_JTadd: { + case ARM::BR_JTadd: + case ARM::tBR_JTr: { // These are jumptable branches, i.e. a branch followed by an inlined // jumptable. The size is 4 + 4 * number of entries. unsigned JTI = MI->getOperand(MI->getNumOperands()-2).getJumpTableIndex(); MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); const std::vector &JT = MJTI->getJumpTables(); assert(JTI < JT.size()); + // Thumb instructions are 2 byte aligned, but JT entries are 4 byte + // 4 aligned. The assembler / linker may add 2 byte padding just before + // the JT entries. Use + 4 even for tBR_JTr to purposely over-estimate + // the size the jumptable. + // FIXME: If we know the size of the function is less than (1 << 16) *2 + // bytes, we can use 16-bit entries instead. Then there won't be an + // alignment issue. return getNumJTEntries(JT, JTI) * 4 + 4; } default: From reid at x10sys.com Tue Jan 30 10:07:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:07:11 -0600 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200701301607.l0UG7BWA007284@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.92 -> 1.93 --- Log message: Add a gxxcmd variable for the g++ command line used to build llvm. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.92 llvm/test/Makefile:1.93 --- llvm/test/Makefile:1.92 Wed Jan 17 01:59:14 2007 +++ llvm/test/Makefile Tue Jan 30 10:06:55 2007 @@ -61,6 +61,7 @@ @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp + @echo 'set gxxcmd "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts)"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp From reid at x10sys.com Tue Jan 30 10:16:32 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:32 -0600 Subject: [llvm-commits] CVS: llvm/test/Feature/paramattrs.ll Message-ID: <200701301616.l0UGGWcY007476@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: paramattrs.ll updated: 1.4 -> 1.5 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+3 -3) paramattrs.ll | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/Feature/paramattrs.ll diff -u llvm/test/Feature/paramattrs.ll:1.4 llvm/test/Feature/paramattrs.ll:1.5 --- llvm/test/Feature/paramattrs.ll:1.4 Fri Jan 26 02:25:06 2007 +++ llvm/test/Feature/paramattrs.ll Tue Jan 30 10:16:01 2007 @@ -12,9 +12,9 @@ define i32 @main(i32 %argc, i8 **%argv) { %val = trunc i32 %argc to i16 - %res = call i16 (i16 sext) sext *@test(i16 %val) - %two = add i16 %res, %res - %res = call i8 @test2(i16 %two zext) zext + %res1 = call i16 (i16 sext) sext *@test(i16 %val) + %two = add i16 %res1, %res1 + %res2 = call i8 @test2(i16 %two zext) zext %retVal = sext i16 %two to i32 ret i32 %retVal } From reid at x10sys.com Tue Jan 30 10:16:32 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:32 -0600 Subject: [llvm-commits] CVS: llvm/test/Integer/2007-01-19-TruncSext.ll indirectcall_bt.ll paramattrs_bt.ll recursivetype_bt.ll Message-ID: <200701301616.l0UGGWoC007488@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: 2007-01-19-TruncSext.ll updated: 1.2 -> 1.3 indirectcall_bt.ll updated: 1.2 -> 1.3 paramattrs_bt.ll updated: 1.2 -> 1.3 recursivetype_bt.ll updated: 1.3 -> 1.4 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+8 -8) 2007-01-19-TruncSext.ll | 2 +- indirectcall_bt.ll | 4 ++-- paramattrs_bt.ll | 2 +- recursivetype_bt.ll | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/test/Integer/2007-01-19-TruncSext.ll diff -u llvm/test/Integer/2007-01-19-TruncSext.ll:1.2 llvm/test/Integer/2007-01-19-TruncSext.ll:1.3 --- llvm/test/Integer/2007-01-19-TruncSext.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/2007-01-19-TruncSext.ll Tue Jan 30 10:16:01 2007 @@ -16,7 +16,7 @@ ret void } -define i32 @main(i32 %argc, i8** %argc) { +define i32 @main(i32 %argc, i8** %argv) { %i = bitcast i32 0 to i32 call void @multiply(i32 %i, i32 -1, i32 255) %P = getelementptr [20 x i17]* @ARRAY, i32 0, i32 0 Index: llvm/test/Integer/indirectcall_bt.ll diff -u llvm/test/Integer/indirectcall_bt.ll:1.2 llvm/test/Integer/indirectcall_bt.ll:1.3 --- llvm/test/Integer/indirectcall_bt.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/indirectcall_bt.ll Tue Jan 30 10:16:01 2007 @@ -48,6 +48,6 @@ define i32 @"main"() begin %Result = call i63 @trampoline(i63 10, i63(i63) *@fib) - %Result = trunc i63 %Result to i32 - ret i32 %Result + %Result2 = trunc i63 %Result to i32 + ret i32 %Result2 end Index: llvm/test/Integer/paramattrs_bt.ll diff -u llvm/test/Integer/paramattrs_bt.ll:1.2 llvm/test/Integer/paramattrs_bt.ll:1.3 --- llvm/test/Integer/paramattrs_bt.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/paramattrs_bt.ll Tue Jan 30 10:16:01 2007 @@ -14,7 +14,7 @@ %val = trunc i33 %argc to i16 %res = call i16 (i16 sext) sext *@test(i16 %val) %two = add i16 %res, %res - %res = call i8 @test2(i16 %two zext) zext + %res2 = call i8 @test2(i16 %two zext) zext %retVal = sext i16 %two to i33 ret i33 %retVal } Index: llvm/test/Integer/recursivetype_bt.ll diff -u llvm/test/Integer/recursivetype_bt.ll:1.3 llvm/test/Integer/recursivetype_bt.ll:1.4 --- llvm/test/Integer/recursivetype_bt.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/recursivetype_bt.ll Tue Jan 30 10:16:01 2007 @@ -68,10 +68,10 @@ %cast1006 = bitcast %list** %reg119 to i8** ;; %reg111 = call i8* @malloc(i32 16) ;; store i8* %reg111, i8** %cast1006 ;; - %reg111 = ptrtoint i8* %reg111 to i64 - %reg1002 = add i64 %reg111, 8 - %reg1002 = inttoptr i64 %reg1002 to i8* ;; - %cast1008 = bitcast i8* %reg1002 to i36* ;; + %reg112 = ptrtoint i8* %reg111 to i64 + %reg1002 = add i64 %reg112, 8 + %reg1005 = inttoptr i64 %reg1002 to i8* ;; + %cast1008 = bitcast i8* %reg1005 to i36* ;; store i36 %Data, i36* %cast1008 ;; %cast1003 = inttoptr i64 0 to i64* ;; %cast1009 = bitcast i8* %reg111 to i64** ;; From reid at x10sys.com Tue Jan 30 10:16:33 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:33 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll fcopysign.ll fp.ll Message-ID: <200701301616.l0UGGXAj007497@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-01-19-InfiniteLoop.ll updated: 1.2 -> 1.3 fcopysign.ll updated: 1.6 -> 1.7 fp.ll updated: 1.13 -> 1.14 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+7 -7) 2007-01-19-InfiniteLoop.ll | 8 ++++---- fcopysign.ll | 4 ++-- fp.ll | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll diff -u llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.2 llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.3 --- llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.2 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll Tue Jan 30 10:16:01 2007 @@ -34,8 +34,8 @@ %tmp606 = load i32* %tmp605 ; [#uses=1] %tmp612 = load i32* null ; [#uses=1] %tmp629 = load i32* null ; [#uses=1] - %tmp629 = sitofp i32 %tmp629 to double ; [#uses=1] - %tmp631 = mul double %tmp629, 0.000000e+00 ; [#uses=1] + %tmp629a = sitofp i32 %tmp629 to double ; [#uses=1] + %tmp631 = mul double %tmp629a, 0.000000e+00 ; [#uses=1] %tmp632 = add double 0.000000e+00, %tmp631 ; [#uses=1] %tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; [#uses=1] %tmp650 = mul i32 %tmp606, %tmp642 ; [#uses=1] @@ -44,9 +44,9 @@ %tmp659 = ashr i32 %tmp658, i8 6 ; [#uses=1] %tmp660 = sub i32 0, %tmp659 ; [#uses=1] %tmp666 = sub i32 %tmp660, %tmp496 ; [#uses=1] - %tmp666 = sitofp i32 %tmp666 to double ; [#uses=2] + %tmp667 = sitofp i32 %tmp666 to double ; [#uses=2] call void @levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null ) - %tmp671 = mul double %tmp666, %tmp666 ; [#uses=1] + %tmp671 = mul double %tmp667, %tmp667 ; [#uses=1] %tmp675 = add double %tmp671, 0.000000e+00 ; [#uses=1] %tmp678 = fcmp oeq double %tmp632, %tmp675 ; [#uses=1] br i1 %tmp678, label %cond_true679, label %cond_false693 Index: llvm/test/CodeGen/ARM/fcopysign.ll diff -u llvm/test/CodeGen/ARM/fcopysign.ll:1.6 llvm/test/CodeGen/ARM/fcopysign.ll:1.7 --- llvm/test/CodeGen/ARM/fcopysign.ll:1.6 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/fcopysign.ll Tue Jan 30 10:16:01 2007 @@ -6,8 +6,8 @@ define float @test1(float %x, double %y) { %tmp = fpext float %x to double %tmp2 = tail call double @copysign( double %tmp, double %y ) - %tmp2 = fptrunc double %tmp2 to float - ret float %tmp2 + %tmp3 = fptrunc double %tmp2 to float + ret float %tmp3 } define double @test2(double %x, float %y) { Index: llvm/test/CodeGen/ARM/fp.ll diff -u llvm/test/CodeGen/ARM/fp.ll:1.13 llvm/test/CodeGen/ARM/fp.ll:1.14 --- llvm/test/CodeGen/ARM/fp.ll:1.13 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fp.ll Tue Jan 30 10:16:01 2007 @@ -43,7 +43,7 @@ ret double %tmp } -float %h() { +float %h2() { entry: ret float 1.000000e+00 } From reid at x10sys.com Tue Jan 30 10:16:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:35 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll and_sext.ll Message-ID: <200701301616.l0UGGZVf007504@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-01-15-AsmDialect.ll updated: 1.3 -> 1.4 and_sext.ll updated: 1.6 -> 1.7 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+11 -10) 2007-01-15-AsmDialect.ll | 13 +++++++------ and_sext.ll | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) Index: llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll diff -u llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll:1.3 llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll:1.4 --- llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll Tue Jan 30 10:16:01 2007 @@ -1,9 +1,10 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep cntlzw +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ +; RUN: grep cntlzw define i32 @foo() { entry: %retval = alloca i32, align 4 ; [#uses=2] - %tmp = alloca i32, align 4 ; [#uses=2] + %temp = alloca i32, align 4 ; [#uses=2] %ctz_x = alloca i32, align 4 ; [#uses=3] %ctz_c = alloca i32, align 4 ; [#uses=2] "alloca point" = bitcast i32 0 to i32 ; [#uses=0] @@ -15,12 +16,12 @@ %tmp4 = call i32 asm "$(cntlz$|cntlzw$) $0,$1", "=r,r,~{dirflag},~{fpsr},~{flags}"( i32 %tmp3 ) ; [#uses=1] store i32 %tmp4, i32* %ctz_c %tmp5 = load i32* %ctz_c ; [#uses=1] - store i32 %tmp5, i32* %tmp - %tmp6 = load i32* %tmp ; [#uses=1] + store i32 %tmp5, i32* %temp + %tmp6 = load i32* %temp ; [#uses=1] store i32 %tmp6, i32* %retval br label %return return: ; preds = %entry - %retval = load i32* %retval ; [#uses=1] - ret i32 %retval + %retval2 = load i32* %retval ; [#uses=1] + ret i32 %retval2 } Index: llvm/test/CodeGen/PowerPC/and_sext.ll diff -u llvm/test/CodeGen/PowerPC/and_sext.ll:1.6 llvm/test/CodeGen/PowerPC/and_sext.ll:1.7 --- llvm/test/CodeGen/PowerPC/and_sext.ll:1.6 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/and_sext.ll Tue Jan 30 10:16:01 2007 @@ -15,15 +15,15 @@ %tmp1 = sext i16 %x to i32 %tmp2 = add i32 %tmp, %tmp1 %tmp4 = ashr i32 %tmp2, i8 1 - %tmp4 = trunc i32 %tmp4 to i16 - %tmp45 = sext i16 %tmp4 to i32 + %tmp5 = trunc i32 %tmp4 to i16 + %tmp45 = sext i16 %tmp5 to i32 %retval = trunc i32 %tmp45 to i16 ret i16 %retval } define i16 @test3(i32 zext %X) sext { %tmp1 = lshr i32 %X, i8 16 - %tmp1 = trunc i32 %tmp1 to i16 - ret i16 %tmp1 + %tmp2 = trunc i32 %tmp1 to i16 + ret i16 %tmp2 } From reid at x10sys.com Tue Jan 30 10:16:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:36 -0600 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/add.ll rem.ll vec_shuffle.ll Message-ID: <200701301616.l0UGGax2007515@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: add.ll updated: 1.35 -> 1.36 rem.ll updated: 1.13 -> 1.14 vec_shuffle.ll updated: 1.8 -> 1.9 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+4 -4) add.ll | 2 +- rem.ll | 2 +- vec_shuffle.ll | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/test/Transforms/InstCombine/add.ll diff -u llvm/test/Transforms/InstCombine/add.ll:1.35 llvm/test/Transforms/InstCombine/add.ll:1.36 --- llvm/test/Transforms/InstCombine/add.ll:1.35 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/InstCombine/add.ll Tue Jan 30 10:16:01 2007 @@ -241,7 +241,7 @@ ret ubyte %C } -int %test34(int %a) { ;; -> -1 +int %test35(int %a) { ;; -> -1 %tmpnot = xor int %a, -1 %tmp2 = add int %tmpnot, %a ret int %tmp2 Index: llvm/test/Transforms/InstCombine/rem.ll diff -u llvm/test/Transforms/InstCombine/rem.ll:1.13 llvm/test/Transforms/InstCombine/rem.ll:1.14 --- llvm/test/Transforms/InstCombine/rem.ll:1.13 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/rem.ll Tue Jan 30 10:16:01 2007 @@ -20,7 +20,7 @@ ret uint %B } -bool %test3(int %A) { +bool %test3a(int %A) { %B = rem int %A, -8 ; & 7 %C = setne int %B, 0 ret bool %C Index: llvm/test/Transforms/InstCombine/vec_shuffle.ll diff -u llvm/test/Transforms/InstCombine/vec_shuffle.ll:1.8 llvm/test/Transforms/InstCombine/vec_shuffle.ll:1.9 --- llvm/test/Transforms/InstCombine/vec_shuffle.ll:1.8 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/InstCombine/vec_shuffle.ll Tue Jan 30 10:16:01 2007 @@ -35,8 +35,8 @@ } define float @test6(<4 x float> %X) { - %X = bitcast <4 x float> %X to <4 x i32> - %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer + %X1 = bitcast <4 x float> %X to <4 x i32> + %tmp152.i53899.i = shufflevector <4 x i32> %X1, <4 x i32> undef, <4 x i32> zeroinitializer %tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float> %tmp34 = extractelement <4 x float> %tmp152.i53900.i, i32 0 ret float %tmp34 From reid at x10sys.com Tue Jan 30 10:16:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:36 -0600 Subject: [llvm-commits] CVS: llvm/test/Analysis/ScalarEvolution/trip-count.ll Message-ID: <200701301616.l0UGGaHi007511@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/ScalarEvolution: trip-count.ll updated: 1.2 -> 1.3 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+2 -4) trip-count.ll | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/test/Analysis/ScalarEvolution/trip-count.ll diff -u llvm/test/Analysis/ScalarEvolution/trip-count.ll:1.2 llvm/test/Analysis/ScalarEvolution/trip-count.ll:1.3 --- llvm/test/Analysis/ScalarEvolution/trip-count.ll:1.2 Fri Jan 26 02:25:05 2007 +++ llvm/test/Analysis/ScalarEvolution/trip-count.ll Tue Jan 30 10:16:01 2007 @@ -19,8 +19,8 @@ bb3: ; preds = %bb, %entry %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ] ; [#uses=3] - %tmp = icmp sle i32 %i.0, 9999 ; [#uses=1] - br i1 %tmp, label %bb, label %bb5 + %tmp3 = icmp sle i32 %i.0, 9999 ; [#uses=1] + br i1 %tmp3, label %bb, label %bb5 bb5: ; preds = %bb3 br label %return @@ -28,5 +28,3 @@ return: ; preds = %bb5 ret void } - - From reid at x10sys.com Tue Jan 30 10:16:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:36 -0600 Subject: [llvm-commits] CVS: llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll Message-ID: <200701301616.l0UGGaKe007536@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/IndVarsSimplify: 2007-01-06-TripCount.ll updated: 1.4 -> 1.5 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+3 -3) 2007-01-06-TripCount.ll | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll diff -u llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.4 llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.5 --- llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.4 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll Tue Jan 30 10:16:01 2007 @@ -26,9 +26,9 @@ br label %bb cond_next: ; preds = %bb2 - %tmp = getelementptr [5 x i8]* @foo, i32 0, i32 %i.0 ; [#uses=1] - %tmp = load i8* %tmp ; [#uses=1] - %tmp5 = icmp eq i8 %tmp, 0 ; [#uses=1] + %tmp2 = getelementptr [5 x i8]* @foo, i32 0, i32 %i.0 ; [#uses=1] + %tmp3 = load i8* %tmp2 ; [#uses=1] + %tmp5 = icmp eq i8 %tmp3, 0 ; [#uses=1] br i1 %tmp5, label %bb6, label %bb bb6: ; preds = %cond_next From reid at x10sys.com Tue Jan 30 10:16:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:36 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll select.ll trunc-to-bool.ll vec_set-3.ll vec_set-4.ll Message-ID: <200701301616.l0UGGaCa007527@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-01-13-StackPtrIndex.ll updated: 1.2 -> 1.3 select.ll updated: 1.5 -> 1.6 trunc-to-bool.ll updated: 1.8 -> 1.9 vec_set-3.ll updated: 1.3 -> 1.4 vec_set-4.ll updated: 1.3 -> 1.4 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+27 -25) 2007-01-13-StackPtrIndex.ll | 36 ++++++++++++++++++------------------ select.ll | 2 +- trunc-to-bool.ll | 4 ++-- vec_set-3.ll | 8 +++++--- vec_set-4.ll | 2 +- 5 files changed, 27 insertions(+), 25 deletions(-) Index: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll diff -u llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.2 llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.3 --- llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll Tue Jan 30 10:16:01 2007 @@ -15,11 +15,11 @@ %r6 = load i32* %a3 %r8 = load i32* %a4 %r14 = load i32* %a5 - %r = sext i32 %r2 to i64 + %rx = sext i32 %r2 to i64 %r9 = sext i32 %r to i64 - %r11 = add i64 %r, 0 - %r = icmp slt i64 %r11, 0 - %r12 = select i1 %r, i64 0, i64 %r11 + %r11 = add i64 %rx, 0 + %ras = icmp slt i64 %r11, 0 + %r12 = select i1 %ras, i64 0, i64 %r11 %r16 = sext i32 %r14 to i64 %r17 = sext i32 %r8 to i64 %r18 = sub i64 %r16, 0 @@ -28,17 +28,17 @@ %r19h = add i64 %r18, 0 %r22 = select i1 %r20, i64 1, i64 %r19h %r23 = mul i64 %r22, 0 - %r23 = trunc i64 %r23 to i32 - %r24 = shl i32 %r23, i8 0 + %r23a = trunc i64 %r23 to i32 + %r24 = shl i32 %r23a, i8 0 %r25 = add i32 %r24, 0 - %r = alloca i8, i32 %r25, align 16 - %r28 = getelementptr i8* %r, i32 0 + %ras2 = alloca i8, i32 %r25, align 16 + %r28 = getelementptr i8* %ras2, i32 0 %r38 = shl i64 %r12, i8 0 %s2013 = add i64 %r38, 0 - %c22012 = getelementptr i8* %r, i64 %s2013 + %c22012 = getelementptr i8* %ras2, i64 %s2013 %r42 = shl i64 %r12, i8 0 %s2011 = add i64 %r42, 16 - %c22010 = getelementptr i8* %r, i64 %s2011 + %c22010 = getelementptr i8* %ras2, i64 %s2011 %r50 = add i64 %r16, 0 %r51 = icmp slt i64 %r50, 0 %r50sh = shl i64 %r50, i8 0 @@ -46,7 +46,7 @@ %r54 = select i1 %r51, i64 0, i64 %r50j %r56 = mul i64 %r54, %r12 %r28s = add i64 %r56, 16 - %c2 = getelementptr i8* %r, i64 %r28s + %c2 = getelementptr i8* %ras2, i64 %r28s %r60 = sub i32 %r2, %r %r61 = icmp slt i32 %r60, 0 br i1 %r61, label %a29b, label %b63 @@ -112,9 +112,9 @@ br label %a30b294 a30b: %w = phi i64 [ 0, %b179 ], [ %v, %a30b ] - %b = shl i64 %w, i8 0 - %r283 = add i64 %b, 0 - %r286 = add i64 %b, 0 + %b2 = shl i64 %w, i8 0 + %r283 = add i64 %b2, 0 + %r286 = add i64 %b2, 0 %r288 = icmp slt i64 %r286, 0 %v = add i64 %w, 0 br i1 %r288, label %b188, label %a30b @@ -204,7 +204,7 @@ %v1853 = add i64 %w1852, 0 br i1 %r708, label %b565, label %a45b b712: - %r795 = add i64 %r, 0 + %r795 = add i64 %rx, 0 %r799 = add i64 %s923, 0 %r802 = add i64 %w1855, 0 %r807 = icmp slt i64 %r802, 0 @@ -255,7 +255,7 @@ %r846 = sext i32 %r60 to i64 %r847 = add i64 %r846, 0 %r851 = load float* bitcast ([128 x i64]* @i6000 to float*) - %r856 = sub i64 %r, 0 + %r856 = sub i64 %rx, 0 br label %b858 b858: %w1891 = phi i64 [ 0, %b820 ], [ %v1892, %b1016 ] @@ -321,7 +321,7 @@ br i1 %r817, label %a93b, label %b1321 b1086: %r1089 = sext i32 %r2 to i64 - %r1090 = add i64 %r, 0 + %r1090 = add i64 %rx, 0 %r1096 = mul i64 %r9, 0 %r1101 = sext i32 %r8 to i64 %r1104 = add i64 %r1096, 0 @@ -424,7 +424,7 @@ %v1959 = add i64 %w1958, 0 br i1 %r1581, label %a74b, label %b1582 b1582: - %r1587 = add i64 %r, 0 + %r1587 = add i64 %rx, 0 %r1591 = add i64 %s1563, 0 %r1596 = add i64 %d1533, 0 %r1601 = icmp slt i64 %r1596, 0 Index: llvm/test/CodeGen/X86/select.ll diff -u llvm/test/CodeGen/X86/select.ll:1.5 llvm/test/CodeGen/X86/select.ll:1.6 --- llvm/test/CodeGen/X86/select.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/select.ll Tue Jan 30 10:16:01 2007 @@ -43,7 +43,7 @@ ret int %X } -int %foldSel2(bool %A, int %B, int %C, double %X, double %Y) { +int %foldSel2a(bool %A, int %B, int %C, double %X, double %Y) { %Cond = setlt double %X, %Y %X = select bool %Cond, int %B, int %C ret int %X Index: llvm/test/CodeGen/X86/trunc-to-bool.ll diff -u llvm/test/CodeGen/X86/trunc-to-bool.ll:1.8 llvm/test/CodeGen/X86/trunc-to-bool.ll:1.9 --- llvm/test/CodeGen/X86/trunc-to-bool.ll:1.8 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/trunc-to-bool.ll Tue Jan 30 10:16:01 2007 @@ -12,8 +12,8 @@ define i1 @test2(i32 %val, i32 %mask) { entry: - %mask = trunc i32 %mask to i8 - %shifted = ashr i32 %val, i8 %mask + %maski8 = trunc i32 %mask to i8 + %shifted = ashr i32 %val, i8 %maski8 %anded = and i32 %shifted, 1 %trunced = trunc i32 %anded to i1 br i1 %trunced, label %ret_true, label %ret_false Index: llvm/test/CodeGen/X86/vec_set-3.ll diff -u llvm/test/CodeGen/X86/vec_set-3.ll:1.3 llvm/test/CodeGen/X86/vec_set-3.ll:1.4 --- llvm/test/CodeGen/X86/vec_set-3.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_set-3.ll Tue Jan 30 10:16:01 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: grep shufps | wc -l | grep 1 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: grep pshufd | wc -l | grep 1 <4 x float> %test(float %a) { %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1 @@ -8,7 +10,7 @@ ret <4 x float> %tmp6 } -<2 x long> %test(int %a) { +<2 x long> %test2(int %a) { %tmp7 = insertelement <4 x int> zeroinitializer, int %a, uint 2 %tmp9 = insertelement <4 x int> %tmp7, int 0, uint 3 %tmp10 = cast <4 x int> %tmp9 to <2 x long> Index: llvm/test/CodeGen/X86/vec_set-4.ll diff -u llvm/test/CodeGen/X86/vec_set-4.ll:1.3 llvm/test/CodeGen/X86/vec_set-4.ll:1.4 --- llvm/test/CodeGen/X86/vec_set-4.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_set-4.ll Tue Jan 30 10:16:01 2007 @@ -11,7 +11,7 @@ ret <2 x long> %tmp19 } -<2 x long> %test(sbyte %a) { +<2 x long> %test2(sbyte %a) { entry: %tmp24 = insertelement <16 x sbyte> zeroinitializer, sbyte %a, uint 10 %tmp26 = insertelement <16 x sbyte> %tmp24, sbyte 0, uint 11 From reid at x10sys.com Tue Jan 30 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 10:16:37 -0600 Subject: [llvm-commits] CVS: llvm/test/Linker/basiclink.ll Message-ID: <200701301616.l0UGGbDs007541@zion.cs.uiuc.edu> Changes in directory llvm/test/Linker: basiclink.ll updated: 1.2 -> 1.3 --- Log message: For PR411: http://llvm.org/PR411 : Update these tests to not use the same name even though the type of the value differs. After PR411: http://llvm.org/PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. --- Diffs of the changes: (+1 -1) basiclink.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Linker/basiclink.ll diff -u llvm/test/Linker/basiclink.ll:1.2 llvm/test/Linker/basiclink.ll:1.3 --- llvm/test/Linker/basiclink.ll:1.2 Sat Jan 27 15:10:35 2007 +++ llvm/test/Linker/basiclink.ll Tue Jan 30 10:16:01 2007 @@ -1,5 +1,5 @@ ; Test linking two functions with different prototypes and two globals -; in different modules. +; in different modules. This is for PR411 ; RUN: llvm-as %s -o %t.bar.bc -f ; RUN: echo "define i32* @foo(i32 %x) { ret i32* @baz } @baz = external global i32" | \ ; RUN: llvm-as -o %t.foo.bc -f From reid at x10sys.com Tue Jan 30 13:37:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 13:37:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Reader.h Message-ID: <200701301937.l0UJb5Bm016858@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.29 -> 1.30 Reader.cpp updated: 1.225 -> 1.226 Reader.h updated: 1.42 -> 1.43 --- Log message: Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't outweight its computational costs. This patch removes all compaction table handling from the bcreader and bcwriter. For the record, here's the difference betweeen having and not having compaction tables for some tests: Test With Without Size Chg Olden/mst 5,602 5,598 +0.1% viterbi 18,026 17,795 +1.3% obsequi 162,133 166,663 -2.8% burg 224,090 228,148 -1.8% kimwitu++ 4,933,263 5,121,159 -3.8% 176.gcc 8,470,424 9,141,539 -7.3% It seems that it is more beneficial to larger files, but even on the largest test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%. --- Diffs of the changes: (+18 -229) Analyzer.cpp | 4 - Reader.cpp | 217 ++++------------------------------------------------------- Reader.h | 26 ------- 3 files changed, 18 insertions(+), 229 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.29 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.30 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.29 Fri Jan 26 02:10:24 2007 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Tue Jan 30 13:36:46 2007 @@ -100,7 +100,6 @@ bca.BlockSizes[BytecodeFormat::ModuleGlobalInfoBlockID] = 0; bca.BlockSizes[BytecodeFormat::GlobalTypePlaneBlockID] = 0; bca.BlockSizes[BytecodeFormat::InstructionListBlockID] = 0; - bca.BlockSizes[BytecodeFormat::CompactionTableBlockID] = 0; bca.BlockSizes[BytecodeFormat::TypeSymbolTableBlockID] = 0; } @@ -635,9 +634,6 @@ print(Out, "Instruction List Bytes", double(bca.BlockSizes[BytecodeFormat::InstructionListBlockID]), double(bca.byteSize)); - print(Out, "Compaction Table Bytes", - double(bca.BlockSizes[BytecodeFormat::CompactionTableBlockID]), - double(bca.byteSize)); print(Out, "Value Symbol Table Bytes", double(bca.BlockSizes[BytecodeFormat::ValueSymbolTableBlockID]), double(bca.byteSize)); Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.225 llvm/lib/Bytecode/Reader/Reader.cpp:1.226 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.225 Fri Jan 26 02:10:24 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Jan 30 13:36:46 2007 @@ -186,8 +186,8 @@ return TyID != Type::LabelTyID && TyID != Type::VoidTyID; } -/// Obtain a type given a typeid and account for things like compaction tables, -/// function level vs module level, and the offsetting for the primitive types. +/// Obtain a type given a typeid and account for things like function level vs +/// module level, and the offsetting for the primitive types. const Type *BytecodeReader::getType(unsigned ID) { if (ID <= Type::LastPrimitiveTyID) if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) @@ -196,12 +196,6 @@ // Otherwise, derived types need offset... ID -= Type::FirstDerivedTyID; - if (!CompactionTypes.empty()) { - if (ID >= CompactionTypes.size()) - error("Type ID out of range for compaction table!"); - return CompactionTypes[ID].first; - } - // Is it a module-level type? if (ID < ModuleTypes.size()) return ModuleTypes[ID].get(); @@ -223,20 +217,11 @@ } /// Get the slot number associated with a type accounting for primitive -/// types, compaction tables, and function level vs module level. +/// types and function level vs module level. unsigned BytecodeReader::getTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) return Ty->getTypeID(); - // Scan the compaction table for the type if needed. - if (!CompactionTypes.empty()) { - for (unsigned i = 0, e = CompactionTypes.size(); i != e; ++i) - if (CompactionTypes[i].first == Ty) - return Type::FirstDerivedTyID + i; - - error("Couldn't find type specified in compaction table!"); - } - // Check the function level types first... TypeListTy::iterator I = std::find(FunctionTypes.begin(), FunctionTypes.end(), Ty); @@ -266,84 +251,28 @@ return Type::FirstDerivedTyID + IT->second; } -/// This is just like getType, but when a compaction table is in use, it is -/// ignored. It also ignores function level types. -/// @see getType -const Type *BytecodeReader::getGlobalTableType(unsigned Slot) { - if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); - if (!Ty) - error("Not a primitive type ID?"); - return Ty; - } - Slot -= Type::FirstDerivedTyID; - if (Slot >= ModuleTypes.size()) - error("Illegal compaction table type reference!"); - return ModuleTypes[Slot]; -} - -/// This is just like getTypeSlot, but when a compaction table is in use, it -/// is ignored. It also ignores function level types. -unsigned BytecodeReader::getGlobalTableTypeSlot(const Type *Ty) { - if (Ty->isPrimitiveType()) - return Ty->getTypeID(); - - // If we don't have our cache yet, build it now. - if (ModuleTypeIDCache.empty()) { - unsigned N = 0; - ModuleTypeIDCache.reserve(ModuleTypes.size()); - for (TypeListTy::iterator I = ModuleTypes.begin(), E = ModuleTypes.end(); - I != E; ++I, ++N) - ModuleTypeIDCache.push_back(std::make_pair(*I, N)); - - std::sort(ModuleTypeIDCache.begin(), ModuleTypeIDCache.end()); - } - - // Binary search the cache for the entry. - std::vector >::iterator IT = - std::lower_bound(ModuleTypeIDCache.begin(), ModuleTypeIDCache.end(), - std::make_pair(Ty, 0U)); - if (IT == ModuleTypeIDCache.end() || IT->first != Ty) - error("Didn't find type in ModuleTypes."); - - return Type::FirstDerivedTyID + IT->second; -} - /// Retrieve a value of a given type and slot number, possibly creating /// it if it doesn't already exist. Value * BytecodeReader::getValue(unsigned type, unsigned oNum, bool Create) { assert(type != Type::LabelTyID && "getValue() cannot get blocks!"); unsigned Num = oNum; - // If there is a compaction table active, it defines the low-level numbers. - // If not, the module values define the low-level numbers. - if (CompactionValues.size() > type && !CompactionValues[type].empty()) { - if (Num < CompactionValues[type].size()) - return CompactionValues[type][Num]; - Num -= CompactionValues[type].size(); - } else { - // By default, the global type id is the type id passed in - unsigned GlobalTyID = type; + // By default, the global type id is the type id passed in + unsigned GlobalTyID = type; - // If the type plane was compactified, figure out the global type ID by - // adding the derived type ids and the distance. - if (!CompactionTypes.empty() && type >= Type::FirstDerivedTyID) - GlobalTyID = CompactionTypes[type-Type::FirstDerivedTyID].second; - - if (hasImplicitNull(GlobalTyID)) { - const Type *Ty = getType(type); - if (!isa(Ty)) { - if (Num == 0) - return Constant::getNullValue(Ty); - --Num; - } + if (hasImplicitNull(GlobalTyID)) { + const Type *Ty = getType(type); + if (!isa(Ty)) { + if (Num == 0) + return Constant::getNullValue(Ty); + --Num; } + } - if (GlobalTyID < ModuleValues.size() && ModuleValues[GlobalTyID]) { - if (Num < ModuleValues[GlobalTyID]->size()) - return ModuleValues[GlobalTyID]->getOperand(Num); - Num -= ModuleValues[GlobalTyID]->size(); - } + if (GlobalTyID < ModuleValues.size() && ModuleValues[GlobalTyID]) { + if (Num < ModuleValues[GlobalTyID]->size()) + return ModuleValues[GlobalTyID]->getOperand(Num); + Num -= ModuleValues[GlobalTyID]->size(); } if (FunctionValues.size() > type && @@ -370,38 +299,6 @@ return 0; // just silence warning, error calls longjmp } -/// This is just like getValue, but when a compaction table is in use, it -/// is ignored. Also, no forward references or other fancy features are -/// supported. -Value* BytecodeReader::getGlobalTableValue(unsigned TyID, unsigned SlotNo) { - if (SlotNo == 0) - return Constant::getNullValue(getType(TyID)); - - if (!CompactionTypes.empty() && TyID >= Type::FirstDerivedTyID) { - TyID -= Type::FirstDerivedTyID; - if (TyID >= CompactionTypes.size()) - error("Type ID out of range for compaction table!"); - TyID = CompactionTypes[TyID].second; - } - - --SlotNo; - - if (TyID >= ModuleValues.size() || ModuleValues[TyID] == 0 || - SlotNo >= ModuleValues[TyID]->size()) { - if (TyID >= ModuleValues.size() || ModuleValues[TyID] == 0) - error("Corrupt compaction table entry!" - + utostr(TyID) + ", " + utostr(SlotNo) + ": " - + utostr(ModuleValues.size())); - else - error("Corrupt compaction table entry!" - + utostr(TyID) + ", " + utostr(SlotNo) + ": " - + utostr(ModuleValues.size()) + ", " - + utohexstr(reinterpret_cast(((void*)ModuleValues[TyID]))) - + ", " - + utostr(ModuleValues[TyID]->size())); - } - return ModuleValues[TyID]->getOperand(SlotNo); -} /// Just like getValue, except that it returns a null pointer /// only on error. It always returns a constant (meaning that if the value is @@ -1079,76 +976,6 @@ if (Handler) Handler->handleSymbolTableEnd(); } -/// Read in the types portion of a compaction table. -void BytecodeReader::ParseCompactionTypes(unsigned NumEntries) { - for (unsigned i = 0; i != NumEntries; ++i) { - unsigned TypeSlot = read_vbr_uint(); - const Type *Typ = getGlobalTableType(TypeSlot); - CompactionTypes.push_back(std::make_pair(Typ, TypeSlot)); - if (Handler) Handler->handleCompactionTableType(i, TypeSlot, Typ); - } -} - -/// Parse a compaction table. -void BytecodeReader::ParseCompactionTable() { - - // Notify handler that we're beginning a compaction table. - if (Handler) Handler->handleCompactionTableBegin(); - - // Get the types for the compaction table. - unsigned NumEntries = read_vbr_uint(); - ParseCompactionTypes(NumEntries); - - // Compaction tables live in separate blocks so we have to loop - // until we've read the whole thing. - while (moreInBlock()) { - // Read the number of Value* entries in the compaction table - unsigned NumEntries = read_vbr_uint(); - unsigned Ty = 0; - - // Decode the type from value read in. Most compaction table - // planes will have one or two entries in them. If that's the - // case then the length is encoded in the bottom two bits and - // the higher bits encode the type. This saves another VBR value. - if ((NumEntries & 3) == 3) { - // In this case, both low-order bits are set (value 3). This - // is a signal that the typeid follows. - NumEntries >>= 2; - Ty = read_vbr_uint(); - } else { - // In this case, the low-order bits specify the number of entries - // and the high order bits specify the type. - Ty = NumEntries >> 2; - NumEntries &= 3; - } - - // Make sure we have enough room for the plane. - if (Ty >= CompactionValues.size()) - CompactionValues.resize(Ty+1); - - // Make sure the plane is empty or we have some kind of error. - if (!CompactionValues[Ty].empty()) - error("Compaction table plane contains multiple entries!"); - - // Notify handler about the plane. - if (Handler) Handler->handleCompactionTablePlane(Ty, NumEntries); - - // Push the implicit zero. - CompactionValues[Ty].push_back(Constant::getNullValue(getType(Ty))); - - // Read in each of the entries, put them in the compaction table - // and notify the handler that we have a new compaction table value. - for (unsigned i = 0; i != NumEntries; ++i) { - unsigned ValSlot = read_vbr_uint(); - Value *V = getGlobalTableValue(Ty, ValSlot); - CompactionValues[Ty].push_back(V); - if (Handler) Handler->handleCompactionTableValue(i, Ty, ValSlot); - } - } - // Notify handler that the compaction table is done. - if (Handler) Handler->handleCompactionTableEnd(); -} - // Parse a single type. The typeid is read in first. If its a primitive type // then nothing else needs to be read, we know how to instantiate it. If its // a derived type, then additional data is read to fill out the type @@ -1667,8 +1494,7 @@ case BytecodeFormat::ConstantPoolBlockID: if (!InsertedArguments) { // Insert arguments into the value table before we parse the first basic - // block in the function, but after we potentially read in the - // compaction table. + // block in the function insertArguments(F); InsertedArguments = true; } @@ -1676,14 +1502,9 @@ ParseConstantPool(FunctionValues, FunctionTypes, true); break; - case BytecodeFormat::CompactionTableBlockID: - ParseCompactionTable(); - break; - case BytecodeFormat::InstructionListBlockID: { // Insert arguments into the value table before we parse the instruction - // list for the function, but after we potentially read in the compaction - // table. + // list for the function if (!InsertedArguments) { insertArguments(F); InsertedArguments = true; @@ -1732,8 +1553,6 @@ // Clear out function-level types... FunctionTypes.clear(); - CompactionTypes.clear(); - CompactionValues.clear(); freeTable(FunctionValues); if (Handler) Handler->handleFunctionEnd(F); Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.42 llvm/lib/Bytecode/Reader/Reader.h:1.43 --- llvm/lib/Bytecode/Reader/Reader.h:1.42 Fri Jan 12 01:05:13 2007 +++ llvm/lib/Bytecode/Reader/Reader.h Tue Jan 30 13:36:46 2007 @@ -212,12 +212,6 @@ /// @brief Parse a function body void ParseFunctionBody(Function* Func); - /// @brief Parse the type list portion of a compaction table - void ParseCompactionTypes(unsigned NumEntries); - - /// @brief Parse a compaction table - void ParseCompactionTable(); - /// @brief Parse global types void ParseGlobalTypes(); @@ -275,15 +269,6 @@ /// unsigned char RevisionNum; // The rev # itself - /// CompactionTypes - If a compaction table is active in the current function, - /// this is the mapping that it contains. We keep track of what resolved type - /// it is as well as what global type entry it is. - std::vector > CompactionTypes; - - /// @brief If a compaction table is active in the current function, - /// this is the mapping that it contains. - std::vector > CompactionValues; - /// @brief This vector is used to deal with forward references to types in /// a module. TypeListTy ModuleTypes; @@ -363,23 +348,12 @@ /// @brief Converts a Type* to its type slot number unsigned getTypeSlot(const Type *Ty); - /// @brief Converts a normal type slot number to a compacted type slot num. - unsigned getCompactionTypeSlot(unsigned type); - /// @brief Gets the global type corresponding to the TypeId const Type *getGlobalTableType(unsigned TypeId); - /// This is just like getTypeSlot, but when a compaction table is in use, - /// it is ignored. - unsigned getGlobalTableTypeSlot(const Type *Ty); - /// @brief Get a value from its typeid and slot number Value* getValue(unsigned TypeID, unsigned num, bool Create = true); - /// @brief Get a value from its type and slot number, ignoring compaction - /// tables. - Value *getGlobalTableValue(unsigned TyID, unsigned SlotNo); - /// @brief Get a basic block for current function BasicBlock *getBasicBlock(unsigned ID); From reid at x10sys.com Tue Jan 30 13:37:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 13:37:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp SlotCalculator.h Writer.cpp Message-ID: <200701301937.l0UJb5vE016867@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: SlotCalculator.cpp updated: 1.80 -> 1.81 SlotCalculator.h updated: 1.25 -> 1.26 Writer.cpp updated: 1.153 -> 1.154 --- Log message: Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't outweight its computational costs. This patch removes all compaction table handling from the bcreader and bcwriter. For the record, here's the difference betweeen having and not having compaction tables for some tests: Test With Without Size Chg Olden/mst 5,602 5,598 +0.1% viterbi 18,026 17,795 +1.3% obsequi 162,133 166,663 -2.8% burg 224,090 228,148 -1.8% kimwitu++ 4,933,263 5,121,159 -3.8% 176.gcc 8,470,424 9,141,539 -7.3% It seems that it is more beneficial to larger files, but even on the largest test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%. --- Diffs of the changes: (+16 -492) SlotCalculator.cpp | 379 +---------------------------------------------------- SlotCalculator.h | 51 ------- Writer.cpp | 78 ---------- 3 files changed, 16 insertions(+), 492 deletions(-) Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.80 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.81 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.80 Fri Jan 12 17:23:08 2007 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Tue Jan 30 13:36:46 2007 @@ -87,38 +87,7 @@ incorporateFunction(M); // Start out in incorporated state } -unsigned SlotCalculator::getGlobalSlot(const Value *V) const { - assert(!CompactionTable.empty() && - "This method can only be used when compaction is enabled!"); - std::map::const_iterator I = NodeMap.find(V); - assert(I != NodeMap.end() && "Didn't find global slot entry!"); - return I->second; -} - -unsigned SlotCalculator::getGlobalSlot(const Type* T) const { - std::map::const_iterator I = TypeMap.find(T); - assert(I != TypeMap.end() && "Didn't find global slot entry!"); - return I->second; -} - SlotCalculator::TypePlane &SlotCalculator::getPlane(unsigned Plane) { - if (CompactionTable.empty()) { // No compaction table active? - // fall out - } else if (!CompactionTable[Plane].empty()) { // Compaction table active. - assert(Plane < CompactionTable.size()); - return CompactionTable[Plane]; - } else { - // Final case: compaction table active, but this plane is not - // compactified. If the type plane is compactified, unmap back to the - // global type plane corresponding to "Plane". - if (!CompactionTypes.empty()) { - const Type *Ty = CompactionTypes[Plane]; - TypeMapType::iterator It = TypeMap.find(Ty); - assert(It != TypeMap.end() && "Type not in global constant map?"); - Plane = It->second; - } - } - // Okay we are just returning an entry out of the main Table. Make sure the // plane exists and return it. if (Plane >= Table.size()) @@ -284,10 +253,6 @@ SC_DEBUG("begin processFunction!\n"); - // If we emitted all of the function constants, build a compaction table. - if (ModuleContainsAllFunctionConstants) - buildCompactionTable(F); - // Update the ModuleLevel entries to be accurate. ModuleLevel.resize(getNumPlanes()); for (unsigned i = 0, e = getNumPlanes(); i != e; ++i) @@ -330,11 +295,6 @@ } } - // If we are building a compaction table, prune out planes that do not benefit - // from being compactified. - if (!CompactionTable.empty()) - pruneCompactionTable(); - SC_DEBUG("end processFunction!\n"); } @@ -345,10 +305,6 @@ SC_DEBUG("begin purgeFunction!\n"); - // First, free the compaction map if used. - CompactionNodeMap.clear(); - CompactionTypeMap.clear(); - // Next, remove values from existing type planes for (unsigned i = 0; i != NumModuleTypes; ++i) { // Size of plane before function came @@ -371,23 +327,18 @@ ModuleTypeLevel = 0; // Finally, remove any type planes defined by the function... - CompactionTypes.clear(); - if (!CompactionTable.empty()) { - CompactionTable.clear(); - } else { - while (Table.size() > NumModuleTypes) { - TypePlane &Plane = Table.back(); - SC_DEBUG("Removing Plane " << (Table.size()-1) << " of size " - << Plane.size() << "\n"); - while (Plane.size()) { - assert(!isa(Plane.back()) && - "Functions cannot define globals!"); - NodeMap.erase(Plane.back()); // Erase from nodemap - Plane.pop_back(); // Shrink plane - } - - Table.pop_back(); // Nuke the plane, we don't like it. + while (Table.size() > NumModuleTypes) { + TypePlane &Plane = Table.back(); + SC_DEBUG("Removing Plane " << (Table.size()-1) << " of size " + << Plane.size() << "\n"); + while (Plane.size()) { + assert(!isa(Plane.back()) && + "Functions cannot define globals!"); + NodeMap.erase(Plane.back()); // Erase from nodemap + Plane.pop_back(); // Shrink plane } + + Table.pop_back(); // Nuke the plane, we don't like it. } SC_DEBUG("end purgeFunction!\n"); @@ -397,278 +348,8 @@ return Ty != Type::LabelTy && Ty != Type::VoidTy && !isa(Ty); } -/// getOrCreateCompactionTableSlot - This method is used to build up the initial -/// approximation of the compaction table. -unsigned SlotCalculator::getOrCreateCompactionTableSlot(const Value *V) { - std::map::iterator I = - CompactionNodeMap.lower_bound(V); - if (I != CompactionNodeMap.end() && I->first == V) - return I->second; // Already exists? - - // Make sure the type is in the table. - unsigned Ty; - if (!CompactionTypes.empty()) - Ty = getOrCreateCompactionTableSlot(V->getType()); - else // If the type plane was decompactified, use the global plane ID - Ty = getSlot(V->getType()); - if (CompactionTable.size() <= Ty) - CompactionTable.resize(Ty+1); - - TypePlane &TyPlane = CompactionTable[Ty]; - - // Make sure to insert the null entry if the thing we are inserting is not a - // null constant. - if (TyPlane.empty() && hasNullValue(V->getType())) { - Value *ZeroInitializer = Constant::getNullValue(V->getType()); - if (V != ZeroInitializer) { - TyPlane.push_back(ZeroInitializer); - CompactionNodeMap[ZeroInitializer] = 0; - } - } - - unsigned SlotNo = TyPlane.size(); - TyPlane.push_back(V); - CompactionNodeMap.insert(std::make_pair(V, SlotNo)); - return SlotNo; -} - -/// getOrCreateCompactionTableSlot - This method is used to build up the initial -/// approximation of the compaction table. -unsigned SlotCalculator::getOrCreateCompactionTableSlot(const Type *T) { - CompactionTypeMapType::iterator I = CompactionTypeMap.lower_bound(T); - if (I != CompactionTypeMap.end() && I->first == T) - return I->second; // Already exists? - - unsigned SlotNo = CompactionTypes.size(); - SC_DEBUG("Inserting Compaction Type #" << SlotNo << ": " << *T << "\n"); - CompactionTypes.push_back(T); - CompactionTypeMap.insert(I, std::make_pair(T, SlotNo)); - return SlotNo; -} - -/// buildCompactionTable - Since all of the function constants and types are -/// stored in the module-level constant table, we don't need to emit a function -/// constant table. Also due to this, the indices for various constants and -/// types might be very large in large programs. In order to avoid blowing up -/// the size of instructions in the bytecode encoding, we build a compaction -/// table, which defines a mapping from function-local identifiers to global -/// identifiers. -void SlotCalculator::buildCompactionTable(const Function *F) { - assert(CompactionNodeMap.empty() && "Compaction table already built!"); - assert(CompactionTypeMap.empty() && "Compaction types already built!"); - // First step, insert the primitive types. - CompactionTable.resize(Type::LastPrimitiveTyID+1); - for (unsigned i = 0; i <= Type::LastPrimitiveTyID; ++i) { - const Type *PrimTy = Type::getPrimitiveType((Type::TypeID)i); - CompactionTypes.push_back(PrimTy); - CompactionTypeMap[PrimTy] = i; - } - CompactionTypeMap[Type::Int1Ty] = CompactionTypes.size(); - CompactionTypes.push_back(Type::Int1Ty); - CompactionTypeMap[Type::Int8Ty] = CompactionTypes.size(); - CompactionTypes.push_back(Type::Int8Ty); - CompactionTypeMap[Type::Int16Ty] = CompactionTypes.size(); - CompactionTypes.push_back(Type::Int16Ty); - CompactionTypeMap[Type::Int32Ty] = CompactionTypes.size(); - CompactionTypes.push_back(Type::Int32Ty); - CompactionTypeMap[Type::Int64Ty] = CompactionTypes.size(); - CompactionTypes.push_back(Type::Int64Ty); - - // Next, include any types used by function arguments. - for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); - I != E; ++I) - getOrCreateCompactionTableSlot(I->getType()); - - // Next, find all of the types and values that are referred to by the - // instructions in the function. - for (const_inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { - getOrCreateCompactionTableSlot(I->getType()); - for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) - if (isa(I->getOperand(op)) || isa(I->getOperand(op))) - getOrCreateCompactionTableSlot(I->getOperand(op)); - } - - // Now do the constants and global values - const SymbolTable &ST = F->getValueSymbolTable(); - for (SymbolTable::plane_const_iterator PI = ST.plane_begin(), - PE = ST.plane_end(); PI != PE; ++PI) - for (SymbolTable::value_const_iterator VI = PI->second.begin(), - VE = PI->second.end(); VI != VE; ++VI) - if (isa(VI->second) && !isa(VI->second)) - getOrCreateCompactionTableSlot(VI->second); - - // Now that we have all of the values in the table, and know what types are - // referenced, make sure that there is at least the zero initializer in any - // used type plane. Since the type was used, we will be emitting instructions - // to the plane even if there are no constants in it. - CompactionTable.resize(CompactionTypes.size()); - for (unsigned i = 0, e = CompactionTable.size(); i != e; ++i) - if (CompactionTable[i].empty() && (i != Type::VoidTyID) && - i != Type::LabelTyID) { - const Type *Ty = CompactionTypes[i]; - SC_DEBUG("Getting Null Value #" << i << " for Type " << *Ty << "\n"); - assert(Ty->getTypeID() != Type::VoidTyID); - assert(Ty->getTypeID() != Type::LabelTyID); - getOrCreateCompactionTableSlot(Constant::getNullValue(Ty)); - } - - // Okay, now at this point, we have a legal compaction table. Since we want - // to emit the smallest possible binaries, do not compactify the type plane if - // it will not save us anything. Because we have not yet incorporated the - // function body itself yet, we don't know whether or not it's a good idea to - // compactify other planes. We will defer this decision until later. - TypeList &GlobalTypes = Types; - - // All of the values types will be scrunched to the start of the types plane - // of the global table. Figure out just how many there are. - assert(!GlobalTypes.empty() && "No global types???"); - unsigned NumFCTypes = GlobalTypes.size()-1; - while (!GlobalTypes[NumFCTypes]->isFirstClassType()) - --NumFCTypes; - - // If there are fewer that 64 types, no instructions will be exploded due to - // the size of the type operands. Thus there is no need to compactify types. - // Also, if the compaction table contains most of the entries in the global - // table, there really is no reason to compactify either. - if (NumFCTypes < 64) { - // Decompactifying types is tricky, because we have to move type planes all - // over the place. At least we don't need to worry about updating the - // CompactionNodeMap for non-types though. - std::vector TmpCompactionTable; - std::swap(CompactionTable, TmpCompactionTable); - TypeList TmpTypes; - std::swap(TmpTypes, CompactionTypes); - - // Move each plane back over to the uncompactified plane - while (!TmpTypes.empty()) { - const Type *Ty = TmpTypes.back(); - TmpTypes.pop_back(); - CompactionTypeMap.erase(Ty); // Decompactify type! - - // Find the global slot number for this type. - int TySlot = getSlot(Ty); - assert(TySlot != -1 && "Type doesn't exist in global table?"); - - // Now we know where to put the compaction table plane. - if (CompactionTable.size() <= unsigned(TySlot)) - CompactionTable.resize(TySlot+1); - // Move the plane back into the compaction table. - std::swap(CompactionTable[TySlot], TmpCompactionTable[TmpTypes.size()]); - - // And remove the empty plane we just moved in. - TmpCompactionTable.pop_back(); - } - } -} - - -/// pruneCompactionTable - Once the entire function being processed has been -/// incorporated into the current compaction table, look over the compaction -/// table and check to see if there are any values whose compaction will not -/// save us any space in the bytecode file. If compactifying these values -/// serves no purpose, then we might as well not even emit the compactification -/// information to the bytecode file, saving a bit more space. -/// -/// Note that the type plane has already been compactified if possible. -/// -void SlotCalculator::pruneCompactionTable() { - TypeList &TyPlane = CompactionTypes; - for (unsigned ctp = 0, e = CompactionTable.size(); ctp != e; ++ctp) - if (!CompactionTable[ctp].empty()) { - TypePlane &CPlane = CompactionTable[ctp]; - unsigned GlobalSlot = ctp; - if (!TyPlane.empty()) - GlobalSlot = getGlobalSlot(TyPlane[ctp]); - - if (GlobalSlot >= Table.size()) - Table.resize(GlobalSlot+1); - TypePlane &GPlane = Table[GlobalSlot]; - - unsigned ModLevel = getModuleLevel(ctp); - unsigned NumFunctionObjs = CPlane.size()-ModLevel; - - // If the maximum index required if all entries in this plane were merged - // into the global plane is less than 64, go ahead and eliminate the - // plane. - bool PrunePlane = GPlane.size() + NumFunctionObjs < 64; - - // If there are no function-local values defined, and the maximum - // referenced global entry is less than 64, we don't need to compactify. - if (!PrunePlane && NumFunctionObjs == 0) { - unsigned MaxIdx = 0; - for (unsigned i = 0; i != ModLevel; ++i) { - unsigned Idx = NodeMap[CPlane[i]]; - if (Idx > MaxIdx) MaxIdx = Idx; - } - PrunePlane = MaxIdx < 64; - } - - // Ok, finally, if we decided to prune this plane out of the compaction - // table, do so now. - if (PrunePlane) { - TypePlane OldPlane; - std::swap(OldPlane, CPlane); - - // Loop over the function local objects, relocating them to the global - // table plane. - for (unsigned i = ModLevel, e = OldPlane.size(); i != e; ++i) { - const Value *V = OldPlane[i]; - CompactionNodeMap.erase(V); - assert(NodeMap.count(V) == 0 && "Value already in table??"); - getOrCreateSlot(V); - } - - // For compactified global values, just remove them from the compaction - // node map. - for (unsigned i = 0; i != ModLevel; ++i) - CompactionNodeMap.erase(OldPlane[i]); - - // Update the new modulelevel for this plane. - assert(ctp < ModuleLevel.size() && "Cannot set modulelevel!"); - ModuleLevel[ctp] = GPlane.size()-NumFunctionObjs; - assert((int)ModuleLevel[ctp] >= 0 && "Bad computation!"); - } - } -} - -/// Determine if the compaction table is actually empty. Because the -/// compaction table always includes the primitive type planes, we -/// can't just check getCompactionTable().size() because it will never -/// be zero. Furthermore, the ModuleLevel factors into whether a given -/// plane is empty or not. This function does the necessary computation -/// to determine if its actually empty. -bool SlotCalculator::CompactionTableIsEmpty() const { - // Check a degenerate case, just in case. - if (CompactionTable.empty()) - return true; - - // Check each plane - for (unsigned i = 0, e = CompactionTable.size(); i < e; ++i) { - // If the plane is not empty - if (!CompactionTable[i].empty()) { - // If the module level is non-zero then at least the - // first element of the plane is valid and therefore not empty. - unsigned End = getModuleLevel(i); - if (End != 0) - return false; - } - } - // All the compaction table planes are empty so the table is - // considered empty too. - return true; -} int SlotCalculator::getSlot(const Value *V) const { - // If there is a CompactionTable active... - if (!CompactionNodeMap.empty()) { - std::map::const_iterator I = - CompactionNodeMap.find(V); - if (I != CompactionNodeMap.end()) - return (int)I->second; - // Otherwise, if it's not in the compaction table, it must be in a - // non-compactified plane. - } - std::map::const_iterator I = NodeMap.find(V); if (I != NodeMap.end()) return (int)I->second; @@ -677,16 +358,6 @@ } int SlotCalculator::getSlot(const Type*T) const { - // If there is a CompactionTable active... - if (!CompactionTypeMap.empty()) { - std::map::const_iterator I = - CompactionTypeMap.find(T); - if (I != CompactionTypeMap.end()) - return (int)I->second; - // Otherwise, if it's not in the compaction table, it must be in a - // non-compactified plane. - } - std::map::const_iterator I = TypeMap.find(T); if (I != TypeMap.end()) return (int)I->second; @@ -705,8 +376,6 @@ if (!isa(V)) // Initializers for globals are handled explicitly if (const Constant *C = dyn_cast(V)) { - assert(CompactionNodeMap.empty() && - "All needed constants should be in the compaction map already!"); // Do not index the characters that make up constant strings. We emit // constant strings as special entities that don't require their @@ -741,20 +410,6 @@ assert(D && "Can't insert a null value!"); assert(getSlot(D) == -1 && "Value is already in the table!"); - // If we are building a compaction map, and if this plane is being compacted, - // insert the value into the compaction map, not into the global map. - if (!CompactionNodeMap.empty()) { - if (D->getType() == Type::VoidTy) return -1; // Do not insert void values - assert(!isa(D) && - "Types, constants, and globals should be in global table!"); - - int Plane = getSlot(D->getType()); - assert(Plane != -1 && CompactionTable.size() > (unsigned)Plane && - "Didn't find value type!"); - if (!CompactionTable[Plane].empty()) - return getOrCreateCompactionTableSlot(D); - } - // If this node does not contribute to a plane, or if the node has a // name and we don't want names, then ignore the silly node... Note that types // do need slot numbers so that we can keep track of where other values land. @@ -773,12 +428,6 @@ assert(Ty && "Can't insert a null type!"); assert(getSlot(Ty) == -1 && "Type is already in the table!"); - // If we are building a compaction map, and if this plane is being compacted, - // insert the value into the compaction map, not into the global map. - if (!CompactionTypeMap.empty()) { - getOrCreateCompactionTableSlot(Ty); - } - // Insert the current type before any subtypes. This is important because // recursive types elements are inserted in a bottom up order. Changing // this here can break things. For example: @@ -818,11 +467,7 @@ // llvm_cerr << "Inserting type '"<(D)->getDescription() <<"'!\n"; if (Typ->isDerivedType()) { - int ValSlot; - if (CompactionTable.empty()) - ValSlot = getSlot(Typ); - else - ValSlot = getGlobalSlot(Typ); + int ValSlot = getSlot(Typ); if (ValSlot == -1) { // Have we already entered this type? // Nope, this is the first we have seen the type, process it. ValSlot = insertType(Typ, true); Index: llvm/lib/Bytecode/Writer/SlotCalculator.h diff -u llvm/lib/Bytecode/Writer/SlotCalculator.h:1.25 llvm/lib/Bytecode/Writer/SlotCalculator.h:1.26 --- llvm/lib/Bytecode/Writer/SlotCalculator.h:1.25 Fri Jan 12 01:05:13 2007 +++ llvm/lib/Bytecode/Writer/SlotCalculator.h Tue Jan 30 13:36:46 2007 @@ -61,17 +61,6 @@ /// is only possible if building information for a bytecode file. bool ModuleContainsAllFunctionConstants; - /// CompactionTable/NodeMap - When function compaction has been performed, - /// these entries provide a compacted view of the namespace needed to emit - /// instructions in a function body. The 'getSlot()' method automatically - /// returns these entries if applicable, or the global entries if not. - std::vector CompactionTable; - TypeList CompactionTypes; - typedef std::map CompactionNodeMapType; - CompactionNodeMapType CompactionNodeMap; - typedef std::map CompactionTypeMapType; - CompactionTypeMapType CompactionTypeMap; - SlotCalculator(const SlotCalculator &); // DO NOT IMPLEMENT void operator=(const SlotCalculator &); // DO NOT IMPLEMENT public: @@ -85,24 +74,8 @@ int getSlot(const Value *V) const; int getSlot(const Type* T) const; - /// getGlobalSlot - Return a slot number from the global table. This can only - /// be used when a compaction table is active. - unsigned getGlobalSlot(const Value *V) const; - unsigned getGlobalSlot(const Type *V) const; - - inline unsigned getNumPlanes() const { - if (CompactionTable.empty()) - return Table.size(); - else - return CompactionTable.size(); - } - - inline unsigned getNumTypes() const { - if (CompactionTypes.empty()) - return Types.size(); - else - return CompactionTypes.size(); - } + inline unsigned getNumPlanes() const { return Table.size(); } + inline unsigned getNumTypes() const { return Types.size(); } inline unsigned getModuleLevel(unsigned Plane) const { return Plane < ModuleLevel.size() ? ModuleLevel[Plane] : 0; @@ -114,11 +87,7 @@ } TypePlane &getPlane(unsigned Plane); - TypeList& getTypes() { - if (!CompactionTypes.empty()) - return CompactionTypes; - return Types; - } + TypeList& getTypes() { return Types; } /// incorporateFunction/purgeFunction - If you'd like to deal with a function, /// use these two methods to get its data into the SlotCalculator! @@ -133,15 +102,6 @@ string_iterator string_begin() const { return ConstantStrings.begin(); } string_iterator string_end() const { return ConstantStrings.end(); } - const std::vector &getCompactionTable() const { - return CompactionTable; - } - - const TypeList& getCompactionTypes() const { return CompactionTypes; } - - /// @brief Determine if the compaction table (not types) is empty - bool CompactionTableIsEmpty() const; - private: // getOrCreateSlot - Values can be crammed into here at will... if // they haven't been inserted already, they get inserted, otherwise @@ -173,11 +133,6 @@ void processValueSymbolTable(const SymbolTable *ST); void processSymbolTableConstants(const SymbolTable *ST); - void buildCompactionTable(const Function *F); - unsigned getOrCreateCompactionTableSlot(const Value *V); - unsigned getOrCreateCompactionTableSlot(const Type *V); - void pruneCompactionTable(); - // insertPrimitives - helper for constructors to insert primitive types. void insertPrimitives(); }; Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.153 llvm/lib/Bytecode/Writer/Writer.cpp:1.154 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.153 Fri Jan 26 02:10:24 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Tue Jan 30 13:36:46 2007 @@ -1112,14 +1112,7 @@ // Get slot information about the function... Table.incorporateFunction(F); - if (Table.getCompactionTable().empty()) { - // Output information about the constants in the function if the compaction - // table is not being used. - outputConstants(true); - } else { - // Otherwise, emit the compaction table. - outputCompactionTable(); - } + outputConstants(true); // Output all of the instructions in the body of the function outputInstructions(F); @@ -1130,75 +1123,6 @@ Table.purgeFunction(); } -void BytecodeWriter::outputCompactionTablePlane(unsigned PlaneNo, - const std::vector &Plane, - unsigned StartNo) { - unsigned End = Table.getModuleLevel(PlaneNo); - if (Plane.empty() || StartNo == End || End == 0) return; // Nothing to emit - assert(StartNo < End && "Cannot emit negative range!"); - assert(StartNo < Plane.size() && End <= Plane.size()); - - // Do not emit the null initializer! - ++StartNo; - - // Figure out which encoding to use. By far the most common case we have is - // to emit 0-2 entries in a compaction table plane. - switch (End-StartNo) { - case 0: // Avoid emitting two vbr's if possible. - case 1: - case 2: - output_vbr((PlaneNo << 2) | End-StartNo); - break; - default: - // Output the number of things. - output_vbr((unsigned(End-StartNo) << 2) | 3); - output_typeid(PlaneNo); // Emit the type plane this is - break; - } - - for (unsigned i = StartNo; i != End; ++i) - output_vbr(Table.getGlobalSlot(Plane[i])); -} - -void BytecodeWriter::outputCompactionTypes(unsigned StartNo) { - // Get the compaction type table from the slot calculator - const std::vector &CTypes = Table.getCompactionTypes(); - - // The compaction types may have been uncompactified back to the - // global types. If so, we just write an empty table - if (CTypes.size() == 0) { - output_vbr(0U); - return; - } - - assert(CTypes.size() >= StartNo && "Invalid compaction types start index"); - - // Determine how many types to write - unsigned NumTypes = CTypes.size() - StartNo; - - // Output the number of types. - output_vbr(NumTypes); - - for (unsigned i = StartNo; i < StartNo+NumTypes; ++i) - output_typeid(Table.getGlobalSlot(CTypes[i])); -} - -void BytecodeWriter::outputCompactionTable() { - // Avoid writing the compaction table at all if there is no content. - if (Table.getCompactionTypes().size() >= Type::FirstDerivedTyID || - (!Table.CompactionTableIsEmpty())) { - BytecodeBlock CTB(BytecodeFormat::CompactionTableBlockID, *this, - true/*ElideIfEmpty*/); - const std::vector > &CT = - Table.getCompactionTable(); - - // First things first, emit the type compaction table if there is one. - outputCompactionTypes(Type::FirstDerivedTyID); - - for (unsigned i = 0, e = CT.size(); i != e; ++i) - outputCompactionTablePlane(i, CT[i], 0); - } -} void BytecodeWriter::outputTypeSymbolTable(const TypeSymbolTable &TST) { // Do not output the block for an empty symbol table, it just wastes From reid at x10sys.com Tue Jan 30 13:37:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 13:37:42 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Format.h Message-ID: <200701301937.l0UJbgYm016888@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Format.h updated: 1.15 -> 1.16 --- Log message: Compaction tables no longer supported, remove its block ID. --- Diffs of the changes: (+1 -7) Format.h | 8 +------- 1 files changed, 1 insertion(+), 7 deletions(-) Index: llvm/include/llvm/Bytecode/Format.h diff -u llvm/include/llvm/Bytecode/Format.h:1.15 llvm/include/llvm/Bytecode/Format.h:1.16 --- llvm/include/llvm/Bytecode/Format.h:1.15 Sat Jan 6 01:24:43 2007 +++ llvm/include/llvm/Bytecode/Format.h Tue Jan 30 13:37:26 2007 @@ -40,13 +40,7 @@ GlobalTypePlaneBlockID = 6, ///< Global type plan identifier InstructionListBlockID = 7, ///< All instructions in a function - /// Blocks with this id are used to define a function local remapping - /// table for the function's values. This allows the indices used within - /// the function to be as small as possible. This often allows the - /// instructions to be encoded more efficiently because VBR takes fewer - /// bytes with smaller values. - /// @brief Value Compaction Table Block - CompactionTableBlockID = 8, + //CompactionTableBlockID = 8, << Placeholder for removed block type TypeSymbolTableBlockID = 9, ///< Value Symbol table identifier // Not a block id, just used to count them From reid at x10sys.com Tue Jan 30 14:09:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:09:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200701302009.l0UK96Zq019240@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.322 -> 1.323 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+5 -5) CBackend.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.322 llvm/lib/Target/CBackend/CBackend.cpp:1.323 --- llvm/lib/Target/CBackend/CBackend.cpp:1.322 Mon Jan 29 11:50:30 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Tue Jan 30 14:08:37 2007 @@ -305,7 +305,7 @@ std::map ExtSymbols; for (Module::iterator I = M.begin(), E = M.end(); I != E;) { Function *GV = I++; - if (GV->isExternal() && GV->hasName()) { + if (GV->isDeclaration() && GV->hasName()) { std::pair::iterator, bool> X = ExtSymbols.insert(std::make_pair(GV->getName(), GV)); if (!X.second) { @@ -321,7 +321,7 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E;) { GlobalVariable *GV = I++; - if (GV->isExternal() && GV->hasName()) { + if (GV->isDeclaration() && GV->hasName()) { std::pair::iterator, bool> X = ExtSymbols.insert(std::make_pair(GV->getName(), GV)); if (!X.second) { @@ -1525,7 +1525,7 @@ Out << "\n\n/* Global Variable Declarations */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; @@ -1554,7 +1554,7 @@ Out << "\n\n/* Global Variable Definitions and Initialization */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; @@ -1777,7 +1777,7 @@ FunctionInnards << Mang->getValueName(F) << '('; bool PrintedArg = false; - if (!F->isExternal()) { + if (!F->isDeclaration()) { if (!F->arg_empty()) { Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); From reid at x10sys.com Tue Jan 30 14:10:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:00 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200701302010.l0UKA00T019261@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.35 -> 1.36 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+4 -4) CppWriter.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.35 llvm/tools/llvm2cpp/CppWriter.cpp:1.36 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.35 Sun Jan 28 09:51:15 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Tue Jan 30 14:08:39 2007 @@ -1452,7 +1452,7 @@ Out << ","; nl(Out) << "/*Name=*/\""; printEscapedString(F->getName()); - Out << "\", mod); " << (F->isExternal()? "// (external, no body)" : ""); + Out << "\", mod); " << (F->isDeclaration()? "// (external, no body)" : ""); nl(Out,-1); printCppName(F); Out << "->setCallingConv("; @@ -1476,7 +1476,7 @@ } void CppWriter::printFunctionBody(const Function *F) { - if (F->isExternal()) + if (F->isDeclaration()) return; // external functions have no bodies. // Clear the DefinedValues and ForwardRefs maps because we can't have @@ -1550,7 +1550,7 @@ error(std::string("Function '") + func + "' not found in input module"); return; } - if (F->isExternal()) { + if (F->isDeclaration()) { error(std::string("Function '") + func + "' is external!"); return; } @@ -1611,7 +1611,7 @@ nl(Out) << "// Function Definitions"; nl(Out); for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); I != E; ++I) { - if (!I->isExternal()) { + if (!I->isDeclaration()) { nl(Out) << "// Function: " << I->getName() << " (" << getCppName(I) << ")"; nl(Out) << "{"; From reid at x10sys.com Tue Jan 30 14:10:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:00 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp Message-ID: <200701302010.l0UKA0p3019258@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: AnalysisWrappers.cpp updated: 1.20 -> 1.21 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) AnalysisWrappers.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/AnalysisWrappers.cpp diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.20 llvm/tools/opt/AnalysisWrappers.cpp:1.21 --- llvm/tools/opt/AnalysisWrappers.cpp:1.20 Tue Dec 5 13:43:42 2006 +++ llvm/tools/opt/AnalysisWrappers.cpp Tue Jan 30 14:08:39 2007 @@ -32,7 +32,7 @@ struct ExternalFunctionsPassedConstants : public ModulePass { virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->isExternal()) { + if (I->isDeclaration()) { bool PrintedFn = false; for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) From reid at x10sys.com Tue Jan 30 14:10:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Mangler.cpp Module.cpp Pass.cpp PassManager.cpp SymbolTable.cpp Verifier.cpp Message-ID: <200701302010.l0UKA1HT019287@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.256 -> 1.257 Mangler.cpp updated: 1.30 -> 1.31 Module.cpp updated: 1.73 -> 1.74 Pass.cpp updated: 1.83 -> 1.84 PassManager.cpp updated: 1.131 -> 1.132 SymbolTable.cpp updated: 1.65 -> 1.66 Verifier.cpp updated: 1.187 -> 1.188 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+17 -17) AsmWriter.cpp | 4 ++-- Mangler.cpp | 4 ++-- Module.cpp | 2 +- Pass.cpp | 4 ++-- PassManager.cpp | 4 ++-- SymbolTable.cpp | 4 ++-- Verifier.cpp | 12 ++++++------ 7 files changed, 17 insertions(+), 17 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.256 llvm/lib/VMCore/AsmWriter.cpp:1.257 --- llvm/lib/VMCore/AsmWriter.cpp:1.256 Sun Jan 28 07:31:35 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Jan 30 14:08:38 2007 @@ -925,7 +925,7 @@ if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out); - if (F->isExternal()) + if (F->isDeclaration()) switch (F->getLinkage()) { case GlobalValue::DLLImportLinkage: Out << "declare dllimport "; break; case GlobalValue::ExternalWeakLinkage: Out << "declare extern_weak "; break; @@ -996,7 +996,7 @@ if (F->getAlignment()) Out << " align " << F->getAlignment(); - if (F->isExternal()) { + if (F->isDeclaration()) { Out << "\n"; } else { Out << " {"; Index: llvm/lib/VMCore/Mangler.cpp diff -u llvm/lib/VMCore/Mangler.cpp:1.30 llvm/lib/VMCore/Mangler.cpp:1.31 --- llvm/lib/VMCore/Mangler.cpp:1.30 Thu Sep 14 13:23:27 2006 +++ llvm/lib/VMCore/Mangler.cpp Tue Jan 30 14:08:38 2007 @@ -170,8 +170,8 @@ GV->hasDLLImportLinkage()) && (ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage()) && - GV->isExternal() && - ExistingValue->isExternal()) { + GV->isDeclaration() && + ExistingValue->isDeclaration()) { // If the two globals both have external inkage, and are both external, // don't mangle either of them, we just have some silly type mismatch. } else { Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.73 llvm/lib/VMCore/Module.cpp:1.74 --- llvm/lib/VMCore/Module.cpp:1.73 Fri Jan 26 02:07:57 2007 +++ llvm/lib/VMCore/Module.cpp Tue Jan 30 14:08:38 2007 @@ -250,7 +250,7 @@ const Function *Found = 0; for (const_iterator I = begin(), E = end(); I != E; ++I) if (I->getName() == Name) - if (I->isExternal()) + if (I->isDeclaration()) Found = I; else return const_cast(&(*I)); Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.83 llvm/lib/VMCore/Pass.cpp:1.84 --- llvm/lib/VMCore/Pass.cpp:1.83 Fri Jan 5 16:47:07 2007 +++ llvm/lib/VMCore/Pass.cpp Tue Jan 30 14:08:38 2007 @@ -76,7 +76,7 @@ bool Changed = doInitialization(M); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal()) // Passes are not run on external functions! + if (!I->isDeclaration()) // Passes are not run on external functions! Changed |= runOnFunction(*I); return Changed | doFinalization(M); @@ -85,7 +85,7 @@ // run - On a function, we simply initialize, run the function, then finalize. // bool FunctionPass::run(Function &F) { - if (F.isExternal()) return false;// Passes are not run on external functions! + if (F.isDeclaration()) return false;// Passes are not run on external functions! bool Changed = doInitialization(*F.getParent()); Changed |= runOnFunction(F); Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.131 llvm/lib/VMCore/PassManager.cpp:1.132 --- llvm/lib/VMCore/PassManager.cpp:1.131 Mon Jan 29 17:10:37 2007 +++ llvm/lib/VMCore/PassManager.cpp Tue Jan 30 14:08:38 2007 @@ -751,7 +751,7 @@ bool BBPassManager::runOnFunction(Function &F) { - if (F.isExternal()) + if (F.isDeclaration()) return false; bool Changed = doInitialization(F); @@ -952,7 +952,7 @@ bool Changed = false; - if (F.isExternal()) + if (F.isDeclaration()) return false; std::string Msg1 = "Executing Pass '"; Index: llvm/lib/VMCore/SymbolTable.cpp diff -u llvm/lib/VMCore/SymbolTable.cpp:1.65 llvm/lib/VMCore/SymbolTable.cpp:1.66 --- llvm/lib/VMCore/SymbolTable.cpp:1.65 Sat Jan 6 01:24:44 2007 +++ llvm/lib/VMCore/SymbolTable.cpp Tue Jan 30 14:08:38 2007 @@ -255,11 +255,11 @@ GlobalValue *NewGV = dyn_cast(V.second); if (ExistGV && NewGV) { - assert((ExistGV->isExternal() || NewGV->isExternal()) && + assert((ExistGV->isDeclaration() || NewGV->isDeclaration()) && "Two planes folded together with overlapping value names!"); // Make sure that ExistGV is the one we want to keep! - if (!NewGV->isExternal()) + if (!NewGV->isDeclaration()) std::swap(NewGV, ExistGV); // Ok we have two external global values. Make all uses of the new Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.187 llvm/lib/VMCore/Verifier.cpp:1.188 --- llvm/lib/VMCore/Verifier.cpp:1.187 Sun Jan 28 07:31:35 2007 +++ llvm/lib/VMCore/Verifier.cpp Tue Jan 30 14:08:38 2007 @@ -132,7 +132,7 @@ visitGlobalValue(*I); // Check to make sure function prototypes are okay. - if (I->isExternal()) visitFunction(*I); + if (I->isDeclaration()) visitFunction(*I); } for (Module::global_iterator I = M.global_begin(), E = M.global_end(); @@ -274,14 +274,14 @@ void Verifier::visitGlobalValue(GlobalValue &GV) { - Assert1(!GV.isExternal() || + Assert1(!GV.isDeclaration() || GV.hasExternalLinkage() || GV.hasDLLImportLinkage() || GV.hasExternalWeakLinkage(), "Global is external, but doesn't have external or dllimport or weak linkage!", &GV); - Assert1(!GV.hasDLLImportLinkage() || GV.isExternal(), + Assert1(!GV.hasDLLImportLinkage() || GV.isDeclaration(), "Global is marked as dllimport, but not external", &GV); Assert1(!GV.hasAppendingLinkage() || isa(GV), @@ -369,7 +369,7 @@ "Functions cannot take aggregates as arguments by value!", I); } - if (!F.isExternal()) { + if (!F.isDeclaration()) { // Verify that this function (which has a body) is not named "llvm.*". It // is not legal to define intrinsics. if (F.getName().size() >= 5) @@ -968,7 +968,7 @@ /// void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { Function *IF = CI.getCalledFunction(); - Assert1(IF->isExternal(), "Intrinsic functions should never be defined!", IF); + Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", IF); #define GET_INTRINSIC_VERIFIER #include "llvm/Intrinsics.gen" @@ -1070,7 +1070,7 @@ // verifyFunction - Create bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) { Function &F = const_cast(f); - assert(!F.isExternal() && "Cannot verify external functions"); + assert(!F.isDeclaration() && "Cannot verify external functions"); FunctionPassManager FPM(new ExistingModuleProvider(F.getParent())); Verifier *V = new Verifier(action); From reid at x10sys.com Tue Jan 30 14:10:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/CrashDebugger.cpp ExtractFunction.cpp Miscompilation.cpp Message-ID: <200701302010.l0UKA177019306@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: CrashDebugger.cpp updated: 1.54 -> 1.55 ExtractFunction.cpp updated: 1.56 -> 1.57 Miscompilation.cpp updated: 1.84 -> 1.85 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+12 -12) CrashDebugger.cpp | 6 +++--- ExtractFunction.cpp | 6 +++--- Miscompilation.cpp | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.54 llvm/tools/bugpoint/CrashDebugger.cpp:1.55 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.54 Sat Jan 6 01:24:44 2007 +++ llvm/tools/bugpoint/CrashDebugger.cpp Tue Jan 30 14:08:38 2007 @@ -219,7 +219,7 @@ // Loop over and delete any functions which we aren't supposed to be playing // with... for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isExternal() && !Functions.count(I)) + if (!I->isDeclaration() && !Functions.count(I)) DeleteFunctionBody(I); // Try running the hacked up program... @@ -406,7 +406,7 @@ std::vector Functions; for (Module::iterator I = BD.getProgram()->begin(), E = BD.getProgram()->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) Functions.push_back(I); if (Functions.size() > 1 && !BugpointIsInterrupted) { @@ -459,7 +459,7 @@ unsigned CurInstructionNum = 0; for (Module::const_iterator FI = BD.getProgram()->begin(), E = BD.getProgram()->end(); FI != E; ++FI) - if (!FI->isExternal()) + if (!FI->isDeclaration()) for (Function::const_iterator BI = FI->begin(), E = FI->end(); BI != E; ++BI) for (BasicBlock::const_iterator I = BI->begin(), E = --BI->end(); Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.56 llvm/tools/bugpoint/ExtractFunction.cpp:1.57 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.56 Sun Dec 31 00:02:26 2006 +++ llvm/tools/bugpoint/ExtractFunction.cpp Tue Jan 30 14:08:38 2007 @@ -170,7 +170,7 @@ void llvm::DeleteFunctionBody(Function *F) { // delete the body of the function... F->deleteBody(); - assert(F->isExternal() && "This didn't make the function external!"); + assert(F->isDeclaration() && "This didn't make the function external!"); } /// GetTorInit - Given a list of entries for static ctors/dtors, return them @@ -195,7 +195,7 @@ /// prune appropriate entries out of M1s list. static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2){ GlobalVariable *GV = M1->getNamedGlobal(GlobalName); - if (!GV || GV->isExternal() || GV->hasInternalLinkage() || + if (!GV || GV->isDeclaration() || GV->hasInternalLinkage() || !GV->use_empty()) return; std::vector > M1Tors, M2Tors; @@ -217,7 +217,7 @@ if (CE->isCast()) FP = CE->getOperand(0); if (Function *F = dyn_cast(FP)) { - if (!F->isExternal()) + if (!F->isDeclaration()) M1Tors.push_back(std::make_pair(F, Priority)); else { // Map to M2's version of the function. Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.84 llvm/tools/bugpoint/Miscompilation.cpp:1.85 --- llvm/tools/bugpoint/Miscompilation.cpp:1.84 Sun Jan 7 02:13:39 2007 +++ llvm/tools/bugpoint/Miscompilation.cpp Tue Jan 30 14:08:38 2007 @@ -320,7 +320,7 @@ std::vector > MisCompFunctions; for (Module::iterator I = ToOptimizeLoopExtracted->begin(), E = ToOptimizeLoopExtracted->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MisCompFunctions.push_back(std::make_pair(I->getName(), I->getFunctionType())); @@ -460,7 +460,7 @@ std::vector > MisCompFunctions; for (Module::iterator I = Extracted->begin(), E = Extracted->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MisCompFunctions.push_back(std::make_pair(I->getName(), I->getFunctionType())); @@ -502,7 +502,7 @@ std::vector MiscompiledFunctions; Module *Prog = BD.getProgram(); for (Module::iterator I = Prog->begin(), E = Prog->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MiscompiledFunctions.push_back(I); // Do the reduction... @@ -637,7 +637,7 @@ // the Test module to call into it. Thus, we create a new function `main' // which just calls the old one. if (Function *oldMain = Safe->getNamedFunction("main")) - if (!oldMain->isExternal()) { + if (!oldMain->isDeclaration()) { // Rename it oldMain->setName("llvm_bugpoint_old_main"); // Create a NEW `main' function with same type in the test module. @@ -680,12 +680,12 @@ // Use the function we just added to get addresses of functions we need. for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { - if (F->isExternal() && !F->use_empty() && &*F != resolverFunc && + if (F->isDeclaration() && !F->use_empty() && &*F != resolverFunc && F->getIntrinsicID() == 0 /* ignore intrinsics */) { Function *TestFn = Test->getNamedFunction(F->getName()); // Don't forward functions which are external in the test module too. - if (TestFn && !TestFn->isExternal()) { + if (TestFn && !TestFn->isDeclaration()) { // 1. Add a string constant with its name to the global file Constant *InitArray = ConstantArray::get(F->getName()); GlobalVariable *funcName = From reid at x10sys.com Tue Jan 30 14:10:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-nm/llvm-nm.cpp Message-ID: <200701302010.l0UKA1bQ019302@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-nm: llvm-nm.cpp updated: 1.29 -> 1.30 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) llvm-nm.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-nm/llvm-nm.cpp diff -u llvm/tools/llvm-nm/llvm-nm.cpp:1.29 llvm/tools/llvm-nm/llvm-nm.cpp:1.30 --- llvm/tools/llvm-nm/llvm-nm.cpp:1.29 Tue Dec 5 19:18:01 2006 +++ llvm/tools/llvm-nm/llvm-nm.cpp Tue Jan 30 14:08:38 2007 @@ -67,7 +67,7 @@ } static char TypeCharForSymbol(GlobalValue &GV) { - if (GV.isExternal()) return 'U'; + if (GV.isDeclaration()) return 'U'; if (GV.hasLinkOnceLinkage()) return 'C'; if (GV.hasWeakLinkage()) return 'W'; if (isa(GV) && GV.hasInternalLinkage()) return 't'; From reid at x10sys.com Tue Jan 30 14:10:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200701302010.l0UKA2sf019317@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.61 -> 1.62 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) IntrinsicLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.61 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.62 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.61 Mon Jan 29 11:42:06 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Tue Jan 30 14:08:37 2007 @@ -61,7 +61,7 @@ void IntrinsicLowering::AddPrototypes(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->isExternal() && !I->use_empty()) + if (I->isDeclaration() && !I->use_empty()) switch (I->getIntrinsicID()) { default: break; case Intrinsic::setjmp: From reid at x10sys.com Tue Jan 30 14:10:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200701302010.l0UKA1m0019296@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.59 -> 1.60 llvmAsmParser.h.cvs updated: 1.47 -> 1.48 llvmAsmParser.y updated: 1.314 -> 1.315 llvmAsmParser.y.cvs updated: 1.60 -> 1.61 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1018 -1192) llvmAsmParser.cpp.cvs | 2162 +++++++++++++++++++++++--------------------------- llvmAsmParser.h.cvs | 40 llvmAsmParser.y | 4 llvmAsmParser.y.cvs | 4 4 files changed, 1018 insertions(+), 1192 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.59 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.60 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.59 Sun Jan 28 07:37:39 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jan 30 14:08:37 2007 @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,21 +18,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -47,7 +37,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -340,7 +330,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1230,10 +1220,9 @@ # define YYTOKEN_TABLE 0 #endif -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" -{ +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1277,10 +1266,9 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 187 of yacc.c. */ -#line 1283 "llvmAsmParser.tab.c" - YYSTYPE; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 1272 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1291,56 +1279,23 @@ /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1296 "llvmAsmParser.tab.c" +/* Line 219 of yacc.c. */ +#line 1284 "llvmAsmParser.tab.c" -#ifdef short -# undef short +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ #endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t #endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t #endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS @@ -1353,32 +1308,7 @@ # endif #endif -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE +#if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1386,76 +1316,64 @@ # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# define YYINCLUDED_STDLIB_H # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# ifdef __cplusplus +extern "C" { # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif +# ifdef __cplusplus +} +# endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; + short int yyss; YYSTYPE yyvs; }; @@ -1465,13 +1383,13 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ +# if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else @@ -1482,7 +1400,7 @@ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif @@ -1500,22 +1418,28 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (YYID (0)) + while (0) #endif -/* YYFINAL -- State number of the termination state. */ +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 40 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 1466 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 146 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 79 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 286 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 567 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ @@ -1526,7 +1450,7 @@ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = +static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1572,7 +1496,7 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const yytype_uint16 yyprhs[] = +static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, @@ -1605,8 +1529,8 @@ 875, 882, 886, 893, 896, 901, 908 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = { 187, 0, -1, 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, @@ -1703,7 +1627,7 @@ }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +static const unsigned short int yyrline[] = { 0, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1032, 1032, 1032, 1033, 1033, 1033, 1033, 1033, 1033, @@ -1739,7 +1663,7 @@ #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", @@ -1787,7 +1711,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -1808,7 +1732,7 @@ # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const unsigned char yyr1[] = { 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 149, 149, 149, 149, 149, 149, @@ -1842,7 +1766,7 @@ }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +static const unsigned char yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1878,7 +1802,7 @@ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const yytype_uint16 yydefact[] = +static const unsigned short int yydefact[] = { 67, 58, 64, 59, 65, 184, 181, 179, 0, 0, 0, 0, 0, 0, 76, 0, 67, 177, 78, 81, @@ -1939,8 +1863,8 @@ 0, 252, 0, 0, 251, 0, 248 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = { -1, 188, 189, 190, 191, 254, 271, 111, 112, 72, 494, 12, 73, 14, 37, 38, 39, 44, 50, 121, @@ -1955,7 +1879,7 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -386 -static const yytype_int16 yypact[] = +static const short int yypact[] = { 357, -386, -386, -386, -386, -386, -386, -386, 28, -112, 61, -51, 136, 27, 288, 172, 594, -386, 209, 93, @@ -2017,7 +1941,7 @@ }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +static const short int yypgoto[] = { -386, 398, 401, 407, 410, 327, 330, -204, -386, 0, 17, 453, 10, -386, -386, -386, 54, -386, -386, -175, @@ -2034,7 +1958,7 @@ number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -177 -static const yytype_int16 yytable[] = +static const short int yytable[] = { 11, 75, 332, 299, 192, 281, 283, 381, 98, 398, 13, 114, 429, 398, 431, 298, 11, 375, 60, 61, @@ -2185,7 +2109,7 @@ 178, 179, 180, 219, 220, 221, 222 }; -static const yytype_int16 yycheck[] = +static const short int yycheck[] = { 0, 26, 241, 207, 113, 185, 186, 304, 4, 328, 0, 81, 9, 332, 9, 9, 16, 300, 5, 6, @@ -2338,7 +2262,7 @@ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const unsigned char yystos[] = { 0, 14, 15, 17, 18, 19, 25, 26, 44, 47, 51, 155, 157, 158, 159, 187, 188, 189, 191, 190, @@ -2424,7 +2348,7 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ @@ -2432,7 +2356,7 @@ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (YYID (0)) +while (0) #define YYTERROR 1 @@ -2447,7 +2371,7 @@ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -2461,7 +2385,7 @@ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif @@ -2473,8 +2397,8 @@ # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -2501,96 +2425,36 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +} while (0) -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) + for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -2599,45 +2463,37 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; +yy_reduce_print (yyrule) int yyrule; #endif { - int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) + yy_reduce_print (Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2671,44 +2527,42 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H +# if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -#else -static YYSIZE_T +# else yystrlen (yystr) - const char *yystr; -#endif + const char *yystr; +# endif { - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) + const char *yys = yystr; + + while (*yys++ != '\0') continue; - return yylen; + + return yys - yystr - 1; } # endif # endif # ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * +# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -#else -static char * +# else yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif + char *yydest; + const char *yysrc; +# endif { char *yyd = yydest; const char *yys = yysrc; @@ -2734,7 +2588,7 @@ { if (*yystr == '"') { - YYSIZE_T yyn = 0; + size_t yyn = 0; char const *yyp = yystr; for (;;) @@ -2769,123 +2623,53 @@ } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +#endif /* YYERROR_VERBOSE */ - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; + - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - if (yysize_overflow) - return YYSIZE_MAXIMUM; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; } + YYFPRINTF (yyoutput, ")"); } -#endif /* YYERROR_VERBOSE */ - +#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -2896,7 +2680,8 @@ YYSTYPE *yyvaluep; #endif { - YYUSE (yyvaluep); + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; if (!yymsg) yymsg = "Deleting"; @@ -2906,7 +2691,7 @@ { default: - break; + break; } } @@ -2914,13 +2699,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus +# if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); -#else +# else int yyparse (); -#endif +# endif #else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); @@ -2945,18 +2730,14 @@ `----------*/ #ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif #else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else @@ -2974,12 +2755,6 @@ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif /* Three stacks and their tools: `yyss': related to states, @@ -2990,9 +2765,9 @@ to reallocate them elsewhere. */ /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -3001,7 +2776,7 @@ -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +#define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; @@ -3010,9 +2785,9 @@ YYSTYPE yyval; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; YYDPRINTF ((stderr, "Starting parse\n")); @@ -3036,7 +2811,8 @@ `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ + have just been pushed. so pushing a state here evens the stacks. + */ yyssp++; yysetstate: @@ -3049,11 +2825,11 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -3081,7 +2857,7 @@ yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -3116,10 +2892,12 @@ `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -3161,21 +2939,22 @@ if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; goto yynewstate; @@ -3211,150 +2990,150 @@ switch (yyn) { case 29: -#line 1037 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1037 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1038 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1038 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1039 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1039 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1041 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1041 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1045 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1045 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1046 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1046 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1047 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1047 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1049 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1049 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1050 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1050 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1052 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1052 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1053 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1053 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 61: -#line 1062 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1062 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 62: -#line 1066 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR ;} break; case 63: -#line 1070 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1070 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3362,15 +3141,15 @@ break; case 66: -#line 1077 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1077 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR ;} break; case 67: -#line 1081 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1081 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3378,193 +3157,193 @@ break; case 68: -#line 1087 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1087 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 69: -#line 1088 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1088 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 70: -#line 1089 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1089 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 71: -#line 1090 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1090 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 72: -#line 1091 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1091 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 73: -#line 1095 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1095 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 74: -#line 1096 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1096 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 75: -#line 1097 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 76: -#line 1101 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 77: -#line 1102 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1102 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 78: -#line 1106 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1107 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 80: -#line 1108 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 81: -#line 1112 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 82: -#line 1113 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 83: -#line 1114 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1114 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 84: -#line 1115 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1115 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 85: -#line 1116 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1116 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 86: -#line 1119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1119 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 87: -#line 1120 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 88: -#line 1121 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 89: -#line 1122 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 90: -#line 1123 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1123 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 91: -#line 1124 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1124 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 92: -#line 1125 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large!"); - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); CHECK_FOR_ERROR ;} break; case 93: -#line 1132 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;} break; case 94: -#line 1133 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1133 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;} break; case 95: -#line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1134 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;} break; case 96: -#line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1135 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;} break; case 97: -#line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} break; case 98: -#line 1139 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); + (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); ;} break; case 99: -#line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;} break; case 101: -#line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} break; case 102: -#line 1149 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); + (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); ;} break; case 103: -#line 1156 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 104: -#line 1157 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR @@ -3572,14 +3351,14 @@ break; case 105: -#line 1163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 106: -#line 1164 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR @@ -3587,57 +3366,57 @@ break; case 107: -#line 1172 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) - if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') + for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) + if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') GEN_ERROR("Invalid character in section name!"); - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[0].StrVal); CHECK_FOR_ERROR ;} break; case 108: -#line 1180 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 109: -#line 1181 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} +#line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 110: -#line 1186 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" {;} break; case 111: -#line 1187 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" {;} break; case 112: -#line 1188 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1188 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurGV->setSection((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + CurGV->setSection((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 113: -#line 1193 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two!"); - CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); + CurGV->setAlignment((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; case 118: -#line 1209 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -3645,39 +3424,39 @@ break; case 119: -#line 1213 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); + (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR ;} break; case 120: -#line 1217 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Pointer type? - if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) + if (*(yyvsp[-1].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); - delete (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 121: -#line 1224 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); + const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.TypeVal) = new PATypeHolder(tmp); ;} break; case 122: -#line 1229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1229 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!"); + if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR @@ -3685,12 +3464,12 @@ break; case 123: -#line 1237 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back((yyvsp[0].ParamAttrs)); + for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3698,21 +3477,21 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, Attrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle + FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, Attrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list + delete (yyvsp[-4].TypeVal); // Delete the return type handle (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR ;} break; case 124: -#line 1255 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back((yyvsp[0].ParamAttrs)); + for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3720,54 +3499,54 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, Attrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, Attrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR ;} break; case 125: -#line 1273 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 126: -#line 1278 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); - if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); + if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); - if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) + if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) GEN_ERROR("Vector length should be a power of 2!"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 127: -#line 1290 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), - E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), + E = (yyvsp[-1].TypeList)->end(); I != E; ++I) Elements.push_back(*I); (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[(2) - (3)].TypeList); + delete (yyvsp[-1].TypeList); CHECK_FOR_ERROR ;} break; case 128: -#line 1300 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -3775,21 +3554,21 @@ break; case 129: -#line 1304 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; - for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), - E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), + E = (yyvsp[-2].TypeList)->end(); I != E; ++I) Elements.push_back(*I); (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[(3) - (5)].TypeList); + delete (yyvsp[-2].TypeList); CHECK_FOR_ERROR ;} break; case 130: -#line 1314 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1314 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -3797,52 +3576,52 @@ break; case 131: -#line 1321 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1321 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); + (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); + (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); ;} break; case 132: -#line 1328 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1328 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); - if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types!"); - (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + (yyval.TypeVal) = (yyvsp[0].TypeVal); ;} break; case 133: -#line 1335 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1335 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 134: -#line 1340 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1340 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); + (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 135: -#line 1345 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1345 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); + ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 137: -#line 1353 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); + (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); @@ -3851,7 +3630,7 @@ break; case 138: -#line 1360 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1360 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; @@ -3862,7 +3641,7 @@ break; case 139: -#line 1367 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1367 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -3870,153 +3649,153 @@ break; case 140: -#line 1375 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1375 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); delete (yyvsp[(1) - (1)].TypeVal); + (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 141: -#line 1380 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 142: -#line 1391 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1391 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 143: -#line 1419 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1419 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 144: -#line 1435 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1435 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + + itostr((int)(EndStr-(yyvsp[0].StrVal))) + " when array has size " + itostr(NumElements) + "!"); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); + for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[0].StrVal)); GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } - free((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[0].StrVal)); (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 145: -#line 1464 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1464 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 146: -#line 1492 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1492 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); - if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) + if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4026,21 +3805,21 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 147: -#line 1517 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1517 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); @@ -4050,25 +3829,25 @@ GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 148: -#line 1536 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1536 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); + const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-5].TypeVal))->getDescription() + "'!"); - if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) + if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4078,21 +3857,21 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); - delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector)); + delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector); CHECK_FOR_ERROR ;} break; case 149: -#line 1561 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1561 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-4].TypeVal))->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); @@ -4102,44 +3881,44 @@ GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (5)].TypeVal); + delete (yyvsp[-4].TypeVal); CHECK_FOR_ERROR ;} break; case 150: -#line 1580 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1580 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'!"); + (*(yyvsp[-1].TypeVal))->getDescription() + "'!"); (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[(1) - (2)].TypeVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 151: -#line 1592 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1592 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); - delete (yyvsp[(1) - (2)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 152: -#line 1599 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1599 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type!"); @@ -4153,7 +3932,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getValNonImprovising(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getValNonImprovising(Ty, (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4168,16 +3947,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[(2) - (2)].ValIDVal).destroy(); + (yyvsp[0].ValIDVal).destroy(); } else { std::string Name; - if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[(2) - (2)].ValIDVal).Name; - else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) + if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[0].ValIDVal).Name; + else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4193,261 +3972,261 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV)); V = GV; } } (yyval.ConstVal) = cast(V); - delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle + delete (yyvsp[-1].TypeVal); // Free the type handle CHECK_FOR_ERROR ;} break; case 153: -#line 1665 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1665 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); - delete (yyvsp[(1) - (2)].TypeVal); + (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription()); + (yyval.ConstVal) = (yyvsp[0].ConstVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 154: -#line 1675 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1675 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[(1) - (2)].TypeVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 155: -#line 1685 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1685 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)); CHECK_FOR_ERROR ;} break; case 156: -#line 1691 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1691 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; case 157: -#line 1697 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1697 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); CHECK_FOR_ERROR ;} break; case 158: -#line 1702 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1702 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); CHECK_FOR_ERROR ;} break; case 159: -#line 1707 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1707 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) + if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type!!"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); + (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; case 160: -#line 1715 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1715 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - Constant *Val = (yyvsp[(3) - (6)].ConstVal); - const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + Constant *Val = (yyvsp[-3].ConstVal); + const Type *DestTy = (yyvsp[-1].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'!"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); - delete (yyvsp[(5) - (6)].TypeVal); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy); + delete (yyvsp[-1].TypeVal); ;} break; case 161: -#line 1727 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1727 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) + if (!isa((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), *(yyvsp[(4) - (5)].ValueList), true); + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); std::vector IdxVec; - for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants!"); - delete (yyvsp[(4) - (5)].ValueList); + delete (yyvsp[-1].ValueList); - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), IdxVec); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec); CHECK_FOR_ERROR ;} break; case 162: -#line 1748 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1748 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) + if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type!"); - if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Select operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 163: -#line 1756 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1756 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Binary operator types must match!"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 164: -#line 1762 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1762 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match!"); - if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { - if (!isa((yyvsp[(3) - (6)].ConstVal)->getType()) || - !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) { + if (!isa((yyvsp[-3].ConstVal)->getType()) || + !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 165: -#line 1773 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("icmp operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 166: -#line 1778 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1778 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 167: -#line 1783 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1783 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(5) - (6)].ConstVal)->getType() != Type::Int8Ty) + if ((yyvsp[-1].ConstVal)->getType() != Type::Int8Ty) GEN_ERROR("Shift count for shift constant must be i8 type!"); - if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 168: -#line 1792 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1792 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands!"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 169: -#line 1798 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1798 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands!"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 170: -#line 1804 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 171: -#line 1813 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1813 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); + ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 172: -#line 1817 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1817 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 173: -#line 1825 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 174: -#line 1825 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 175: -#line 1836 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1836 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4456,7 +4235,7 @@ break; case 176: -#line 1841 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1841 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4465,12 +4244,12 @@ break; case 179: -#line 1854 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 180: -#line 1854 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -4478,26 +4257,26 @@ break; case 181: -#line 1858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 182: -#line 1858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 183: -#line 1861 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1861 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 184: -#line 1864 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1864 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { @@ -4513,10 +4292,10 @@ break; case 185: -#line 1876 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1876 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4526,84 +4305,84 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); + ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); - if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); + CurModule.Types.push_back(*(yyvsp[0].TypeVal)); } - delete (yyvsp[(3) - (3)].TypeVal); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 186: -#line 1900 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1900 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); - if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); + CurModule.Types.push_back((yyvsp[0].PrimType)); } CHECK_FOR_ERROR ;} break; case 187: -#line 1911 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1911 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ - if ((yyvsp[(4) - (4)].ConstVal) == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (4)].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[(2) - (4)].Visibility), (yyvsp[(3) - (4)].BoolVal), (yyvsp[(4) - (4)].ConstVal)->getType(), (yyvsp[(4) - (4)].ConstVal)); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 188: -#line 1918 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1918 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 189: -#line 1921 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(5) - (5)].ConstVal) == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal)); + CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 190: -#line 1926 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1926 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 191: -#line 1929 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1929 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (5)].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), *(yyvsp[(5) - (5)].TypeVal), 0); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); CHECK_FOR_ERROR - delete (yyvsp[(5) - (5)].TypeVal); + delete (yyvsp[0].TypeVal); ;} break; case 192: -#line 1935 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4611,26 +4390,26 @@ break; case 193: -#line 1939 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1939 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 194: -#line 1942 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1942 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 195: -#line 1948 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); - std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); - free((yyvsp[(1) - (1)].StrVal)); + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string NewAsm((yyvsp[0].StrVal), EndStr); + free((yyvsp[0].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); @@ -4641,68 +4420,68 @@ break; case 196: -#line 1961 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1961 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); ;} break; case 197: -#line 1965 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1965 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); ;} break; case 199: -#line 1972 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1972 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 200: -#line 1977 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1977 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 201: -#line 1982 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1982 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 202: -#line 1991 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 1991 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); - (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); - (yyvsp[(1) - (5)].ArgList)->push_back(E); + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); + (yyval.ArgList) = (yyvsp[-4].ArgList); + (yyvsp[-4].ArgList)->push_back(E); CHECK_FOR_ERROR ;} break; case 203: -#line 2001 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2001 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); (yyval.ArgList) = new ArgListType; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR @@ -4710,17 +4489,17 @@ break; case 204: -#line 2012 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2012 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR ;} break; case 205: -#line 2016 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2016 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + (yyval.ArgList) = (yyvsp[-2].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; @@ -4731,7 +4510,7 @@ break; case 206: -#line 2025 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -4744,7 +4523,7 @@ break; case 207: -#line 2034 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2034 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -4752,22 +4531,22 @@ break; case 208: -#line 2040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); - std::string FunctionName((yyvsp[(3) - (9)].StrVal)); - free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory! + UnEscapeLexed((yyvsp[-6].StrVal)); + std::string FunctionName((yyvsp[-6].StrVal)); + free((yyvsp[-6].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) - (9)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[-7].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); std::vector ParamTypeList; std::vector ParamAttrs; - ParamAttrs.push_back((yyvsp[(7) - (9)].ParamAttrs)); - if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I) { + ParamAttrs.push_back((yyvsp[-2].ParamAttrs)); + if ((yyvsp[-4].ArgList)) { // If there are arguments... + for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4780,10 +4559,10 @@ bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[(2) - (9)].TypeVal); + delete (yyvsp[-7].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4804,11 +4583,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); @@ -4828,24 +4607,24 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); - Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); - if ((yyvsp[(8) - (9)].StrVal)) { - Fn->setSection((yyvsp[(8) - (9)].StrVal)); - free((yyvsp[(8) - (9)].StrVal)); + Fn->setCallingConv((yyvsp[-8].UIntVal)); + Fn->setAlignment((yyvsp[0].UIntVal)); + if ((yyvsp[-1].StrVal)) { + Fn->setSection((yyvsp[-1].StrVal)); + free((yyvsp[-1].StrVal)); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... + if ((yyvsp[-4].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0&& + assert((yyvsp[-4].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[-4].ArgList)->back().Name == 0&& "Not a varargs marker!"); - delete (yyvsp[(5) - (9)].ArgList)->back().Ty; - (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry + delete (yyvsp[-4].ArgList)->back().Ty; + (yyvsp[-4].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4853,37 +4632,37 @@ Idx++; } - delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list + delete (yyvsp[-4].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR ;} break; case 211: -#line 2147 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2147 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); + (yyval.FunctionVal)->setLinkage((yyvsp[-3].Linkage)); + (yyval.FunctionVal)->setVisibility((yyvsp[-2].Visibility)); ;} break; case 214: -#line 2158 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2158 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 215: -#line 2163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2163 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); + CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); + CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -4891,7 +4670,7 @@ break; case 216: -#line 2175 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2175 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4899,7 +4678,7 @@ break; case 217: -#line 2179 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2179 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4907,31 +4686,31 @@ break; case 218: -#line 2184 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2184 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR ;} break; case 219: -#line 2188 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2188 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; case 220: -#line 2192 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; case 221: -#line 2196 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2196 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -4939,7 +4718,7 @@ break; case 222: -#line 2200 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2200 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -4947,7 +4726,7 @@ break; case 223: -#line 2204 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -4955,7 +4734,7 @@ break; case 224: -#line 2208 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2208 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -4963,7 +4742,7 @@ break; case 225: -#line 2212 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2212 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -4971,10 +4750,10 @@ break; case 226: -#line 2216 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2216 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); - int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); + int NumElements = (yyvsp[-1].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -4986,129 +4765,129 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[(2) - (3)].ConstVector))); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector))); + delete PTy; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 227: -#line 2241 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2241 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 228: -#line 2245 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2245 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); - std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); - End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); - std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); - free((yyvsp[(3) - (5)].StrVal)); - free((yyvsp[(5) - (5)].StrVal)); + char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); + std::string AsmStr = std::string((yyvsp[-2].StrVal), End); + End = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string Constraints = std::string((yyvsp[0].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); + free((yyvsp[-2].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 229: -#line 2259 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2259 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR ;} break; case 230: -#line 2263 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2263 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR ;} break; case 231: -#line 2267 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2267 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); + (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 232: -#line 2271 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2271 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); + (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 235: -#line 2283 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2283 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); - delete (yyvsp[(1) - (2)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 236: -#line 2292 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2292 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 237: -#line 2296 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2296 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 238: -#line 2305 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2305 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); + setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR - InsertValue((yyvsp[(3) - (3)].TermInstVal)); + InsertValue((yyvsp[0].TermInstVal)); - (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); - InsertValue((yyvsp[(1) - (3)].BasicBlockVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); + InsertValue((yyvsp[-2].BasicBlockVal)); + (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); CHECK_FOR_ERROR ;} break; case 239: -#line 2316 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2316 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) + if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) if (CI2->getParent() == 0) - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); + (yyvsp[-1].BasicBlockVal)->getInstList().push_back(CI2); + (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); + (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); CHECK_FOR_ERROR ;} break; case 240: -#line 2325 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2325 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); CHECK_FOR_ERROR @@ -5124,9 +4903,9 @@ break; case 241: -#line 2337 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2337 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.BasicBlockVal) = getBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal)), true); + (yyval.BasicBlockVal) = getBBVal(ValID::createLocalName((yyvsp[0].StrVal)), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -5140,15 +4919,15 @@ break; case 242: -#line 2350 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2350 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); + (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 243: -#line 2354 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2354 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR @@ -5156,57 +4935,57 @@ break; case 244: -#line 2358 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2358 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBB); ;} break; case 245: -#line 2363 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2363 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); ;} break; case 246: -#line 2373 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2373 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size()); (yyval.TermInstVal) = S; - std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), - E = (yyvsp[(8) - (9)].JumpTable)->end(); + std::vector >::iterator I = (yyvsp[-1].JumpTable)->begin(), + E = (yyvsp[-1].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer!"); } - delete (yyvsp[(8) - (9)].JumpTable); + delete (yyvsp[-1].JumpTable); CHECK_FOR_ERROR ;} break; case 247: -#line 2392 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2392 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); (yyval.TermInstVal) = S; @@ -5215,19 +4994,19 @@ break; case 248: -#line 2402 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2402 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || + if (!(PFTy = dyn_cast((yyvsp[-11].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[(8) - (14)].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back((yyvsp[-6].ParamAttrs)); + for (ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5235,20 +5014,20 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-10].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); + BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); + BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (14)].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[-8].ValueRefList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5258,7 +5037,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[-8].ValueRefList)->begin(), ArgE = (yyvsp[-8].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5277,15 +5056,15 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, Args); - II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); + II->setCallingConv((yyvsp[-12].UIntVal)); (yyval.TermInstVal) = II; - delete (yyvsp[(6) - (14)].ValueRefList); + delete (yyvsp[-8].ValueRefList); CHECK_FOR_ERROR ;} break; case 249: -#line 2468 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2468 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -5293,7 +5072,7 @@ break; case 250: -#line 2472 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2472 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -5301,120 +5080,120 @@ break; case 251: -#line 2479 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2479 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getValNonImprovising((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); + (yyval.JumpTable) = (yyvsp[-5].JumpTable); + Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); ;} break; case 252: -#line 2490 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2490 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getValNonImprovising((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); + Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); ;} break; case 253: -#line 2503 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2503 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... - setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); + setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR - InsertValue((yyvsp[(2) - (2)].InstVal)); - (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); + InsertValue((yyvsp[0].InstVal)); + (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR ;} break; case 254: -#line 2512 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2512 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[(1) - (6)].TypeVal); + delete (yyvsp[-5].TypeVal); ;} break; case 255: -#line 2523 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2523 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); - Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); + (yyval.PHIList) = (yyvsp[-6].PHIList); + Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + (yyvsp[-6].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); ;} break; case 256: -#line 2533 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2533 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); // Used for call and invoke instructions (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); + ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); (yyval.ValueRefList)->push_back(E); ;} break; case 257: -#line 2541 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2541 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + (yyval.ValueRefList) = (yyvsp[-4].ValueRefList); + ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); (yyval.ValueRefList)->push_back(E); CHECK_FOR_ERROR ;} break; case 258: -#line 2549 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2549 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueRefList) = new ValueRefList(); ;} break; case 259: -#line 2552 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2552 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 260: -#line 2553 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2553 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + (yyval.ValueList) = (yyvsp[-2].ValueList); + (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 261: -#line 2560 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2560 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5422,7 +5201,7 @@ break; case 262: -#line 2564 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2564 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5430,200 +5209,200 @@ break; case 263: -#line 2569 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2569 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && + !isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && - ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) + if (isa((*(yyvsp[-3].TypeVal)).get()) && + ((yyvsp[-4].BinaryOpVal) == Instruction::URem || + (yyvsp[-4].BinaryOpVal) == Instruction::SRem || + (yyvsp[-4].BinaryOpVal) == Instruction::FRem)) GEN_ERROR("U/S/FRem not supported on packed types!"); - Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[(2) - (5)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 264: -#line 2590 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2590 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { - if (!isa((yyvsp[(2) - (5)].TypeVal)->get()) || - !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (!(*(yyvsp[-3].TypeVal))->isInteger()) { + if (!isa((yyvsp[-3].TypeVal)->get()) || + !cast((yyvsp[-3].TypeVal)->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } - Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[(2) - (5)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 265: -#line 2607 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2607 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR("Packed types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("icmp operator returned null!"); ;} break; case 266: -#line 2620 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2620 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR("Packed types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("fcmp operator returned null!"); ;} break; case 267: -#line 2633 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2633 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(4) - (4)].ValueVal)->getType() != Type::Int8Ty) + if ((yyvsp[0].ValueVal)->getType() != Type::Int8Ty) GEN_ERROR("Shift amount must be i8 type!"); - if (!(yyvsp[(2) - (4)].ValueVal)->getType()->isInteger()) + if (!(yyvsp[-2].ValueVal)->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; - (yyval.InstVal) = new ShiftInst((yyvsp[(1) - (4)].OtherOpVal), (yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); + (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 268: -#line 2642 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - Value* Val = (yyvsp[(2) - (4)].ValueVal); - const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + Value* Val = (yyvsp[-2].ValueVal); + const Type* DestTy = (yyvsp[0].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[-3].CastOpVal), Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'!"); - (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); - delete (yyvsp[(4) - (4)].TypeVal); + (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), Val, DestTy); + delete (yyvsp[0].TypeVal); ;} break; case 269: -#line 2654 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2654 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) + if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean!"); - if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) + if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) GEN_ERROR("select value types should match!"); - (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 270: -#line 2662 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2662 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); - delete (yyvsp[(4) - (4)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 271: -#line 2669 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2669 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid extractelement operands!"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); + (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 272: -#line 2675 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2675 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid insertelement operands!"); - (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 273: -#line 2681 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2681 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 274: -#line 2687 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2687 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); + const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type!"); (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); - while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { - if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) + ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[0].PHIList)->size()); + while ((yyvsp[0].PHIList)->begin() != (yyvsp[0].PHIList)->end()) { + if ((yyvsp[0].PHIList)->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type!"); - cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); - (yyvsp[(2) - (2)].PHIList)->pop_front(); + cast((yyval.InstVal))->addIncoming((yyvsp[0].PHIList)->front().first, (yyvsp[0].PHIList)->front().second); + (yyvsp[0].PHIList)->pop_front(); } - delete (yyvsp[(2) - (2)].PHIList); // Free the list... + delete (yyvsp[0].PHIList); // Free the list... CHECK_FOR_ERROR ;} break; case 275: -#line 2703 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2703 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || + if (!(PFTy = dyn_cast((yyvsp[-5].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[(8) - (8)].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back((yyvsp[0].ParamAttrs)); + for (ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5631,16 +5410,16 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-4].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (8)].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[-2].ValueRefList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5651,7 +5430,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[-2].ValueRefList)->begin(), ArgE = (yyvsp[-2].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5668,25 +5447,25 @@ } // Create the call node CallInst *CI = new CallInst(V, Args); - CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); - CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); + CI->setTailCall((yyvsp[-7].BoolVal)); + CI->setCallingConv((yyvsp[-6].UIntVal)); (yyval.InstVal) = CI; - delete (yyvsp[(6) - (8)].ValueRefList); - delete (yyvsp[(3) - (8)].TypeVal); + delete (yyvsp[-2].ValueRefList); + delete (yyvsp[-5].TypeVal); CHECK_FOR_ERROR ;} break; case 276: -#line 2766 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2766 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR ;} break; case 277: -#line 2771 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2771 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5694,7 +5473,7 @@ break; case 278: -#line 2775 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2775 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5702,129 +5481,131 @@ break; case 279: -#line 2782 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2782 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 280: -#line 2789 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2789 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); + (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; case 281: -#line 2797 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2797 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 282: -#line 2804 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); + (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; case 283: -#line 2812 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2812 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) + if (!isa((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "!"); - (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); + (yyvsp[0].ValueVal)->getType()->getDescription() + "!"); + (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 284: -#line 2820 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2820 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(3) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!isa((yyvsp[-1].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!cast((yyvsp[(3) - (4)].TypeVal)->get())->getElementType()->isFirstClassType()) + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[(3) - (4)].TypeVal), (yyvsp[(4) - (4)].ValIDVal)); + (*(yyvsp[-1].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); - delete (yyvsp[(3) - (4)].TypeVal); + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); + delete (yyvsp[-1].TypeVal); ;} break; case 285: -#line 2834 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2834 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[(5) - (6)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + (*(yyvsp[-1].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[(3) - (6)].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[(3) - (6)].ValueVal)->getType()->getDescription() + + if (ElTy != (yyvsp[-3].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); - Value* tmpVal = getVal(*(yyvsp[(5) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[(3) - (6)].ValueVal), tmpVal, (yyvsp[(1) - (6)].BoolVal)); - delete (yyvsp[(5) - (6)].TypeVal); + (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); + delete (yyvsp[-1].TypeVal); ;} break; case 286: -#line 2851 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2851 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (!isa((yyvsp[-2].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), *(yyvsp[(4) - (4)].ValueList), true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), *(yyvsp[0].ValueList), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'!"); - Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); + (*(yyvsp[-2].TypeVal))->getDescription()+ "'!"); + Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[(4) - (4)].ValueList)); - delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); + (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[0].ValueList)); + delete (yyvsp[-2].TypeVal); + delete (yyvsp[0].ValueList); ;} break; -/* Line 1267 of yacc.c. */ -#line 5822 "llvmAsmParser.tab.c" default: break; } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - YYPOPSTACK (yylen); - yylen = 0; +/* Line 1126 of yacc.c. */ +#line 5604 "llvmAsmParser.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -5853,41 +5634,110 @@ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; } - } - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + { + yyerror (YY_("syntax error")); goto yyexhaustedlab; - } - } -#endif + } + } + else +#endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); } @@ -5898,15 +5748,14 @@ error, discard it. */ if (yychar <= YYEOF) - { + { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; - } + } else { - yydestruct ("Error: discarding", - yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } @@ -5924,14 +5773,11 @@ /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ - if (/*CONSTCOND*/ 0) + if (0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +yyvsp -= yylen; + yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -5961,9 +5807,8 @@ YYABORT; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -5974,7 +5819,7 @@ *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -6009,30 +5854,21 @@ if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); - YYPOPSTACK (1); + YYPOPSTACK; } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } -#line 2868 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 2868 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.47 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.48 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.47 Sun Jan 28 07:37:39 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Tue Jan 30 14:08:37 2007 @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,18 +18,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -304,10 +294,9 @@ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" -{ +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -351,10 +340,9 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 1489 of yacc.c. */ -#line 357 "llvmAsmParser.tab.h" - YYSTYPE; +} YYSTYPE; +/* Line 1447 of yacc.c. */ +#line 346 "llvmAsmParser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -362,3 +350,5 @@ extern YYSTYPE llvmAsmlval; + + Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.314 llvm/lib/AsmParser/llvmAsmParser.y:1.315 --- llvm/lib/AsmParser/llvmAsmParser.y:1.314 Sun Jan 28 07:31:35 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Jan 30 14:08:37 2007 @@ -2088,11 +2088,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.60 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.61 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.60 Sun Jan 28 07:31:35 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Tue Jan 30 14:08:37 2007 @@ -2088,11 +2088,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); From reid at x10sys.com Tue Jan 30 14:10:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasDebugger.cpp BasicAliasAnalysis.cpp ProfileInfoLoader.cpp Message-ID: <200701302010.l0UKA4aG019327@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasDebugger.cpp updated: 1.1 -> 1.2 BasicAliasAnalysis.cpp updated: 1.101 -> 1.102 ProfileInfoLoader.cpp updated: 1.10 -> 1.11 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+3 -3) AliasDebugger.cpp | 2 +- BasicAliasAnalysis.cpp | 2 +- ProfileInfoLoader.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/AliasDebugger.cpp diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.1 llvm/lib/Analysis/AliasDebugger.cpp:1.2 --- llvm/lib/Analysis/AliasDebugger.cpp:1.1 Mon Nov 13 23:20:28 2006 +++ llvm/lib/Analysis/AliasDebugger.cpp Tue Jan 30 14:08:36 2007 @@ -48,7 +48,7 @@ for(Module::iterator I = M.begin(), E = M.end(); I != E; ++I){ Vals.insert(&*I); - if(!I->isExternal()) { + if(!I->isDeclaration()) { for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end(); AI != AE; ++AI) Vals.insert(&*AI); Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.101 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.102 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.101 Sat Jan 13 23:57:53 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue Jan 30 14:08:36 2007 @@ -823,7 +823,7 @@ AliasAnalysis::ModRefBehavior BasicAliasAnalysis::getModRefBehavior(Function *F, CallSite CS, std::vector *Info) { - if (!F->isExternal()) return UnknownModRefBehavior; + if (!F->isDeclaration()) return UnknownModRefBehavior; static bool Initialized = false; if (!Initialized) { Index: llvm/lib/Analysis/ProfileInfoLoader.cpp diff -u llvm/lib/Analysis/ProfileInfoLoader.cpp:1.10 llvm/lib/Analysis/ProfileInfoLoader.cpp:1.11 --- llvm/lib/Analysis/ProfileInfoLoader.cpp:1.10 Wed Dec 6 19:30:31 2006 +++ llvm/lib/Analysis/ProfileInfoLoader.cpp Tue Jan 30 14:08:36 2007 @@ -164,7 +164,7 @@ unsigned Counter = 0; for (Module::iterator I = M.begin(), E = M.end(); I != E && Counter != FunctionCounts.size(); ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) Counts.push_back(std::make_pair(I, FunctionCounts[Counter++])); } From reid at x10sys.com Tue Jan 30 14:10:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h GlobalValue.h GlobalVariable.h Message-ID: <200701302010.l0UKA4l8019336@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Function.h updated: 1.70 -> 1.71 GlobalValue.h updated: 1.31 -> 1.32 GlobalVariable.h updated: 1.38 -> 1.39 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+12 -13) Function.h | 8 ++++---- GlobalValue.h | 6 +++--- GlobalVariable.h | 11 +++++------ 3 files changed, 12 insertions(+), 13 deletions(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.70 llvm/include/llvm/Function.h:1.71 --- llvm/include/llvm/Function.h:1.70 Fri Jan 26 02:01:30 2007 +++ llvm/include/llvm/Function.h Tue Jan 30 14:08:38 2007 @@ -89,11 +89,11 @@ /// arguments. bool isVarArg() const; - /// isExternal - Is the body of this function unknown? (The basic block list - /// is empty if so.) This is true for external functions, defined as forward - /// "declare"ations + /// isDeclaration - Is the body of this function unknown? (The basic block + /// list is empty if so.) This is true for function declarations, but not + /// true for function definitions. /// - virtual bool isExternal() const { return BasicBlocks.empty(); } + virtual bool isDeclaration() const { return BasicBlocks.empty(); } /// getIntrinsicID - This method returns the ID number of the specified /// function, or Intrinsic::not_intrinsic if the function is not an Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.31 llvm/include/llvm/GlobalValue.h:1.32 --- llvm/include/llvm/GlobalValue.h:1.31 Fri Jan 26 22:42:50 2007 +++ llvm/include/llvm/GlobalValue.h Tue Jan 30 14:08:38 2007 @@ -113,9 +113,9 @@ /// Override from Constant class. virtual void destroyConstant(); - /// isExternal - Return true if the primary definition of this global value is - /// outside of the current translation unit... - virtual bool isExternal() const = 0; + /// isDeclaration - Return true if the primary definition of this global + /// value is outside of the current translation unit... + virtual bool isDeclaration() const = 0; /// getParent - Get the module that this global value is contained inside /// of... Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.38 llvm/include/llvm/GlobalVariable.h:1.39 --- llvm/include/llvm/GlobalVariable.h:1.38 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/GlobalVariable.h Tue Jan 30 14:08:38 2007 @@ -58,17 +58,16 @@ Constant *Initializer, const std::string &Name, GlobalVariable *InsertBefore); - /// isExternal - Is this global variable lacking an initializer? If so, the - /// global variable is defined in some other translation unit, and is thus - /// externally defined here. - /// - virtual bool isExternal() const { return getNumOperands() == 0; } + /// isDeclaration - Is this global variable lacking an initializer? If so, + /// the global variable is defined in some other translation unit, and is thus + /// only a declaration here. + virtual bool isDeclaration() const { return getNumOperands() == 0; } /// hasInitializer - Unless a global variable isExternal(), it has an /// initializer. The initializer for the global variable/constant is held by /// Initializer if an initializer is specified. /// - inline bool hasInitializer() const { return !isExternal(); } + inline bool hasInitializer() const { return !isDeclaration(); } /// getInitializer - Return the initializer for this global variable. It is /// illegal to call this method if the global is external, because we cannot From reid at x10sys.com Tue Jan 30 14:10:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp ExtractFunction.cpp FunctionResolution.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp Inliner.cpp Internalize.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp Message-ID: <200701302010.l0UKA5a5019377@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadArgumentElimination.cpp updated: 1.35 -> 1.36 ExtractFunction.cpp updated: 1.16 -> 1.17 FunctionResolution.cpp updated: 1.65 -> 1.66 GlobalDCE.cpp updated: 1.40 -> 1.41 GlobalOpt.cpp updated: 1.88 -> 1.89 IPConstantPropagation.cpp updated: 1.21 -> 1.22 IndMemRemoval.cpp updated: 1.11 -> 1.12 Inliner.cpp updated: 1.35 -> 1.36 Internalize.cpp updated: 1.41 -> 1.42 PruneEH.cpp updated: 1.27 -> 1.28 RaiseAllocations.cpp updated: 1.35 -> 1.36 SimplifyLibCalls.cpp updated: 1.89 -> 1.90 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+30 -30) DeadArgumentElimination.cpp | 2 +- ExtractFunction.cpp | 4 ++-- FunctionResolution.cpp | 18 +++++++++--------- GlobalDCE.cpp | 6 +++--- GlobalOpt.cpp | 4 ++-- IPConstantPropagation.cpp | 2 +- IndMemRemoval.cpp | 4 ++-- Inliner.cpp | 4 ++-- Internalize.cpp | 6 +++--- PruneEH.cpp | 4 ++-- RaiseAllocations.cpp | 4 ++-- SimplifyLibCalls.cpp | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.35 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.36 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.35 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jan 30 14:08:38 2007 @@ -114,7 +114,7 @@ /// llvm.vastart is never called, the varargs list is dead for the function. bool DAE::DeleteDeadVarargs(Function &Fn) { assert(Fn.getFunctionType()->isVarArg() && "Function isn't varargs!"); - if (Fn.isExternal() || !Fn.hasInternalLinkage()) return false; + if (Fn.isDeclaration() || !Fn.hasInternalLinkage()) return false; // Ensure that the function is only directly called. for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); I != E; ++I) { Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.16 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.17 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.16 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Tue Jan 30 14:08:38 2007 @@ -63,7 +63,7 @@ Named->setLinkage(GlobalValue::ExternalLinkage); Named->deleteBody(); - assert(Named->isExternal() && "This didn't make the function external!"); + assert(Named->isDeclaration() && "This didn't make the function external!"); return true; } @@ -73,7 +73,7 @@ // Mark all global variables internal for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { I->setInitializer(0); // Make all variables external I->setLinkage(GlobalValue::ExternalLinkage); } Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.65 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.66 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.65 Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Tue Jan 30 14:08:38 2007 @@ -174,13 +174,13 @@ // to 'int (int)' or 'int ()' or whatever else is not completely generic. // Function *F = cast(Globals[i]); - if (!F->isExternal()) { - if (Concrete && !Concrete->isExternal()) + if (!F->isDeclaration()) { + if (Concrete && !Concrete->isDeclaration()) return false; // Found two different functions types. Can't choose! Concrete = Globals[i]; } else if (Concrete) { - if (Concrete->isExternal()) // If we have multiple external symbols... + if (Concrete->isDeclaration()) // If we have multiple external symbols... if (F->getFunctionType()->getNumParams() > cast(Concrete)->getFunctionType()->getNumParams()) Concrete = F; // We are more concrete than "Concrete"! @@ -190,7 +190,7 @@ } } else { GlobalVariable *GV = cast(Globals[i]); - if (!GV->isExternal()) { + if (!GV->isDeclaration()) { if (Concrete) { cerr << "WARNING: Two global variables with external linkage" << " exist with the same name: '" << GV->getName() @@ -211,7 +211,7 @@ unsigned NumInstancesWithExternalLinkage = 0; for (unsigned i = 0, e = Globals.size(); i != e; ++i) { - if (Globals[i]->isExternal()) + if (Globals[i]->isDeclaration()) HasExternal = true; else if (!Globals[i]->hasInternalLinkage()) NumInstancesWithExternalLinkage++; @@ -306,7 +306,7 @@ bool Changed = false; for (Module::iterator I = M.begin(), E = M.end(); I != E; ) { Function *F = I++; - if (F->use_empty() && F->isExternal()) { + if (F->use_empty() && F->isDeclaration()) { M.getFunctionList().erase(F); Changed = true; } else if (!F->hasInternalLinkage() && !F->getName().empty() && @@ -317,7 +317,7 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) { GlobalVariable *GV = I++; - if (GV->use_empty() && GV->isExternal()) { + if (GV->use_empty() && GV->isDeclaration()) { M.getGlobalList().erase(GV); Changed = true; } else if (!GV->hasInternalLinkage() && !GV->getName().empty()) @@ -337,7 +337,7 @@ // dead. If so, remove them now. for (Module::iterator I = M.begin(), E = M.end(); I != E; ) - if (I->isExternal() && I->use_empty()) { + if (I->isDeclaration() && I->use_empty()) { Function *F = I; ++I; M.getFunctionList().erase(F); @@ -349,7 +349,7 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) - if (I->isExternal() && I->use_empty()) { + if (I->isDeclaration() && I->use_empty()) { GlobalVariable *GV = I; ++I; M.getGlobalList().erase(GV); Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.40 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.41 --- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.40 Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/GlobalDCE.cpp Tue Jan 30 14:08:38 2007 @@ -57,7 +57,7 @@ Changed |= RemoveUnusedGlobalValue(*I); // Functions with external linkage are needed if they have a body if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && - !I->isExternal()) + !I->isDeclaration()) GlobalIsNeeded(I); } @@ -66,7 +66,7 @@ // Externally visible & appending globals are needed, if they have an // initializer. if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && - !I->isExternal()) + !I->isDeclaration()) GlobalIsNeeded(I); } @@ -89,7 +89,7 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!AliveGlobals.count(I)) { DeadFunctions.push_back(I); // Keep track of dead globals - if (!I->isExternal()) + if (!I->isDeclaration()) I->deleteBody(); } Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.88 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.89 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.88 Sat Jan 20 18:29:25 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 30 14:08:38 2007 @@ -1553,7 +1553,7 @@ if (GlobalVariable *GV = dyn_cast(C)) { if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage()) return false; // do not allow weak/linkonce/dllimport/dllexport linkage. - return !GV->isExternal(); // reject external globals. + return !GV->isDeclaration(); // reject external globals. } if (ConstantExpr *CE = dyn_cast(C)) // Handle a constantexpr gep. @@ -1773,7 +1773,7 @@ for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i) Formals.push_back(getVal(Values, CI->getOperand(i))); - if (Callee->isExternal()) { + if (Callee->isDeclaration()) { // If this is a function we can constant fold, do it. if (Constant *C = ConstantFoldCall(Callee, Formals)) { InstResult = C; Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.21 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.22 --- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.21 Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Tue Jan 30 14:08:38 2007 @@ -51,7 +51,7 @@ while (LocalChange) { LocalChange = false; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Delete any klingons. I->removeDeadConstantUsers(); if (I->hasInternalLinkage()) Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.11 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.12 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.11 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Tue Jan 30 14:08:38 2007 @@ -45,7 +45,7 @@ //happen through intrinsics. bool changed = false; if (Function* F = M.getNamedFunction("free")) { - assert(F->isExternal() && "free not external?"); + assert(F->isDeclaration() && "free not external?"); if (!F->use_empty()) { Function* FN = new Function(F->getFunctionType(), GlobalValue::LinkOnceLinkage, @@ -60,7 +60,7 @@ } } if (Function* F = M.getNamedFunction("malloc")) { - assert(F->isExternal() && "malloc not external?"); + assert(F->isDeclaration() && "malloc not external?"); if (!F->use_empty()) { Function* FN = new Function(F->getFunctionType(), GlobalValue::LinkOnceLinkage, Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.35 llvm/lib/Transforms/IPO/Inliner.cpp:1.36 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.35 Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/Inliner.cpp Tue Jan 30 14:08:38 2007 @@ -84,7 +84,7 @@ for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { CallSite CS = CallSite::get(I); if (CS.getInstruction() && (!CS.getCalledFunction() || - !CS.getCalledFunction()->isExternal())) + !CS.getCalledFunction()->isDeclaration())) CallSites.push_back(CS); } @@ -109,7 +109,7 @@ for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi) if (Function *Callee = CallSites[CSi].getCalledFunction()) { // Calls to external functions are never inlinable. - if (Callee->isExternal() || + if (Callee->isDeclaration() || CallSites[CSi].getInstruction()->getParent()->getParent() ==Callee){ if (SCC.size() == 1) { std::swap(CallSites[CSi], CallSites.back()); Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.41 llvm/lib/Transforms/IPO/Internalize.cpp:1.42 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.41 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Transforms/IPO/Internalize.cpp Tue Jan 30 14:08:38 2007 @@ -96,7 +96,7 @@ // if (ExternalNames.empty()) { Function *MainFunc = M.getMainFunction(); - if (MainFunc == 0 || MainFunc->isExternal()) + if (MainFunc == 0 || MainFunc->isDeclaration()) return false; // No main found, must be a library... // Preserve main, internalize all else. @@ -107,7 +107,7 @@ // Found a main function, mark all functions not named main as internal. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal() && // Function must be defined here + if (!I->isDeclaration() && // Function must be defined here !I->hasInternalLinkage() && // Can't already have internal linkage !ExternalNames.count(I->getName())) {// Not marked to keep external? I->setLinkage(GlobalValue::InternalLinkage); @@ -129,7 +129,7 @@ // Mark all global variables with initializers as internal as well. for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal() && !I->hasInternalLinkage() && + if (!I->isDeclaration() && !I->hasInternalLinkage() && !ExternalNames.count(I->getName())) { // Special case handling of the global ctor and dtor list. When we // internalize it, we mark it constant, which allows elimination of Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.27 llvm/lib/Transforms/IPO/PruneEH.cpp:1.28 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.27 Thu Jan 25 18:47:38 2007 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Tue Jan 30 14:08:38 2007 @@ -72,11 +72,11 @@ for (unsigned i = 0, e = SCC.size(); (!SCCMightUnwind || !SCCMightReturn) && i != e; ++i) { Function *F = SCC[i]->getFunction(); - if (F == 0 || (F->isExternal() && !F->getIntrinsicID())) { + if (F == 0 || (F->isDeclaration() && !F->getIntrinsicID())) { SCCMightUnwind = true; SCCMightReturn = true; } else { - if (F->isExternal()) + if (F->isDeclaration()) SCCMightReturn = true; // Check to see if this function performs an unwind or calls an Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.35 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.36 --- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.35 Sat Dec 30 23:48:39 2006 +++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp Tue Jan 30 14:08:38 2007 @@ -109,8 +109,8 @@ } // Don't mess with locally defined versions of these functions... - if (MallocFunc && !MallocFunc->isExternal()) MallocFunc = 0; - if (FreeFunc && !FreeFunc->isExternal()) FreeFunc = 0; + if (MallocFunc && !MallocFunc->isDeclaration()) MallocFunc = 0; + if (FreeFunc && !FreeFunc->isDeclaration()) FreeFunc = 0; } // run - Transform calls into instructions... Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.89 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.90 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.89 Sat Jan 20 04:07:23 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Tue Jan 30 14:08:38 2007 @@ -177,7 +177,7 @@ // because they live in a runtime library somewhere and were (probably) // not compiled by LLVM. So, we only act on external functions that // have external or dllimport linkage and non-empty uses. - if (!FI->isExternal() || + if (!FI->isDeclaration() || !(FI->hasExternalLinkage() || FI->hasDLLImportLinkage()) || FI->use_empty()) continue; From reid at x10sys.com Tue Jan 30 14:10:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:06 -0600 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200701302010.l0UKA6JC019372@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.141 -> 1.142 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) llc.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.141 llvm/tools/llc/llc.cpp:1.142 --- llvm/tools/llc/llc.cpp:1.141 Tue Dec 5 19:18:00 2006 +++ llvm/tools/llc/llc.cpp Tue Jan 30 14:08:38 2007 @@ -260,7 +260,7 @@ // Run our queue of passes all at once now, efficiently. // TODO: this could lazily stream functions out of the module. for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) Passes.run(*I); Passes.doFinalization(); From reid at x10sys.com Tue Jan 30 14:10:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:05 -0600 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200701302010.l0UKA5f0019343@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.31 -> 1.32 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+3 -3) lto.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.31 llvm/tools/lto/lto.cpp:1.32 --- llvm/tools/lto/lto.cpp:1.31 Sun Jan 21 00:34:18 2007 +++ llvm/tools/lto/lto.cpp Tue Jan 30 14:08:39 2007 @@ -164,7 +164,7 @@ LTOLinkageTypes lt = getLTOLinkageType(f); - if (!f->isExternal() && lt != LTOInternalLinkage + if (!f->isDeclaration() && lt != LTOInternalLinkage && strncmp (f->getName().c_str(), "llvm.", 5)) { int alignment = ( 16 > f->getAlignment() ? 16 : f->getAlignment()); LLVMSymbol *newSymbol = new LLVMSymbol(lt, f, f->getName(), @@ -186,7 +186,7 @@ for (Module::global_iterator v = m->global_begin(), e = m->global_end(); v != e; ++v) { LTOLinkageTypes lt = getLTOLinkageType(v); - if (!v->isExternal() && lt != LTOInternalLinkage + if (!v->isDeclaration() && lt != LTOInternalLinkage && strncmp (v->getName().c_str(), "llvm.", 5)) { const TargetData *TD = Target->getTargetData(); LLVMSymbol *newSymbol = new LLVMSymbol(lt, v, v->getName(), @@ -324,7 +324,7 @@ // Run the code generator, if present. CodeGenPasses->doInitialization(); for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) { - if (!I->isExternal()) + if (!I->isDeclaration()) CodeGenPasses->run(*I); } CodeGenPasses->doFinalization(); From reid at x10sys.com Tue Jan 30 14:10:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:05 -0600 Subject: [llvm-commits] CVS: llvm-stacker/lib/compiler/StackerCompiler.cpp Message-ID: <200701302010.l0UKA57M019370@zion.cs.uiuc.edu> Changes in directory llvm-stacker/lib/compiler: StackerCompiler.cpp updated: 1.30 -> 1.31 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) StackerCompiler.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-stacker/lib/compiler/StackerCompiler.cpp diff -u llvm-stacker/lib/compiler/StackerCompiler.cpp:1.30 llvm-stacker/lib/compiler/StackerCompiler.cpp:1.31 --- llvm-stacker/lib/compiler/StackerCompiler.cpp:1.30 Sun Jan 7 02:39:27 2007 +++ llvm-stacker/lib/compiler/StackerCompiler.cpp Tue Jan 30 14:08:39 2007 @@ -666,7 +666,7 @@ DefinitionType, GlobalValue::ExternalLinkage, name ); - assert( the_function->isExternal() ); + assert( the_function->isDeclaration() ); free( name ); return the_function; From reid at x10sys.com Tue Jan 30 14:10:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp Message-ID: <200701302010.l0UKA9cg019401@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.79 -> 1.80 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) AlphaISelLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.79 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.80 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.79 Mon Jan 29 16:58:52 2007 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jan 30 14:08:37 2007 @@ -427,7 +427,7 @@ GlobalValue *GV = GSDN->getGlobal(); SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset()); - // if (!GV->hasWeakLinkage() && !GV->isExternal() && !GV->hasLinkOnceLinkage()) { + // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { if (GV->hasInternalLinkage()) { SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA, DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200701302010.l0UKAAkN019434@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.101 -> 1.102 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+4 -4) ExecutionEngine.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.101 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.102 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.101 Fri Jan 19 15:13:56 2007 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Tue Jan 30 14:08:37 2007 @@ -194,7 +194,7 @@ // an old-style (llvmgcc3) static ctor with __main linked in and in use. If // this is the case, don't execute any of the global ctors, __main will do // it. - if (!GV || GV->isExternal() || GV->hasInternalLinkage()) continue; + if (!GV || GV->isDeclaration() || GV->hasInternalLinkage()) continue; // Should be an array of '{ int, void ()* }' structs. The first value is // the init priority, which we ignore. @@ -746,7 +746,7 @@ for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { const GlobalValue *GV = I; - if (GV->hasInternalLinkage() || GV->isExternal() || + if (GV->hasInternalLinkage() || GV->isDeclaration() || GV->hasAppendingLinkage() || !GV->hasName()) continue;// Ignore external globals and globals with internal linkage. @@ -791,7 +791,7 @@ } } - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Get the type of the global. const Type *Ty = I->getType()->getElementType(); @@ -829,7 +829,7 @@ // and initialize their contents. for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (!I->isExternal()) { + if (!I->isDeclaration()) { if (!LinkedGlobalsMap.empty()) { if (const GlobalValue *GVEntry = LinkedGlobalsMap[std::make_pair(I->getName(), I->getType())]) From reid at x10sys.com Tue Jan 30 14:10:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:06 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.y UpgradeParser.y.cvs Message-ID: <200701302010.l0UKA6To019389@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.52 -> 1.53 UpgradeParser.y updated: 1.53 -> 1.54 UpgradeParser.y.cvs updated: 1.51 -> 1.52 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+6 -6) UpgradeParser.cpp.cvs | 4 ++-- UpgradeParser.y | 4 ++-- UpgradeParser.y.cvs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.52 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.53 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.52 Mon Jan 29 13:08:46 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Tue Jan 30 14:08:38 2007 @@ -5113,11 +5113,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) error("Redefinition of function '" + FunctionName + "'"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.53 llvm/tools/llvm-upgrade/UpgradeParser.y:1.54 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.53 Mon Jan 29 13:07:18 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Tue Jan 30 14:08:39 2007 @@ -2619,11 +2619,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) error("Redefinition of function '" + FunctionName + "'"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.51 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.52 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.51 Mon Jan 29 13:08:46 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Tue Jan 30 14:08:39 2007 @@ -2619,11 +2619,11 @@ (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) { // If this is the case, either we need to be a forward decl, or it needs // to be. - if (!CurFun.isDeclare && !Fn->isExternal()) + if (!CurFun.isDeclare && !Fn->isDeclaration()) error("Redefinition of function '" + FunctionName + "'"); // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isExternal()) + if (Fn->isDeclaration()) for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); AI != AE; ++AI) AI->setName(""); From reid at x10sys.com Tue Jan 30 14:10:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200701302010.l0UKA9JL019396@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.165 -> 1.166 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+2 -2) Execution.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.165 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.166 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.165 Sat Jan 20 18:29:25 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Tue Jan 30 14:08:37 2007 @@ -1137,7 +1137,7 @@ // Check to see if this is an intrinsic function call... if (Function *F = CS.getCalledFunction()) - if (F->isExternal ()) + if (F->isDeclaration ()) switch (F->getIntrinsicID()) { case Intrinsic::not_intrinsic: break; @@ -1726,7 +1726,7 @@ StackFrame.CurFunction = F; // Special handling for external functions. - if (F->isExternal()) { + if (F->isDeclaration()) { GenericValue Result = callExternalFunction (F, ArgVals); // Simulate a 'ret' instruction of the appropriate type. popStackAndReturnValueToCaller (F->getReturnType (), Result); From reid at x10sys.com Tue Jan 30 14:10:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp JITEmitter.cpp Message-ID: <200701302010.l0UKA9RQ019411@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.cpp updated: 1.90 -> 1.91 JITEmitter.cpp updated: 1.128 -> 1.129 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+4 -4) JIT.cpp | 4 ++-- JITEmitter.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.90 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.91 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.90 Sat Jan 20 16:35:55 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Tue Jan 30 14:08:37 2007 @@ -291,7 +291,7 @@ } } - if (F->isExternal()) { + if (F->isDeclaration()) { void *Addr = getPointerToNamedFunction(F->getName()); addGlobalMapping(F, Addr); return Addr; @@ -314,7 +314,7 @@ if (Ptr) return Ptr; // If the global is external, just remember the address. - if (GV->isExternal()) { + if (GV->isDeclaration()) { #if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_4) && \ ((MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4) || \ (MAC_OS_X_VERSION_MIN_REQUIRED == MAC_OS_X_VERSION_10_4 && \ Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.128 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.129 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.128 Tue Jan 23 04:26:08 2007 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Jan 30 14:08:37 2007 @@ -543,7 +543,7 @@ // Call the lazy resolver function unless we already KNOW it is an external // function, in which case we just skip the lazy resolution step. void *Actual = (void*)(intptr_t)LazyResolverFn; - if (F->isExternal() && !F->hasNotBeenReadFromBytecode()) + if (F->isDeclaration() && !F->hasNotBeenReadFromBytecode()) Actual = TheJIT->getPointerToFunction(F); // Otherwise, codegen a new stub. For now, the stub will call the lazy @@ -746,7 +746,7 @@ void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F); if (ResultPtr) return ResultPtr; - if (F->isExternal() && !F->hasNotBeenReadFromBytecode()) { + if (F->isDeclaration() && !F->hasNotBeenReadFromBytecode()) { // If this is an external function pointer, we can force the JIT to // 'compile' it, which really just adds it to the map. if (DoesntNeedStub) From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp Message-ID: <200701302010.l0UKAARM019425@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64AsmPrinter.cpp updated: 1.42 -> 1.43 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+3 -3) IA64AsmPrinter.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.42 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.43 --- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.42 Wed Jan 24 01:03:39 2007 +++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Tue Jan 30 14:08:38 2007 @@ -193,17 +193,17 @@ bool Needfptr=false; // if we're computing an address @ltoff(X), do // we need to decorate it so it becomes // @ltoff(@fptr(X)) ? - if (F && !isBRCALLinsn /*&& F->isExternal()*/) + if (F && !isBRCALLinsn /*&& F->isDeclaration()*/) Needfptr=true; // if this is the target of a call instruction, we should define // the function somewhere (GNU gas has no problem without this, but // Intel ias rightly complains of an 'undefined symbol') - if (F /*&& isBRCALLinsn*/ && F->isExternal()) + if (F /*&& isBRCALLinsn*/ && F->isDeclaration()) ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal())); else - if (GV->isExternal()) // e.g. stuff like 'stdin' + if (GV->isDeclaration()) // e.g. stuff like 'stdin' ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal())); if (!isBRCALLinsn) From reid at x10sys.com Tue Jan 30 14:10:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp LinkModules.cpp Message-ID: <200701302010.l0UKA9mr019412@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkArchives.cpp updated: 1.54 -> 1.55 LinkModules.cpp updated: 1.129 -> 1.130 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+13 -13) LinkArchives.cpp | 6 +++--- LinkModules.cpp | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/lib/Linker/LinkArchives.cpp diff -u llvm/lib/Linker/LinkArchives.cpp:1.54 llvm/lib/Linker/LinkArchives.cpp:1.55 --- llvm/lib/Linker/LinkArchives.cpp:1.54 Sat Nov 11 14:27:49 2006 +++ llvm/lib/Linker/LinkArchives.cpp Tue Jan 30 14:08:37 2007 @@ -44,12 +44,12 @@ // This is needed for programs where the main function is defined in an // archive, such f2c'd programs. Function *Main = M->getMainFunction(); - if (Main == 0 || Main->isExternal()) + if (Main == 0 || Main->isDeclaration()) UndefinedSymbols.insert("main"); for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) if (I->hasName()) { - if (I->isExternal()) + if (I->isDeclaration()) UndefinedSymbols.insert(I->getName()); else if (!I->hasInternalLinkage()) { assert(!I->hasDLLImportLinkage() @@ -60,7 +60,7 @@ for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) if (I->hasName()) { - if (I->isExternal()) + if (I->isDeclaration()) UndefinedSymbols.insert(I->getName()); else if (!I->hasInternalLinkage()) { assert(!I->hasDLLImportLinkage() Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.129 llvm/lib/Linker/LinkModules.cpp:1.130 --- llvm/lib/Linker/LinkModules.cpp:1.129 Sun Jan 28 20:18:13 2007 +++ llvm/lib/Linker/LinkModules.cpp Tue Jan 30 14:08:37 2007 @@ -365,12 +365,12 @@ // Linking something to nothing. LinkFromSrc = true; LT = Src->getLinkage(); - } else if (Src->isExternal()) { + } else if (Src->isDeclaration()) { // If Src is external or if both Src & Drc are external.. Just link the // external globals, we aren't adding anything. if (Src->hasDLLImportLinkage()) { // If one of GVs has DLLImport linkage, result should be dllimport'ed. - if (Dest->isExternal()) { + if (Dest->isDeclaration()) { LinkFromSrc = true; LT = Src->getLinkage(); } @@ -382,7 +382,7 @@ LinkFromSrc = false; LT = Dest->getLinkage(); } - } else if (Dest->isExternal() && !Dest->hasDLLImportLinkage()) { + } else if (Dest->isDeclaration() && !Dest->hasDLLImportLinkage()) { // If Dest is external but Src is not: LinkFromSrc = true; LT = Src->getLinkage(); @@ -536,7 +536,7 @@ DGV->setInitializer(0); } else { if (SGV->isConstant() && !DGV->isConstant()) { - if (DGV->isExternal()) + if (DGV->isDeclaration()) DGV->setConstant(true); } SGV->setLinkage(GlobalValue::ExternalLinkage); @@ -637,18 +637,18 @@ // ... and remember this mapping... ValueMap.insert(std::make_pair(SF, NewDF)); - } else if (SF->isExternal()) { + } else if (SF->isDeclaration()) { // If SF is external or if both SF & DF are external.. Just link the // external functions, we aren't adding anything. if (SF->hasDLLImportLinkage()) { - if (DF->isExternal()) { + if (DF->isDeclaration()) { ValueMap.insert(std::make_pair(SF, DF)); DF->setLinkage(SF->getLinkage()); } } else { ValueMap.insert(std::make_pair(SF, DF)); } - } else if (DF->isExternal() && !DF->hasDLLImportLinkage()) { + } else if (DF->isDeclaration() && !DF->hasDLLImportLinkage()) { // If DF is external but SF is not... // Link the external functions, update linkage qualifiers ValueMap.insert(std::make_pair(SF, DF)); @@ -691,7 +691,7 @@ static bool LinkFunctionBody(Function *Dest, Function *Src, std::map &GlobalMap, std::string *Err) { - assert(Src && Dest && Dest->isExternal() && !Src->isExternal()); + assert(Src && Dest && Dest->isDeclaration() && !Src->isDeclaration()); // Go through and convert function arguments over, remembering the mapping. Function::arg_iterator DI = Dest->arg_begin(); @@ -737,11 +737,11 @@ // Loop over all of the functions in the src module, mapping them over as we // go for (Module::iterator SF = Src->begin(), E = Src->end(); SF != E; ++SF) { - if (!SF->isExternal()) { // No body if function is external + if (!SF->isDeclaration()) { // No body if function is external Function *DF = cast(ValueMap[SF]); // Destination function // DF not external SF external? - if (DF->isExternal()) { + if (DF->isDeclaration()) { // Only provide the function body if there isn't one already. if (LinkFunctionBody(DF, SF, ValueMap, Err)) return true; From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200701302010.l0UKAAo0019428@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.351 -> 1.352 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.351 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.352 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.351 Mon Jan 29 17:45:14 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Jan 30 14:08:37 2007 @@ -2107,7 +2107,7 @@ void SelectionDAGLowering::visitCall(CallInst &I) { const char *RenameFn = 0; if (Function *F = I.getCalledFunction()) { - if (F->isExternal()) + if (F->isDeclaration()) if (unsigned IID = F->getIntrinsicID()) { RenameFn = visitIntrinsicCall(I, IID); if (!RenameFn) From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp InlineFunction.cpp Message-ID: <200701302010.l0UKAARr019431@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneModule.cpp updated: 1.20 -> 1.21 InlineFunction.cpp updated: 1.49 -> 1.50 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+2 -2) CloneModule.cpp | 2 +- InlineFunction.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Utils/CloneModule.cpp diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.20 llvm/lib/Transforms/Utils/CloneModule.cpp:1.21 --- llvm/lib/Transforms/Utils/CloneModule.cpp:1.20 Fri Jan 26 02:11:39 2007 +++ llvm/lib/Transforms/Utils/CloneModule.cpp Tue Jan 30 14:08:38 2007 @@ -87,7 +87,7 @@ // for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) { Function *F = cast(ValueMap[I]); - if (!I->isExternal()) { + if (!I->isDeclaration()) { Function::arg_iterator DestI = F->arg_begin(); for (Function::const_arg_iterator J = I->arg_begin(); J != I->arg_end(); ++J) { Index: llvm/lib/Transforms/Utils/InlineFunction.cpp diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.49 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.50 --- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.49 Sun Jan 7 01:54:34 2007 +++ llvm/lib/Transforms/Utils/InlineFunction.cpp Tue Jan 30 14:08:38 2007 @@ -184,7 +184,7 @@ const Function *CalledFunc = CS.getCalledFunction(); if (CalledFunc == 0 || // Can't inline external function or indirect - CalledFunc->isExternal() || // call, or call to a vararg function! + CalledFunc->isDeclaration() || // call, or call to a vararg function! CalledFunc->getFunctionType()->isVarArg()) return false; From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelLowering.cpp Message-ID: <200701302010.l0UKAA5e019426@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.53 -> 1.54 ARMISelLowering.cpp updated: 1.6 -> 1.7 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+3 -3) ARMAsmPrinter.cpp | 2 +- ARMISelLowering.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.53 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.54 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.53 Tue Jan 30 02:04:53 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Tue Jan 30 14:08:37 2007 @@ -264,7 +264,7 @@ bool isCallOp = Modifier && !strcmp(Modifier, "call"); GlobalValue *GV = MO.getGlobal(); std::string Name = Mang->getValueName(GV); - bool isExt = (GV->isExternal() || GV->hasWeakLinkage() || + bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()); if (isExt && isCallOp && Subtarget->isTargetDarwin() && TM.getRelocationModel() != Reloc::Static) { Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.6 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.7 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.6 Mon Jan 29 16:58:52 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Jan 30 14:08:37 2007 @@ -467,7 +467,7 @@ GlobalValue *GV = G->getGlobal(); Callee = DAG.getTargetGlobalAddress(GV, getPointerTy()); isDirect = true; - bool isExt = (GV->isExternal() || GV->hasWeakLinkage() || + bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()); bool isStub = (isExt && Subtarget->isTargetDarwin()) && getTargetMachine().getRelocationModel() != Reloc::Static; @@ -632,7 +632,7 @@ /// even in dynamic-no-pic mode. static bool GVIsIndirectSymbol(GlobalValue *GV) { return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode())); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); } SDOperand ARMTargetLowering::LowerGlobalAddress(SDOperand Op, From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp GlobalsModRef.cpp Message-ID: <200701302010.l0UKAA18019462@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.42 -> 1.43 CallGraph.cpp updated: 1.63 -> 1.64 GlobalsModRef.cpp updated: 1.27 -> 1.28 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+7 -7) Andersens.cpp | 8 ++++---- CallGraph.cpp | 2 +- GlobalsModRef.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.42 llvm/lib/Analysis/IPA/Andersens.cpp:1.43 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.42 Sat Dec 23 00:05:40 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Tue Jan 30 14:08:37 2007 @@ -367,7 +367,7 @@ // program and modify stuff. We ignore this technical niggle for now. This // is, after all, a "research quality" implementation of Andersen's analysis. if (Function *F = CS.getCalledFunction()) - if (F->isExternal()) { + if (F->isDeclaration()) { Node *N1 = getNode(P); if (N1->begin() == N1->end()) @@ -599,7 +599,7 @@ /// constraints and return true. If this is a call to an unknown function, /// return false. bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) { - assert(F->isExternal() && "Not an external function!"); + assert(F->isDeclaration() && "Not an external function!"); // These functions don't induce any points-to constraints. if (F->getName() == "atoi" || F->getName() == "atof" || @@ -724,7 +724,7 @@ if (!F->hasInternalLinkage()) AddConstraintsForNonInternalLinkage(F); - if (!F->isExternal()) { + if (!F->isDeclaration()) { // Scan the function body, creating a memory object for each heap/stack // allocation in the body of the function and a node to represent all // pointer values defined by instructions and used as operands. @@ -883,7 +883,7 @@ void Andersens::AddConstraintsForCall(CallSite CS, Function *F) { // If this is a call to an external function, handle it directly to get some // taste of context sensitivity. - if (F->isExternal() && AddConstraintsForExternalCall(CS, F)) + if (F->isDeclaration() && AddConstraintsForExternalCall(CS, F)) return; if (isa(CS.getType())) { Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.63 llvm/lib/Analysis/IPA/CallGraph.cpp:1.64 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.63 Sat Dec 16 23:15:12 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Tue Jan 30 14:08:37 2007 @@ -133,7 +133,7 @@ // If this function is not defined in this translation unit, it could call // anything. - if (F->isExternal() && !F->getIntrinsicID()) + if (F->isDeclaration() && !F->getIntrinsicID()) Node->addCalledFunction(CallSite(), CallsExternalNode); // Loop over all of the users of the function... looking for callers... Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.27 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.28 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.27 Sat Dec 23 00:05:40 2006 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Tue Jan 30 14:08:37 2007 @@ -300,7 +300,7 @@ // Okay, easy case. } else if (CallInst *CI = dyn_cast(Ptr)) { Function *F = CI->getCalledFunction(); - if (!F || !F->isExternal()) return false; // Too hard to analyze. + if (!F || !F->isDeclaration()) return false; // Too hard to analyze. if (F->getName() != "calloc") return false; // Not calloc. } else { return false; // Too hard to analyze. @@ -341,7 +341,7 @@ if ((*I).size() != 1) { AnalyzeSCC(*I); } else if (Function *F = (*I)[0]->getFunction()) { - if (!F->isExternal()) { + if (!F->isDeclaration()) { // Nonexternal function. AnalyzeSCC(*I); } else { From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerGC.cpp Reg2Mem.cpp SCCP.cpp Message-ID: <200701302010.l0UKAAaj019456@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.609 -> 1.610 LowerGC.cpp updated: 1.18 -> 1.19 Reg2Mem.cpp updated: 1.9 -> 1.10 SCCP.cpp updated: 1.152 -> 1.153 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+11 -11) InstructionCombining.cpp | 10 +++++----- LowerGC.cpp | 2 +- Reg2Mem.cpp | 2 +- SCCP.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.609 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.610 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.609 Sat Jan 27 17:08:34 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 14:08:38 2007 @@ -7234,7 +7234,7 @@ // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { - if (Callee->isExternal() && !Caller->use_empty() && + if (Callee->isDeclaration() && !Caller->use_empty() && OldRetTy != FT->getReturnType() && // Conversion is ok if changing from pointer to int of same size. !(isa(FT->getReturnType()) && @@ -7270,11 +7270,11 @@ ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()) || (c && ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits() && c->getSExtValue() > 0); - if (Callee->isExternal() && !isConvertible) return false; + if (Callee->isDeclaration() && !isConvertible) return false; } if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() && - Callee->isExternal()) + Callee->isDeclaration()) return false; // Do not delete arguments unless we have a function body... // Okay, we decided that this is a safe thing to do: go ahead and start @@ -8102,14 +8102,14 @@ // Instcombine load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast(Op)) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) return ReplaceInstUsesWith(LI, GV->getInitializer()); // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded. if (ConstantExpr *CE = dyn_cast(Op)) if (CE->getOpcode() == Instruction::GetElementPtr) { if (GlobalVariable *GV = dyn_cast(CE->getOperand(0))) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) return ReplaceInstUsesWith(LI, V); Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.18 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.19 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.18 Sun Jan 7 00:56:34 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Tue Jan 30 14:08:38 2007 @@ -130,7 +130,7 @@ GlobalValue::LinkOnceLinkage, Constant::getNullValue(PRLTy), "llvm_gc_root_chain", &M); - } else if (RootChain->hasExternalLinkage() && RootChain->isExternal()) { + } else if (RootChain->hasExternalLinkage() && RootChain->isDeclaration()) { RootChain->setInitializer(Constant::getNullValue(PRLTy)); RootChain->setLinkage(GlobalValue::LinkOnceLinkage); } Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.9 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.10 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.9 Tue Dec 19 15:40:18 2006 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Tue Jan 30 14:08:38 2007 @@ -49,7 +49,7 @@ } virtual bool runOnFunction(Function &F) { - if (!F.isExternal()) { + if (!F.isDeclaration()) { //give us a clean block BasicBlock* bbold = &F.getEntryBlock(); BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock()); Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.152 llvm/lib/Transforms/Scalar/SCCP.cpp:1.153 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.152 Fri Jan 12 18:42:58 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Jan 30 14:08:38 2007 @@ -1021,7 +1021,7 @@ // Transform load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast(Ptr)) { if (GV->isConstant()) { - if (!GV->isExternal()) { + if (!GV->isDeclaration()) { markConstant(IV, &I, GV->getInitializer()); return; } @@ -1040,7 +1040,7 @@ if (ConstantExpr *CE = dyn_cast(Ptr)) if (CE->getOpcode() == Instruction::GetElementPtr) if (GlobalVariable *GV = dyn_cast(CE->getOperand(0))) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) { markConstant(IV, &I, V); @@ -1088,7 +1088,7 @@ return; } - if (F == 0 || !F->isExternal() || !canConstantFoldCallTo(F)) { + if (F == 0 || !F->isDeclaration() || !canConstantFoldCallTo(F)) { markOverdefined(IV, I); return; } @@ -1486,7 +1486,7 @@ hash_map &Values = Solver.getValueMapping(); for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) if (!F->hasInternalLinkage() || AddressIsTaken(F)) { - if (!F->isExternal()) + if (!F->isDeclaration()) Solver.MarkBlockExecutable(F->begin()); for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI) From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200701302010.l0UKAAdn019470@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.61 -> 1.62 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+2 -2) ReaderWrappers.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.61 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.62 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.61 Sun Jan 7 00:45:57 2007 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Tue Jan 30 14:08:37 2007 @@ -298,13 +298,13 @@ static void getSymbols(Module*M, std::vector& symbols) { // Loop over global variables for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI) - if (!GI->isExternal() && !GI->hasInternalLinkage()) + if (!GI->isDeclaration() && !GI->hasInternalLinkage()) if (!GI->getName().empty()) symbols.push_back(GI->getName()); // Loop over functions. for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI) - if (!FI->isExternal() && !FI->hasInternalLinkage()) + if (!FI->isDeclaration() && !FI->hasInternalLinkage()) if (!FI->getName().empty()) symbols.push_back(FI->getName()); } From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCSubtarget.cpp Message-ID: <200701302010.l0UKAApN019475@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.231 -> 1.232 PPCSubtarget.cpp updated: 1.28 -> 1.29 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+3 -3) PPCAsmPrinter.cpp | 4 ++-- PPCSubtarget.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.231 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.232 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.231 Tue Jan 30 02:04:53 2007 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Jan 30 14:08:38 2007 @@ -183,7 +183,7 @@ if (TM.getRelocationModel() != Reloc::Static) { if (MO.getType() == MachineOperand::MO_GlobalAddress) { GlobalValue *GV = MO.getGlobal(); - if (((GV->isExternal() || GV->hasWeakLinkage() || + if (((GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()))) { // Dynamically-resolved functions need a stub for the function. std::string Name = Mang->getValueName(GV); @@ -381,7 +381,7 @@ // External or weakly linked global variables need non-lazily-resolved stubs if (TM.getRelocationModel() != Reloc::Static) { - if (((GV->isExternal() || GV->hasWeakLinkage() || + if (((GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()))) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.28 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.29 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.28 Tue Jan 16 03:29:16 2007 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Tue Jan 30 14:08:38 2007 @@ -137,5 +137,5 @@ return false; return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()); } From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200701302010.l0UKAANc019478@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.154 -> 1.155 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+5 -5) Writer.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.154 llvm/lib/Bytecode/Writer/Writer.cpp:1.155 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.154 Tue Jan 30 13:36:46 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Tue Jan 30 14:08:37 2007 @@ -1030,12 +1030,12 @@ unsigned CC = I->getCallingConv()+1; unsigned ID = (Slot << 5) | (CC & 15); - if (I->isExternal()) // If external, we don't have an FunctionInfo block. + if (I->isDeclaration()) // If external, we don't have an FunctionInfo block. ID |= 1 << 4; if (I->getAlignment() || I->hasSection() || (CC & ~15) != 0 || - (I->isExternal() && I->hasDLLImportLinkage()) || - (I->isExternal() && I->hasExternalWeakLinkage()) + (I->isDeclaration() && I->hasDLLImportLinkage()) || + (I->isDeclaration() && I->hasExternalWeakLinkage()) ) ID |= 1 << 31; // Do we need an extension word? @@ -1046,7 +1046,7 @@ // convention, bit 10 = hasSectionID., bits 11-12 = external linkage type unsigned extLinkage = 0; - if (I->isExternal()) { + if (I->isDeclaration()) { if (I->hasDLLImportLinkage()) { extLinkage = 1; } else if (I->hasExternalWeakLinkage()) { @@ -1103,7 +1103,7 @@ void BytecodeWriter::outputFunction(const Function *F) { // If this is an external function, there is nothing else to emit! - if (F->isExternal()) return; + if (F->isDeclaration()) return; BytecodeBlock FunctionBlock(BytecodeFormat::FunctionBlockID, *this); unsigned rWord = (getEncodedVisibility(F) << 16) | getEncodedLinkage(F); From reid at x10sys.com Tue Jan 30 14:10:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86IntelAsmPrinter.cpp X86Subtarget.cpp Message-ID: <200701302010.l0UKABI2019498@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.95 -> 1.96 X86IntelAsmPrinter.cpp updated: 1.68 -> 1.69 X86Subtarget.cpp updated: 1.51 -> 1.52 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+8 -8) X86ATTAsmPrinter.cpp | 6 +++--- X86IntelAsmPrinter.cpp | 6 +++--- X86Subtarget.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.95 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.96 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.95 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Tue Jan 30 14:08:38 2007 @@ -281,7 +281,7 @@ if (printStub(TM, Subtarget)) { // Link-once, External, or Weakly-linked global variables need // non-lazily-resolved stubs - if (GV->isExternal() || + if (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) { // Dynamically-resolved functions need a stub for the function. @@ -310,10 +310,10 @@ if (isCallOp && isa(GV)) { if (printGOT(TM, Subtarget)) { // Assemble call via PLT for non-local symbols - if (!GV->hasHiddenVisibility() || GV->isExternal()) + if (!GV->hasHiddenVisibility() || GV->isDeclaration()) O << "@PLT"; } - if (Subtarget->isTargetCygMing() && GV->isExternal()) + if (Subtarget->isTargetCygMing() && GV->isDeclaration()) // Save function name for later type emission FnStubs.insert(Name); } Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.68 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.69 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.68 Sat Jan 13 17:59:03 2007 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Tue Jan 30 14:08:38 2007 @@ -347,7 +347,7 @@ // Emit declarations for external functions. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->isExternal()) { + if (I->isDeclaration()) { std::string Name = Mang->getValueName(I); X86SharedAsmPrinter::decorateName(Name, I); @@ -362,7 +362,7 @@ // external globals to have type byte, and if that's good enough for VC++... for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->isExternal()) { + if (I->isDeclaration()) { std::string Name = Mang->getValueName(I); O << "\textern " ; @@ -382,7 +382,7 @@ // Print out module-level global variables here. for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->isExternal()) continue; // External global require no code + if (I->isDeclaration()) continue; // External global require no code // Check to see if this is a special global used by LLVM, if so, emit it. if (EmitSpecialLLVMGlobal(I)) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.51 llvm/lib/Target/X86/X86Subtarget.cpp:1.52 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.51 Sun Jan 28 07:31:35 2007 +++ llvm/lib/Target/X86/X86Subtarget.cpp Tue Jan 30 14:08:38 2007 @@ -40,11 +40,11 @@ if (isTargetDarwin()) { return (!isDirectCall && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()))); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()))); } else if (TM.getRelocationModel() == Reloc::PIC_ && isPICStyleGOT()) { // Extra load is needed for all non-statics. return (!isDirectCall && - (GV->isExternal() || !GV->hasInternalLinkage())); + (GV->isDeclaration() || !GV->hasInternalLinkage())); } else if (isTargetCygMing() || isTargetWindows()) { return (GV->hasDLLImportLinkage()); } From reid at x10sys.com Tue Jan 30 14:10:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 14:10:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EmitFunctions.cpp RSProfiling.cpp Message-ID: <200701302010.l0UKAA0o019489@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.19 -> 1.20 EmitFunctions.cpp updated: 1.27 -> 1.28 RSProfiling.cpp updated: 1.17 -> 1.18 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+4 -4) BlockProfiling.cpp | 4 ++-- EmitFunctions.cpp | 2 +- RSProfiling.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.19 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.20 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.19 Sat Dec 30 23:48:39 2006 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Tue Jan 30 14:08:38 2007 @@ -54,7 +54,7 @@ unsigned NumFunctions = 0; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) ++NumFunctions; const Type *ATy = ArrayType::get(Type::Int32Ty, NumFunctions); @@ -65,7 +65,7 @@ // Instrument all of the functions... unsigned i = 0; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) // Insert counter at the start of the function IncrementCounterInBlock(I->begin(), i++, Counters); Index: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp diff -u llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.27 llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.28 --- llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.27 Sat Dec 30 23:48:39 2006 +++ llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp Tue Jan 30 14:08:38 2007 @@ -81,7 +81,7 @@ unsigned int counter = 0; for(Module::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI) - if (!MI->isExternal()) { + if (!MI->isDeclaration()) { vType.push_back(MI->getType()); //std::cerr< > BackEdges; RSProfilers& LI = getAnalysis(); From evan.cheng at apple.com Tue Jan 30 14:37:33 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 14:37:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMConstantPoolValue.cpp ARMConstantPoolValue.h ARMISelLowering.cpp ARMISelLowering.h ARMInstrInfo.td ARMInstrThumb.td Message-ID: <200701302037.l0UKbXWd020225@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.54 -> 1.55 ARMConstantPoolValue.cpp updated: 1.1 -> 1.2 ARMConstantPoolValue.h updated: 1.1 -> 1.2 ARMISelLowering.cpp updated: 1.7 -> 1.8 ARMISelLowering.h updated: 1.1 -> 1.2 ARMInstrInfo.td updated: 1.86 -> 1.87 ARMInstrThumb.td updated: 1.9 -> 1.10 --- Log message: - Fix codegen for pc relative constant (e.g. JT) in thumb mode: .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) LPCRELL0: add r1, pc, #PCRELV0 This is not legal since add r1, pc, #c requires the constant be a multiple of 4. Do the following instead: .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) LPCRELL0: mov r1, #PCRELV0 add r1, pc - In thumb mode, it's not possible to use .set generate a pc relative stub address. The stub is ARM code which is in a different section from the thumb code. Load the value from a constpool instead. - Some asm printing clean up. --- Diffs of the changes: (+96 -47) ARMAsmPrinter.cpp | 28 ++++++++++++++++++++++------ ARMConstantPoolValue.cpp | 30 +++++++++++++++++++++++------- ARMConstantPoolValue.h | 21 ++++++++++++++++++--- ARMISelLowering.cpp | 36 ++++++++++++++++++++++++++---------- ARMISelLowering.h | 2 -- ARMInstrInfo.td | 5 ++--- ARMInstrThumb.td | 21 +++++---------------- 7 files changed, 96 insertions(+), 47 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.54 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.55 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.54 Tue Jan 30 14:08:37 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Tue Jan 30 14:37:08 2007 @@ -122,10 +122,15 @@ ARMConstantPoolValue *ACPV = (ARMConstantPoolValue*)MCPV; GlobalValue *GV = ACPV->getGV(); - std::string Name = Mang->getValueName(GV); + std::string Name = GV ? Mang->getValueName(GV) : TAI->getGlobalPrefix(); + if (!GV) + Name += ACPV->getSymbol(); if (ACPV->isNonLazyPointer()) { GVNonLazyPtrs.insert(Name); O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; + } else if (ACPV->isStub()) { + FnStubs.insert(Name); + O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; } else O << Name; if (ACPV->getPCAdjustment() != 0) @@ -136,7 +141,7 @@ // If the constant pool value is a extern weak symbol, remember to emit // the weak reference. - if (GV->hasExternalWeakLinkage()) + if (GV && GV->hasExternalWeakLinkage()) ExtWeakSymbols.insert(GV); } @@ -680,18 +685,29 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - if (MI->getOpcode() == ARM::CONSTPOOL_ENTRY) { + int Opc = MI->getOpcode(); + switch (Opc) { + case ARM::CONSTPOOL_ENTRY: if (!InCPMode && AFI->isThumbFunction()) { EmitAlignment(2); InCPMode = true; } - } else { + break; + default: { if (InCPMode && AFI->isThumbFunction()) { EmitAlignment(1); InCPMode = false; } - O << "\t"; - } + switch (Opc) { + case ARM::PICADD: + case ARM::PICLD: + case ARM::tPICADD: + break; + default: + O << "\t"; + break; + } + }} // Call the autogenerated instruction printer routines. printInstruction(MI); Index: llvm/lib/Target/ARM/ARMConstantPoolValue.cpp diff -u llvm/lib/Target/ARM/ARMConstantPoolValue.cpp:1.1 llvm/lib/Target/ARM/ARMConstantPoolValue.cpp:1.2 --- llvm/lib/Target/ARM/ARMConstantPoolValue.cpp:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMConstantPoolValue.cpp Tue Jan 30 14:37:08 2007 @@ -14,12 +14,20 @@ #include "ARMConstantPoolValue.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/GlobalValue.h" +#include "llvm/Type.h" using namespace llvm; ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv, unsigned id, - bool isNonLazy, unsigned char PCAdj) + ARMCP::ARMCPKind k, + unsigned char PCAdj) : MachineConstantPoolValue((const Type*)gv->getType()), - GV(gv), LabelId(id), isNonLazyPtr(isNonLazy), PCAdjust(PCAdj) {} + GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj) {} + +ARMConstantPoolValue::ARMConstantPoolValue(const char *s, unsigned id, + ARMCP::ARMCPKind k, + unsigned char PCAdj) + : MachineConstantPoolValue((const Type*)Type::Int32Ty), + GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj) {} int ARMConstantPoolValue::getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment) { @@ -30,8 +38,11 @@ (Constants[i].Offset & AlignMask) == 0) { ARMConstantPoolValue *CPV = (ARMConstantPoolValue *)Constants[i].Val.MachineCPVal; - if (CPV->GV == GV && CPV->LabelId == LabelId && - CPV->isNonLazyPtr == isNonLazyPtr) + if (CPV->GV == GV && + CPV->S == S && + CPV->LabelId == LabelId && + CPV->Kind == Kind && + CPV->PCAdjust == PCAdjust) return i; } } @@ -42,14 +53,19 @@ void ARMConstantPoolValue::AddSelectionDAGCSEId(FoldingSetNodeID &ID) { ID.AddPointer(GV); + ID.AddPointer(S); ID.AddInteger(LabelId); - ID.AddInteger((unsigned)isNonLazyPtr); + ID.AddInteger((unsigned)Kind); ID.AddInteger(PCAdjust); } void ARMConstantPoolValue::print(std::ostream &O) const { - O << GV->getName(); - if (isNonLazyPtr) O << "$non_lazy_ptr"; + if (GV) + O << GV->getName(); + else + O << S; + if (isNonLazyPointer()) O << "$non_lazy_ptr"; + else if (isStub()) O << "$stub"; if (PCAdjust != 0) O << "-(LPIC" << LabelId << "+" << (unsigned)PCAdjust << ")"; } Index: llvm/lib/Target/ARM/ARMConstantPoolValue.h diff -u llvm/lib/Target/ARM/ARMConstantPoolValue.h:1.1 llvm/lib/Target/ARM/ARMConstantPoolValue.h:1.2 --- llvm/lib/Target/ARM/ARMConstantPoolValue.h:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMConstantPoolValue.h Tue Jan 30 14:37:08 2007 @@ -18,23 +18,38 @@ namespace llvm { +namespace ARMCP { + enum ARMCPKind { + CPValue, + CPNonLazyPtr, + CPStub + }; +} + /// ARMConstantPoolValue - ARM specific constantpool value. This is used to /// represent PC relative displacement between the address of the load /// instruction and the global value being loaded, i.e. (&GV-(LPIC+8)). class ARMConstantPoolValue : public MachineConstantPoolValue { GlobalValue *GV; // GlobalValue being loaded. + const char *S; // ExtSymbol being loaded. unsigned LabelId; // Label id of the load. - bool isNonLazyPtr; // True if loading a Mac OS X non_lazy_ptr stub. + ARMCP::ARMCPKind Kind; // non_lazy_ptr or stub? unsigned char PCAdjust; // Extra adjustment if constantpool is pc relative. // 8 for ARM, 4 for Thumb. public: - ARMConstantPoolValue(GlobalValue *gv, unsigned id, bool isNonLazy = false, + ARMConstantPoolValue(GlobalValue *gv, unsigned id, + ARMCP::ARMCPKind Kind = ARMCP::CPValue, + unsigned char PCAdj = 0); + ARMConstantPoolValue(const char *s, unsigned id, + ARMCP::ARMCPKind Kind = ARMCP::CPValue, unsigned char PCAdj = 0); GlobalValue *getGV() const { return GV; } + const char *getSymbol() const { return S; } unsigned getLabelId() const { return LabelId; } - bool isNonLazyPointer() const { return isNonLazyPtr; } + bool isNonLazyPointer() const { return Kind == ARMCP::CPNonLazyPtr; } + bool isStub() const { return Kind == ARMCP::CPStub; } unsigned char getPCAdjustment() const { return PCAdjust; } virtual int getExistingMachineCPValue(MachineConstantPool *CP, Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.7 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.8 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.7 Tue Jan 30 14:08:37 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Jan 30 14:37:08 2007 @@ -230,7 +230,6 @@ switch (Opcode) { default: return 0; case ARMISD::Wrapper: return "ARMISD::Wrapper"; - case ARMISD::WrapperCall: return "ARMISD::WrapperCall"; case ARMISD::WrapperJT: return "ARMISD::WrapperJT"; case ARMISD::CALL: return "ARMISD::CALL"; case ARMISD::CALL_NOLINK: return "ARMISD::CALL_NOLINK"; @@ -465,25 +464,40 @@ bool isARMFunc = false; if (GlobalAddressSDNode *G = dyn_cast(Callee)) { GlobalValue *GV = G->getGlobal(); - Callee = DAG.getTargetGlobalAddress(GV, getPointerTy()); isDirect = true; bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()); bool isStub = (isExt && Subtarget->isTargetDarwin()) && getTargetMachine().getRelocationModel() != Reloc::Static; isARMFunc = !Subtarget->isThumb() || isStub; - // Wrap it since tBX takes a register source operand. - if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) - Callee = DAG.getNode(ARMISD::WrapperCall, MVT::i32, Callee); + // tBX takes a register source operand. + if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) { + ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMPCLabelIndex, + ARMCP::CPStub, 4); + SDOperand CPAddr = DAG.getTargetConstantPool(CPV, getPointerTy(), 2); + CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr); + Callee = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), CPAddr, NULL, 0); + SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32); + Callee = DAG.getNode(ARMISD::PIC_ADD, getPointerTy(), Callee, PICLabel); + } else + Callee = DAG.getTargetGlobalAddress(GV, getPointerTy()); } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) { - Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy()); isDirect = true; bool isStub = Subtarget->isTargetDarwin() && getTargetMachine().getRelocationModel() != Reloc::Static; isARMFunc = !Subtarget->isThumb() || isStub; - // Wrap it since tBX takes a register source operand. - if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) - Callee = DAG.getNode(ARMISD::WrapperCall, MVT::i32, Callee); + // tBX takes a register source operand. + const char *Sym = S->getSymbol(); + if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) { + ARMConstantPoolValue *CPV = new ARMConstantPoolValue(Sym, ARMPCLabelIndex, + ARMCP::CPStub, 4); + SDOperand CPAddr = DAG.getTargetConstantPool(CPV, getPointerTy(), 2); + CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr); + Callee = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), CPAddr, NULL, 0); + SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32); + Callee = DAG.getNode(ARMISD::PIC_ADD, getPointerTy(), Callee, PICLabel); + } else + Callee = DAG.getTargetExternalSymbol(Sym, getPointerTy()); } std::vector NodeTys; @@ -647,8 +661,10 @@ else { unsigned PCAdj = (RelocM != Reloc::PIC_) ? 0 : (Subtarget->isThumb() ? 4 : 8); + ARMCP::ARMCPKind Kind = IsIndirect ? ARMCP::CPNonLazyPtr + : ARMCP::CPValue; ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMPCLabelIndex, - IsIndirect, PCAdj); + Kind, PCAdj); CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); } CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr); Index: llvm/lib/Target/ARM/ARMISelLowering.h diff -u llvm/lib/Target/ARM/ARMISelLowering.h:1.1 llvm/lib/Target/ARM/ARMISelLowering.h:1.2 --- llvm/lib/Target/ARM/ARMISelLowering.h:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.h Tue Jan 30 14:37:08 2007 @@ -31,8 +31,6 @@ Wrapper, // Wrapper - A wrapper node for TargetConstantPool, // TargetExternalSymbol, and TargetGlobalAddress. - WrapperCall, // WrapperCall - Same as wrapper, but mark the wrapped - // node as call operand. WrapperJT, // WrapperJT - A wrapper node for TargetJumpTable CALL, // Function call. Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.86 llvm/lib/Target/ARM/ARMInstrInfo.td:1.87 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.86 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Tue Jan 30 14:37:08 2007 @@ -41,7 +41,6 @@ // Node definitions. def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>; -def ARMWrapperCall : SDNode<"ARMISD::WrapperCall", SDTIntUnaryOp>; def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>; def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq, @@ -514,11 +513,11 @@ [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>; def PICADD : AI1<(ops GPR:$dst, GPR:$a, pclabel:$cp), - "\n$cp:\n\tadd $dst, pc, $a", + "$cp:\n\tadd $dst, pc, $a", [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>; let AddedComplexity = 10 in def PICLD : AI2<(ops GPR:$dst, addrmodepc:$addr), - "\n${addr:label}:\n\tldr $dst, $addr", + "${addr:label}:\n\tldr $dst, $addr", [(set GPR:$dst, (load addrmodepc:$addr))]>; //===----------------------------------------------------------------------===// Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.9 llvm/lib/Target/ARM/ARMInstrThumb.td:1.10 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.9 Mon Jan 29 20:35:32 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Tue Jan 30 14:37:08 2007 @@ -158,7 +158,7 @@ // def tPICADD : TIt<(ops GPR:$dst, GPR:$lhs, pclabel:$cp), - "\n$cp:\n\tadd $dst, pc", + "$cp:\n\tadd $dst, pc", [(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>; //===----------------------------------------------------------------------===// @@ -475,25 +475,18 @@ // tLEApcrel - Load a pc-relative address into a register without offending the // assembler. -def tLEApcrel : TI<(ops GPR:$dst, i32imm:$label), +def tLEApcrel : TIx2<(ops GPR:$dst, i32imm:$label), !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(", "${:private}PCRELL${:uid}+4))\n"), !strconcat("${:private}PCRELL${:uid}:\n\t", - "add $dst, pc, #PCRELV${:uid}")), + "mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), []>; -def tLEApcrelCall : TI<(ops GPR:$dst, i32imm:$label), - !strconcat(!strconcat(".set PCRELV${:uid}, (${label:call}-(", - "${:private}PCRELL${:uid}+4))\n"), - !strconcat("${:private}PCRELL${:uid}:\n\t", - "add $dst, pc, #PCRELV${:uid}")), - []>; - -def tLEApcrelJT : TI<(ops GPR:$dst, i32imm:$label, i32imm:$id), +def tLEApcrelJT : TIx2<(ops GPR:$dst, i32imm:$label, i32imm:$id), !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(", "${:private}PCRELL${:uid}+4))\n"), !strconcat("${:private}PCRELL${:uid}:\n\t", - "add $dst, pc, #PCRELV${:uid}")), + "mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), []>; //===----------------------------------------------------------------------===// @@ -503,10 +496,6 @@ // ConstantPool, GlobalAddress def : ThumbPat<(ARMWrapper tglobaladdr :$dst), (tLEApcrel tglobaladdr :$dst)>; def : ThumbPat<(ARMWrapper tconstpool :$dst), (tLEApcrel tconstpool :$dst)>; -def : ThumbPat<(ARMWrapperCall tglobaladdr :$dst), - (tLEApcrelCall tglobaladdr :$dst)>; -def : ThumbPat<(ARMWrapperCall texternalsym:$dst), - (tLEApcrelCall texternalsym:$dst)>; // JumpTable def : ThumbPat<(ARMWrapperJT tjumptable:$dst, imm:$id), From dpatel at apple.com Tue Jan 30 15:36:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 30 Jan 2007 13:36:47 -0800 Subject: [llvm-commits] [PATCH] fvisibility=hidden makes all objc meta symbols private extern References: <2AF85298-0B2C-4008-8FFB-1940A05030DA@apple.com> Message-ID: <55D4EFE0-44EE-4ECB-86C1-E2531E7354D8@apple.com> DECL_VISIBILITY is valid only if TREE_PUBLIC is set. This patch uses the same approach used by varasm.c I applied this patch. - Devang Index: llvm-backend.cpp =================================================================== --- llvm-backend.cpp (revision 122793) +++ llvm-backend.cpp (working copy) @@ -536,7 +536,7 @@ void emit_global_to_llvm(tree decl) { #endif /* TARGET_ADJUST_LLVM_LINKAGE */ // Handle visibility style - if (DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(decl) && DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) GV->setVisibility(GlobalValue::HiddenVisibility); // Set the section for the global. @@ -700,7 +700,7 @@ void make_decl_llvm(tree decl) { #endif /* TARGET_ADJUST_LLVM_LINKAGE */ // Handle visibility style - if (DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(decl) && DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) FnEntry->setVisibility(Function::HiddenVisibility); assert(FnEntry->getName() == Name &&"Preexisting fn with the same name!"); @@ -729,7 +729,7 @@ void make_decl_llvm(tree decl) { #endif /* TARGET_ADJUST_LLVM_LINKAGE */ // Handle visibility style - if (DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(decl) && DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) GV->setVisibility(Function::HiddenVisibility); } else { // If the global has a name, prevent multiple vars with the same name from @@ -749,7 +749,7 @@ void make_decl_llvm(tree decl) { #endif /* TARGET_ADJUST_LLVM_LINKAGE */ // Handle visibility style - if (DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(decl) && DECL_VISIBILITY(decl) == VISIBILITY_HIDDEN) GV->setVisibility(Function::HiddenVisibility); } else { GV = GVE; // Global already created, reuse it. Index: llvm-convert.cpp =================================================================== --- llvm-convert.cpp (revision 122793) +++ llvm-convert.cpp (working copy) @@ -295,7 +295,7 @@ void TreeToLLVM::StartFunctionBody() { "Calling convention disagreement between prototype and impl!"); // The visibility can be changed from the last time we've seen this // function. Set to current. - if (DECL_VISIBILITY(FnDecl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(FnDecl) && DECL_VISIBILITY(FnDecl) == VISIBILITY_HIDDEN) Fn->setVisibility(Function::HiddenVisibility); else if (DECL_VISIBILITY(FnDecl) == VISIBILITY_DEFAULT) Fn->setVisibility(Function::DefaultVisibility); @@ -350,7 +350,7 @@ void TreeToLLVM::StartFunctionBody() { #endif /* TARGET_ADJUST_LLVM_LINKAGE */ // Handle visibility style - if (DECL_VISIBILITY(FnDecl) == VISIBILITY_HIDDEN) + if (TREE_PUBLIC(FnDecl) && DECL_VISIBILITY(FnDecl) == VISIBILITY_HIDDEN) Fn->setVisibility(Function::HiddenVisibility); // Handle functions in specified sections. From sabre at nondot.org Tue Jan 30 16:33:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 16:33:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200701302233.l0UMXD90025694@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.610 -> 1.611 --- Log message: Symbolically evaluate constant expressions like &A[123] - &A[4].f. This occurs in C++ code like: #include #include int a[] = { 1, 2, 3, 4, 5 }; int main() { using namespace std; copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator(cout, "\n")); return 0; } Before we would decide the loop trip count is: sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4) Now we decide it is "5". Amazing. This code will need to be refactored, but I'm doing that as a separate commit. --- Diffs of the changes: (+143 -2) InstructionCombining.cpp | 145 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 143 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.610 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.611 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.610 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 16:32:46 2007 @@ -1355,6 +1355,63 @@ break; } + case Instruction::BitCast: { + // packed->packed + const PackedType *PTy = dyn_cast(I->getOperand(0)->getType()); + if (!PTy) break; + unsigned InVWidth = PTy->getNumElements(); + uint64_t InputDemandedElts = 0; + unsigned Ratio; + + if (VWidth == InVWidth) { + Ratio = 1; + InputDemandedElts = DemandedElts; + } else if (VWidth > InVWidth) { + // If there are more elements in the result than there are in the source, + // then an input element is live if any of the corresponding output + // elements are live. + Ratio = VWidth/InVWidth; + for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx) { + if (DemandedElts & (1ULL << OutIdx)) + InputDemandedElts |= 1ULL << (OutIdx/Ratio); + } + } else { + // If there are more elements in the source than there are in the result, + // then an input element is live if the corresponding output element is + // live. + Ratio = InVWidth/VWidth; + for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx) + if (DemandedElts & (1ULL << InIdx/Ratio)) + InputDemandedElts |= 1ULL << InIdx; + } + + // div/rem demand all inputs, because they don't want divide by zero. + TmpV = SimplifyDemandedVectorElts(I->getOperand(0), InputDemandedElts, + UndefElts2, Depth+1); + if (TmpV) { + I->setOperand(0, TmpV); + MadeChange = true; + } + + UndefElts = UndefElts2; + if (VWidth > InVWidth) { + // If there are more elements in the result than there are in the source, + // then an output element is undef if the corresponding input element is + // undef. + for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx) + if (UndefElts2 & (1ULL << (OutIdx/Ratio))) + UndefElts |= 1ULL << OutIdx; + } else if (VWidth < InVWidth) { + // If there are more elements in the source than there are in the result, + // then a result element is undef if all of the corresponding input + // elements are undef. + UndefElts = ~0ULL >> (64-VWidth); // Start out all undef. + for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx) + if ((UndefElts2 & (1ULL << InIdx)) == 0) // Not undef? + UndefElts &= ~(1ULL << (InIdx/Ratio)); // Clear undef bit. + } + break; + } case Instruction::And: case Instruction::Or: case Instruction::Xor: @@ -1756,7 +1813,8 @@ ConstantInt *XorRHS = 0; Value *XorLHS = 0; - if (match(LHS, m_Xor(m_Value(XorLHS), m_ConstantInt(XorRHS)))) { + if (isa(RHSC) && + match(LHS, m_Xor(m_Value(XorLHS), m_ConstantInt(XorRHS)))) { unsigned TySizeBits = I.getType()->getPrimitiveSizeInBits(); int64_t RHSSExt = cast(RHSC)->getSExtValue(); uint64_t RHSZExt = cast(RHSC)->getZExtValue(); @@ -8985,7 +9043,14 @@ } } } - + + // See if SimplifyDemandedVectorElts can simplify based on this shuffle. For + // example, if this is a splat, then we only demand from one input element. + uint64_t UndefElts; + if (Value *V = SimplifyDemandedVectorElts(&SVI, (1ULL << Mask.size())-1, + UndefElts)) + return ReplaceInstUsesWith(SVI, V); + return MadeChange ? &SVI : 0; } @@ -9028,6 +9093,58 @@ return true; } +/// IsConstantOffsetFromGlobal - If this constant is actually a constant offset +/// from a global, return the global and the constant. Because of +/// constantexprs, this function is recursive. +static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, + int64_t &Offset, const TargetData &TD) { + // Trivial case, constant is the global. + if ((GV = dyn_cast(C))) { + Offset = 0; + return true; + } + + // Otherwise, if this isn't a constant expr, bail out. + ConstantExpr *CE = dyn_cast(C); + if (!CE) return false; + + // Look through ptr->int and ptr->ptr casts. + if (CE->getOpcode() == Instruction::PtrToInt || + CE->getOpcode() == Instruction::BitCast) + return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD); + + // i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) + if (CE->getOpcode() == Instruction::GetElementPtr) { + // Cannot compute this if the element type of the pointer is missing size + // info. + if (!cast(CE->getOperand(0)->getType())->getElementType()->isSized()) + return false; + + // If the base isn't a global+constant, we aren't either. + if (!IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD)) + return false; + + // Otherwise, add any offset that our operands provide. + gep_type_iterator GTI = gep_type_begin(CE); + for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i, ++GTI) { + ConstantInt *CI = dyn_cast(CE->getOperand(i)); + if (!CI) return false; // Index isn't a simple constant? + if (CI->getZExtValue() == 0) continue; // Not adding anything. + + if (const StructType *ST = dyn_cast(*GTI)) { + // N = N + Offset + Offset += TD.getStructLayout(ST)->MemberOffsets[CI->getZExtValue()]; + } else { + const SequentialType *ST = cast(*GTI); + Offset += TD.getTypeSize(ST->getElementType())*CI->getSExtValue(); + } + } + return true; + } + + return false; +} + /// OptimizeConstantExpr - Given a constant expression and target data layout /// information, symbolically evaluate the constant expr to something simpler /// if possible. @@ -9051,6 +9168,30 @@ } } + + // SROA + + // Fold (and 0xffffffff00000000, (shl x, 32)) -> shl. + // Fold (lshr (or X, Y), 32) -> (lshr [X/Y], 32) if one doesn't contribute + // bits. + + + // If the constant expr is something like &A[123] - &A[4].f, fold this into a + // constant. This happens frequently when iterating over a global array. + if (CE->getOpcode() == Instruction::Sub) { + GlobalValue *GV1, *GV2; + int64_t Offs1, Offs2; + + if (IsConstantOffsetFromGlobal(CE->getOperand(0), GV1, Offs1, *TD)) + if (IsConstantOffsetFromGlobal(CE->getOperand(1), GV2, Offs2, *TD) && + GV1 == GV2) { + // (&GV+C1) - (&GV+C2) -> C1-C2, pointer arithmetic cannot overflow. + return ConstantInt::get(CE->getType(), Offs1-Offs2); + } + } + + // TODO: Fold icmp setne/seteq as well. + return CE; } From sabre at nondot.org Tue Jan 30 16:50:48 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 16:50:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200701302250.l0UMomvX026038@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.611 -> 1.612 --- Log message: remove some bits that are not yet meant to land. --- Diffs of the changes: (+0 -57) InstructionCombining.cpp | 57 ----------------------------------------------- 1 files changed, 57 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.611 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.612 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.611 Tue Jan 30 16:32:46 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 16:50:32 2007 @@ -1355,63 +1355,6 @@ break; } - case Instruction::BitCast: { - // packed->packed - const PackedType *PTy = dyn_cast(I->getOperand(0)->getType()); - if (!PTy) break; - unsigned InVWidth = PTy->getNumElements(); - uint64_t InputDemandedElts = 0; - unsigned Ratio; - - if (VWidth == InVWidth) { - Ratio = 1; - InputDemandedElts = DemandedElts; - } else if (VWidth > InVWidth) { - // If there are more elements in the result than there are in the source, - // then an input element is live if any of the corresponding output - // elements are live. - Ratio = VWidth/InVWidth; - for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx) { - if (DemandedElts & (1ULL << OutIdx)) - InputDemandedElts |= 1ULL << (OutIdx/Ratio); - } - } else { - // If there are more elements in the source than there are in the result, - // then an input element is live if the corresponding output element is - // live. - Ratio = InVWidth/VWidth; - for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx) - if (DemandedElts & (1ULL << InIdx/Ratio)) - InputDemandedElts |= 1ULL << InIdx; - } - - // div/rem demand all inputs, because they don't want divide by zero. - TmpV = SimplifyDemandedVectorElts(I->getOperand(0), InputDemandedElts, - UndefElts2, Depth+1); - if (TmpV) { - I->setOperand(0, TmpV); - MadeChange = true; - } - - UndefElts = UndefElts2; - if (VWidth > InVWidth) { - // If there are more elements in the result than there are in the source, - // then an output element is undef if the corresponding input element is - // undef. - for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx) - if (UndefElts2 & (1ULL << (OutIdx/Ratio))) - UndefElts |= 1ULL << OutIdx; - } else if (VWidth < InVWidth) { - // If there are more elements in the source than there are in the result, - // then a result element is undef if all of the corresponding input - // elements are undef. - UndefElts = ~0ULL >> (64-VWidth); // Start out all undef. - for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx) - if ((UndefElts2 & (1ULL << InIdx)) == 0) // Not undef? - UndefElts &= ~(1ULL << (InIdx/Ratio)); // Clear undef bit. - } - break; - } case Instruction::And: case Instruction::Or: case Instruction::Xor: From evan.cheng at apple.com Tue Jan 30 17:02:02 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 17:02:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701302302.l0UN22RW026216@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.46 -> 1.47 --- Log message: During PEI, if the immediate value of sp + offset is too large (i.e. something that would require > 3 instructions to materialize), load the immediate from a constpool entry. --- Diffs of the changes: (+102 -21) ARMRegisterInfo.cpp | 123 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 102 insertions(+), 21 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.46 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.47 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.46 Mon Jan 29 20:57:02 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Tue Jan 30 17:01:46 2007 @@ -18,14 +18,16 @@ #include "ARMMachineFunctionInfo.h" #include "ARMRegisterInfo.h" #include "ARMSubtarget.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLocation.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" -#include "llvm/Type.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include @@ -281,7 +283,7 @@ return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects(); } -/// emitARMRegPlusImmediate - Emit a series of instructions to materialize +/// emitARMRegPlusImmediate - Emits a series of instructions to materialize /// a destreg = basereg + immediate in ARM code. static void emitARMRegPlusImmediate(MachineBasicBlock &MBB, @@ -323,7 +325,70 @@ } } -/// emitThumbRegPlusImmediate - Emit a series of instructions to materialize +/// calcNumMI - Returns the number of instructions required to materialize +/// the specific add / sub r, c instruction. +static unsigned calcNumMI(int Opc, int ExtraOpc, unsigned Bytes, + unsigned NumBits, unsigned Scale) { + unsigned NumMIs = 0; + unsigned Chunk = ((1 << NumBits) - 1) * Scale; + + if (Opc == ARM::tADDrSPi) { + unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes; + Bytes -= ThisVal; + NumMIs++; + NumBits = 8; + Scale = 1; + Chunk = ((1 << NumBits) - 1) * Scale; + } + + NumMIs += Bytes / Chunk; + if ((Bytes % Chunk) != 0) + NumMIs++; + if (ExtraOpc) + NumMIs++; + return NumMIs; +} + +/// emitThumbRegPlusConstPool - Emits a series of instructions to materialize +/// a destreg = basereg + immediate in Thumb code. Load the immediate from a +/// constpool entry. +static +void emitThumbRegPlusConstPool(MachineBasicBlock &MBB, + MachineBasicBlock::iterator &MBBI, + unsigned DestReg, unsigned BaseReg, + int NumBytes, const TargetInstrInfo &TII) { + MachineFunction &MF = *MBB.getParent(); + MachineConstantPool *ConstantPool = MF.getConstantPool(); + bool isHigh = !isLowRegister(DestReg) || !isLowRegister(BaseReg); + bool isSub = false; + // Subtract doesn't have high register version. Load the negative value + // if either base or dest register is a high register. + if (NumBytes < 0 && !isHigh) { + isSub = true; + NumBytes = -NumBytes; + } + Constant *C = ConstantInt::get(Type::Int32Ty, NumBytes); + unsigned Idx = ConstantPool->getConstantPoolIndex(C, 2); + unsigned LdReg = DestReg; + if (DestReg == ARM::SP) { + assert(BaseReg == ARM::SP && "Unexpected!"); + LdReg = ARM::R3; + BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), ARM::R12).addReg(ARM::R3); + } + // Load the constant. + BuildMI(MBB, MBBI, TII.get(ARM::tLDRpci), LdReg).addConstantPoolIndex(Idx); + // Emit add / sub. + int Opc = (isSub) ? ARM::tSUBrr : (isHigh ? ARM::tADDhirr : ARM::tADDrr); + const MachineInstrBuilder MIB = BuildMI(MBB, MBBI, TII.get(Opc), DestReg); + if (DestReg == ARM::SP) + MIB.addReg(BaseReg).addReg(LdReg); + else + MIB.addReg(LdReg).addReg(BaseReg); + if (DestReg == ARM::SP) + BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), ARM::R3).addReg(ARM::R12); +} + +/// emitThumbRegPlusImmediate - Emits a series of instructions to materialize /// a destreg = basereg + immediate in Thumb code. static void emitThumbRegPlusImmediate(MachineBasicBlock &MBB, @@ -335,10 +400,11 @@ if (isSub) Bytes = -NumBytes; bool isMul4 = (Bytes & 3) == 0; bool isTwoAddr = false; + bool DstNeBase = false; unsigned NumBits = 1; unsigned Scale = 1; - unsigned Opc = 0; - unsigned ExtraOpc = 0; + int Opc = 0; + int ExtraOpc = 0; if (DestReg == BaseReg && BaseReg == ARM::SP) { assert(isMul4 && "Thumb sp inc / dec size must be multiple of 4!"); @@ -359,24 +425,39 @@ Scale = 4; Opc = ARM::tADDrSPi; } else { - if (DestReg != BaseReg) { - if (isLowRegister(DestReg) && isLowRegister(BaseReg)) { - // If both are low registers, emit DestReg = add BaseReg, max(Imm, 7) - unsigned Chunk = (1 << 3) - 1; - unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes; - Bytes -= ThisVal; - BuildMI(MBB, MBBI, TII.get(isSub ? ARM::tSUBi3 : ARM::tADDi3), DestReg) - .addReg(BaseReg).addImm(ThisVal); - } else { - BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), DestReg).addReg(BaseReg); - } - BaseReg = DestReg; - } + // sp = sub sp, c + // r1 = sub sp, c + // r8 = sub sp, c + if (DestReg != BaseReg) + DstNeBase = true; NumBits = 8; Opc = isSub ? ARM::tSUBi8 : ARM::tADDi8; isTwoAddr = true; } + unsigned NumMIs = calcNumMI(Opc, ExtraOpc, Bytes, NumBits, Scale); + unsigned Threshold = (DestReg == ARM::SP) ? 4 : 3; + if (NumMIs > Threshold) { + // This will expand into too many instructions. Load the immediate from a + // constpool entry. + emitThumbRegPlusConstPool(MBB, MBBI, DestReg, BaseReg, NumBytes, TII); + return; + } + + if (DstNeBase) { + if (isLowRegister(DestReg) && isLowRegister(BaseReg)) { + // If both are low registers, emit DestReg = add BaseReg, max(Imm, 7) + unsigned Chunk = (1 << 3) - 1; + unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes; + Bytes -= ThisVal; + BuildMI(MBB, MBBI, TII.get(isSub ? ARM::tSUBi3 : ARM::tADDi3), DestReg) + .addReg(BaseReg).addImm(ThisVal); + } else { + BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), DestReg).addReg(BaseReg); + } + BaseReg = DestReg; + } + unsigned Chunk = ((1 << NumBits) - 1) * Scale; while (Bytes) { unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes; @@ -643,7 +724,7 @@ return; } - // Otherwise, it didn't fit. Pull in what we can to simplify the immediate. + // Otherwise, it didn't fit. Pull in what we can to simplify the immediate. if (AddrMode == ARMII::AddrModeTs) { // Thumb tLDRspi, tSTRspi. These will change to instructions that use a // different base register. From evan.cheng at apple.com Tue Jan 30 17:06:38 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 17:06:38 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/large-stack.ll addSubConstant.ll Message-ID: <200701302306.l0UN6cMe026311@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: large-stack.ll updated: 1.2 -> 1.3 addSubConstant.ll (r1.1) removed --- Log message: Combine two tests. --- Diffs of the changes: (+11 -1) large-stack.ll | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/large-stack.ll diff -u llvm/test/CodeGen/ARM/large-stack.ll:1.2 llvm/test/CodeGen/ARM/large-stack.ll:1.3 --- llvm/test/CodeGen/ARM/large-stack.ll:1.2 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/large-stack.ll Tue Jan 30 17:06:22 2007 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm -enable-thumb +; RUN: llvm-as < %s | llc -march=arm -enable-thumb && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep 'ldr.*LCP' | wc -l | grep 5 define void @test1() { %tmp = alloca [ 64 x i32 ] , align 4 @@ -10,3 +11,12 @@ %tmp = alloca [ 4168 x i8 ] , align 4 ret void } + +define i32 @test3() { + %retval = alloca i32, align 4 + %tmp = alloca i32, align 4 + %a = alloca [805306369 x i8], align 16 + store i32 0, i32* %tmp + %tmp1 = load i32* %tmp + ret i32 %tmp1 +} From sabre at nondot.org Tue Jan 30 17:13:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:13:06 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Local.h Message-ID: <200701302313.l0UND68k026477@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: Local.h updated: 1.24 -> 1.25 --- Log message: Change constant folding APIs to take an optional TargetData, and change ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array of operands + size, instead of an std::vector. --- Diffs of the changes: (+6 -3) Local.h | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Transforms/Utils/Local.h diff -u llvm/include/llvm/Transforms/Utils/Local.h:1.24 llvm/include/llvm/Transforms/Utils/Local.h:1.25 --- llvm/include/llvm/Transforms/Utils/Local.h:1.24 Sat Dec 23 00:05:40 2006 +++ llvm/include/llvm/Transforms/Utils/Local.h Tue Jan 30 17:12:47 2007 @@ -24,6 +24,7 @@ class PHINode; class AllocaInst; class ConstantExpr; +class TargetData; //===----------------------------------------------------------------------===// // Local constant propagation... @@ -32,7 +33,7 @@ /// doConstantPropagation - Constant prop a specific instruction. Returns true /// and potentially moves the iterator if constant propagation was performed. /// -bool doConstantPropagation(BasicBlock::iterator &I); +bool doConstantPropagation(BasicBlock::iterator &I, const TargetData *TD = 0); /// ConstantFoldTerminator - If a terminator instruction is predicated on a /// constant value, convert it into an unconditional branch to the constant @@ -46,7 +47,7 @@ /// is returned. Note that this function can only fail when attempting to fold /// instructions like loads and stores, which have no constant expression form. /// -Constant *ConstantFoldInstruction(Instruction *I); +Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0); /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the /// specified operands. If successful, the constant result is returned, if not, @@ -56,7 +57,9 @@ /// Constant *ConstantFoldInstOperands( const Instruction *I, ///< The model instruction - const std::vector &Ops ///< The constant operands to use. + Constant** Ops, ///< The array of constant operands to use. + unsigned NumOps, ///< The number of operands provided. + const TargetData *TD = 0 ///< Optional target information. ); From sabre at nondot.org Tue Jan 30 17:13:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:13:06 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/ConstantFolding.h Message-ID: <200701302313.l0UND63c026480@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: ConstantFolding.h updated: 1.1 -> 1.2 --- Log message: Change constant folding APIs to take an optional TargetData, and change ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array of operands + size, instead of an std::vector. --- Diffs of the changes: (+2 -8) ConstantFolding.h | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) Index: llvm/include/llvm/Analysis/ConstantFolding.h diff -u llvm/include/llvm/Analysis/ConstantFolding.h:1.1 llvm/include/llvm/Analysis/ConstantFolding.h:1.2 --- llvm/include/llvm/Analysis/ConstantFolding.h:1.1 Thu Oct 27 11:00:09 2005 +++ llvm/include/llvm/Analysis/ConstantFolding.h Tue Jan 30 17:12:47 2007 @@ -20,17 +20,11 @@ /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. -extern bool canConstantFoldCallTo(Function *F); -/// ConstantFoldFP - Given a function that evaluates the constant, return an -/// LLVM Constant that represents the evaluated constant -extern Constant * -ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty); - /// ConstantFoldCall - Attempt to constant fold a call to the specified function /// with the specified arguments, returning null if unsuccessful. -extern Constant * -ConstantFoldCall(Function *F, const std::vector &Operands); +Constant * +ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands); } From sabre at nondot.org Tue Jan 30 17:14:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:14:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneFunction.cpp Local.cpp Message-ID: <200701302314.l0UNE5bp026530@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneFunction.cpp updated: 1.36 -> 1.37 Local.cpp updated: 1.65 -> 1.66 --- Log message: Change constant folding APIs to take an optional TargetData, and change ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array of operands + size, instead of an std::vector. In some cases, switch to using a SmallVector instead of a vector. This allows us to get rid of some special case gross code that was there to avoid the cost of constructing a vector. --- Diffs of the changes: (+18 -41) CloneFunction.cpp | 22 +++------------------- Local.cpp | 37 +++++++++++++++---------------------- 2 files changed, 18 insertions(+), 41 deletions(-) Index: llvm/lib/Transforms/Utils/CloneFunction.cpp diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.36 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.37 --- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.36 Thu Jan 11 22:24:46 2007 +++ llvm/lib/Transforms/Utils/CloneFunction.cpp Tue Jan 30 17:13:49 2007 @@ -21,6 +21,7 @@ #include "llvm/Support/CFG.h" #include "ValueMapper.h" #include "llvm/Transforms/Utils/Local.h" +#include "llvm/ADT/SmallVector.h" using namespace llvm; // CloneBasicBlock - See comments in Cloning.h @@ -281,24 +282,7 @@ /// mapping its operands through ValueMap if they are available. Constant *PruningFunctionCloner:: ConstantFoldMappedInstruction(const Instruction *I) { - if (isa(I)) { - if (Constant *Op0 = dyn_cast_or_null(MapValue(I->getOperand(0), - ValueMap))) - if (Constant *Op1 = dyn_cast_or_null(MapValue(I->getOperand(1), - ValueMap))) - return ConstantExpr::getCompare(cast(I)->getPredicate(), Op0, - Op1); - return 0; - } else if (isa(I) || isa(I)) { - if (Constant *Op0 = dyn_cast_or_null(MapValue(I->getOperand(0), - ValueMap))) - if (Constant *Op1 = dyn_cast_or_null(MapValue(I->getOperand(1), - ValueMap))) - return ConstantExpr::get(I->getOpcode(), Op0, Op1); - return 0; - } - - std::vector Ops; + SmallVector Ops; for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) if (Constant *Op = dyn_cast_or_null(MapValue(I->getOperand(i), ValueMap))) @@ -306,7 +290,7 @@ else return 0; // All operands not constant! - return ConstantFoldInstOperands(I, Ops); + return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); } /// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto, Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.65 llvm/lib/Transforms/Utils/Local.cpp:1.66 --- llvm/lib/Transforms/Utils/Local.cpp:1.65 Thu Jan 11 22:24:46 2007 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Jan 30 17:13:49 2007 @@ -18,8 +18,10 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/Analysis/ConstantFolding.h" +#include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" +#include "llvm/ADT/SmallVector.h" #include using namespace llvm; @@ -30,8 +32,9 @@ /// doConstantPropagation - If an instruction references constants, try to fold /// them together... /// -bool llvm::doConstantPropagation(BasicBlock::iterator &II) { - if (Constant *C = ConstantFoldInstruction(II)) { +bool llvm::doConstantPropagation(BasicBlock::iterator &II, + const TargetData *TD) { + if (Constant *C = ConstantFoldInstruction(II, TD)) { // Replaces all of the uses of a variable with uses of the constant. II->replaceAllUsesWith(C); @@ -48,7 +51,7 @@ /// is returned. Note that this function can only fail when attempting to fold /// instructions like loads and stores, which have no constant expression form. /// -Constant *llvm::ConstantFoldInstruction(Instruction *I) { +Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) { if (PHINode *PN = dyn_cast(I)) { if (PN->getNumIncomingValues() == 0) return Constant::getNullValue(PN->getType()); @@ -79,24 +82,16 @@ case 0: return 0; } - if (isa(I) || isa(I)) { - return ConstantExpr::get(I->getOpcode(), Op0, Op1); - } else if (isa(I)) { - return ConstantExpr::getICmp(cast(I)->getPredicate(), Op0, Op1); - } else if (isa(I)) { - return ConstantExpr::getFCmp(cast(I)->getPredicate(), Op0, Op1); - } - // Scan the operand list, checking to see if they are all constants, if so, // hand off to ConstantFoldInstOperands. - std::vector Ops; + SmallVector Ops; for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) if (Constant *Op = dyn_cast(I->getOperand(i))) Ops.push_back(Op); else return 0; // All operands not constant! - return ConstantFoldInstOperands(I, Ops); + return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); } /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the @@ -106,7 +101,8 @@ /// constant expression form. /// Constant *llvm::ConstantFoldInstOperands(const Instruction* I, - const std::vector &Ops) { + Constant** Ops, unsigned NumOps, + const TargetData *TD) { unsigned Opc = I->getOpcode(); const Type *DestTy = I->getType(); @@ -117,12 +113,9 @@ switch (Opc) { default: return 0; case Instruction::Call: - if (Function *F = dyn_cast(Ops[0])) { - if (canConstantFoldCallTo(F)) { - std::vector Args(Ops.begin()+1, Ops.end()); - return ConstantFoldCall(F, Args); - } - } + if (Function *F = dyn_cast(Ops[0])) + if (canConstantFoldCallTo(F)) + return ConstantFoldCall(F, Ops+1, NumOps); return 0; case Instruction::ICmp: case Instruction::FCmp: @@ -155,8 +148,8 @@ return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); case Instruction::GetElementPtr: return ConstantExpr::getGetElementPtr(Ops[0], - std::vector(Ops.begin()+1, - Ops.end())); + std::vector(Ops+1, + Ops+NumOps)); } } From sabre at nondot.org Tue Jan 30 17:15:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:15:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200701302315.l0UNF7Du026592@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.89 -> 1.90 --- Log message: adjust to api change --- Diffs of the changes: (+2 -1) GlobalOpt.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.89 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.90 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.89 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 30 17:14:52 2007 @@ -1775,7 +1775,8 @@ if (Callee->isDeclaration()) { // If this is a function we can constant fold, do it. - if (Constant *C = ConstantFoldCall(Callee, Formals)) { + if (Constant *C = ConstantFoldCall(Callee, &Formals[0], + Formals.size())) { InstResult = C; } else { return false; From sabre at nondot.org Tue Jan 30 17:15:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:15:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp Message-ID: <200701302315.l0UNFZAY026649@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: SCCP.cpp updated: 1.153 -> 1.154 --- Log message: use smallvector instead of vector to make constant folding a bit more efficient --- Diffs of the changes: (+3 -2) SCCP.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.153 llvm/lib/Transforms/Scalar/SCCP.cpp:1.154 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.153 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Jan 30 17:15:19 2007 @@ -33,6 +33,7 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/hash_map" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -1093,7 +1094,7 @@ return; } - std::vector Operands; + SmallVector Operands; Operands.reserve(I->getNumOperands()-1); for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); @@ -1109,7 +1110,7 @@ Operands.push_back(State.getConstant()); } - if (Constant *C = ConstantFoldCall(F, Operands)) + if (Constant *C = ConstantFoldCall(F, &Operands[0], Operands.size())) markConstant(IV, I, C); else markOverdefined(IV, I); From sabre at nondot.org Tue Jan 30 17:15:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:15:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp ScalarEvolution.cpp Message-ID: <200701302315.l0UNFxIq026707@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.10 -> 1.11 ScalarEvolution.cpp updated: 1.90 -> 1.91 --- Log message: adjust to constant folding api changes. --- Diffs of the changes: (+8 -7) ConstantFolding.cpp | 11 ++++++----- ScalarEvolution.cpp | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.10 llvm/lib/Analysis/ConstantFolding.cpp:1.11 --- llvm/lib/Analysis/ConstantFolding.cpp:1.10 Mon Jan 15 00:27:37 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Tue Jan 30 17:15:43 2007 @@ -85,23 +85,24 @@ } } -Constant * -llvm::ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty) { +static Constant *ConstantFoldFP(double (*NativeFP)(double), double V, + const Type *Ty) { errno = 0; V = NativeFP(V); if (errno == 0) return ConstantFP::get(Ty, V); + errno = 0; return 0; } /// ConstantFoldCall - Attempt to constant fold a call to the specified function /// with the specified arguments, returning null if unsuccessful. Constant * -llvm::ConstantFoldCall(Function *F, const std::vector &Operands) { +llvm::ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands) { const std::string &Name = F->getName(); const Type *Ty = F->getReturnType(); - if (Operands.size() == 1) { + if (NumOperands == 1) { if (ConstantFP *Op = dyn_cast(Operands[0])) { double V = Op->getValue(); switch (Name[0]) @@ -172,7 +173,7 @@ else if (Name == "llvm.bswap.i64") return ConstantInt::get(Ty, ByteSwap_64(V)); } - } else if (Operands.size() == 2) { + } else if (NumOperands == 2) { if (ConstantFP *Op1 = dyn_cast(Operands[0])) { double Op1V = Op1->getValue(); if (ConstantFP *Op2 = dyn_cast(Operands[1])) { Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.90 llvm/lib/Analysis/ScalarEvolution.cpp:1.91 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.90 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Jan 30 17:15:43 2007 @@ -1761,8 +1761,8 @@ return ConstantExpr::getSelect(Operands[0], Operands[1], Operands[2]); case Instruction::Call: if (Function *GV = dyn_cast(Operands[0])) { - Operands.erase(Operands.begin()); - return ConstantFoldCall(cast(GV), Operands); + return ConstantFoldCall(cast(GV), &Operands[1], + Operands.size()-1); } return 0; case Instruction::GetElementPtr: { From sabre at nondot.org Tue Jan 30 17:16:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:16:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200701302316.l0UNGYXC026768@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.612 -> 1.613 --- Log message: pass TD to constant folding apis --- Diffs of the changes: (+2 -2) InstructionCombining.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.612 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.613 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.612 Tue Jan 30 16:50:32 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 17:16:15 2007 @@ -9167,7 +9167,7 @@ } // ConstantProp instruction if trivially constant. - if (Constant *C = ConstantFoldInstruction(Inst)) { + if (Constant *C = ConstantFoldInstruction(Inst, TD)) { if (ConstantExpr *CE = dyn_cast(C)) C = OptimizeConstantExpr(CE, TD); DOUT << "IC: ConstFold to: " << *C << " from: " << *Inst; @@ -9258,7 +9258,7 @@ } // Instruction isn't dead, see if we can constant propagate it. - if (Constant *C = ConstantFoldInstruction(I)) { + if (Constant *C = ConstantFoldInstruction(I, TD)) { if (ConstantExpr *CE = dyn_cast(C)) C = OptimizeConstantExpr(CE, TD); DOUT << "IC: ConstFold to: " << *C << " from: " << *I; From sabre at nondot.org Tue Jan 30 17:16:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:16:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FoldingSet.cpp Message-ID: <200701302316.l0UNGcwx026775@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FoldingSet.cpp updated: 1.11 -> 1.12 --- Log message: reformat comment --- Diffs of the changes: (+2 -2) FoldingSet.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Support/FoldingSet.cpp diff -u llvm/lib/Support/FoldingSet.cpp:1.11 llvm/lib/Support/FoldingSet.cpp:1.12 --- llvm/lib/Support/FoldingSet.cpp:1.11 Thu Nov 2 19:38:14 2006 +++ llvm/lib/Support/FoldingSet.cpp Tue Jan 30 17:16:22 2007 @@ -125,8 +125,8 @@ /// singly-linked-list. In order to make deletion more efficient, we make /// the list circular, so we can delete a node without computing its hash. /// The problem with this is that the start of the hash buckets are not -/// Nodes. If NextInBucketPtr is a bucket pointer, this method returns null -/// : use GetBucketPtr when this happens. +/// Nodes. If NextInBucketPtr is a bucket pointer, this method returns null: +/// use GetBucketPtr when this happens. static FoldingSetImpl::Node *GetNextPtr(void *NextInBucketPtr, void **Buckets, unsigned NumBuckets) { if (NextInBucketPtr >= Buckets && NextInBucketPtr < Buckets + NumBuckets) From sabre at nondot.org Tue Jan 30 17:22:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:22:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneFunction.cpp InlineFunction.cpp Message-ID: <200701302322.l0UNMu9t026921@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneFunction.cpp updated: 1.37 -> 1.38 InlineFunction.cpp updated: 1.50 -> 1.51 --- Log message: The inliner/cloner can now optionally take TargetData info, which can be used by constant folding. --- Diffs of the changes: (+14 -11) CloneFunction.cpp | 13 ++++++++----- InlineFunction.cpp | 12 ++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) Index: llvm/lib/Transforms/Utils/CloneFunction.cpp diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.37 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.38 --- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.37 Tue Jan 30 17:13:49 2007 +++ llvm/lib/Transforms/Utils/CloneFunction.cpp Tue Jan 30 17:22:39 2007 @@ -158,15 +158,17 @@ std::vector &Returns; const char *NameSuffix; ClonedCodeInfo *CodeInfo; + const TargetData *TD; public: PruningFunctionCloner(Function *newFunc, const Function *oldFunc, std::map &valueMap, std::vector &returns, const char *nameSuffix, - ClonedCodeInfo *codeInfo) + ClonedCodeInfo *codeInfo, + const TargetData *td) : NewFunc(newFunc), OldFunc(oldFunc), ValueMap(valueMap), Returns(returns), - NameSuffix(nameSuffix), CodeInfo(codeInfo) { + NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td) { } /// CloneBlock - The specified block is found to be reachable, clone it and @@ -290,7 +292,7 @@ else return 0; // All operands not constant! - return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); + return ConstantFoldInstOperands(I, &Ops[0], Ops.size(), TD); } /// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto, @@ -304,7 +306,8 @@ std::map &ValueMap, std::vector &Returns, const char *NameSuffix, - ClonedCodeInfo *CodeInfo) { + ClonedCodeInfo *CodeInfo, + const TargetData *TD) { assert(NameSuffix && "NameSuffix cannot be null!"); #ifndef NDEBUG @@ -314,7 +317,7 @@ #endif PruningFunctionCloner PFC(NewFunc, OldFunc, ValueMap, Returns, - NameSuffix, CodeInfo); + NameSuffix, CodeInfo, TD); // Clone the entry block, and anything recursively reachable from it. PFC.CloneBlock(&OldFunc->getEntryBlock()); Index: llvm/lib/Transforms/Utils/InlineFunction.cpp diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.50 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.51 --- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.50 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/Utils/InlineFunction.cpp Tue Jan 30 17:22:39 2007 @@ -22,11 +22,11 @@ #include "llvm/Support/CallSite.h" using namespace llvm; -bool llvm::InlineFunction(CallInst *CI, CallGraph *CG) { - return InlineFunction(CallSite(CI), CG); +bool llvm::InlineFunction(CallInst *CI, CallGraph *CG, const TargetData *TD) { + return InlineFunction(CallSite(CI), CG, TD); } -bool llvm::InlineFunction(InvokeInst *II, CallGraph *CG) { - return InlineFunction(CallSite(II), CG); +bool llvm::InlineFunction(InvokeInst *II, CallGraph *CG, const TargetData *TD) { + return InlineFunction(CallSite(II), CG, TD); } /// HandleInlinedInvoke - If we inlined an invoke site, we need to convert calls @@ -177,7 +177,7 @@ // exists in the instruction stream. Similiarly this will inline a recursive // function by one level. // -bool llvm::InlineFunction(CallSite CS, CallGraph *CG) { +bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { Instruction *TheCall = CS.getInstruction(); assert(TheCall->getParent() && TheCall->getParent()->getParent() && "Instruction not in function!"); @@ -225,7 +225,7 @@ // (which can happen, e.g., because an argument was constant), but we'll be // happy with whatever the cloner can do. CloneAndPruneFunctionInto(Caller, CalledFunc, ValueMap, Returns, ".i", - &InlinedFunctionInfo); + &InlinedFunctionInfo, TD); // Remember the first block that is newly cloned over. FirstNewBlock = LastBlock; ++FirstNewBlock; From sabre at nondot.org Tue Jan 30 17:22:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:22:56 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Cloning.h Message-ID: <200701302322.l0UNMurL026926@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: Cloning.h updated: 1.20 -> 1.21 --- Log message: The inliner/cloner can now optionally take TargetData info, which can be used by constant folding. --- Diffs of the changes: (+6 -4) Cloning.h | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Transforms/Utils/Cloning.h diff -u llvm/include/llvm/Transforms/Utils/Cloning.h:1.20 llvm/include/llvm/Transforms/Utils/Cloning.h:1.21 --- llvm/include/llvm/Transforms/Utils/Cloning.h:1.20 Fri May 26 20:21:50 2006 +++ llvm/include/llvm/Transforms/Utils/Cloning.h Tue Jan 30 17:22:39 2007 @@ -33,6 +33,7 @@ class CallSite; class Trace; class CallGraph; +class TargetData; /// CloneModule - Return an exact copy of the specified module /// @@ -141,7 +142,8 @@ std::map &ValueMap, std::vector &Returns, const char *NameSuffix = "", - ClonedCodeInfo *CodeInfo = 0); + ClonedCodeInfo *CodeInfo = 0, + const TargetData *TD = 0); /// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is @@ -170,9 +172,9 @@ /// If a non-null callgraph pointer is provided, these functions update the /// CallGraph to represent the program after inlining. /// -bool InlineFunction(CallInst *C, CallGraph *CG = 0); -bool InlineFunction(InvokeInst *II, CallGraph *CG = 0); -bool InlineFunction(CallSite CS, CallGraph *CG = 0); +bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0); +bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD =0); +bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0); } // End llvm namespace From rspencer at reidspencer.com Tue Jan 30 17:26:19 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 30 Jan 2007 15:26:19 -0800 Subject: [llvm-commits] [llvm-gcc] Patch for isExternal -> isDeclaration Message-ID: <1170199579.545.143.camel@bashful.x10sys.com> Here's a patch for llvm-gcc for PR1136 renaming GlobalValue::isExternal as isDeclaration. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: isDeclaration.patch Type: text/x-patch Size: 2284 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070130/afd8cdd1/attachment.bin From sabre at nondot.org Tue Jan 30 17:28:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:28:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Inliner.cpp Inliner.h Message-ID: <200701302328.l0UNStK5027070@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Inliner.cpp updated: 1.36 -> 1.37 Inliner.h updated: 1.8 -> 1.9 --- Log message: the inliner pass now passes targetdata down through the inliner api's --- Diffs of the changes: (+19 -3) Inliner.cpp | 17 ++++++++++++++--- Inliner.h | 5 +++++ 2 files changed, 19 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.36 llvm/lib/Transforms/IPO/Inliner.cpp:1.37 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.36 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/IPO/Inliner.cpp Tue Jan 30 17:28:39 2007 @@ -19,6 +19,7 @@ #include "llvm/Instructions.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Support/CallSite.h" +#include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" @@ -37,12 +38,21 @@ Inliner::Inliner() : InlineThreshold(InlineLimit) {} +/// getAnalysisUsage - For this class, we declare that we require and preserve +/// the call graph. If the derived class implements this method, it should +/// always explicitly call the implementation here. +void Inliner::getAnalysisUsage(AnalysisUsage &Info) const { + Info.addRequired(); + CallGraphSCCPass::getAnalysisUsage(Info); +} + // InlineCallIfPossible - If it is possible to inline the specified call site, // do so and update the CallGraph for this operation. static bool InlineCallIfPossible(CallSite CS, CallGraph &CG, - const std::set &SCCFunctions) { + const std::set &SCCFunctions, + const TargetData &TD) { Function *Callee = CS.getCalledFunction(); - if (!InlineFunction(CS, &CG)) return false; + if (!InlineFunction(CS, &CG, &TD)) return false; // If we inlined the last possible call site to the function, delete the // function body now. @@ -134,7 +144,8 @@ << ", Call: " << *CS.getInstruction(); // Attempt to inline the function... - if (InlineCallIfPossible(CS, CG, SCCFunctions)) { + if (InlineCallIfPossible(CS, CG, SCCFunctions, + getAnalysis())) { // Remove this call site from the list. If possible, use // swap/pop_back for efficiency, but do not use it if doing so would // move a call site to a function in this SCC before the Index: llvm/lib/Transforms/IPO/Inliner.h diff -u llvm/lib/Transforms/IPO/Inliner.h:1.8 llvm/lib/Transforms/IPO/Inliner.h:1.9 --- llvm/lib/Transforms/IPO/Inliner.h:1.8 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/Inliner.h Tue Jan 30 17:28:39 2007 @@ -29,6 +29,11 @@ struct Inliner : public CallGraphSCCPass { Inliner(); + /// getAnalysisUsage - For this class, we declare that we require and preserve + /// the call graph. If the derived class implements this method, it should + /// always explicitly call the implementation here. + virtual void getAnalysisUsage(AnalysisUsage &Info) const; + // Main run interface method, this implements the interface required by the // Pass class. virtual bool runOnSCC(const std::vector &SCC); From sabre at nondot.org Tue Jan 30 17:30:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:30:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200701302330.l0UNU3Zk027138@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.66 -> 1.67 --- Log message: remove now-dead code. --- Diffs of the changes: (+0 -14) Local.cpp | 14 -------------- 1 files changed, 14 deletions(-) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.66 llvm/lib/Transforms/Utils/Local.cpp:1.67 --- llvm/lib/Transforms/Utils/Local.cpp:1.66 Tue Jan 30 17:13:49 2007 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Jan 30 17:29:47 2007 @@ -68,20 +68,6 @@ return Result; } - Constant *Op0 = 0, *Op1 = 0; - switch (I->getNumOperands()) { - default: - case 2: - Op1 = dyn_cast(I->getOperand(1)); - if (Op1 == 0) return 0; // Not a constant?, can't fold - /* FALL THROUGH */ - case 1: - Op0 = dyn_cast(I->getOperand(0)); - if (Op0 == 0) return 0; // Not a constant?, can't fold - break; - case 0: return 0; - } - // Scan the operand list, checking to see if they are all constants, if so, // hand off to ConstantFoldInstOperands. SmallVector Ops; From sabre at nondot.org Tue Jan 30 17:46:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp Message-ID: <200701302346.l0UNk1C6027787@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.11 -> 1.12 --- Log message: move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into libanalysis/ConstantFolding.cpp. --- Diffs of the changes: (+155 -2) ConstantFolding.cpp | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 155 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.11 llvm/lib/Analysis/ConstantFolding.cpp:1.12 --- llvm/lib/Analysis/ConstantFolding.cpp:1.11 Tue Jan 30 17:15:43 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Tue Jan 30 17:45:45 2007 @@ -15,19 +15,172 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" #include #include using namespace llvm; +/// ConstantFoldInstruction - Attempt to constant fold the specified +/// instruction. If successful, the constant result is returned, if not, null +/// is returned. Note that this function can only fail when attempting to fold +/// instructions like loads and stores, which have no constant expression form. +/// +Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) { + if (PHINode *PN = dyn_cast(I)) { + if (PN->getNumIncomingValues() == 0) + return Constant::getNullValue(PN->getType()); + + Constant *Result = dyn_cast(PN->getIncomingValue(0)); + if (Result == 0) return 0; + + // Handle PHI nodes specially here... + for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) + if (PN->getIncomingValue(i) != Result && PN->getIncomingValue(i) != PN) + return 0; // Not all the same incoming constants... + + // If we reach here, all incoming values are the same constant. + return Result; + } + + // Scan the operand list, checking to see if they are all constants, if so, + // hand off to ConstantFoldInstOperands. + SmallVector Ops; + for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) + if (Constant *Op = dyn_cast(I->getOperand(i))) + Ops.push_back(Op); + else + return 0; // All operands not constant! + + return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); +} + +/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the +/// specified opcode and operands. If successful, the constant result is +/// returned, if not, null is returned. Note that this function can fail when +/// attempting to fold instructions like loads and stores, which have no +/// constant expression form. +/// +Constant *llvm::ConstantFoldInstOperands(const Instruction* I, + Constant** Ops, unsigned NumOps, + const TargetData *TD) { + unsigned Opc = I->getOpcode(); + const Type *DestTy = I->getType(); + + // Handle easy binops first + if (isa(I)) + return ConstantExpr::get(Opc, Ops[0], Ops[1]); + + switch (Opc) { + default: return 0; + case Instruction::Call: + if (Function *F = dyn_cast(Ops[0])) + if (canConstantFoldCallTo(F)) + return ConstantFoldCall(F, Ops+1, NumOps); + return 0; + case Instruction::ICmp: + case Instruction::FCmp: + return ConstantExpr::getCompare(cast(I)->getPredicate(), Ops[0], + Ops[1]); + case Instruction::Shl: + case Instruction::LShr: + case Instruction::AShr: + return ConstantExpr::get(Opc, Ops[0], Ops[1]); + case Instruction::Trunc: + case Instruction::ZExt: + case Instruction::SExt: + case Instruction::FPTrunc: + case Instruction::FPExt: + case Instruction::UIToFP: + case Instruction::SIToFP: + case Instruction::FPToUI: + case Instruction::FPToSI: + case Instruction::PtrToInt: + case Instruction::IntToPtr: + case Instruction::BitCast: + return ConstantExpr::getCast(Opc, Ops[0], DestTy); + case Instruction::Select: + return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]); + case Instruction::ExtractElement: + return ConstantExpr::getExtractElement(Ops[0], Ops[1]); + case Instruction::InsertElement: + return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]); + case Instruction::ShuffleVector: + return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); + case Instruction::GetElementPtr: + return ConstantExpr::getGetElementPtr(Ops[0], + std::vector(Ops+1, + Ops+NumOps)); + } +} + +/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a +/// getelementptr constantexpr, return the constant value being addressed by the +/// constant expression, or null if something is funny and we can't decide. +Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C, + ConstantExpr *CE) { + if (CE->getOperand(1) != Constant::getNullValue(CE->getOperand(1)->getType())) + return 0; // Do not allow stepping over the value! + + // Loop over all of the operands, tracking down which value we are + // addressing... + gep_type_iterator I = gep_type_begin(CE), E = gep_type_end(CE); + for (++I; I != E; ++I) + if (const StructType *STy = dyn_cast(*I)) { + ConstantInt *CU = cast(I.getOperand()); + assert(CU->getZExtValue() < STy->getNumElements() && + "Struct index out of range!"); + unsigned El = (unsigned)CU->getZExtValue(); + if (ConstantStruct *CS = dyn_cast(C)) { + C = CS->getOperand(El); + } else if (isa(C)) { + C = Constant::getNullValue(STy->getElementType(El)); + } else if (isa(C)) { + C = UndefValue::get(STy->getElementType(El)); + } else { + return 0; + } + } else if (ConstantInt *CI = dyn_cast(I.getOperand())) { + if (const ArrayType *ATy = dyn_cast(*I)) { + if (CI->getZExtValue() >= ATy->getNumElements()) + return 0; + if (ConstantArray *CA = dyn_cast(C)) + C = CA->getOperand(CI->getZExtValue()); + else if (isa(C)) + C = Constant::getNullValue(ATy->getElementType()); + else if (isa(C)) + C = UndefValue::get(ATy->getElementType()); + else + return 0; + } else if (const PackedType *PTy = dyn_cast(*I)) { + if (CI->getZExtValue() >= PTy->getNumElements()) + return 0; + if (ConstantPacked *CP = dyn_cast(C)) + C = CP->getOperand(CI->getZExtValue()); + else if (isa(C)) + C = Constant::getNullValue(PTy->getElementType()); + else if (isa(C)) + C = UndefValue::get(PTy->getElementType()); + else + return 0; + } else { + return 0; + } + } else { + return 0; + } + return C; +} + + //===----------------------------------------------------------------------===// -// Constant Folding ... +// Constant Folding for Calls // - /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. bool From sabre at nondot.org Tue Jan 30 17:46:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200701302346.l0UNk3TF027792@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.67 -> 1.68 --- Log message: move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into libanalysis/ConstantFolding.cpp. --- Diffs of the changes: (+0 -152) Local.cpp | 152 -------------------------------------------------------------- 1 files changed, 152 deletions(-) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.67 llvm/lib/Transforms/Utils/Local.cpp:1.68 --- llvm/lib/Transforms/Utils/Local.cpp:1.67 Tue Jan 30 17:29:47 2007 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Jan 30 17:45:45 2007 @@ -21,7 +21,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" -#include "llvm/ADT/SmallVector.h" #include using namespace llvm; @@ -46,99 +45,6 @@ return false; } -/// ConstantFoldInstruction - Attempt to constant fold the specified -/// instruction. If successful, the constant result is returned, if not, null -/// is returned. Note that this function can only fail when attempting to fold -/// instructions like loads and stores, which have no constant expression form. -/// -Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) { - if (PHINode *PN = dyn_cast(I)) { - if (PN->getNumIncomingValues() == 0) - return Constant::getNullValue(PN->getType()); - - Constant *Result = dyn_cast(PN->getIncomingValue(0)); - if (Result == 0) return 0; - - // Handle PHI nodes specially here... - for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) - if (PN->getIncomingValue(i) != Result && PN->getIncomingValue(i) != PN) - return 0; // Not all the same incoming constants... - - // If we reach here, all incoming values are the same constant. - return Result; - } - - // Scan the operand list, checking to see if they are all constants, if so, - // hand off to ConstantFoldInstOperands. - SmallVector Ops; - for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) - if (Constant *Op = dyn_cast(I->getOperand(i))) - Ops.push_back(Op); - else - return 0; // All operands not constant! - - return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); -} - -/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the -/// specified opcode and operands. If successful, the constant result is -/// returned, if not, null is returned. Note that this function can fail when -/// attempting to fold instructions like loads and stores, which have no -/// constant expression form. -/// -Constant *llvm::ConstantFoldInstOperands(const Instruction* I, - Constant** Ops, unsigned NumOps, - const TargetData *TD) { - unsigned Opc = I->getOpcode(); - const Type *DestTy = I->getType(); - - // Handle easy binops first - if (isa(I)) - return ConstantExpr::get(Opc, Ops[0], Ops[1]); - - switch (Opc) { - default: return 0; - case Instruction::Call: - if (Function *F = dyn_cast(Ops[0])) - if (canConstantFoldCallTo(F)) - return ConstantFoldCall(F, Ops+1, NumOps); - return 0; - case Instruction::ICmp: - case Instruction::FCmp: - return ConstantExpr::getCompare(cast(I)->getPredicate(), Ops[0], - Ops[1]); - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: - return ConstantExpr::get(Opc, Ops[0], Ops[1]); - case Instruction::Trunc: - case Instruction::ZExt: - case Instruction::SExt: - case Instruction::FPTrunc: - case Instruction::FPExt: - case Instruction::UIToFP: - case Instruction::SIToFP: - case Instruction::FPToUI: - case Instruction::FPToSI: - case Instruction::PtrToInt: - case Instruction::IntToPtr: - case Instruction::BitCast: - return ConstantExpr::getCast(Opc, Ops[0], DestTy); - case Instruction::Select: - return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]); - case Instruction::ExtractElement: - return ConstantExpr::getExtractElement(Ops[0], Ops[1]); - case Instruction::InsertElement: - return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]); - case Instruction::ShuffleVector: - return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); - case Instruction::GetElementPtr: - return ConstantExpr::getGetElementPtr(Ops[0], - std::vector(Ops+1, - Ops+NumOps)); - } -} - // ConstantFoldTerminator - If a terminator instruction is predicated on a // constant value, convert it into an unconditional branch to the constant // destination. @@ -259,64 +165,6 @@ return false; } -/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a -/// getelementptr constantexpr, return the constant value being addressed by the -/// constant expression, or null if something is funny and we can't decide. -Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C, - ConstantExpr *CE) { - if (CE->getOperand(1) != Constant::getNullValue(CE->getOperand(1)->getType())) - return 0; // Do not allow stepping over the value! - - // Loop over all of the operands, tracking down which value we are - // addressing... - gep_type_iterator I = gep_type_begin(CE), E = gep_type_end(CE); - for (++I; I != E; ++I) - if (const StructType *STy = dyn_cast(*I)) { - ConstantInt *CU = cast(I.getOperand()); - assert(CU->getZExtValue() < STy->getNumElements() && - "Struct index out of range!"); - unsigned El = (unsigned)CU->getZExtValue(); - if (ConstantStruct *CS = dyn_cast(C)) { - C = CS->getOperand(El); - } else if (isa(C)) { - C = Constant::getNullValue(STy->getElementType(El)); - } else if (isa(C)) { - C = UndefValue::get(STy->getElementType(El)); - } else { - return 0; - } - } else if (ConstantInt *CI = dyn_cast(I.getOperand())) { - if (const ArrayType *ATy = dyn_cast(*I)) { - if (CI->getZExtValue() >= ATy->getNumElements()) - return 0; - if (ConstantArray *CA = dyn_cast(C)) - C = CA->getOperand(CI->getZExtValue()); - else if (isa(C)) - C = Constant::getNullValue(ATy->getElementType()); - else if (isa(C)) - C = UndefValue::get(ATy->getElementType()); - else - return 0; - } else if (const PackedType *PTy = dyn_cast(*I)) { - if (CI->getZExtValue() >= PTy->getNumElements()) - return 0; - if (ConstantPacked *CP = dyn_cast(C)) - C = CP->getOperand(CI->getZExtValue()); - else if (isa(C)) - C = Constant::getNullValue(PTy->getElementType()); - else if (isa(C)) - C = UndefValue::get(PTy->getElementType()); - else - return 0; - } else { - return 0; - } - } else { - return 0; - } - return C; -} - //===----------------------------------------------------------------------===// // Local dead code elimination... From dpatel at apple.com Tue Jan 30 17:45:45 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 30 Jan 2007 15:45:45 -0800 Subject: [llvm-commits] [llvm-gcc] Patch for isExternal -> isDeclaration In-Reply-To: <1170199579.545.143.camel@bashful.x10sys.com> References: <1170199579.545.143.camel@bashful.x10sys.com> Message-ID: On Jan 30, 2007, at 3:26 PM, Reid Spencer wrote: > Here's a patch for llvm-gcc for PR1136 renaming > GlobalValue::isExternal > as isDeclaration. Applied. Thanks, - Devang From sabre at nondot.org Tue Jan 30 17:46:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ConstantProp.cpp CorrelatedExprs.cpp GCSE.cpp InstructionCombining.cpp LICM.cpp LoopUnroll.cpp LoopUnswitch.cpp SCCP.cpp Message-ID: <200701302346.l0UNkhJW027877@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ConstantProp.cpp updated: 1.54 -> 1.55 CorrelatedExprs.cpp updated: 1.50 -> 1.51 GCSE.cpp updated: 1.50 -> 1.51 InstructionCombining.cpp updated: 1.613 -> 1.614 LICM.cpp updated: 1.84 -> 1.85 LoopUnroll.cpp updated: 1.33 -> 1.34 LoopUnswitch.cpp updated: 1.58 -> 1.59 SCCP.cpp updated: 1.154 -> 1.155 --- Log message: Adjust #includes to match movement of constant folding code from transformutils to libanalysis. --- Diffs of the changes: (+10 -7) ConstantProp.cpp | 2 +- CorrelatedExprs.cpp | 2 +- GCSE.cpp | 5 ++--- InstructionCombining.cpp | 1 + LICM.cpp | 2 +- LoopUnroll.cpp | 1 + LoopUnswitch.cpp | 1 + SCCP.cpp | 3 ++- 8 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.54 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.55 --- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.54 Tue Dec 19 15:40:18 2006 +++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Tue Jan 30 17:46:24 2007 @@ -20,7 +20,7 @@ #define DEBUG_TYPE "constprop" #include "llvm/Transforms/Scalar.h" -#include "llvm/Transforms/Utils/Local.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Constant.h" #include "llvm/Instruction.h" #include "llvm/Pass.h" Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.50 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.51 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.50 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Tue Jan 30 17:46:24 2007 @@ -34,9 +34,9 @@ #include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Assembly/Writer.h" -#include "llvm/Transforms/Utils/Local.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/CFG.h" Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.50 llvm/lib/Transforms/Scalar/GCSE.cpp:1.51 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.50 Tue Dec 19 15:40:18 2006 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Tue Jan 30 17:46:24 2007 @@ -16,13 +16,12 @@ #define DEBUG_TYPE "gcse" #include "llvm/Transforms/Scalar.h" -#include "llvm/BasicBlock.h" -#include "llvm/Constant.h" #include "llvm/Instructions.h" +#include "llvm/Function.h" #include "llvm/Type.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/ValueNumbering.h" -#include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.613 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.614 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.613 Tue Jan 30 17:16:15 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 17:46:24 2007 @@ -39,6 +39,7 @@ #include "llvm/Pass.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.84 llvm/lib/Transforms/Scalar/LICM.cpp:1.85 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.84 Sat Dec 23 00:05:41 2006 +++ llvm/lib/Transforms/Scalar/LICM.cpp Tue Jan 30 17:46:24 2007 @@ -33,6 +33,7 @@ #define DEBUG_TYPE "licm" #include "llvm/Transforms/Scalar.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Target/TargetData.h" @@ -42,7 +43,6 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" #include "llvm/Transforms/Utils/PromoteMemToReg.h" -#include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.33 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.34 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.33 Tue Dec 19 15:40:18 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Tue Jan 30 17:46:24 2007 @@ -22,6 +22,7 @@ #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.58 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.59 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.58 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Jan 30 17:46:24 2007 @@ -32,6 +32,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.154 llvm/lib/Transforms/Scalar/SCCP.cpp:1.155 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.154 Tue Jan 30 17:15:19 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Jan 30 17:46:24 2007 @@ -28,10 +28,11 @@ #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Pass.h" -#include "llvm/Support/InstVisitor.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/InstVisitor.h" #include "llvm/ADT/hash_map" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" From sabre at nondot.org Tue Jan 30 17:46:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200701302346.l0UNkhXa027882@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.90 -> 1.91 --- Log message: Adjust #includes to match movement of constant folding code from transformutils to libanalysis. --- Diffs of the changes: (+2 -2) GlobalOpt.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.90 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.91 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.90 Tue Jan 30 17:14:52 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 30 17:46:24 2007 @@ -22,9 +22,9 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Module.h" #include "llvm/Pass.h" -#include "llvm/Support/Debug.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Target/TargetData.h" -#include "llvm/Transforms/Utils/Local.h" +#include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include From sabre at nondot.org Tue Jan 30 17:46:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneFunction.cpp SimplifyCFG.cpp Message-ID: <200701302346.l0UNkigu027892@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneFunction.cpp updated: 1.38 -> 1.39 SimplifyCFG.cpp updated: 1.114 -> 1.115 --- Log message: Adjust #includes to match movement of constant folding code from transformutils to libanalysis. --- Diffs of the changes: (+2 -1) CloneFunction.cpp | 2 +- SimplifyCFG.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/CloneFunction.cpp diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.38 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.39 --- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.38 Tue Jan 30 17:22:39 2007 +++ llvm/lib/Transforms/Utils/CloneFunction.cpp Tue Jan 30 17:46:24 2007 @@ -20,7 +20,7 @@ #include "llvm/Function.h" #include "llvm/Support/CFG.h" #include "ValueMapper.h" -#include "llvm/Transforms/Utils/Local.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/ADT/SmallVector.h" using namespace llvm; Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.114 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.115 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.114 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Tue Jan 30 17:46:24 2007 @@ -19,6 +19,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Debug.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include #include From sabre at nondot.org Tue Jan 30 17:46:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:46:59 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Local.h Message-ID: <200701302346.l0UNkxQa027904@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: Local.h updated: 1.25 -> 1.26 --- Log message: move constant folding code out of Utils/Local into libanalysis --- Diffs of the changes: (+0 -27) Local.h | 27 --------------------------- 1 files changed, 27 deletions(-) Index: llvm/include/llvm/Transforms/Utils/Local.h diff -u llvm/include/llvm/Transforms/Utils/Local.h:1.25 llvm/include/llvm/Transforms/Utils/Local.h:1.26 --- llvm/include/llvm/Transforms/Utils/Local.h:1.25 Tue Jan 30 17:12:47 2007 +++ llvm/include/llvm/Transforms/Utils/Local.h Tue Jan 30 17:46:43 2007 @@ -16,7 +16,6 @@ #define LLVM_TRANSFORMS_UTILS_LOCAL_H #include "llvm/Function.h" -#include "llvm/Analysis/ConstantFolding.h" namespace llvm { @@ -42,32 +41,6 @@ /// bool ConstantFoldTerminator(BasicBlock *BB); -/// ConstantFoldInstruction - Attempt to constant fold the specified -/// instruction. If successful, the constant result is returned, if not, null -/// is returned. Note that this function can only fail when attempting to fold -/// instructions like loads and stores, which have no constant expression form. -/// -Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0); - -/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the -/// specified operands. If successful, the constant result is returned, if not, -/// null is returned. Note that this function can fail when attempting to -/// fold instructions like loads and stores, which have no constant expression -/// form. -/// -Constant *ConstantFoldInstOperands( - const Instruction *I, ///< The model instruction - Constant** Ops, ///< The array of constant operands to use. - unsigned NumOps, ///< The number of operands provided. - const TargetData *TD = 0 ///< Optional target information. -); - - -/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a -/// getelementptr constantexpr, return the constant value being addressed by the -/// constant expression, or null if something is funny and we can't decide. -Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE); - //===----------------------------------------------------------------------===// // Local dead code elimination... // From sabre at nondot.org Tue Jan 30 17:47:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:47:51 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/ConstantFolding.h Message-ID: <200701302347.l0UNlpDO027963@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: ConstantFolding.h updated: 1.2 -> 1.3 --- Log message: Make this a *real* header: 1. Remove using namespace llvm; 2. Remove unneeded #includes. 3. Add #include guard. Also add prototypes for new code moved from transformutils to libanalysis. --- Diffs of the changes: (+34 -3) ConstantFolding.h | 37 ++++++++++++++++++++++++++++++++++--- 1 files changed, 34 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Analysis/ConstantFolding.h diff -u llvm/include/llvm/Analysis/ConstantFolding.h:1.2 llvm/include/llvm/Analysis/ConstantFolding.h:1.3 --- llvm/include/llvm/Analysis/ConstantFolding.h:1.2 Tue Jan 30 17:12:47 2007 +++ llvm/include/llvm/Analysis/ConstantFolding.h Tue Jan 30 17:47:35 2007 @@ -12,12 +12,42 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/Function.h" -using namespace llvm; +#ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H +#define LLVM_ANALYSIS_CONSTANTFOLDING_H namespace llvm { + class Constant; + class ConstantExpr; + class Instruction; + class TargetData; + class Function; +/// ConstantFoldInstruction - Attempt to constant fold the specified +/// instruction. If successful, the constant result is returned, if not, null +/// is returned. Note that this function can only fail when attempting to fold +/// instructions like loads and stores, which have no constant expression form. +/// +Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0); + +/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the +/// specified operands. If successful, the constant result is returned, if not, +/// null is returned. Note that this function can fail when attempting to +/// fold instructions like loads and stores, which have no constant expression +/// form. +/// +Constant *ConstantFoldInstOperands( + const Instruction *I, ///< The model instruction + Constant** Ops, ///< The array of constant operands to use. + unsigned NumOps, ///< The number of operands provided. + const TargetData *TD = 0 ///< Optional target information. +); + + +/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a +/// getelementptr constantexpr, return the constant value being addressed by the +/// constant expression, or null if something is funny and we can't decide. +Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE); + /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. bool canConstantFoldCallTo(Function *F); @@ -28,3 +58,4 @@ ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands); } +#endif From sabre at nondot.org Tue Jan 30 17:53:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 17:53:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200701302353.l0UNr0bX028101@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.91 -> 1.92 --- Log message: The local "ConstantFold" method is now just a watered down version of ConstantFoldInstOperands. Switch to ConstantFoldInstOperands and remove ConstantFold. --- Diffs of the changes: (+3 -37) ScalarEvolution.cpp | 40 +++------------------------------------- 1 files changed, 3 insertions(+), 37 deletions(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.91 llvm/lib/Analysis/ScalarEvolution.cpp:1.92 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.91 Tue Jan 30 17:15:43 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Jan 30 17:52:44 2007 @@ -1746,41 +1746,6 @@ return false; } -/// ConstantFold - Constant fold an instruction of the specified type with the -/// specified constant operands. This function may modify the operands vector. -static Constant *ConstantFold(const Instruction *I, - std::vector &Operands) { - if (isa(I) || isa(I)) - return ConstantExpr::get(I->getOpcode(), Operands[0], Operands[1]); - - if (isa(I)) - return ConstantExpr::getCast(I->getOpcode(), Operands[0], I->getType()); - - switch (I->getOpcode()) { - case Instruction::Select: - return ConstantExpr::getSelect(Operands[0], Operands[1], Operands[2]); - case Instruction::Call: - if (Function *GV = dyn_cast(Operands[0])) { - return ConstantFoldCall(cast(GV), &Operands[1], - Operands.size()-1); - } - return 0; - case Instruction::GetElementPtr: { - Constant *Base = Operands[0]; - Operands.erase(Operands.begin()); - return ConstantExpr::getGetElementPtr(Base, Operands); - } - case Instruction::ICmp: - return ConstantExpr::getICmp( - cast(I)->getPredicate(), Operands[0], Operands[1]); - case Instruction::FCmp: - return ConstantExpr::getFCmp( - cast(I)->getPredicate(), Operands[0], Operands[1]); - } - return 0; -} - - /// getConstantEvolvingPHI - Given an LLVM value and a loop, return a PHI node /// in the loop that V is derived from. We allow arbitrary operations along the /// way, but the operands of an operation must either be constants or a value @@ -1841,7 +1806,7 @@ if (Operands[i] == 0) return 0; } - return ConstantFold(I, Operands); + return ConstantFoldInstOperands(I, &Operands[0], Operands.size()); } /// getConstantEvolutionLoopExitValue - If we know that the specified Phi is @@ -2006,7 +1971,8 @@ } } } - return SCEVUnknown::get(ConstantFold(I, Operands)); + Constant *C =ConstantFoldInstOperands(I, &Operands[0], Operands.size()); + return SCEVUnknown::get(C); } } From reid at x10sys.com Tue Jan 30 18:13:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 18:13:54 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/convert.cpp Message-ID: <200701310013.l0V0DsKN028540@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: convert.cpp added (r1.1) --- Log message: New test case for testing conversions between int and APInt. --- Diffs of the changes: (+32 -0) convert.cpp | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/convert.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/convert.cpp:1.1 *** /dev/null Tue Jan 30 18:13:48 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/convert.cpp Tue Jan 30 18:13:38 2007 *************** *** 0 **** --- 1,32 ---- + //===--- convert.c --- Test Cases for Bit Accurate Types ------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for arithmetic operations with signed and + // unsigned operands. + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/APInt.h" + #include + + using namespace llvm; + + int + main ( int argc, char** argv) + { + APInt x(0,23); + APInt y(0,23); + int j = 32; + + x = y + 17; + x += j; + y = x - j; + y += 17; + + // Should produce: 49 34 + printf("%d %d \n", (int)x.getValue(), (int)y.getValue()); + } From reid at x10sys.com Tue Jan 30 18:26:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 18:26:24 -0600 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200701310026.l0V0QO0g028802@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.61 -> 1.62 --- Log message: Excise documentation about Compaction Tables. --- Diffs of the changes: (+7 -99) BytecodeFormat.html | 106 +++------------------------------------------------- 1 files changed, 7 insertions(+), 99 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.61 llvm/docs/BytecodeFormat.html:1.62 --- llvm/docs/BytecodeFormat.html:1.61 Sat Jan 27 13:23:25 2007 +++ llvm/docs/BytecodeFormat.html Tue Jan 30 18:26:08 2007 @@ -38,7 +38,6 @@
  • Module Info Block
  • Global Constant Pool
  • Function Definition
  • -
  • Compaction Table
  • Instructions List
  • Instructions
  • Symbol Table
  • @@ -403,15 +402,7 @@ always written to the file first (in the Global Type Pool) and in such a way that both forward and backward references of the types can often be resolved with a single pass through the type pool.

    -

    Slot numbers are also kept small by rearranging their order. Because -of the structure of LLVM, certain values are much more likely to be used -frequently in the body of a function. For this reason, a compaction table is -provided in the body of a function if its use would make the function body -smaller. Suppose you have a function body that uses just the types "int*" and -"{double}" but uses them thousands of time. Its worthwhile to ensure that the -slot number for these types are low so they can be encoded in a single byte -(via vbr). This is exactly what the compaction table does.

    -

    In summary then, a slot number can be though of as just a vbr encoded index +

    In summary then, a slot number can be thought of as just a vbr encoded index into a list of Type* or Value*. To keep slot numbers low, Value* are indexed by two slot numbers: the "type plane index" (type slot) and the "value index" (value slot).

    @@ -500,7 +491,7 @@    Function Definitions* One function block is written for each function in the module. The function block contains the instructions, -compaction table, type constant pool, and symbol table for the function. +type constant pool, and symbol table for the function. 0x03 @@ -514,18 +505,6 @@ within the function are emitted here in the function constant pool. - 0x08 - Function - Yes - No - 2 -       Compaction Table - This table reduces bytecode size by providing -a funtion-local mapping of type and value slot numbers to their global -slot numbers - - 0x07 Function No @@ -1394,9 +1373,9 @@
    -

    Function definitions contain the linkage, constant pool or -compaction table, instruction list, and symbol table for a function. -The following table shows the structure of a function definition.

    +

    Function definitions contain the linkage, constant pool, instruction list, +and symbol table for a function. The following table shows the structure of +a function definition.

    @@ -1422,11 +1401,6 @@ - - - - @@ -1442,9 +1416,6 @@
    1. Note that if the linkage type is "External" then none of the other fields will be present as the function is defined elsewhere.
    2. -
    3. Note that only one of the constant pool or compaction table will -be written. Compaction tables are only written if they will actually -save bytecode space. If not, then a regular constant pool is written.
    @@ -1470,76 +1441,13 @@ -
    blockThe compaction -table block for the function.2
    block The instruction list for the function.
    bit(19-31)Currently unassigned.
    - -
    - -
    -

    Compaction tables are part of a function definition. They are merely -a device for reducing the size of bytecode files. The size of a -bytecode file is dependent on the values of the slot numbers -used because larger values use more bytes in the variable bit rate -encoding scheme. Furthermore, the compressed instruction format -reserves only six bits for the type of the instruction. In large -modules, declaring hundreds or thousands of types, the values of the -slot numbers can be quite large. However, functions may use only a -small fraction of the global types. In such cases a compaction table is -created that maps the global type and value slot numbers to smaller -values used by a function. Functions will contain either a -function-specific constant pool or a compaction table but not -both. Compaction tables have the format shown in the table below.

    - - - - - - - - - - - - - - - - - - - - - - - -
    TypeField Description
    uint32_vbrThe number of types that follow
    uint24_vbr+The type slot number in the global types of -the type that will be referenced in the function with the index of this -entry in the compaction table.
    type_lenAn encoding of the type and number of values -that follow. This field's encoding varies depending on the size of the -type plane. See Type and Length for further -details.
    uint32_vbr+The value slot number in the global values -that will be referenced in the function with the index of this entry in -the compaction table.
    -
    - - -
    -

    The type and length of a compaction table type plane is encoded -differently depending on the length of the plane. For planes of length -1 or 2, the length is encoded into bits 0 and 1 of a uint32_vbr and the type is encoded into bits -2-31. Because type numbers are often small, this often saves an extra -byte per plane. If the length of the plane is greater than 2 then the -encoding uses a uint32_vbr for each of the -length and type, in that order.

    -
    -

    The instructions in a function are written as a simple list. Basic @@ -2190,7 +2098,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/01/27 19:23:25 $ +Last modified: $Date: 2007/01/31 00:26:08 $ From reid at x10sys.com Tue Jan 30 18:39:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 18:39:02 -0600 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200701310039.l0V0d249029109@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.62 -> 1.63 --- Log message: Correct the instruction op codes to meet current head changes. --- Diffs of the changes: (+34 -52) BytecodeFormat.html | 85 ++++++++++++++++++++-------------------------------- 1 files changed, 34 insertions(+), 51 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.62 llvm/docs/BytecodeFormat.html:1.63 --- llvm/docs/BytecodeFormat.html:1.62 Tue Jan 30 18:26:08 2007 +++ llvm/docs/BytecodeFormat.html Tue Jan 30 18:38:46 2007 @@ -1529,34 +1529,41 @@ And1611.0 Or1711.0 Xor1811.0 - Binary Comparison Operators - SetEQ1911.0 - SetNE2011.0 - SetLE2111.0 - SetGE2211.0 - SetLT2311.0 - SetGT2411.0 Memory Operators - Malloc2511.0 - Free2611.0 - Alloca2711.0 - Load2811.0 - Store2911.0 - GetElementPtr3011.0 + Malloc1911.0 + Free2011.0 + Alloca2111.0 + Load2211.0 + Store2311.0 + GetElementPtr2411.0 + Cast Operators + Trunc2512.0 + ZExt2612.0 + SExt2712.0 + FPToUI2812.0 + FPToSI2912.0 + UIToFP3012.0 + SIToFP3112.0 + FPTrunc3212.0 + FPExt3312.0 + PtrToInt3412.0 + IntToPtr3512.0 + BitCast3612.0 Other Operators - PHI3111.0 - Cast3211.0 - Call3311.0 - Shl3411.0 - LShr3562.0 - AShr3662.0 - Select3721.2 - UserOp13811.0 - UserOp23911.0 - VAArg4051.5 - ExtractElement4151.5 - InsertElement4251.5 - ShuffleElement4351.5 + ICmp3711.0 + FCmp3811.0 + PHI3911.0 + Call4011.0 + Shl4111.0 + LShr4262.0 + AShr4362.0 + Select4421.2 + UserOp14511.0 + UserOp24611.0 + VAArg4751.5 + ExtractElement4851.5 + InsertElement4951.5 + ShuffleElement5051.5 Pseudo Instructions* @@ -1970,31 +1977,6 @@ Fields.

    -
    Version 1.2 Differences @@ -2098,7 +2080,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/01/31 00:26:08 $ +Last modified: $Date: 2007/01/31 00:38:46 $ From sabre at nondot.org Tue Jan 30 18:52:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 18:52:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp Message-ID: <200701310052.l0V0q4KO029362@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.12 -> 1.13 --- Log message: Move some symbolic constant folding code out of instcombine into a place it can be used by multiple clients. This specifically allows the inliner to constant fold symbolically. --- Diffs of the changes: (+136 -3) ConstantFolding.cpp | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 136 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.12 llvm/lib/Analysis/ConstantFolding.cpp:1.13 --- llvm/lib/Analysis/ConstantFolding.cpp:1.12 Tue Jan 30 17:45:45 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Tue Jan 30 18:51:48 2007 @@ -19,12 +19,136 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" #include #include using namespace llvm; +//===----------------------------------------------------------------------===// +// Constant Folding internal helper functions +//===----------------------------------------------------------------------===// + +/// IsConstantOffsetFromGlobal - If this constant is actually a constant offset +/// from a global, return the global and the constant. Because of +/// constantexprs, this function is recursive. +static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, + int64_t &Offset, const TargetData &TD) { + // Trivial case, constant is the global. + if ((GV = dyn_cast(C))) { + Offset = 0; + return true; + } + + // Otherwise, if this isn't a constant expr, bail out. + ConstantExpr *CE = dyn_cast(C); + if (!CE) return false; + + // Look through ptr->int and ptr->ptr casts. + if (CE->getOpcode() == Instruction::PtrToInt || + CE->getOpcode() == Instruction::BitCast) + return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD); + + // i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) + if (CE->getOpcode() == Instruction::GetElementPtr) { + // Cannot compute this if the element type of the pointer is missing size + // info. + if (!cast(CE->getOperand(0)->getType())->getElementType()->isSized()) + return false; + + // If the base isn't a global+constant, we aren't either. + if (!IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD)) + return false; + + // Otherwise, add any offset that our operands provide. + gep_type_iterator GTI = gep_type_begin(CE); + for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i, ++GTI) { + ConstantInt *CI = dyn_cast(CE->getOperand(i)); + if (!CI) return false; // Index isn't a simple constant? + if (CI->getZExtValue() == 0) continue; // Not adding anything. + + if (const StructType *ST = dyn_cast(*GTI)) { + // N = N + Offset + Offset += TD.getStructLayout(ST)->MemberOffsets[CI->getZExtValue()]; + } else { + const SequentialType *ST = cast(*GTI); + Offset += TD.getTypeSize(ST->getElementType())*CI->getSExtValue(); + } + } + return true; + } + + return false; +} + + +/// SymbolicallyEvaluateBinop - One of Op0/Op1 is a constant expression. +/// Attempt to symbolically evaluate the result of a binary operator merging +/// these together. If target data info is available, it is provided as TD, +/// otherwise TD is null. +static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0, + Constant *Op1, const TargetData *TD){ + // SROA + + // Fold (and 0xffffffff00000000, (shl x, 32)) -> shl. + // Fold (lshr (or X, Y), 32) -> (lshr [X/Y], 32) if one doesn't contribute + // bits. + + + // If the constant expr is something like &A[123] - &A[4].f, fold this into a + // constant. This happens frequently when iterating over a global array. + if (Opc == Instruction::Sub && TD) { + GlobalValue *GV1, *GV2; + int64_t Offs1, Offs2; + + if (IsConstantOffsetFromGlobal(Op0, GV1, Offs1, *TD)) + if (IsConstantOffsetFromGlobal(Op1, GV2, Offs2, *TD) && + GV1 == GV2) { + // (&GV+C1) - (&GV+C2) -> C1-C2, pointer arithmetic cannot overflow. + return ConstantInt::get(Op0->getType(), Offs1-Offs2); + } + } + + // TODO: Fold icmp setne/seteq as well. + return 0; +} + +/// SymbolicallyEvaluateGEP - If we can symbolically evaluate the specified GEP +/// constant expression, do so. +static Constant *SymbolicallyEvaluateGEP(Constant** Ops, unsigned NumOps, + const Type *ResultTy, + const TargetData *TD) { + Constant *Ptr = Ops[0]; + if (!cast(Ptr->getType())->getElementType()->isSized()) + return 0; + + if (TD && Ptr->isNullValue()) { + // If this is a constant expr gep that is effectively computing an + // "offsetof", fold it into 'cast int Size to T*' instead of 'gep 0, 0, 12' + bool isFoldableGEP = true; + for (unsigned i = 1; i != NumOps; ++i) + if (!isa(Ops[i])) { + isFoldableGEP = false; + break; + } + if (isFoldableGEP) { + std::vector NewOps(Ops+1, Ops+NumOps); + uint64_t Offset = TD->getIndexedOffset(Ptr->getType(), NewOps); + Constant *C = ConstantInt::get(TD->getIntPtrType(), Offset); + return ConstantExpr::getIntToPtr(C, ResultTy); + } + } + + return 0; +} + + +//===----------------------------------------------------------------------===// +// Constant Folding public APIs +//===----------------------------------------------------------------------===// + + /// ConstantFoldInstruction - Attempt to constant fold the specified /// instruction. If successful, the constant result is returned, if not, null /// is returned. Note that this function can only fail when attempting to fold @@ -56,7 +180,7 @@ else return 0; // All operands not constant! - return ConstantFoldInstOperands(I, &Ops[0], Ops.size()); + return ConstantFoldInstOperands(I, &Ops[0], Ops.size(), TD); } /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the @@ -71,9 +195,15 @@ unsigned Opc = I->getOpcode(); const Type *DestTy = I->getType(); - // Handle easy binops first - if (isa(I)) + // Handle easy binops first. + if (isa(I)) { + if (isa(Ops[0]) || isa(Ops[1])) + if (Constant *C = SymbolicallyEvaluateBinop(I->getOpcode(), Ops[0], + Ops[1], TD)) + return C; + return ConstantExpr::get(Opc, Ops[0], Ops[1]); + } switch (Opc) { default: return 0; @@ -112,6 +242,9 @@ case Instruction::ShuffleVector: return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); case Instruction::GetElementPtr: + if (Constant *C = SymbolicallyEvaluateGEP(Ops, NumOps, I->getType(), TD)) + return C; + return ConstantExpr::getGetElementPtr(Ops[0], std::vector(Ops+1, Ops+NumOps)); From sabre at nondot.org Tue Jan 30 18:53:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 18:53:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200701310053.l0V0rPxI029431@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.614 -> 1.615 --- Log message: Move symbolic constant folding code to libanalysis. --- Diffs of the changes: (+0 -106) InstructionCombining.cpp | 106 ----------------------------------------------- 1 files changed, 106 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.614 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.615 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.614 Tue Jan 30 17:46:24 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 18:53:10 2007 @@ -9037,108 +9037,6 @@ return true; } -/// IsConstantOffsetFromGlobal - If this constant is actually a constant offset -/// from a global, return the global and the constant. Because of -/// constantexprs, this function is recursive. -static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, - int64_t &Offset, const TargetData &TD) { - // Trivial case, constant is the global. - if ((GV = dyn_cast(C))) { - Offset = 0; - return true; - } - - // Otherwise, if this isn't a constant expr, bail out. - ConstantExpr *CE = dyn_cast(C); - if (!CE) return false; - - // Look through ptr->int and ptr->ptr casts. - if (CE->getOpcode() == Instruction::PtrToInt || - CE->getOpcode() == Instruction::BitCast) - return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD); - - // i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) - if (CE->getOpcode() == Instruction::GetElementPtr) { - // Cannot compute this if the element type of the pointer is missing size - // info. - if (!cast(CE->getOperand(0)->getType())->getElementType()->isSized()) - return false; - - // If the base isn't a global+constant, we aren't either. - if (!IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD)) - return false; - - // Otherwise, add any offset that our operands provide. - gep_type_iterator GTI = gep_type_begin(CE); - for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i, ++GTI) { - ConstantInt *CI = dyn_cast(CE->getOperand(i)); - if (!CI) return false; // Index isn't a simple constant? - if (CI->getZExtValue() == 0) continue; // Not adding anything. - - if (const StructType *ST = dyn_cast(*GTI)) { - // N = N + Offset - Offset += TD.getStructLayout(ST)->MemberOffsets[CI->getZExtValue()]; - } else { - const SequentialType *ST = cast(*GTI); - Offset += TD.getTypeSize(ST->getElementType())*CI->getSExtValue(); - } - } - return true; - } - - return false; -} - -/// OptimizeConstantExpr - Given a constant expression and target data layout -/// information, symbolically evaluate the constant expr to something simpler -/// if possible. -static Constant *OptimizeConstantExpr(ConstantExpr *CE, const TargetData *TD) { - if (!TD) return CE; - - Constant *Ptr = CE->getOperand(0); - if (CE->getOpcode() == Instruction::GetElementPtr && Ptr->isNullValue() && - cast(Ptr->getType())->getElementType()->isSized()) { - // If this is a constant expr gep that is effectively computing an - // "offsetof", fold it into 'cast int Size to T*' instead of 'gep 0, 0, 12' - bool isFoldableGEP = true; - for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i) - if (!isa(CE->getOperand(i))) - isFoldableGEP = false; - if (isFoldableGEP) { - std::vector Ops(CE->op_begin()+1, CE->op_end()); - uint64_t Offset = TD->getIndexedOffset(Ptr->getType(), Ops); - Constant *C = ConstantInt::get(TD->getIntPtrType(), Offset); - return ConstantExpr::getIntToPtr(C, CE->getType()); - } - } - - - // SROA - - // Fold (and 0xffffffff00000000, (shl x, 32)) -> shl. - // Fold (lshr (or X, Y), 32) -> (lshr [X/Y], 32) if one doesn't contribute - // bits. - - - // If the constant expr is something like &A[123] - &A[4].f, fold this into a - // constant. This happens frequently when iterating over a global array. - if (CE->getOpcode() == Instruction::Sub) { - GlobalValue *GV1, *GV2; - int64_t Offs1, Offs2; - - if (IsConstantOffsetFromGlobal(CE->getOperand(0), GV1, Offs1, *TD)) - if (IsConstantOffsetFromGlobal(CE->getOperand(1), GV2, Offs2, *TD) && - GV1 == GV2) { - // (&GV+C1) - (&GV+C2) -> C1-C2, pointer arithmetic cannot overflow. - return ConstantInt::get(CE->getType(), Offs1-Offs2); - } - } - - // TODO: Fold icmp setne/seteq as well. - - return CE; -} - /// AddReachableCodeToWorklist - Walk the function in depth-first order, adding /// all reachable code to the worklist. @@ -9169,8 +9067,6 @@ // ConstantProp instruction if trivially constant. if (Constant *C = ConstantFoldInstruction(Inst, TD)) { - if (ConstantExpr *CE = dyn_cast(C)) - C = OptimizeConstantExpr(CE, TD); DOUT << "IC: ConstFold to: " << *C << " from: " << *Inst; Inst->replaceAllUsesWith(C); ++NumConstProp; @@ -9260,8 +9156,6 @@ // Instruction isn't dead, see if we can constant propagate it. if (Constant *C = ConstantFoldInstruction(I, TD)) { - if (ConstantExpr *CE = dyn_cast(C)) - C = OptimizeConstantExpr(CE, TD); DOUT << "IC: ConstFold to: " << *C << " from: " << *I; // Add operands to the worklist. From reid at x10sys.com Tue Jan 30 19:19:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 30 Jan 2007 19:19:15 -0600 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200701310119.l0V1JFWv029942@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.63 -> 1.64 --- Log message: Fix version information for new instructions. --- Diffs of the changes: (+23 -23) BytecodeFormat.html | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.63 llvm/docs/BytecodeFormat.html:1.64 --- llvm/docs/BytecodeFormat.html:1.63 Tue Jan 30 18:38:46 2007 +++ llvm/docs/BytecodeFormat.html Tue Jan 30 19:18:59 2007 @@ -1519,12 +1519,12 @@ Add711.0 Sub811.0 Mul911.0 - UDiv1011.9 - SDiv1111.9 - FDiv1211.9 - URem1311.9 - SRem1411.9 - FRem1511.9 + UDiv1061.9 + SDiv1161.9 + FDiv1261.9 + URem1361.9 + SRem1461.9 + FRem1561.9 Logical Operators And1611.0 Or1711.0 @@ -1537,26 +1537,26 @@ Store2311.0 GetElementPtr2411.0 Cast Operators - Trunc2512.0 - ZExt2612.0 - SExt2712.0 - FPToUI2812.0 - FPToSI2912.0 - UIToFP3012.0 - SIToFP3112.0 - FPTrunc3212.0 - FPExt3312.0 - PtrToInt3412.0 - IntToPtr3512.0 - BitCast3612.0 + Trunc2572.0 + ZExt2672.0 + SExt2772.0 + FPToUI2872.0 + FPToSI2972.0 + UIToFP3072.0 + SIToFP3172.0 + FPTrunc3272.0 + FPExt3372.0 + PtrToInt3472.0 + IntToPtr3572.0 + BitCast3672.0 Other Operators - ICmp3711.0 - FCmp3811.0 + ICmp3772.0 + FCmp3872.0 PHI3911.0 Call4011.0 Shl4111.0 - LShr4262.0 - AShr4362.0 + LShr4261.9 + AShr4361.9 Select4421.2 UserOp14511.0 UserOp24611.0 @@ -2080,7 +2080,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/01/31 00:38:46 $ +Last modified: $Date: 2007/01/31 01:18:59 $ From evan.cheng at apple.com Tue Jan 30 20:22:38 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 30 Jan 2007 20:22:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701310222.l0V2Mcxq031072@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.13 -> 1.14 --- Log message: - Added Thumb constpool island support. - Islands are inserted right after the user MI since thumb LDR cannot encode negative offset. --- Diffs of the changes: (+17 -24) ARMConstantIslandPass.cpp | 41 +++++++++++++++++------------------------ 1 files changed, 17 insertions(+), 24 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.13 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.14 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.13 Mon Jan 29 19:18:38 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Tue Jan 30 20:22:22 2007 @@ -112,7 +112,7 @@ std::vector &CPEMIs); void InitialFunctionScan(MachineFunction &Fn, const std::vector &CPEMIs); - void SplitBlockBeforeInstr(MachineInstr *MI); + MachineBasicBlock *SplitBlockBeforeInstr(MachineInstr *MI); void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB); bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); bool BBIsInBranchRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned D); @@ -406,8 +406,8 @@ /// Split the basic block containing MI into two blocks, which are joined by /// an unconditional branch. Update datastructures and renumber blocks to -/// account for this change. -void ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) { +/// account for this change and returns the newly created block. +MachineBasicBlock *ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) { MachineBasicBlock *OrigBB = MI->getParent(); bool isThumb = AFI->isThumbFunction(); @@ -453,6 +453,8 @@ // We removed instructions from UserMBB, subtract that off from its size. // Add 2 or 4 to the block to count the unconditional branch we added to it. BBSizes[OrigBB->getNumber()] -= NewBBSize - (isThumb ? 2 : 4); + + return NewBB; } /// HandleConstantPoolUser - Analyze the specified user, checking to see if it @@ -475,33 +477,25 @@ // User before the CPE. if (CPEOffset-UserOffset <= U.MaxDisp) return false; - } else { + } else if (!AFI->isThumbFunction()) { + // Thumb LDR cannot encode negative offset. if (UserOffset-CPEOffset <= U.MaxDisp) return false; } - - // Solution guaranteed to work: split the user's MBB right before the user and + + // Solution guaranteed to work: split the user's MBB right after the user and // insert a clone the CPE into the newly created water. - - // If the user isn't at the start of its MBB, or if there is a fall-through - // into the user's MBB, split the MBB before the User. - MachineBasicBlock *UserMBB = UserMI->getParent(); - if (&UserMBB->front() != UserMI || - UserMBB == &Fn.front() || // entry MBB of function. - BBHasFallthrough(prior(MachineFunction::iterator(UserMBB)))) { - // TODO: Search for the best place to split the code. In practice, using - // loop nesting information to insert these guys outside of loops would be - // sufficient. - SplitBlockBeforeInstr(UserMI); - - // UserMI's BB may have changed. - UserMBB = UserMI->getParent(); - } - + + MachineInstr *NextMI = next(MachineBasicBlock::iterator(UserMI)); + // TODO: Search for the best place to split the code. In practice, using + // loop nesting information to insert these guys outside of loops would be + // sufficient. + MachineBasicBlock *NewBB = SplitBlockBeforeInstr(NextMI); + // Okay, we know we can put an island before UserMBB now, do it! MachineBasicBlock *NewIsland = new MachineBasicBlock(); - Fn.getBasicBlockList().insert(UserMBB, NewIsland); + Fn.getBasicBlockList().insert(NewBB, NewIsland); // Update internal data structures to account for the newly inserted MBB. UpdateForInsertedWaterBlock(NewIsland); @@ -528,7 +522,6 @@ DEBUG(std::cerr << " Moved CPE to #" << ID << " CPI=" << CPI << "\t" << *UserMI); - return true; } From sabre at nondot.org Tue Jan 30 22:39:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:39:45 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Instructions.h Message-ID: <200701310439.l0V4dj92000995@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.121 -> 1.122 Instructions.h updated: 1.50 -> 1.51 --- Log message: Revise APIs for creating constantexpr GEPs to not require the use of vectors. This allows us to eliminate many temporary vectors, and their associated malloc/free pairs. --- Diffs of the changes: (+24 -6) Constants.h | 16 ++++++++++++---- Instructions.h | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.121 llvm/include/llvm/Constants.h:1.122 --- llvm/include/llvm/Constants.h:1.121 Sat Jan 20 18:29:25 2007 +++ llvm/include/llvm/Constants.h Tue Jan 30 22:39:29 2007 @@ -447,7 +447,7 @@ static Constant *getSelectTy(const Type *Ty, Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, - const std::vector &IdxList); + Value* const *Idxs, unsigned NumIdxs); static Constant *getExtractElementTy(const Type *Ty, Constant *Val, Constant *Idx); static Constant *getInsertElementTy(const Type *Ty, Constant *Val, @@ -577,10 +577,18 @@ /// all elements must be Constant's. /// static Constant *getGetElementPtr(Constant *C, - const std::vector &IdxList); + Constant* const *IdxList, unsigned NumIdx); static Constant *getGetElementPtr(Constant *C, - const std::vector &IdxList); - + Value* const *IdxList, unsigned NumIdx); + static Constant *getGetElementPtr(Constant *C, + const std::vector &IdxList) { + return getGetElementPtr(C, &IdxList[0], IdxList.size()); + } + static Constant *getGetElementPtr(Constant *C, + const std::vector &IdxList) { + return getGetElementPtr(C, &IdxList[0], IdxList.size()); + } + static Constant *getExtractElement(Constant *Vec, Constant *Idx); static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx); static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask); Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.50 llvm/include/llvm/Instructions.h:1.51 --- llvm/include/llvm/Instructions.h:1.50 Sun Jan 14 13:41:24 2007 +++ llvm/include/llvm/Instructions.h Tue Jan 30 22:39:29 2007 @@ -348,7 +348,11 @@ const std::string &Name = "", Instruction *InsertBefore =0); GetElementPtrInst(Value *Ptr, const std::vector &Idx, const std::string &Name, BasicBlock *InsertAtEnd); - + GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx, + const std::string &Name = "", Instruction *InsertBefore =0); + GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx, + const std::string &Name, BasicBlock *InsertAtEnd); + /// Constructors - These two constructors are convenience methods because one /// and two index getelementptr instructions are so common. GetElementPtrInst(Value *Ptr, Value *Idx, @@ -375,8 +379,14 @@ /// pointer type. /// static const Type *getIndexedType(const Type *Ptr, - const std::vector &Indices, + Value* const *Idx, unsigned NumIdx, bool AllowStructLeaf = false); + + static const Type *getIndexedType(const Type *Ptr, + const std::vector &Indices, + bool AllowStructLeaf = false) { + return getIndexedType(Ptr, &Indices[0], Indices.size(), AllowStructLeaf); + } static const Type *getIndexedType(const Type *Ptr, Value *Idx0, Value *Idx1, bool AllowStructLeaf = false); static const Type *getIndexedType(const Type *Ptr, Value *Idx); From sabre at nondot.org Tue Jan 30 22:40:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:40:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp ConstantFolding.h Constants.cpp Instructions.cpp Message-ID: <200701310440.l0V4ei6o001108@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.133 -> 1.134 ConstantFolding.h updated: 1.52 -> 1.53 Constants.cpp updated: 1.205 -> 1.206 Instructions.cpp updated: 1.66 -> 1.67 --- Log message: Revise APIs for creating constantexpr GEPs to not require the use of vectors. This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs. --- Diffs of the changes: (+47 -46) ConstantFolding.cpp | 37 +++++++++++++++++++++---------------- ConstantFolding.h | 4 +--- Constants.cpp | 41 +++++++++++++++++++---------------------- Instructions.cpp | 11 ++++++----- 4 files changed, 47 insertions(+), 46 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.133 llvm/lib/VMCore/ConstantFolding.cpp:1.134 --- llvm/lib/VMCore/ConstantFolding.cpp:1.133 Fri Jan 19 15:13:56 2007 +++ llvm/lib/VMCore/ConstantFolding.cpp Tue Jan 30 22:40:28 2007 @@ -23,6 +23,7 @@ #include "llvm/Instructions.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/ManagedStatic.h" @@ -216,7 +217,7 @@ // the first element. If so, return the appropriate GEP instruction. if (const PointerType *PTy = dyn_cast(V->getType())) if (const PointerType *DPTy = dyn_cast(DestTy)) { - std::vector IdxList; + SmallVector IdxList; IdxList.push_back(Constant::getNullValue(Type::Int32Ty)); const Type *ElTy = PTy->getElementType(); while (ElTy != DPTy->getElementType()) { @@ -236,7 +237,7 @@ if (ElTy == DPTy->getElementType()) return ConstantExpr::getGetElementPtr( - const_cast(V),IdxList); + const_cast(V), &IdxList[0], IdxList.size()); } // Handle casts from one packed constant to another. We know that the src @@ -1290,28 +1291,31 @@ } Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, - const std::vector &IdxList) { - if (IdxList.size() == 0 || - (IdxList.size() == 1 && cast(IdxList[0])->isNullValue())) + Constant* const *Idxs, + unsigned NumIdx) { + if (NumIdx == 0 || + (NumIdx == 1 && Idxs[0]->isNullValue())) return const_cast(C); if (isa(C)) { - const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), + (Value**)Idxs, NumIdx, true); assert(Ty != 0 && "Invalid indices for GEP!"); return UndefValue::get(PointerType::get(Ty)); } - Constant *Idx0 = cast(IdxList[0]); + Constant *Idx0 = Idxs[0]; if (C->isNullValue()) { bool isNull = true; - for (unsigned i = 0, e = IdxList.size(); i != e; ++i) - if (!cast(IdxList[i])->isNullValue()) { + for (unsigned i = 0, e = NumIdx; i != e; ++i) + if (!Idxs[i]->isNullValue()) { isNull = false; break; } if (isNull) { - const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), + (Value**)Idxs, NumIdx, true); assert(Ty != 0 && "Invalid indices for GEP!"); return ConstantPointerNull::get(PointerType::get(Ty)); @@ -1330,8 +1334,8 @@ LastTy = *I; if ((LastTy && isa(LastTy)) || Idx0->isNullValue()) { - std::vector NewIndices; - NewIndices.reserve(IdxList.size() + CE->getNumOperands()); + SmallVector NewIndices; + NewIndices.reserve(NumIdx + CE->getNumOperands()); for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i) NewIndices.push_back(CE->getOperand(i)); @@ -1353,8 +1357,9 @@ } NewIndices.push_back(Combined); - NewIndices.insert(NewIndices.end(), IdxList.begin()+1, IdxList.end()); - return ConstantExpr::getGetElementPtr(CE->getOperand(0), NewIndices); + NewIndices.insert(NewIndices.end(), Idxs+1, Idxs+NumIdx); + return ConstantExpr::getGetElementPtr(CE->getOperand(0), &NewIndices[0], + NewIndices.size()); } } @@ -1363,7 +1368,7 @@ // long 0, long 0) // To: int* getelementptr ([3 x int]* %X, long 0, long 0) // - if (CE->isCast() && IdxList.size() > 1 && Idx0->isNullValue()) + if (CE->isCast() && NumIdx > 1 && Idx0->isNullValue()) if (const PointerType *SPT = dyn_cast(CE->getOperand(0)->getType())) if (const ArrayType *SAT = dyn_cast(SPT->getElementType())) @@ -1371,7 +1376,7 @@ dyn_cast(cast(C->getType())->getElementType())) if (CAT->getElementType() == SAT->getElementType()) return ConstantExpr::getGetElementPtr( - (Constant*)CE->getOperand(0), IdxList); + (Constant*)CE->getOperand(0), Idxs, NumIdx); } return 0; } Index: llvm/lib/VMCore/ConstantFolding.h diff -u llvm/lib/VMCore/ConstantFolding.h:1.52 llvm/lib/VMCore/ConstantFolding.h:1.53 --- llvm/lib/VMCore/ConstantFolding.h:1.52 Sun Dec 24 12:52:08 2006 +++ llvm/lib/VMCore/ConstantFolding.h Tue Jan 30 22:40:28 2007 @@ -19,8 +19,6 @@ #ifndef CONSTANTFOLDING_H #define CONSTANTFOLDING_H -#include - namespace llvm { class Value; class Constant; @@ -49,7 +47,7 @@ const Constant *C1, const Constant *C2); Constant *ConstantFoldGetElementPtr(const Constant *C, - const std::vector &IdxList); + Constant* const *Idxs, unsigned NumIdx); } // End llvm namespace #endif Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.205 llvm/lib/VMCore/Constants.cpp:1.206 --- llvm/lib/VMCore/Constants.cpp:1.205 Fri Jan 26 01:37:34 2007 +++ llvm/lib/VMCore/Constants.cpp Tue Jan 30 22:40:28 2007 @@ -1377,7 +1377,8 @@ case Instruction::GetElementPtr: // Make everyone now use a constant of the new type... std::vector Idx(OldC->op_begin()+1, OldC->op_end()); - New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), Idx); + New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), + &Idx[0], Idx.size()); break; } @@ -1744,45 +1745,41 @@ } Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, - const std::vector &IdxList) { - assert(GetElementPtrInst::getIndexedType(C->getType(), IdxList, true) && + Value* const *Idxs, + unsigned NumIdx) { + assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, NumIdx, true) && "GEP indices invalid!"); - if (Constant *FC = ConstantFoldGetElementPtr(C, IdxList)) + if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx)) return FC; // Fold a few common cases... assert(isa(C->getType()) && "Non-pointer type for constant GetElementPtr expression"); // Look up the constant in the table first to ensure uniqueness std::vector ArgVec; - ArgVec.reserve(IdxList.size()+1); + ArgVec.reserve(NumIdx+1); ArgVec.push_back(C); - for (unsigned i = 0, e = IdxList.size(); i != e; ++i) - ArgVec.push_back(cast(IdxList[i])); - const ExprMapKeyType Key(Instruction::GetElementPtr,ArgVec); + for (unsigned i = 0; i != NumIdx; ++i) + ArgVec.push_back(cast(Idxs[i])); + const ExprMapKeyType Key(Instruction::GetElementPtr, ArgVec); return ExprConstants->getOrCreate(ReqTy, Key); } -Constant *ConstantExpr::getGetElementPtr(Constant *C, - const std::vector &IdxList){ +Constant *ConstantExpr::getGetElementPtr(Constant *C, Value* const *Idxs, + unsigned NumIdx) { // Get the result type of the getelementptr! - std::vector VIdxList(IdxList.begin(), IdxList.end()); - - const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), VIdxList, - true); + const Type *Ty = + GetElementPtrInst::getIndexedType(C->getType(), Idxs, NumIdx, true); assert(Ty && "GEP indices invalid!"); - return getGetElementPtrTy(PointerType::get(Ty), C, VIdxList); + return getGetElementPtrTy(PointerType::get(Ty), C, Idxs, NumIdx); } -Constant *ConstantExpr::getGetElementPtr(Constant *C, - const std::vector &IdxList) { - // Get the result type of the getelementptr! - const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, - true); - assert(Ty && "GEP indices invalid!"); - return getGetElementPtrTy(PointerType::get(Ty), C, IdxList); +Constant *ConstantExpr::getGetElementPtr(Constant *C, Constant* const *Idxs, + unsigned NumIdx) { + return getGetElementPtr(C, (Value* const *)Idxs, NumIdx); } + Constant * ConstantExpr::getICmp(unsigned short pred, Constant* LHS, Constant* RHS) { assert(LHS->getType() == RHS->getType()); Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.66 llvm/lib/VMCore/Instructions.cpp:1.67 --- llvm/lib/VMCore/Instructions.cpp:1.66 Fri Jan 26 00:30:34 2007 +++ llvm/lib/VMCore/Instructions.cpp Tue Jan 30 22:40:28 2007 @@ -765,12 +765,13 @@ // pointer type. // const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, - const std::vector &Idx, + Value* const *Idxs, + unsigned NumIdx, bool AllowCompositeLeaf) { if (!isa(Ptr)) return 0; // Type isn't a pointer type! // Handle the special case of the empty set index set... - if (Idx.empty()) + if (NumIdx == 0) if (AllowCompositeLeaf || cast(Ptr)->getElementType()->isFirstClassType()) return cast(Ptr)->getElementType(); @@ -779,12 +780,12 @@ unsigned CurIdx = 0; while (const CompositeType *CT = dyn_cast(Ptr)) { - if (Idx.size() == CurIdx) { + if (NumIdx == CurIdx) { if (AllowCompositeLeaf || CT->isFirstClassType()) return Ptr; return 0; // Can't load a whole structure or array!?!? } - Value *Index = Idx[CurIdx++]; + Value *Index = Idxs[CurIdx++]; if (isa(CT) && CurIdx != 1) return 0; // Can only index into pointer types at the first index! if (!CT->indexValid(Index)) return 0; @@ -798,7 +799,7 @@ Ptr = Ty; } } - return CurIdx == Idx.size() ? Ptr : 0; + return CurIdx == NumIdx ? Ptr : 0; } const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, From sabre at nondot.org Tue Jan 30 22:41:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:41:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp InstructionCombining.cpp Message-ID: <200701310441.l0V4fBop001153@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.106 -> 1.107 InstructionCombining.cpp updated: 1.615 -> 1.616 --- Log message: eliminate temporary vectors --- Diffs of the changes: (+13 -8) IndVarSimplify.cpp | 5 +++-- InstructionCombining.cpp | 16 ++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.106 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.107 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.106 Sun Jan 14 20:27:26 2007 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Jan 30 22:40:53 2007 @@ -173,9 +173,10 @@ /*empty*/; if (isa(*GTI)) { // Pull the last index out of the constant expr GEP. - std::vector CEIdxs(CE->op_begin()+1, CE->op_end()-1); + SmallVector CEIdxs(CE->op_begin()+1, CE->op_end()-1); Constant *NCE = ConstantExpr::getGetElementPtr(CE->getOperand(0), - CEIdxs); + &CEIdxs[0], + CEIdxs.size()); GetElementPtrInst *NGEPI = new GetElementPtrInst(NCE, Constant::getNullValue(Type::Int32Ty), NewAdd, GEPI->getName(), GEPI); Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.615 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.616 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.615 Tue Jan 30 18:53:10 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 30 22:40:53 2007 @@ -50,6 +50,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/PatternMatch.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -7797,13 +7798,14 @@ // constants, we can promote this to a constexpr instead of an instruction. // Scan for nonconstants... - std::vector Indices; + SmallVector Indices; User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); for (; I != E && isa(*I); ++I) Indices.push_back(cast(*I)); if (I == E) { // If they are all constants... - Constant *CE = ConstantExpr::getGetElementPtr(GV, Indices); + Constant *CE = ConstantExpr::getGetElementPtr(GV, + &Indices[0],Indices.size()); // Replace all uses of the GEP with the new constexpr... return ReplaceInstUsesWith(GEP, CE); @@ -8001,8 +8003,9 @@ if (const ArrayType *ASrcTy = dyn_cast(SrcPTy)) if (Constant *CSrc = dyn_cast(CastOp)) if (ASrcTy->getNumElements() != 0) { - std::vector Idxs(2, Constant::getNullValue(Type::Int32Ty)); - CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs); + Value *Idxs[2]; + Idxs[0] = Idxs[1] = Constant::getNullValue(Type::Int32Ty); + CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs, 2); SrcTy = cast(CastOp->getType()); SrcPTy = SrcTy->getElementType(); } @@ -8188,8 +8191,9 @@ if (const ArrayType *ASrcTy = dyn_cast(SrcPTy)) if (Constant *CSrc = dyn_cast(CastOp)) if (ASrcTy->getNumElements() != 0) { - std::vector Idxs(2, Constant::getNullValue(Type::Int32Ty)); - CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs); + Value* Idxs[2]; + Idxs[0] = Idxs[1] = Constant::getNullValue(Type::Int32Ty); + CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs, 2); SrcTy = cast(CastOp->getType()); SrcPTy = SrcTy->getElementType(); } From sabre at nondot.org Tue Jan 30 22:41:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:41:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200701310441.l0V4fCCj001158@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.91 -> 1.92 --- Log message: eliminate temporary vectors --- Diffs of the changes: (+12 -9) GlobalOpt.cpp | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.91 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.92 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.91 Tue Jan 30 17:46:24 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 30 22:40:53 2007 @@ -25,6 +25,7 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/Debug.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include @@ -443,11 +444,12 @@ // Form a shorter GEP if needed. if (GEP->getNumOperands() > 3) if (ConstantExpr *CE = dyn_cast(GEP)) { - std::vector Idxs; + SmallVector Idxs; Idxs.push_back(NullInt); for (unsigned i = 3, e = CE->getNumOperands(); i != e; ++i) Idxs.push_back(CE->getOperand(i)); - NewPtr = ConstantExpr::getGetElementPtr(cast(NewPtr), Idxs); + NewPtr = ConstantExpr::getGetElementPtr(cast(NewPtr), + &Idxs[0], Idxs.size()); } else { GetElementPtrInst *GEPI = cast(GEP); std::vector Idxs; @@ -576,16 +578,17 @@ } } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { // Should handle GEP here. - std::vector Indices; - Indices.reserve(GEPI->getNumOperands()-1); + SmallVector Idxs; + Idxs.reserve(GEPI->getNumOperands()-1); for (unsigned i = 1, e = GEPI->getNumOperands(); i != e; ++i) if (Constant *C = dyn_cast(GEPI->getOperand(i))) - Indices.push_back(C); + Idxs.push_back(C); else break; - if (Indices.size() == GEPI->getNumOperands()-1) + if (Idxs.size() == GEPI->getNumOperands()-1) Changed |= OptimizeAwayTrappingUsesOfValue(GEPI, - ConstantExpr::getGetElementPtr(NewV, Indices)); + ConstantExpr::getGetElementPtr(NewV, &Idxs[0], + Idxs.size())); if (GEPI->use_empty()) { Changed = true; GEPI->eraseFromParent(); @@ -1744,10 +1747,10 @@ getVal(Values, SI->getOperand(2))); } else if (GetElementPtrInst *GEP = dyn_cast(CurInst)) { Constant *P = getVal(Values, GEP->getOperand(0)); - std::vector GEPOps; + SmallVector GEPOps; for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i) GEPOps.push_back(getVal(Values, GEP->getOperand(i))); - InstResult = ConstantExpr::getGetElementPtr(P, GEPOps); + InstResult = ConstantExpr::getGetElementPtr(P, &GEPOps[0], GEPOps.size()); } else if (LoadInst *LI = dyn_cast(CurInst)) { if (LI->isVolatile()) return false; // no volatile accesses. InstResult = ComputeLoadResult(getVal(Values, LI->getOperand(0)), From sabre at nondot.org Tue Jan 30 22:42:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:42:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp Message-ID: <200701310442.l0V4gLuO001228@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.13 -> 1.14 --- Log message: elimiante a temporary vector --- Diffs of the changes: (+1 -3) ConstantFolding.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.13 llvm/lib/Analysis/ConstantFolding.cpp:1.14 --- llvm/lib/Analysis/ConstantFolding.cpp:1.13 Tue Jan 30 18:51:48 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Tue Jan 30 22:42:05 2007 @@ -245,9 +245,7 @@ if (Constant *C = SymbolicallyEvaluateGEP(Ops, NumOps, I->getType(), TD)) return C; - return ConstantExpr::getGetElementPtr(Ops[0], - std::vector(Ops+1, - Ops+NumOps)); + return ConstantExpr::getGetElementPtr(Ops[0], Ops+1, NumOps-1); } } From sabre at nondot.org Tue Jan 30 22:43:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:43:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200701310443.l0V4hGwH001311@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.226 -> 1.227 --- Log message: eliminate a temporary vector --- Diffs of the changes: (+2 -2) Reader.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.226 llvm/lib/Bytecode/Reader/Reader.cpp:1.227 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.226 Tue Jan 30 13:36:46 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Jan 30 22:43:00 2007 @@ -1171,8 +1171,8 @@ if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result); return Result; } else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr - std::vector IdxList(ArgVec.begin()+1, ArgVec.end()); - Constant *Result = ConstantExpr::getGetElementPtr(ArgVec[0], IdxList); + Constant *Result = ConstantExpr::getGetElementPtr(ArgVec[0], &ArgVec[1], + ArgVec.size()-1); if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result); return Result; } else if (Opcode == Instruction::Select) { From sabre at nondot.org Tue Jan 30 22:44:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:44:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200701310444.l0V4i2WB001370@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.315 -> 1.316 --- Log message: eliminate a temporary vector --- Diffs of the changes: (+3 -2) llvmAsmParser.y | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.315 llvm/lib/AsmParser/llvmAsmParser.y:1.316 --- llvm/lib/AsmParser/llvmAsmParser.y:1.315 Tue Jan 30 14:08:37 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Jan 30 22:43:46 2007 @@ -20,6 +20,7 @@ #include "llvm/SymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" @@ -1733,7 +1734,7 @@ if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); - std::vector IdxVec; + SmallVector IdxVec; for (unsigned i = 0, e = $4->size(); i != e; ++i) if (Constant *C = dyn_cast((*$4)[i])) IdxVec.push_back(C); @@ -1742,7 +1743,7 @@ delete $4; - $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + $$ = ConstantExpr::getGetElementPtr($3, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { From sabre at nondot.org Tue Jan 30 22:44:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:44:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200701310444.l0V4iOPQ001410@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.60 -> 1.61 llvmAsmParser.h.cvs updated: 1.48 -> 1.49 llvmAsmParser.y.cvs updated: 1.61 -> 1.62 --- Log message: regenerate --- Diffs of the changes: (+3206 -4294) llvmAsmParser.cpp.cvs | 7056 +++++++++++++++++++++----------------------------- llvmAsmParser.h.cvs | 439 --- llvmAsmParser.y.cvs | 5 3 files changed, 3206 insertions(+), 4294 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.60 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.61 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.60 Tue Jan 30 14:08:37 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jan 30 22:44:08 2007 @@ -1,336 +1,147 @@ -/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 +#define YYBISON 1 /* Identify Bison output. */ -/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define LOCALVAL_ID 259 +#define GLOBALVAL_ID 260 +#define FPVAL 261 +#define VOID 262 +#define INTTYPE 263 +#define FLOAT 264 +#define DOUBLE 265 +#define LABEL 266 +#define TYPE 267 +#define LOCALVAR 268 +#define GLOBALVAR 269 +#define LABELSTR 270 +#define STRINGCONSTANT 271 +#define ATSTRINGCONSTANT 272 +#define IMPLEMENTATION 273 +#define ZEROINITIALIZER 274 +#define TRUETOK 275 +#define FALSETOK 276 +#define BEGINTOK 277 +#define ENDTOK 278 +#define DECLARE 279 +#define DEFINE 280 +#define GLOBAL 281 +#define CONSTANT 282 +#define SECTION 283 +#define VOLATILE 284 +#define TO 285 +#define DOTDOTDOT 286 +#define NULL_TOK 287 +#define UNDEF 288 +#define INTERNAL 289 +#define LINKONCE 290 +#define WEAK 291 +#define APPENDING 292 +#define DLLIMPORT 293 +#define DLLEXPORT 294 +#define EXTERN_WEAK 295 +#define OPAQUE 296 +#define EXTERNAL 297 +#define TARGET 298 +#define TRIPLE 299 +#define ALIGN 300 +#define DEPLIBS 301 +#define CALL 302 +#define TAIL 303 +#define ASM_TOK 304 +#define MODULE 305 +#define SIDEEFFECT 306 +#define CC_TOK 307 +#define CCC_TOK 308 +#define FASTCC_TOK 309 +#define COLDCC_TOK 310 +#define X86_STDCALLCC_TOK 311 +#define X86_FASTCALLCC_TOK 312 +#define DATALAYOUT 313 +#define RET 314 +#define BR 315 +#define SWITCH 316 +#define INVOKE 317 +#define UNWIND 318 +#define UNREACHABLE 319 +#define ADD 320 +#define SUB 321 +#define MUL 322 +#define UDIV 323 +#define SDIV 324 +#define FDIV 325 +#define UREM 326 +#define SREM 327 +#define FREM 328 +#define AND 329 +#define OR 330 +#define XOR 331 +#define ICMP 332 +#define FCMP 333 +#define EQ 334 +#define NE 335 +#define SLT 336 +#define SGT 337 +#define SLE 338 +#define SGE 339 +#define ULT 340 +#define UGT 341 +#define ULE 342 +#define UGE 343 +#define OEQ 344 +#define ONE 345 +#define OLT 346 +#define OGT 347 +#define OLE 348 +#define OGE 349 +#define ORD 350 +#define UNO 351 +#define UEQ 352 +#define UNE 353 +#define MALLOC 354 +#define ALLOCA 355 +#define FREE 356 +#define LOAD 357 +#define STORE 358 +#define GETELEMENTPTR 359 +#define TRUNC 360 +#define ZEXT 361 +#define SEXT 362 +#define FPTRUNC 363 +#define FPEXT 364 +#define BITCAST 365 +#define UITOFP 366 +#define SITOFP 367 +#define FPTOUI 368 +#define FPTOSI 369 +#define INTTOPTR 370 +#define PTRTOINT 371 +#define PHI_TOK 372 +#define SELECT 373 +#define SHL 374 +#define LSHR 375 +#define ASHR 376 +#define VAARG 377 +#define EXTRACTELEMENT 378 +#define INSERTELEMENT 379 +#define SHUFFLEVECTOR 380 +#define NORETURN 381 +#define INREG 382 +#define SRET 383 +#define DEFAULT 384 +#define HIDDEN 385 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - LOCALVAL_ID = 260, - GLOBALVAL_ID = 261, - FPVAL = 262, - VOID = 263, - INTTYPE = 264, - FLOAT = 265, - DOUBLE = 266, - LABEL = 267, - TYPE = 268, - LOCALVAR = 269, - GLOBALVAR = 270, - LABELSTR = 271, - STRINGCONSTANT = 272, - ATSTRINGCONSTANT = 273, - IMPLEMENTATION = 274, - ZEROINITIALIZER = 275, - TRUETOK = 276, - FALSETOK = 277, - BEGINTOK = 278, - ENDTOK = 279, - DECLARE = 280, - DEFINE = 281, - GLOBAL = 282, - CONSTANT = 283, - SECTION = 284, - VOLATILE = 285, - TO = 286, - DOTDOTDOT = 287, - NULL_TOK = 288, - UNDEF = 289, - INTERNAL = 290, - LINKONCE = 291, - WEAK = 292, - APPENDING = 293, - DLLIMPORT = 294, - DLLEXPORT = 295, - EXTERN_WEAK = 296, - OPAQUE = 297, - EXTERNAL = 298, - TARGET = 299, - TRIPLE = 300, - ALIGN = 301, - DEPLIBS = 302, - CALL = 303, - TAIL = 304, - ASM_TOK = 305, - MODULE = 306, - SIDEEFFECT = 307, - CC_TOK = 308, - CCC_TOK = 309, - FASTCC_TOK = 310, - COLDCC_TOK = 311, - X86_STDCALLCC_TOK = 312, - X86_FASTCALLCC_TOK = 313, - DATALAYOUT = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - UDIV = 324, - SDIV = 325, - FDIV = 326, - UREM = 327, - SREM = 328, - FREM = 329, - AND = 330, - OR = 331, - XOR = 332, - ICMP = 333, - FCMP = 334, - EQ = 335, - NE = 336, - SLT = 337, - SGT = 338, - SLE = 339, - SGE = 340, - ULT = 341, - UGT = 342, - ULE = 343, - UGE = 344, - OEQ = 345, - ONE = 346, - OLT = 347, - OGT = 348, - OLE = 349, - OGE = 350, - ORD = 351, - UNO = 352, - UEQ = 353, - UNE = 354, - MALLOC = 355, - ALLOCA = 356, - FREE = 357, - LOAD = 358, - STORE = 359, - GETELEMENTPTR = 360, - TRUNC = 361, - ZEXT = 362, - SEXT = 363, - FPTRUNC = 364, - FPEXT = 365, - BITCAST = 366, - UITOFP = 367, - SITOFP = 368, - FPTOUI = 369, - FPTOSI = 370, - INTTOPTR = 371, - PTRTOINT = 372, - PHI_TOK = 373, - SELECT = 374, - SHL = 375, - LSHR = 376, - ASHR = 377, - VAARG = 378, - EXTRACTELEMENT = 379, - INSERTELEMENT = 380, - SHUFFLEVECTOR = 381, - NORETURN = 382, - INREG = 383, - SRET = 384, - DEFAULT = 385, - HIDDEN = 386 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define LOCALVAL_ID 260 -#define GLOBALVAL_ID 261 -#define FPVAL 262 -#define VOID 263 -#define INTTYPE 264 -#define FLOAT 265 -#define DOUBLE 266 -#define LABEL 267 -#define TYPE 268 -#define LOCALVAR 269 -#define GLOBALVAR 270 -#define LABELSTR 271 -#define STRINGCONSTANT 272 -#define ATSTRINGCONSTANT 273 -#define IMPLEMENTATION 274 -#define ZEROINITIALIZER 275 -#define TRUETOK 276 -#define FALSETOK 277 -#define BEGINTOK 278 -#define ENDTOK 279 -#define DECLARE 280 -#define DEFINE 281 -#define GLOBAL 282 -#define CONSTANT 283 -#define SECTION 284 -#define VOLATILE 285 -#define TO 286 -#define DOTDOTDOT 287 -#define NULL_TOK 288 -#define UNDEF 289 -#define INTERNAL 290 -#define LINKONCE 291 -#define WEAK 292 -#define APPENDING 293 -#define DLLIMPORT 294 -#define DLLEXPORT 295 -#define EXTERN_WEAK 296 -#define OPAQUE 297 -#define EXTERNAL 298 -#define TARGET 299 -#define TRIPLE 300 -#define ALIGN 301 -#define DEPLIBS 302 -#define CALL 303 -#define TAIL 304 -#define ASM_TOK 305 -#define MODULE 306 -#define SIDEEFFECT 307 -#define CC_TOK 308 -#define CCC_TOK 309 -#define FASTCC_TOK 310 -#define COLDCC_TOK 311 -#define X86_STDCALLCC_TOK 312 -#define X86_FASTCALLCC_TOK 313 -#define DATALAYOUT 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define UDIV 324 -#define SDIV 325 -#define FDIV 326 -#define UREM 327 -#define SREM 328 -#define FREM 329 -#define AND 330 -#define OR 331 -#define XOR 332 -#define ICMP 333 -#define FCMP 334 -#define EQ 335 -#define NE 336 -#define SLT 337 -#define SGT 338 -#define SLE 339 -#define SGE 340 -#define ULT 341 -#define UGT 342 -#define ULE 343 -#define UGE 344 -#define OEQ 345 -#define ONE 346 -#define OLT 347 -#define OGT 348 -#define OLE 349 -#define OGE 350 -#define ORD 351 -#define UNO 352 -#define UEQ 353 -#define UNE 354 -#define MALLOC 355 -#define ALLOCA 356 -#define FREE 357 -#define LOAD 358 -#define STORE 359 -#define GETELEMENTPTR 360 -#define TRUNC 361 -#define ZEXT 362 -#define SEXT 363 -#define FPTRUNC 364 -#define FPEXT 365 -#define BITCAST 366 -#define UITOFP 367 -#define SITOFP 368 -#define FPTOUI 369 -#define FPTOSI 370 -#define INTTOPTR 371 -#define PTRTOINT 372 -#define PHI_TOK 373 -#define SELECT 374 -#define SHL 375 -#define LSHR 376 -#define ASHR 377 -#define VAARG 378 -#define EXTRACTELEMENT 379 -#define INSERTELEMENT 380 -#define SHUFFLEVECTOR 381 -#define NORETURN 382 -#define INREG 383 -#define SRET 384 -#define DEFAULT 385 -#define HIDDEN 386 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -340,6 +151,7 @@ #include "llvm/SymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" @@ -1201,28 +1013,8 @@ } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#line 886 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1267,1529 +1059,1062 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -/* Line 196 of yacc.c. */ -#line 1272 "llvmAsmParser.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 1284 "llvmAsmParser.tab.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +#define YYFINAL 567 +#define YYFLAG -32768 +#define YYNTBASE 146 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 224) + +static const short yytranslate[] = { 0, + 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, 2, 2, 2, 2, 2, 136, + 137, 134, 2, 133, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, + 132, 142, 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, + 138, 135, 140, 2, 2, 2, 2, 2, 145, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, + 2, 2, 143, 2, 144, 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, 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, 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, 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, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 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, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131 +}; -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, + 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, + 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, + 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, + 195, 198, 199, 202, 203, 207, 210, 211, 213, 214, + 218, 220, 223, 225, 227, 229, 231, 233, 235, 238, + 240, 243, 249, 255, 261, 267, 271, 274, 280, 285, + 288, 290, 292, 294, 298, 300, 304, 306, 307, 309, + 313, 318, 322, 326, 331, 336, 340, 347, 353, 356, + 359, 362, 365, 368, 371, 374, 377, 380, 383, 390, + 396, 405, 412, 419, 427, 435, 442, 449, 458, 467, + 471, 473, 475, 477, 479, 480, 482, 485, 486, 490, + 491, 495, 499, 501, 505, 509, 510, 517, 518, 526, + 527, 535, 538, 542, 544, 548, 552, 556, 560, 562, + 563, 569, 573, 575, 579, 581, 582, 592, 594, 596, + 601, 603, 605, 608, 612, 613, 615, 617, 619, 621, + 623, 625, 627, 629, 631, 635, 637, 643, 645, 647, + 649, 651, 653, 655, 658, 661, 664, 668, 671, 672, + 674, 677, 680, 684, 694, 704, 713, 728, 730, 732, + 739, 745, 748, 755, 763, 767, 773, 774, 775, 779, + 782, 784, 790, 796, 803, 810, 815, 820, 827, 832, + 837, 844, 851, 854, 863, 865, 867, 868, 872, 879, + 883, 890, 893, 898, 905 +}; -#endif +static const short yyrhs[] = { 66, + 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, + 0, 72, 0, 73, 0, 74, 0, 75, 0, 76, + 0, 77, 0, 106, 0, 107, 0, 108, 0, 109, + 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, + 0, 115, 0, 116, 0, 117, 0, 120, 0, 121, + 0, 122, 0, 80, 0, 81, 0, 82, 0, 83, + 0, 84, 0, 85, 0, 86, 0, 87, 0, 88, + 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, + 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, + 0, 99, 0, 86, 0, 87, 0, 88, 0, 89, + 0, 21, 0, 22, 0, 9, 0, 10, 0, 11, + 0, 14, 0, 17, 0, 154, 0, 0, 154, 132, + 0, 0, 15, 0, 18, 0, 157, 132, 0, 0, + 35, 0, 37, 0, 36, 0, 38, 0, 40, 0, + 39, 0, 41, 0, 43, 0, 0, 131, 0, 0, + 39, 0, 41, 0, 0, 35, 0, 36, 0, 37, + 0, 40, 0, 0, 54, 0, 55, 0, 56, 0, + 57, 0, 58, 0, 53, 4, 0, 107, 0, 108, + 0, 128, 0, 129, 0, 0, 166, 165, 0, 127, + 0, 165, 0, 0, 168, 167, 0, 0, 46, 4, + 0, 0, 133, 46, 4, 0, 29, 17, 0, 0, + 171, 0, 0, 133, 174, 173, 0, 171, 0, 46, + 4, 0, 9, 0, 10, 0, 11, 0, 12, 0, + 42, 0, 175, 0, 176, 134, 0, 208, 0, 135, + 4, 0, 176, 136, 180, 137, 168, 0, 8, 136, + 180, 137, 168, 0, 138, 4, 139, 176, 140, 0, + 141, 4, 139, 176, 142, 0, 143, 181, 144, 0, + 143, 144, 0, 141, 143, 181, 144, 142, 0, 141, + 143, 144, 142, 0, 176, 166, 0, 176, 0, 8, + 0, 177, 0, 179, 133, 177, 0, 179, 0, 179, + 133, 32, 0, 32, 0, 0, 176, 0, 181, 133, + 176, 0, 176, 138, 184, 140, 0, 176, 138, 140, + 0, 176, 145, 17, 0, 176, 141, 184, 142, 0, + 176, 143, 184, 144, 0, 176, 143, 144, 0, 176, + 141, 143, 184, 144, 142, 0, 176, 141, 143, 144, + 142, 0, 176, 33, 0, 176, 34, 0, 176, 208, + 0, 176, 183, 0, 176, 20, 0, 152, 3, 0, + 152, 4, 0, 9, 21, 0, 9, 22, 0, 153, + 7, 0, 148, 136, 182, 31, 176, 137, 0, 105, + 136, 182, 219, 137, 0, 119, 136, 182, 133, 182, + 133, 182, 137, 0, 146, 136, 182, 133, 182, 137, + 0, 147, 136, 182, 133, 182, 137, 0, 78, 150, + 136, 182, 133, 182, 137, 0, 79, 151, 136, 182, + 133, 182, 137, 0, 149, 136, 182, 133, 182, 137, + 0, 124, 136, 182, 133, 182, 137, 0, 125, 136, + 182, 133, 182, 133, 182, 137, 0, 126, 136, 182, + 133, 182, 133, 182, 137, 0, 184, 133, 182, 0, + 182, 0, 27, 0, 28, 0, 187, 0, 0, 188, + 0, 187, 188, 0, 0, 26, 189, 204, 0, 0, + 25, 190, 205, 0, 51, 50, 194, 0, 19, 0, + 156, 13, 176, 0, 156, 13, 8, 0, 0, 158, + 161, 185, 182, 191, 173, 0, 0, 158, 159, 161, + 185, 182, 192, 173, 0, 0, 158, 160, 161, 185, + 176, 193, 173, 0, 44, 195, 0, 47, 132, 196, + 0, 17, 0, 45, 132, 17, 0, 59, 132, 17, + 0, 138, 197, 140, 0, 197, 133, 17, 0, 17, + 0, 0, 198, 133, 176, 166, 155, 0, 176, 166, + 155, 0, 198, 0, 198, 133, 32, 0, 32, 0, + 0, 164, 178, 157, 136, 199, 137, 168, 172, 169, + 0, 23, 0, 143, 0, 163, 161, 200, 201, 0, + 24, 0, 144, 0, 211, 203, 0, 162, 161, 200, + 0, 0, 52, 0, 3, 0, 4, 0, 7, 0, + 21, 0, 22, 0, 33, 0, 34, 0, 20, 0, + 141, 184, 142, 0, 183, 0, 50, 206, 17, 133, + 17, 0, 5, 0, 6, 0, 154, 0, 157, 0, + 208, 0, 207, 0, 176, 209, 0, 211, 212, 0, + 202, 212, 0, 213, 156, 214, 0, 213, 216, 0, + 0, 16, 0, 60, 210, 0, 60, 8, 0, 61, + 12, 209, 0, 61, 9, 209, 133, 12, 209, 133, + 12, 209, 0, 62, 152, 209, 133, 12, 209, 138, + 215, 140, 0, 62, 152, 209, 133, 12, 209, 138, + 140, 0, 63, 164, 178, 209, 136, 218, 137, 168, + 31, 12, 209, 64, 12, 209, 0, 64, 0, 65, + 0, 215, 152, 207, 133, 12, 209, 0, 152, 207, + 133, 12, 209, 0, 156, 221, 0, 176, 138, 209, + 133, 209, 140, 0, 217, 133, 138, 209, 133, 209, + 140, 0, 176, 209, 166, 0, 218, 133, 176, 209, + 166, 0, 0, 0, 219, 133, 210, 0, 49, 48, + 0, 48, 0, 146, 176, 209, 133, 209, 0, 147, + 176, 209, 133, 209, 0, 78, 150, 176, 209, 133, + 209, 0, 79, 151, 176, 209, 133, 209, 0, 149, + 210, 133, 210, 0, 148, 210, 31, 176, 0, 119, + 210, 133, 210, 133, 210, 0, 123, 210, 133, 176, + 0, 124, 210, 133, 210, 0, 125, 210, 133, 210, + 133, 210, 0, 126, 210, 133, 210, 133, 210, 0, + 118, 217, 0, 220, 164, 178, 209, 136, 218, 137, + 168, 0, 223, 0, 30, 0, 0, 100, 176, 170, + 0, 100, 176, 133, 9, 209, 170, 0, 101, 176, + 170, 0, 101, 176, 133, 9, 209, 170, 0, 102, + 210, 0, 222, 103, 176, 209, 0, 222, 104, 210, + 133, 176, 209, 0, 105, 176, 209, 219, 0 +}; -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; #endif -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 40 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1466 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 146 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 79 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 286 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 567 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 386 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 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, 2, 2, 2, 2, 2, - 136, 137, 134, 2, 133, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 141, 132, 142, 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, 138, 135, 140, 2, 2, 2, 2, 2, 145, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 139, 2, 2, 143, 2, 144, 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, - 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, 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, 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, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 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, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131 +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1033, + 1033, 1033, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1035, + 1035, 1035, 1035, 1035, 1036, 1036, 1036, 1038, 1038, 1039, + 1039, 1040, 1040, 1041, 1041, 1042, 1042, 1046, 1046, 1047, + 1047, 1048, 1048, 1049, 1049, 1050, 1050, 1051, 1051, 1052, + 1052, 1053, 1054, 1059, 1060, 1060, 1062, 1062, 1063, 1063, + 1067, 1071, 1076, 1076, 1078, 1082, 1088, 1089, 1090, 1091, + 1092, 1096, 1097, 1098, 1102, 1103, 1107, 1108, 1109, 1113, + 1114, 1115, 1116, 1117, 1120, 1120, 1121, 1122, 1123, 1124, + 1125, 1133, 1134, 1135, 1136, 1139, 1140, 1145, 1146, 1149, + 1150, 1157, 1157, 1164, 1164, 1173, 1181, 1181, 1187, 1187, + 1189, 1194, 1207, 1207, 1207, 1207, 1210, 1214, 1218, 1225, + 1230, 1238, 1256, 1274, 1279, 1291, 1301, 1305, 1315, 1322, + 1329, 1336, 1341, 1346, 1353, 1354, 1361, 1368, 1376, 1381, + 1392, 1420, 1436, 1465, 1493, 1518, 1537, 1562, 1581, 1593, + 1600, 1666, 1676, 1686, 1692, 1698, 1703, 1708, 1716, 1728, + 1749, 1757, 1763, 1774, 1779, 1784, 1793, 1799, 1805, 1814, + 1818, 1826, 1826, 1837, 1842, 1850, 1851, 1855, 1855, 1859, + 1859, 1862, 1865, 1877, 1901, 1912, 1919, 1922, 1927, 1930, + 1936, 1940, 1943, 1949, 1962, 1966, 1971, 1973, 1978, 1983, + 1992, 2002, 2013, 2017, 2026, 2035, 2040, 2146, 2146, 2148, + 2157, 2157, 2159, 2164, 2176, 2180, 2185, 2189, 2193, 2197, + 2201, 2205, 2209, 2213, 2217, 2242, 2246, 2260, 2264, 2268, + 2272, 2278, 2278, 2284, 2293, 2297, 2306, 2317, 2326, 2338, + 2351, 2355, 2359, 2364, 2374, 2393, 2402, 2469, 2473, 2480, + 2491, 2504, 2513, 2524, 2534, 2542, 2550, 2553, 2554, 2561, + 2565, 2570, 2591, 2608, 2621, 2634, 2643, 2655, 2663, 2670, + 2676, 2682, 2688, 2703, 2767, 2772, 2776, 2783, 2790, 2798, + 2805, 2813, 2821, 2835, 2852 }; +#endif -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, - 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, - 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, - 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, - 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, - 195, 197, 198, 201, 202, 205, 206, 210, 213, 214, - 216, 217, 221, 223, 226, 228, 230, 232, 234, 236, - 238, 241, 243, 246, 252, 258, 264, 270, 274, 277, - 283, 288, 291, 293, 295, 297, 301, 303, 307, 309, - 310, 312, 316, 321, 325, 329, 334, 339, 343, 350, - 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, - 386, 393, 399, 408, 415, 422, 430, 438, 445, 452, - 461, 470, 474, 476, 478, 480, 482, 483, 485, 488, - 489, 493, 494, 498, 502, 504, 508, 512, 513, 520, - 521, 529, 530, 538, 541, 545, 547, 551, 555, 559, - 563, 565, 566, 572, 576, 578, 582, 584, 585, 595, - 597, 599, 604, 606, 608, 611, 615, 616, 618, 620, - 622, 624, 626, 628, 630, 632, 634, 638, 640, 646, - 648, 650, 652, 654, 656, 658, 661, 664, 667, 671, - 674, 675, 677, 680, 683, 687, 697, 707, 716, 731, - 733, 735, 742, 748, 751, 758, 766, 770, 776, 777, - 778, 782, 785, 787, 793, 799, 806, 813, 818, 823, - 830, 835, 840, 847, 854, 857, 866, 868, 870, 871, - 875, 882, 886, 893, 896, 901, 908 -}; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 187, 0, -1, 66, -1, 67, -1, 68, -1, 69, - -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, - -1, 75, -1, 76, -1, 77, -1, 106, -1, 107, - -1, 108, -1, 109, -1, 110, -1, 111, -1, 112, - -1, 113, -1, 114, -1, 115, -1, 116, -1, 117, - -1, 120, -1, 121, -1, 122, -1, 80, -1, 81, - -1, 82, -1, 83, -1, 84, -1, 85, -1, 86, - -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, - -1, 92, -1, 93, -1, 94, -1, 95, -1, 96, - -1, 97, -1, 98, -1, 99, -1, 86, -1, 87, - -1, 88, -1, 89, -1, 21, -1, 22, -1, 9, - -1, 10, -1, 11, -1, 14, -1, 17, -1, 155, - -1, -1, 155, 132, -1, -1, 15, -1, 18, -1, - 158, 132, -1, -1, 35, -1, 37, -1, 36, -1, - 38, -1, 40, -1, 39, -1, 41, -1, 43, -1, - -1, 131, -1, -1, 39, -1, 41, -1, -1, 35, - -1, 36, -1, 37, -1, 40, -1, -1, 54, -1, - 55, -1, 56, -1, 57, -1, 58, -1, 53, 4, - -1, 107, -1, 108, -1, 128, -1, 129, -1, -1, - 167, 166, -1, 127, -1, 166, -1, -1, 169, 168, - -1, -1, 46, 4, -1, -1, 133, 46, 4, -1, - 29, 17, -1, -1, 172, -1, -1, 133, 175, 174, - -1, 172, -1, 46, 4, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 42, -1, 176, -1, 177, 134, - -1, 209, -1, 135, 4, -1, 177, 136, 181, 137, - 169, -1, 8, 136, 181, 137, 169, -1, 138, 4, - 139, 177, 140, -1, 141, 4, 139, 177, 142, -1, - 143, 182, 144, -1, 143, 144, -1, 141, 143, 182, - 144, 142, -1, 141, 143, 144, 142, -1, 177, 167, - -1, 177, -1, 8, -1, 178, -1, 180, 133, 178, - -1, 180, -1, 180, 133, 32, -1, 32, -1, -1, - 177, -1, 182, 133, 177, -1, 177, 138, 185, 140, - -1, 177, 138, 140, -1, 177, 145, 17, -1, 177, - 141, 185, 142, -1, 177, 143, 185, 144, -1, 177, - 143, 144, -1, 177, 141, 143, 185, 144, 142, -1, - 177, 141, 143, 144, 142, -1, 177, 33, -1, 177, - 34, -1, 177, 209, -1, 177, 184, -1, 177, 20, - -1, 153, 3, -1, 153, 4, -1, 9, 21, -1, - 9, 22, -1, 154, 7, -1, 149, 136, 183, 31, - 177, 137, -1, 105, 136, 183, 220, 137, -1, 119, - 136, 183, 133, 183, 133, 183, 137, -1, 147, 136, - 183, 133, 183, 137, -1, 148, 136, 183, 133, 183, - 137, -1, 78, 151, 136, 183, 133, 183, 137, -1, - 79, 152, 136, 183, 133, 183, 137, -1, 150, 136, - 183, 133, 183, 137, -1, 124, 136, 183, 133, 183, - 137, -1, 125, 136, 183, 133, 183, 133, 183, 137, - -1, 126, 136, 183, 133, 183, 133, 183, 137, -1, - 185, 133, 183, -1, 183, -1, 27, -1, 28, -1, - 188, -1, -1, 189, -1, 188, 189, -1, -1, 26, - 190, 205, -1, -1, 25, 191, 206, -1, 51, 50, - 195, -1, 19, -1, 157, 13, 177, -1, 157, 13, - 8, -1, -1, 159, 162, 186, 183, 192, 174, -1, - -1, 159, 160, 162, 186, 183, 193, 174, -1, -1, - 159, 161, 162, 186, 177, 194, 174, -1, 44, 196, - -1, 47, 132, 197, -1, 17, -1, 45, 132, 17, - -1, 59, 132, 17, -1, 138, 198, 140, -1, 198, - 133, 17, -1, 17, -1, -1, 199, 133, 177, 167, - 156, -1, 177, 167, 156, -1, 199, -1, 199, 133, - 32, -1, 32, -1, -1, 165, 179, 158, 136, 200, - 137, 169, 173, 170, -1, 23, -1, 143, -1, 164, - 162, 201, 202, -1, 24, -1, 144, -1, 212, 204, - -1, 163, 162, 201, -1, -1, 52, -1, 3, -1, - 4, -1, 7, -1, 21, -1, 22, -1, 33, -1, - 34, -1, 20, -1, 141, 185, 142, -1, 184, -1, - 50, 207, 17, 133, 17, -1, 5, -1, 6, -1, - 155, -1, 158, -1, 209, -1, 208, -1, 177, 210, - -1, 212, 213, -1, 203, 213, -1, 214, 157, 215, - -1, 214, 217, -1, -1, 16, -1, 60, 211, -1, - 60, 8, -1, 61, 12, 210, -1, 61, 9, 210, - 133, 12, 210, 133, 12, 210, -1, 62, 153, 210, - 133, 12, 210, 138, 216, 140, -1, 62, 153, 210, - 133, 12, 210, 138, 140, -1, 63, 165, 179, 210, - 136, 219, 137, 169, 31, 12, 210, 64, 12, 210, - -1, 64, -1, 65, -1, 216, 153, 208, 133, 12, - 210, -1, 153, 208, 133, 12, 210, -1, 157, 222, - -1, 177, 138, 210, 133, 210, 140, -1, 218, 133, - 138, 210, 133, 210, 140, -1, 177, 210, 167, -1, - 219, 133, 177, 210, 167, -1, -1, -1, 220, 133, - 211, -1, 49, 48, -1, 48, -1, 147, 177, 210, - 133, 210, -1, 148, 177, 210, 133, 210, -1, 78, - 151, 177, 210, 133, 210, -1, 79, 152, 177, 210, - 133, 210, -1, 150, 211, 133, 211, -1, 149, 211, - 31, 177, -1, 119, 211, 133, 211, 133, 211, -1, - 123, 211, 133, 177, -1, 124, 211, 133, 211, -1, - 125, 211, 133, 211, 133, 211, -1, 126, 211, 133, - 211, 133, 211, -1, 118, 218, -1, 221, 165, 179, - 210, 136, 219, 137, 169, -1, 224, -1, 30, -1, - -1, 100, 177, 171, -1, 100, 177, 133, 9, 210, - 171, -1, 101, 177, 171, -1, 101, 177, 133, 9, - 210, 171, -1, 102, 211, -1, 223, 103, 177, 210, - -1, 223, 104, 211, 133, 177, 210, -1, 105, 177, - 210, 220, -1 -}; +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, - 1031, 1032, 1032, 1032, 1033, 1033, 1033, 1033, 1033, 1033, - 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1037, - 1037, 1038, 1038, 1039, 1039, 1040, 1040, 1041, 1041, 1045, - 1045, 1046, 1046, 1047, 1047, 1048, 1048, 1049, 1049, 1050, - 1050, 1051, 1051, 1052, 1053, 1058, 1059, 1059, 1061, 1061, - 1062, 1062, 1066, 1070, 1075, 1075, 1077, 1081, 1087, 1088, - 1089, 1090, 1091, 1095, 1096, 1097, 1101, 1102, 1106, 1107, - 1108, 1112, 1113, 1114, 1115, 1116, 1119, 1120, 1121, 1122, - 1123, 1124, 1125, 1132, 1133, 1134, 1135, 1138, 1139, 1144, - 1145, 1148, 1149, 1156, 1157, 1163, 1164, 1172, 1180, 1181, - 1186, 1187, 1188, 1193, 1206, 1206, 1206, 1206, 1209, 1213, - 1217, 1224, 1229, 1237, 1255, 1273, 1278, 1290, 1300, 1304, - 1314, 1321, 1328, 1335, 1340, 1345, 1352, 1353, 1360, 1367, - 1375, 1380, 1391, 1419, 1435, 1464, 1492, 1517, 1536, 1561, - 1580, 1592, 1599, 1665, 1675, 1685, 1691, 1697, 1702, 1707, - 1715, 1727, 1748, 1756, 1762, 1773, 1778, 1783, 1792, 1798, - 1804, 1813, 1817, 1825, 1825, 1836, 1841, 1849, 1850, 1854, - 1854, 1858, 1858, 1861, 1864, 1876, 1900, 1911, 1911, 1921, - 1921, 1929, 1929, 1939, 1942, 1948, 1961, 1965, 1970, 1972, - 1977, 1982, 1991, 2001, 2012, 2016, 2025, 2034, 2039, 2145, - 2145, 2147, 2156, 2156, 2158, 2163, 2175, 2179, 2184, 2188, - 2192, 2196, 2200, 2204, 2208, 2212, 2216, 2241, 2245, 2259, - 2263, 2267, 2271, 2277, 2277, 2283, 2292, 2296, 2305, 2316, - 2325, 2337, 2350, 2354, 2358, 2363, 2373, 2392, 2401, 2468, - 2472, 2479, 2490, 2503, 2512, 2523, 2533, 2541, 2549, 2552, - 2553, 2560, 2564, 2569, 2590, 2607, 2620, 2633, 2642, 2654, - 2662, 2669, 2675, 2681, 2687, 2702, 2766, 2771, 2775, 2782, - 2789, 2797, 2804, 2812, 2820, 2834, 2851 +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL","VOID","INTTYPE","FLOAT","DOUBLE", +"LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT", +"IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK", +"DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO","DOTDOTDOT", +"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", +"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL", +"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK", +"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", +"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM", +"FREM","AND","OR","XOR","ICMP","FCMP","EQ","NE","SLT","SGT","SLE","SGE","ULT", +"UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE", +"MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC","ZEXT","SEXT", +"FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI","INTTOPTR","PTRTOINT", +"PHI_TOK","SELECT","SHL","LSHR","ASHR","VAARG","EXTRACTELEMENT","INSERTELEMENT", +"SHUFFLEVECTOR","NORETURN","INREG","SRET","DEFAULT","HIDDEN","'='","','","'*'", +"'\\\\'","'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", +"LogicalOps","CastOps","ShiftOps","IPredicates","FPredicates","IntType","FPType", +"LocalName","OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GVInternalLinkage", +"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", +"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign", +"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", +"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", +"ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList", +"Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", +"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", +"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", +"OptVolatile","MemoryInst", NULL }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", - "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", "FLOAT", - "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", - "STRINGCONSTANT", "ATSTRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", - "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", - "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", - "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", - "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", - "XOR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", - "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", - "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", - "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", - "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", - "PHI_TOK", "SELECT", "SHL", "LSHR", "ASHR", "VAARG", "EXTRACTELEMENT", - "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", "DEFAULT", - "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", - "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", - "LogicalOps", "CastOps", "ShiftOps", "IPredicates", "FPredicates", - "IntType", "FPType", "LocalName", "OptLocalName", "OptLocalAssign", - "GlobalName", "OptGlobalAssign", "GVInternalLinkage", - "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", - "FunctionDefineLinkage", "OptCallingConv", "ParamAttr", "OptParamAttrs", - "FuncAttr", "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", - "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", - "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", - "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType", - "Module", "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", - "AsmBlock", "TargetDefinition", "LibrariesDefinition", "LibList", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", - "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", - "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", - "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", - "OptVolatile", "MemoryInst", 0 +static const short yyr1[] = { 0, + 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, + 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 149, 149, 149, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 152, 153, 153, 154, 154, 155, 155, + 156, 156, 157, 157, 158, 158, 159, 159, 159, 159, + 159, 160, 160, 160, 161, 161, 162, 162, 162, 163, + 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, + 164, 165, 165, 165, 165, 166, 166, 167, 167, 168, + 168, 169, 169, 170, 170, 171, 172, 172, 173, 173, + 174, 174, 175, 175, 175, 175, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, + 178, 178, 179, 179, 180, 180, 180, 180, 181, 181, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, + 184, 185, 185, 186, 186, 187, 187, 189, 188, 190, + 188, 188, 188, 188, 188, 191, 188, 192, 188, 193, + 188, 188, 188, 194, 195, 195, 196, 197, 197, 197, + 198, 198, 199, 199, 199, 199, 200, 201, 201, 202, + 203, 203, 204, 205, 206, 206, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, + 208, 209, 209, 210, 211, 211, 212, 213, 213, 213, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, + 215, 216, 217, 217, 218, 218, 218, 219, 219, 220, + 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, + 223, 223, 223, 223, 223 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 61, 44, 42, 92, 40, 41, 91, 120, - 93, 60, 62, 123, 125, 99 +static const short yyr2[] = { 0, + 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, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, + 2, 0, 2, 0, 3, 2, 0, 1, 0, 3, + 1, 2, 1, 1, 1, 1, 1, 1, 2, 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, 6, 5, + 8, 6, 6, 7, 7, 6, 6, 8, 8, 3, + 1, 1, 1, 1, 0, 1, 2, 0, 3, 0, + 3, 3, 1, 3, 3, 0, 6, 0, 7, 0, + 7, 2, 3, 1, 3, 3, 3, 3, 1, 0, + 5, 3, 1, 3, 1, 0, 9, 1, 1, 4, + 1, 1, 2, 3, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 3, 2, 0, 1, + 2, 2, 3, 9, 9, 8, 14, 1, 1, 6, + 5, 2, 6, 7, 3, 5, 0, 0, 3, 2, + 1, 5, 5, 6, 6, 4, 4, 6, 4, 4, + 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, + 6, 2, 4, 6, 4 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 148, 148, 148, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 150, 150, 150, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 153, 154, 154, 155, 155, - 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, - 160, 160, 160, 161, 161, 161, 162, 162, 163, 163, - 163, 164, 164, 164, 164, 164, 165, 165, 165, 165, - 165, 165, 165, 166, 166, 166, 166, 167, 167, 168, - 168, 169, 169, 170, 170, 171, 171, 172, 173, 173, - 174, 174, 175, 175, 176, 176, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 178, 179, 179, 180, 180, 181, 181, 181, 181, - 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 185, 185, 186, 186, 187, 187, 188, 188, 190, - 189, 191, 189, 189, 189, 189, 189, 192, 189, 193, - 189, 194, 189, 189, 189, 195, 196, 196, 197, 198, - 198, 198, 199, 199, 200, 200, 200, 200, 201, 202, - 202, 203, 204, 204, 205, 206, 207, 207, 208, 208, - 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, - 209, 209, 209, 210, 210, 211, 212, 212, 213, 214, - 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 216, 216, 217, 218, 218, 219, 219, 219, 220, - 220, 221, 221, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 223, 223, 224, - 224, 224, 224, 224, 224, 224, 224 +static const short yydefact[] = { 66, + 57, 63, 58, 64, 183, 180, 178, 0, 0, 0, + 0, 0, 0, 75, 66, 176, 77, 80, 0, 0, + 192, 0, 0, 61, 0, 65, 67, 69, 68, 70, + 72, 71, 73, 74, 76, 75, 75, 0, 177, 78, + 79, 75, 181, 81, 82, 83, 84, 75, 239, 179, + 239, 0, 0, 200, 193, 194, 182, 228, 229, 185, + 113, 114, 115, 116, 117, 0, 0, 0, 0, 230, + 231, 118, 184, 120, 0, 0, 172, 173, 0, 85, + 85, 240, 236, 62, 211, 212, 213, 235, 195, 196, + 199, 0, 138, 121, 0, 0, 0, 0, 127, 139, + 0, 119, 138, 0, 0, 113, 114, 115, 0, 0, + 0, 186, 0, 86, 87, 88, 89, 90, 0, 214, + 0, 277, 238, 0, 197, 137, 96, 133, 135, 0, + 0, 0, 0, 0, 0, 126, 0, 188, 190, 156, + 157, 154, 155, 158, 153, 149, 150, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, + 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 0, 25, 26, 27, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, + 151, 109, 91, 132, 131, 0, 208, 209, 210, 276, + 261, 0, 0, 0, 0, 85, 248, 249, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 237, 85, 252, 0, 275, 198, + 130, 0, 100, 0, 0, 129, 0, 140, 100, 109, + 109, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 0, 52, 53, 48, 49, 50, 51, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, + 0, 0, 0, 0, 142, 171, 0, 0, 0, 146, + 0, 143, 0, 0, 0, 0, 0, 187, 0, 260, + 242, 0, 241, 0, 0, 54, 0, 0, 0, 0, + 104, 104, 282, 0, 0, 273, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 92, 93, + 94, 95, 97, 136, 134, 123, 124, 125, 128, 122, + 189, 191, 0, 0, 258, 0, 0, 0, 0, 0, + 141, 127, 139, 0, 144, 145, 0, 0, 0, 0, + 0, 0, 111, 109, 206, 217, 218, 219, 224, 220, + 221, 222, 223, 215, 0, 226, 233, 232, 234, 0, + 243, 0, 0, 0, 0, 0, 278, 0, 280, 258, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 98, 99, 101, 0, 0, 0, + 0, 0, 0, 0, 170, 148, 0, 0, 0, 0, + 0, 106, 112, 110, 205, 96, 203, 0, 216, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, + 0, 0, 0, 269, 270, 0, 0, 0, 0, 267, + 266, 0, 283, 0, 0, 0, 0, 160, 0, 0, + 0, 0, 147, 0, 0, 0, 0, 60, 0, 100, + 0, 225, 0, 0, 257, 0, 0, 104, 105, 104, + 0, 0, 0, 0, 0, 262, 263, 257, 0, 0, + 0, 259, 0, 167, 0, 0, 162, 163, 159, 166, + 59, 202, 204, 96, 107, 0, 0, 0, 0, 0, + 264, 265, 0, 279, 281, 0, 0, 268, 271, 272, + 0, 284, 164, 165, 0, 0, 0, 60, 108, 102, + 227, 0, 0, 96, 0, 100, 253, 0, 100, 161, + 168, 169, 201, 0, 207, 0, 246, 0, 0, 255, + 0, 0, 254, 274, 103, 244, 0, 245, 0, 96, + 0, 0, 0, 256, 0, 0, 0, 0, 251, 0, + 0, 250, 0, 247, 0, 0, 0 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 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, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, - 1, 0, 2, 0, 2, 0, 3, 2, 0, 1, - 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, - 2, 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, - 6, 5, 8, 6, 6, 7, 7, 6, 6, 8, - 8, 3, 1, 1, 1, 1, 0, 1, 2, 0, - 3, 0, 3, 3, 1, 3, 3, 0, 6, 0, - 7, 0, 7, 2, 3, 1, 3, 3, 3, 3, - 1, 0, 5, 3, 1, 3, 1, 0, 9, 1, - 1, 4, 1, 1, 2, 3, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, - 0, 1, 2, 2, 3, 9, 9, 8, 14, 1, - 1, 6, 5, 2, 6, 7, 3, 5, 0, 0, - 3, 2, 1, 5, 5, 6, 6, 4, 4, 6, - 4, 4, 6, 6, 2, 8, 1, 1, 0, 3, - 6, 3, 6, 2, 4, 6, 4 +static const short yydefgoto[] = { 186, + 187, 188, 189, 252, 269, 109, 110, 70, 492, 12, + 71, 14, 36, 37, 38, 42, 48, 119, 323, 231, + 397, 326, 535, 377, 353, 520, 288, 354, 72, 111, + 128, 196, 129, 130, 101, 276, 366, 277, 79, 565, + 15, 16, 18, 17, 192, 240, 241, 57, 21, 55, + 92, 417, 418, 120, 199, 49, 87, 50, 43, 420, + 367, 74, 369, 293, 51, 83, 84, 225, 539, 123, + 306, 500, 400, 226, 227, 228, 229 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned short int yydefact[] = -{ - 67, 58, 64, 59, 65, 184, 181, 179, 0, 0, - 0, 0, 0, 0, 76, 0, 67, 177, 78, 81, - 0, 0, 193, 0, 0, 62, 0, 66, 68, 70, - 69, 71, 73, 72, 74, 75, 77, 76, 76, 0, - 1, 178, 79, 80, 76, 182, 82, 83, 84, 85, - 76, 240, 180, 240, 0, 0, 201, 194, 195, 183, - 229, 230, 186, 114, 115, 116, 117, 118, 0, 0, - 0, 0, 231, 232, 119, 185, 121, 0, 0, 173, - 174, 0, 86, 86, 241, 237, 63, 212, 213, 214, - 236, 196, 197, 200, 0, 139, 122, 0, 0, 0, - 0, 128, 140, 0, 120, 139, 0, 0, 114, 115, - 116, 0, 0, 0, 187, 0, 87, 88, 89, 90, - 91, 0, 215, 0, 278, 239, 0, 198, 138, 97, - 134, 136, 0, 0, 0, 0, 0, 0, 127, 0, - 189, 191, 157, 158, 155, 156, 159, 154, 150, 151, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 0, 0, 0, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 153, 152, 110, 92, 133, 132, 0, 209, - 210, 211, 277, 262, 0, 0, 0, 0, 86, 249, - 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 238, 86, 253, - 0, 276, 199, 131, 0, 101, 0, 0, 130, 0, - 141, 101, 110, 110, 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, 0, 0, 0, 143, 172, 0, - 0, 0, 147, 0, 144, 0, 0, 0, 0, 0, - 188, 0, 261, 243, 0, 242, 0, 0, 55, 0, - 0, 0, 0, 105, 105, 283, 0, 0, 274, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 93, 94, 95, 96, 98, 137, 135, 124, 125, - 126, 129, 123, 190, 192, 0, 0, 259, 0, 0, - 0, 0, 0, 142, 128, 140, 0, 145, 146, 0, - 0, 0, 0, 0, 0, 112, 110, 207, 218, 219, - 220, 225, 221, 222, 223, 224, 216, 0, 227, 234, - 233, 235, 0, 244, 0, 0, 0, 0, 0, 279, - 0, 281, 259, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 99, 100, 102, - 0, 0, 0, 0, 0, 0, 0, 171, 149, 0, - 0, 0, 0, 0, 107, 113, 111, 206, 97, 204, - 0, 217, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 286, 0, 0, 0, 270, 271, 0, 0, - 0, 0, 268, 267, 0, 284, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 148, 0, 0, 0, 0, - 61, 0, 101, 0, 226, 0, 0, 258, 0, 0, - 105, 106, 105, 0, 0, 0, 0, 0, 263, 264, - 258, 0, 0, 0, 260, 0, 168, 0, 0, 163, - 164, 160, 167, 60, 203, 205, 97, 108, 0, 0, - 0, 0, 0, 265, 266, 0, 280, 282, 0, 0, - 269, 272, 273, 0, 285, 165, 166, 0, 0, 0, - 61, 109, 103, 228, 0, 0, 97, 0, 101, 254, - 0, 101, 162, 169, 170, 202, 0, 208, 0, 247, - 0, 0, 256, 0, 0, 255, 275, 104, 245, 0, - 246, 0, 97, 0, 0, 0, 257, 0, 0, 0, - 0, 252, 0, 0, 251, 0, 248 +static const short yypact[] = { 356, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 4, -115, -2, + -52, 93, -4, 51, 593,-32768, 195, 140, 41, 99, +-32768, 87, 141,-32768, 125,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 128, 128, 47,-32768,-32768, +-32768, 128,-32768,-32768,-32768,-32768,-32768, 128, 251,-32768, + 17, 262, 264, 269,-32768,-32768,-32768,-32768,-32768, 151, +-32768,-32768,-32768,-32768,-32768, 287, 292, 3, 13,-32768, +-32768,-32768, 113,-32768, 47, 47,-32768,-32768, 840, 290, + 290,-32768,-32768, 88,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -90, 1094,-32768, 158, 164, 107, 151,-32768, 113, + -91,-32768, 1094, 840, 1054, 79, 295, 297, 208, 298, + 616,-32768, 302,-32768,-32768,-32768,-32768,-32768, 1197,-32768, + -14, 1319,-32768, 291,-32768,-32768, 113,-32768, 179, 176, + 1054, 1054, 175, -82, 1054,-32768, 200,-32768, 113,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 241, + 474, 202,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 205,-32768,-32768,-32768, 213, 214, + 215, 802, 1213, 460, 335, 218, 221, 232, 236,-32768, +-32768, 245,-32768, 151, 113, 163,-32768,-32768,-32768,-32768, +-32768, 331, 1235, 210, 371, 290,-32768,-32768, 241, 474, + 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, + 1054, 1054, 1054, 1054,-32768, 290,-32768, 181,-32768,-32768, + -61, 1133,-32768, 26, -64,-32768, 242, 113,-32768, 245, + 245,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 247,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 249, 840, + 840, 840, 840, 840,-32768,-32768, -30, 517, -10,-32768, + -40,-32768, 840, 840, 840, 840, 10,-32768, 252,-32768, + 151, 759,-32768, 884, 884,-32768, 884, 1197, 1054, 1054, + 19, 144,-32768, 759, 119, 254, 258, 261, 263, 265, + 266, 759, 759, 364, 268, 1197, 1054, 1054,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, -31,-32768,-32768,-32768, -31, +-32768,-32768, 840, 840,-32768, 271, 273, 275, 276, 840, +-32768, 260, 616, -6,-32768,-32768, 277, 278, 387, 286, + 404, 420,-32768, 245, 1149,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 374, 840,-32768,-32768,-32768,-32768, 294, +-32768, 296, 884, 759, 759, 20,-32768, 25,-32768,-32768, + 884, 299, 1054, 1054, 1054, 1054, 1054, 301, 303, 1054, + 1054, 884, 759, 305,-32768,-32768,-32768, 306, 307, 32, + 840, 840, 840, 840,-32768,-32768, 300, 840, 840, 1054, + 840,-32768,-32768,-32768,-32768, 113, 310, 308,-32768, 411, + 8, 432, 434, 311, 315, 319, 884, 428, 884, 320, + 322, 884, 323, 113,-32768, 324, 326, 884, 884, 113, +-32768, 325,-32768, 1054, 840, 840, 1054,-32768, 327, 336, + 330, 343,-32768, 342, 346, 136, 347, 154, 1168,-32768, + 352,-32768, 884, 884, 1054, 884, 884, 354,-32768, 354, + 884, 355, 1054, 1054, 1054,-32768,-32768, 1054, 759, 353, + 357,-32768, 840,-32768, 840, 840,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 113, 56, 447, 365, 359, 759, 73, +-32768,-32768, 454,-32768,-32768, 340, 884,-32768,-32768,-32768, + 100,-32768,-32768,-32768, 366, 367, 368, 154,-32768, 461, +-32768, 494, 5,-32768, 1054,-32768,-32768, 369,-32768,-32768, +-32768,-32768,-32768, 504,-32768, 884,-32768, 1008, 7, -61, + 759, 182,-32768, -31,-32768,-32768, 379,-32768, 1008,-32768, + 501, 502, 382, -61, 884, 884, 505, 452,-32768, 884, + 507,-32768, 884,-32768, 520, 521,-32768 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 188, 189, 190, 191, 254, 271, 111, 112, 72, - 494, 12, 73, 14, 37, 38, 39, 44, 50, 121, - 325, 233, 399, 328, 537, 379, 355, 522, 290, 356, - 74, 113, 130, 198, 131, 132, 103, 278, 368, 279, - 81, 15, 16, 17, 19, 18, 194, 242, 243, 59, - 22, 57, 94, 419, 420, 122, 201, 51, 89, 52, - 45, 422, 369, 76, 371, 295, 53, 85, 86, 227, - 541, 125, 308, 502, 402, 228, 229, 230, 231 +static const short yypgoto[] = { 402, + 408, 414, 415, 329, 332, -203,-32768, 0, 15, 455, + 11,-32768,-32768,-32768, 204,-32768,-32768, -174, -286, -380, +-32768, -231,-32768, -296, 45,-32768, -228,-32768,-32768, -24, + 309, -278,-32768, 440, 449, -69, -108, -179, 168,-32768, +-32768, 529,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 467,-32768,-32768,-32768,-32768,-32768,-32768, + -429, -74, 118, -159,-32768, 498,-32768,-32768,-32768,-32768, +-32768, 74, 171,-32768,-32768,-32768,-32768 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -386 -static const short int yypact[] = -{ - 357, -386, -386, -386, -386, -386, -386, -386, 28, -112, - 61, -51, 136, 27, 288, 172, 594, -386, 209, 93, - 49, 75, -386, 48, 230, -386, 841, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, 129, 129, 229, - -386, -386, -386, -386, 129, -386, -386, -386, -386, -386, - 129, 252, -386, 18, 257, 274, 279, -386, -386, -386, - -386, -386, 161, -386, -386, -386, -386, -386, 294, 295, - 4, 13, -386, -386, -386, 137, -386, 229, 229, -386, - -386, 1052, 228, 228, -386, -386, 110, -386, -386, -386, - -386, -386, -386, -386, -65, 126, -386, 164, 165, 108, - 161, -386, 137, -49, -386, 126, 1052, 1192, 68, 298, - 299, 44, 300, 617, -386, 305, -386, -386, -386, -386, - -386, 1206, -386, 9, 1340, -386, 293, -386, -386, 137, - -386, 178, 175, 1192, 1192, 171, -45, 1192, -386, 177, - -386, 137, -386, -386, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, -386, 264, 475, 179, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, 186, -386, -386, - -386, 194, 202, 203, 803, 1241, 461, 325, 219, 222, - 237, 243, -386, -386, 236, -386, 161, 137, 226, -386, - -386, -386, -386, -386, 332, 1256, 233, 372, 228, -386, - -386, 264, 475, 1192, 1192, 1192, 1192, 1192, 1192, 1192, - 1192, 1192, 1192, 1192, 1192, 1192, 1192, -386, 228, -386, - 159, -386, -386, -64, 1095, -386, -33, 78, -386, 242, - 137, -386, 236, 236, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, 249, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, 250, 1052, 1052, 1052, 1052, 1052, -386, -386, -57, - 518, -92, -386, -39, -386, 1052, 1052, 1052, 1052, 23, - -386, 253, -386, 161, 760, -386, 885, 885, -386, 885, - 1206, 1192, 1192, 43, 77, -386, 760, 31, 255, 259, - 262, 263, 266, 267, 760, 760, 366, 269, 1206, 1192, - 1192, -386, -386, -386, -386, -386, -386, -386, -50, -386, - -386, -386, -50, -386, -386, 1052, 1052, -386, 270, 272, - 276, 277, 1052, -386, 265, 617, -23, -386, -386, 278, - 287, 381, 289, 408, 423, -386, 236, 1134, -386, -386, - -386, -386, -386, -386, -386, -386, 376, 1052, -386, -386, - -386, -386, 296, -386, 297, 885, 760, 760, 3, -386, - 5, -386, -386, 885, 301, 1192, 1192, 1192, 1192, 1192, - 302, 304, 1192, 1192, 885, 760, 307, -386, -386, -386, - 308, 310, -40, 1052, 1052, 1052, 1052, -386, -386, 291, - 1052, 1052, 1192, 1052, -386, -386, -386, -386, 137, 311, - 309, -386, 421, -88, 433, 435, 312, 316, 320, 885, - 450, 885, 323, 324, 885, 326, 137, -386, 328, 329, - 885, 885, 137, -386, 322, -386, 1192, 1052, 1052, 1192, - -386, 331, 337, 344, 347, -386, 348, 349, 101, 351, - 125, 1150, -386, 356, -386, 885, 885, 1192, 885, 885, - 358, -386, 358, 885, 362, 1192, 1192, 1192, -386, -386, - 1192, 760, 361, 364, -386, 1052, -386, 1052, 1052, -386, - -386, -386, -386, -386, -386, -386, 137, 56, 448, 371, - 343, 760, -31, -386, -386, 438, -386, -386, 359, 885, - -386, -386, -386, 37, -386, -386, -386, 368, 369, 370, - 125, -386, 462, -386, 497, 6, -386, 1192, -386, -386, - 373, -386, -386, -386, -386, -386, 506, -386, 885, -386, - 1009, 20, -64, 760, 151, -386, -50, -386, -386, 382, - -386, 1009, -386, 502, 504, 384, -64, 885, 885, 507, - 454, -386, 885, 509, -386, 885, -386 -}; -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -386, 398, 401, 407, 410, 327, 330, -204, -386, 0, - 17, 453, 10, -386, -386, -386, 54, -386, -386, -175, - -319, -381, -386, -239, -386, -297, 46, -386, -203, -386, - -386, -25, 306, -283, -386, 436, 445, -70, -109, -180, - 210, -386, -386, 529, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, 464, -386, -386, -386, -386, - -386, -386, -385, -75, 117, -159, -386, 496, -386, -386, - -386, -386, -386, 70, 170, -386, -386, -386, -386 -}; +#define YYLAST 1445 -/* 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 -177 -static const short int yytable[] = -{ - 11, 75, 332, 299, 192, 281, 283, 381, 98, 398, - 13, 114, 429, 398, 431, 298, 11, 375, 60, 61, - 23, 100, 63, 64, 65, 66, 13, 1, 2, 298, - 3, 4, 199, 300, 84, 394, 140, 460, 193, 333, - 334, 342, 87, 321, 322, 342, 102, 144, 145, 430, - 347, 430, 353, 318, 464, 67, 305, 321, 322, 309, - 310, 311, 312, 313, 323, 324, 316, 317, 126, 354, - 129, -55, -55, 20, 102, 127, 342, 397, 323, 324, - 129, 25, 141, 343, 137, 353, 11, 21, 137, 142, - 143, 77, 78, 449, 342, 138, 197, 450, 82, 239, - 346, 104, 527, 105, 83, 348, 528, 329, 236, 237, - 342, 24, 240, 60, 61, 520, 100, 63, 64, 65, - 66, 409, 1, 2, 1, 3, 4, 3, 46, 47, - 48, 60, 61, 49, 100, 63, 64, 65, 66, 1, - 1, 2, 3, 3, 4, 542, 539, 99, 68, 26, - 67, 69, 200, 416, 70, 549, 71, 101, 128, 27, - 550, 396, 88, 321, 322, 104, 555, 105, 67, 383, - 527, 556, 40, 506, 531, 507, 378, 104, 398, 105, - 294, 54, 553, 397, 323, 324, 56, 423, 303, 304, - 294, 306, 307, 294, 294, 294, 294, 294, 314, 315, - 294, 294, 337, 338, 339, 340, 341, 55, 291, 129, - 380, 104, 104, 105, 105, 349, 350, 351, 352, 370, - 330, 370, 370, 497, 370, 398, 435, 398, 437, 438, - 439, 370, 321, 322, 443, 104, 192, 105, 491, 370, - 370, 2, 296, 68, 4, 297, 69, 58, 42, 70, - 43, 71, 135, 323, 324, 345, 79, 80, 321, 322, - 36, 68, 319, 320, 69, 400, 401, 70, 84, 71, - 193, 104, 407, 105, 91, 197, 376, 377, 397, 323, - 324, 115, 116, 117, 118, 119, 120, 106, 107, 544, - 484, 92, 546, 197, 395, 294, 93, 95, 96, 97, - 370, 370, 370, 133, 134, -56, -57, 146, 370, 195, - 232, 234, 235, 238, 241, 272, 510, 511, 512, 370, - 370, 540, 273, 28, 29, 30, 31, 32, 33, 34, - 274, 35, 418, 451, 452, 453, 454, 551, 275, 276, - 456, 457, 284, 459, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 370, 285, 370, -176, 286, 370, - 294, 436, 294, 294, 294, 370, 370, 442, 294, 289, - -63, 1, 2, 287, 3, 4, 5, 482, 483, 288, - 292, 298, 6, 7, 331, 335, 336, 458, 384, 357, - 370, 370, 385, 370, 370, 386, 387, 392, 370, 388, - 389, 8, 393, 403, 9, 404, 370, 408, 10, 405, - 406, 410, 412, 372, 373, 517, 374, 518, 519, 36, - 411, 481, 413, 382, 294, 414, 370, 415, 421, 424, - 425, 390, 391, 455, 370, 440, 496, 441, 463, 434, - 446, 447, 501, 448, 461, 465, 462, 466, 467, 468, - 294, 294, 294, 469, 471, 501, 449, 473, 480, 475, - 493, 476, 477, 370, 485, 523, 60, 61, 370, 100, - 108, 109, 110, 66, 486, 1, 2, 487, 3, 4, - 488, 525, 370, 370, 430, 489, 490, 370, 492, 498, - 370, 505, 426, 427, 428, 509, 255, 256, 515, 529, - 433, 516, 543, 67, 524, 532, 533, 534, 536, 538, - 547, 444, 445, 545, 557, 554, 558, 559, 563, 562, - 493, 565, 223, 60, 61, 224, 100, 108, 109, 110, - 66, 225, 1, 2, 226, 3, 4, 535, 301, 124, - 327, 139, 302, 521, 136, 41, 470, 123, 472, 90, - 513, 474, 432, 0, 0, 0, 0, 478, 479, 0, - 67, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 0, 0, 0, 0, 0, - 0, 0, 499, 500, 0, 503, 504, 0, 0, 0, - 508, 0, 0, 0, -175, 0, 68, 0, 514, 69, - 0, 0, 70, 0, 71, 282, 0, -63, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 526, 6, - 7, 0, 60, 61, 0, 0, 530, 0, 0, 0, - 0, 1, 2, 0, 3, 4, 0, 147, 8, 0, - 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, - 148, 149, 0, 68, 0, 548, 69, 0, 0, 70, - 552, 71, 344, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 560, 561, 0, 0, 0, 564, - 0, 0, 566, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 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, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 0, 177, 178, 179, 180, - 0, 181, 182, 183, 0, 0, 0, 0, 0, 0, - 0, 104, 0, 105, 0, 184, 0, 0, 185, 0, - 186, 0, 187, 358, 359, 60, 61, 360, 0, 0, - 0, 0, 0, 0, 1, 2, 0, 3, 4, 0, - 361, 362, 363, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 364, 365, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 61, - 366, 100, 108, 109, 110, 66, 0, 1, 2, 0, - 3, 4, 0, 0, 0, 0, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 0, 0, 0, 0, 0, 67, 60, 61, 0, 62, - 63, 64, 65, 66, 0, 1, 2, 0, 3, 4, - 0, 0, 0, 0, 0, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 0, 177, - 178, 179, 180, 67, 181, 182, 183, 0, 358, 359, - 60, 61, 360, 0, 104, 0, 105, 0, 0, 1, - 2, 367, 3, 4, 0, 361, 362, 363, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 364, 365, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 366, 0, 0, 68, 0, - 0, 69, 0, 277, 70, 0, 71, 0, 0, 0, - 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68, 0, 0, 69, - 0, 0, 70, 0, 71, 0, 0, 0, 0, 0, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 0, 177, 178, 179, 180, 0, 181, - 182, 183, 358, 359, 0, 0, 360, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 367, 0, 0, 361, - 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 364, 365, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 60, 61, 366, - 100, 108, 109, 110, 66, 0, 1, 2, 0, 3, - 4, 0, 0, 0, 0, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 0, - 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, - 60, 61, 0, 100, 63, 64, 65, 66, 0, 1, - 2, 0, 3, 4, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 326, 177, 178, - 179, 180, 0, 181, 182, 183, 0, 67, 0, 60, - 61, 0, 100, 63, 64, 65, 66, 0, 1, 2, - 367, 3, 4, 0, 0, 60, 61, 0, 100, 63, - 64, 65, 66, 0, 1, 2, 417, 3, 4, 0, - 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, - 0, 0, 495, 0, 0, 0, 0, 68, 0, 0, - 69, 0, 67, 70, 0, 71, 0, 60, 61, 0, - 100, 63, 64, 65, 66, 0, 1, 2, 0, 3, - 4, 60, 61, 0, 196, 63, 64, 65, 66, 0, - 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, - 68, 0, 0, 69, 67, 0, 70, 0, 71, 0, - 0, 0, 0, 0, 0, 0, 60, 61, 67, 100, - 108, 109, 110, 66, 0, 1, 2, 0, 3, 4, - 0, 60, 61, 0, 293, 63, 64, 65, 66, 68, - 1, 2, 69, 3, 4, 70, 0, 71, 0, 0, - 0, 0, 0, 67, 0, 68, 0, 0, 69, 0, - 0, 70, 0, 71, 0, 0, 0, 0, 67, 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, 68, 0, 0, - 69, 0, 0, 70, 0, 71, 0, 0, 0, 0, - 0, 68, 0, 0, 69, 0, 0, 70, 0, 71, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 202, 0, 0, 0, 0, 0, 68, 0, 0, 69, - 0, 0, 70, 0, 280, 0, 0, 0, 203, 204, - 0, 68, 0, 0, 69, 0, 0, 70, 0, 71, - 205, 206, 207, 208, 209, 210, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 211, 212, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 213, 214, 215, 0, 0, 216, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 217, 218, - 178, 179, 180, 219, 220, 221, 222 -}; -static const short int yycheck[] = -{ - 0, 26, 241, 207, 113, 185, 186, 304, 4, 328, - 0, 81, 9, 332, 9, 9, 16, 300, 5, 6, - 132, 8, 9, 10, 11, 12, 16, 14, 15, 9, - 17, 18, 23, 208, 16, 318, 106, 418, 113, 242, - 243, 133, 24, 107, 108, 133, 71, 3, 4, 46, - 142, 46, 29, 228, 142, 42, 215, 107, 108, 218, - 219, 220, 221, 222, 128, 129, 225, 226, 133, 46, - 95, 3, 4, 45, 99, 140, 133, 127, 128, 129, - 105, 132, 107, 140, 133, 29, 86, 59, 133, 21, - 22, 37, 38, 133, 133, 144, 121, 137, 44, 144, - 280, 134, 133, 136, 50, 144, 137, 140, 133, 134, - 133, 50, 137, 5, 6, 496, 8, 9, 10, 11, - 12, 144, 14, 15, 14, 17, 18, 17, 35, 36, - 37, 5, 6, 40, 8, 9, 10, 11, 12, 14, - 14, 15, 17, 17, 18, 526, 140, 143, 135, 13, - 42, 138, 143, 356, 141, 540, 143, 144, 32, 132, - 140, 320, 144, 107, 108, 134, 551, 136, 42, 138, - 133, 552, 0, 470, 137, 472, 133, 134, 497, 136, - 205, 132, 31, 127, 128, 129, 138, 367, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 272, 273, 274, 275, 276, 132, 198, 234, - 133, 134, 134, 136, 136, 285, 286, 287, 288, 294, - 142, 296, 297, 462, 299, 544, 385, 546, 387, 388, - 389, 306, 107, 108, 393, 134, 345, 136, 137, 314, - 315, 15, 9, 135, 18, 12, 138, 17, 39, 141, - 41, 143, 144, 128, 129, 280, 27, 28, 107, 108, - 131, 135, 103, 104, 138, 335, 336, 141, 16, 143, - 345, 134, 342, 136, 17, 300, 301, 302, 127, 128, - 129, 53, 54, 55, 56, 57, 58, 77, 78, 528, - 449, 17, 531, 318, 319, 320, 17, 136, 4, 4, - 375, 376, 377, 139, 139, 7, 7, 7, 383, 4, - 17, 133, 137, 142, 137, 136, 475, 476, 477, 394, - 395, 525, 136, 35, 36, 37, 38, 39, 40, 41, - 136, 43, 357, 403, 404, 405, 406, 541, 136, 136, - 410, 411, 17, 413, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 429, 136, 431, 0, 136, 434, - 385, 386, 387, 388, 389, 440, 441, 392, 393, 133, - 13, 14, 15, 136, 17, 18, 19, 447, 448, 136, - 48, 9, 25, 26, 142, 136, 136, 412, 133, 136, - 465, 466, 133, 468, 469, 133, 133, 31, 473, 133, - 133, 44, 133, 133, 47, 133, 481, 142, 51, 133, - 133, 133, 31, 296, 297, 485, 299, 487, 488, 131, - 133, 446, 133, 306, 449, 17, 501, 4, 52, 133, - 133, 314, 315, 142, 509, 133, 461, 133, 17, 138, - 133, 133, 467, 133, 133, 12, 137, 12, 136, 133, - 475, 476, 477, 133, 4, 480, 133, 133, 136, 133, - 460, 133, 133, 538, 133, 17, 5, 6, 543, 8, - 9, 10, 11, 12, 137, 14, 15, 133, 17, 18, - 133, 138, 557, 558, 46, 137, 137, 562, 137, 133, - 565, 133, 375, 376, 377, 133, 21, 22, 137, 140, - 383, 137, 527, 42, 133, 137, 137, 137, 46, 12, - 4, 394, 395, 140, 12, 133, 12, 133, 64, 12, - 520, 12, 124, 5, 6, 124, 8, 9, 10, 11, - 12, 124, 14, 15, 124, 17, 18, 520, 211, 86, - 234, 105, 212, 497, 99, 16, 429, 83, 431, 53, - 480, 434, 382, -1, -1, -1, -1, 440, 441, -1, - 42, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, -1, -1, -1, -1, -1, - -1, -1, 465, 466, -1, 468, 469, -1, -1, -1, - 473, -1, -1, -1, 0, -1, 135, -1, 481, 138, - -1, -1, 141, -1, 143, 144, -1, 13, 14, 15, - -1, 17, 18, 19, -1, -1, -1, -1, 501, 25, - 26, -1, 5, 6, -1, -1, 509, -1, -1, -1, - -1, 14, 15, -1, 17, 18, -1, 20, 44, -1, - -1, 47, -1, -1, -1, 51, -1, -1, -1, -1, - 33, 34, -1, 135, -1, 538, 138, -1, -1, 141, - 543, 143, 144, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 557, 558, -1, -1, -1, 562, - -1, -1, 565, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, -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, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, -1, 119, 120, 121, 122, - -1, 124, 125, 126, -1, -1, -1, -1, -1, -1, - -1, 134, -1, 136, -1, 138, -1, -1, 141, -1, - 143, -1, 145, 3, 4, 5, 6, 7, -1, -1, - -1, -1, -1, -1, 14, 15, -1, 17, 18, -1, - 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 33, 34, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 6, - 50, 8, 9, 10, 11, 12, -1, 14, 15, -1, - 17, 18, -1, -1, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - -1, -1, -1, -1, -1, 42, 5, 6, -1, 8, - 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, - -1, -1, -1, -1, -1, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, -1, 119, - 120, 121, 122, 42, 124, 125, 126, -1, 3, 4, - 5, 6, 7, -1, 134, -1, 136, -1, -1, 14, - 15, 141, 17, 18, -1, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 50, -1, -1, 135, -1, - -1, 138, -1, 140, 141, -1, 143, -1, -1, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 135, -1, -1, 138, - -1, -1, 141, -1, 143, -1, -1, -1, -1, -1, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, -1, 119, 120, 121, 122, -1, 124, - 125, 126, 3, 4, -1, -1, 7, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 141, -1, -1, 20, - 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 33, 34, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 5, 6, 50, - 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, - 18, -1, -1, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, -1, - -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, - 5, 6, -1, 8, 9, 10, 11, 12, -1, 14, - 15, -1, 17, 18, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 32, 119, 120, - 121, 122, -1, 124, 125, 126, -1, 42, -1, 5, - 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, - 141, 17, 18, -1, -1, 5, 6, -1, 8, 9, - 10, 11, 12, -1, 14, 15, 32, 17, 18, -1, - -1, -1, -1, -1, -1, -1, 42, -1, -1, -1, - -1, -1, 32, -1, -1, -1, -1, 135, -1, -1, - 138, -1, 42, 141, -1, 143, -1, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, - 18, 5, 6, -1, 8, 9, 10, 11, 12, -1, - 14, 15, -1, 17, 18, -1, -1, -1, -1, -1, - 135, -1, -1, 138, 42, -1, 141, -1, 143, -1, - -1, -1, -1, -1, -1, -1, 5, 6, 42, 8, - 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, - -1, 5, 6, -1, 8, 9, 10, 11, 12, 135, - 14, 15, 138, 17, 18, 141, -1, 143, -1, -1, - -1, -1, -1, 42, -1, 135, -1, -1, 138, -1, - -1, 141, -1, 143, -1, -1, -1, -1, 42, -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, 135, -1, -1, - 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, - -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 30, -1, -1, -1, -1, -1, 135, -1, -1, 138, - -1, -1, 141, -1, 143, -1, -1, -1, 48, 49, - -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 100, 101, 102, -1, -1, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126 +static const short yytable[] = { 11, + 73, 297, 190, 279, 281, 379, 96, 330, 197, 112, + 13, 331, 332, 296, 11, 296, 22, 58, 59, 373, + 98, 61, 62, 63, 64, 13, 1, 2, 427, 3, + 4, 298, 82, 429, 138, 458, 191, 392, 351, 396, + 85, 135, 124, 396, 100, 319, 320, 23, 19, 125, + 135, 316, 136, 303, 65, 352, 307, 308, 309, 310, + 311, 237, 20, 314, 315, 428, 321, 322, 127, 102, + 428, 103, 100, 77, 78, 319, 320, 328, 127, 24, + 139, -54, -54, 11, 351, 27, 28, 29, 30, 31, + 32, 33, 340, 34, 195, 395, 321, 322, 344, 140, + 141, 1, 340, 346, 3, 25, 234, 235, 547, 341, + 238, 58, 59, 518, 98, 61, 62, 63, 64, 553, + 1, 2, 340, 3, 4, 414, 340, 26, 198, 58, + 59, 345, 60, 61, 62, 63, 64, 407, 1, 2, + 340, 3, 4, 540, 537, 97, 548, 66, 65, 462, + 67, 376, 102, 68, 103, 69, 99, 56, 394, 102, + 86, 103, 319, 320, 447, 327, 65, 1, 448, 554, + 3, 504, 52, 505, 44, 45, 46, 2, 292, 47, + 4, 35, 395, 321, 322, 421, 301, 302, 292, 304, + 305, 292, 292, 292, 292, 292, 312, 313, 292, 292, + 335, 336, 337, 338, 339, 525, 289, 127, 396, 526, + 142, 143, 551, 347, 348, 349, 350, 368, 294, 368, + 368, 295, 368, 433, 54, 435, 436, 437, 495, 368, + 53, 441, 525, 40, 190, 41, 529, 368, 368, 75, + 76, 66, 104, 105, 67, 80, 102, 68, 103, 69, + 133, 81, 102, 343, 103, 396, 381, 396, 35, 66, + 319, 320, 67, 398, 399, 68, 82, 69, 191, 102, + 405, 103, 489, 195, 374, 375, 378, 102, 89, 103, + 90, 321, 322, 317, 318, 91, 93, 482, 319, 320, + 94, 195, 393, 292, 542, 95, 131, 544, 368, 368, + 368, -55, 132, -56, 144, 193, 368, 230, 395, 321, + 322, 232, 233, 508, 509, 510, 236, 368, 368, 538, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 416, 449, 450, 451, 452, 549, 239, 270, 454, 455, + 271, 457, 113, 114, 115, 116, 117, 118, 272, 273, + 274, 282, 368, 283, 368, -175, 284, 368, 292, 434, + 292, 292, 292, 368, 368, 440, 292, 285, -62, 1, + 2, 286, 3, 4, 5, 480, 481, 287, 290, 296, + 6, 7, 333, 329, 334, 456, 382, 355, 368, 368, + 383, 368, 368, 384, 390, 385, 368, 386, 387, 8, + 391, 406, 9, 401, 368, 402, 10, 403, 404, 408, + 409, 370, 371, 515, 372, 516, 517, 410, 411, 479, + 412, 380, 292, 413, 368, 419, 422, 461, 423, 388, + 389, 469, 368, 438, 494, 439, 432, 444, 445, 446, + 499, 453, 459, 463, 460, 464, 465, 466, 292, 292, + 292, 467, 447, 499, 471, 473, 474, 491, 475, 483, + 478, 368, 485, 521, 58, 59, 368, 98, 106, 107, + 108, 64, 484, 1, 2, 486, 3, 4, 487, 527, + 368, 368, 488, 490, 496, 368, 503, 507, 368, 513, + 424, 425, 426, 514, 253, 254, 523, 522, 431, 428, + 541, 65, 530, 531, 532, 536, 534, 545, 543, 442, + 443, 552, 555, 556, 557, 561, 560, 491, 563, 566, + 567, 58, 59, 221, 98, 106, 107, 108, 64, 222, + 1, 2, 533, 3, 4, 223, 224, 299, 122, 519, + 325, 300, 137, 39, 468, 134, 470, 121, 88, 472, + 430, 511, 0, 0, 0, 476, 477, 0, 65, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 0, 0, 0, 0, 0, 0, 0, + 497, 498, 0, 501, 502, 0, 0, 0, 506, 0, + 0, 0, -174, 0, 66, 0, 512, 67, 0, 0, + 68, 0, 69, 280, 0, -62, 1, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 524, 6, 7, 0, + 58, 59, 0, 0, 528, 0, 0, 0, 0, 1, + 2, 0, 3, 4, 0, 145, 8, 0, 0, 9, + 0, 0, 0, 10, 0, 0, 0, 0, 146, 147, + 0, 66, 0, 546, 67, 0, 0, 68, 550, 69, + 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 558, 559, 0, 0, 0, 562, 0, 0, + 564, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 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, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 0, 175, 176, 177, 178, 0, 179, + 180, 181, 0, 0, 0, 0, 0, 0, 0, 102, + 0, 103, 0, 182, 0, 0, 183, 0, 184, 0, + 185, 356, 357, 58, 59, 358, 0, 0, 0, 0, + 0, 0, 1, 2, 0, 3, 4, 0, 359, 360, + 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 362, 363, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 58, 59, 364, 98, + 106, 107, 108, 64, 0, 1, 2, 0, 3, 4, + 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, + 0, 0, 0, 65, 58, 59, 0, 98, 106, 107, + 108, 64, 0, 1, 2, 0, 3, 4, 0, 0, + 0, 0, 0, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 0, 175, 176, 177, + 178, 65, 179, 180, 181, 0, 356, 357, 58, 59, + 358, 0, 102, 0, 103, 0, 0, 1, 2, 365, + 3, 4, 0, 359, 360, 361, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 362, 363, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 364, 0, 0, 66, 0, 0, 67, + 0, 275, 68, 0, 69, 0, 0, 0, 0, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 66, 0, 0, 67, 0, 0, + 68, 0, 69, 0, 0, 0, 0, 0, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 0, 175, 176, 177, 178, 0, 179, 180, 181, + 356, 357, 0, 0, 358, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 365, 0, 0, 359, 360, 361, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 58, 59, + 0, 98, 61, 62, 63, 64, 0, 1, 2, 0, + 3, 4, 0, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 0, 0, 58, 59, + 0, 98, 61, 62, 63, 64, 0, 1, 2, 0, + 3, 4, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 126, 175, 176, 177, 178, + 0, 179, 180, 181, 0, 65, 0, 58, 59, 0, + 98, 61, 62, 63, 64, 0, 1, 2, 365, 3, + 4, 0, 0, 58, 59, 0, 98, 61, 62, 63, + 64, 0, 1, 2, 324, 3, 4, 0, 0, 0, + 0, 0, 58, 59, 65, 98, 61, 62, 63, 64, + 415, 1, 2, 0, 3, 4, 0, 0, 66, 0, + 65, 67, 0, 0, 68, 0, 69, 0, 0, 493, + 0, 58, 59, 0, 194, 61, 62, 63, 64, 65, + 1, 2, 0, 3, 4, 0, 0, 58, 59, 0, + 98, 106, 107, 108, 64, 0, 1, 2, 66, 3, + 4, 67, 0, 0, 68, 0, 69, 0, 65, 58, + 59, 0, 291, 61, 62, 63, 64, 0, 1, 2, + 0, 3, 4, 0, 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 67, 0, 0, 68, 0, 69, 65, 0, 0, 0, + 0, 0, 0, 66, 0, 0, 67, 0, 0, 68, + 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 66, 0, 0, 67, 0, 0, 68, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 67, 0, 0, 68, 0, 69, + 0, 0, 0, 0, 0, 0, 0, 66, 200, 0, + 67, 0, 0, 68, 0, 278, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 201, 202, 0, 66, + 0, 0, 67, 0, 0, 68, 0, 69, 203, 204, + 205, 206, 207, 208, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 209, 210, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, + 213, 0, 0, 214, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 215, 216, 176, 177, + 178, 217, 218, 219, 220 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 14, 15, 17, 18, 19, 25, 26, 44, 47, - 51, 155, 157, 158, 159, 187, 188, 189, 191, 190, - 45, 59, 196, 132, 50, 132, 13, 132, 35, 36, - 37, 38, 39, 40, 41, 43, 131, 160, 161, 162, - 0, 189, 39, 41, 163, 206, 35, 36, 37, 40, - 164, 203, 205, 212, 132, 132, 138, 197, 17, 195, - 5, 6, 8, 9, 10, 11, 12, 42, 135, 138, - 141, 143, 155, 158, 176, 177, 209, 162, 162, 27, - 28, 186, 162, 162, 16, 213, 214, 24, 144, 204, - 213, 17, 17, 17, 198, 136, 4, 4, 4, 143, - 8, 144, 177, 182, 134, 136, 186, 186, 9, 10, - 11, 153, 154, 177, 183, 53, 54, 55, 56, 57, - 58, 165, 201, 201, 157, 217, 133, 140, 32, 177, - 178, 180, 181, 139, 139, 144, 182, 133, 144, 181, - 183, 177, 21, 22, 3, 4, 7, 20, 33, 34, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 119, 120, 121, - 122, 124, 125, 126, 138, 141, 143, 145, 147, 148, - 149, 150, 184, 209, 192, 4, 8, 177, 179, 23, - 143, 202, 30, 48, 49, 60, 61, 62, 63, 64, - 65, 78, 79, 100, 101, 102, 105, 118, 119, 123, - 124, 125, 126, 147, 148, 149, 150, 215, 221, 222, - 223, 224, 17, 167, 133, 137, 177, 177, 142, 144, - 177, 137, 193, 194, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 151, 21, 22, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 152, 136, 136, 136, 136, 136, 140, 183, 185, - 143, 185, 144, 185, 17, 136, 136, 136, 136, 133, - 174, 158, 48, 8, 177, 211, 9, 12, 9, 153, - 165, 151, 152, 177, 177, 211, 177, 177, 218, 211, - 211, 211, 211, 211, 177, 177, 211, 211, 165, 103, - 104, 107, 108, 128, 129, 166, 32, 178, 169, 140, - 142, 142, 169, 174, 174, 136, 136, 183, 183, 183, - 183, 183, 133, 140, 144, 177, 185, 142, 144, 183, - 183, 183, 183, 29, 46, 172, 175, 136, 3, 4, - 7, 20, 21, 22, 33, 34, 50, 141, 184, 208, - 209, 210, 210, 210, 210, 179, 177, 177, 133, 171, - 133, 171, 210, 138, 133, 133, 133, 133, 133, 133, - 210, 210, 31, 133, 179, 177, 211, 127, 166, 168, - 183, 183, 220, 133, 133, 133, 133, 183, 142, 144, - 133, 133, 31, 133, 17, 4, 174, 32, 177, 199, - 200, 52, 207, 185, 133, 133, 210, 210, 210, 9, - 46, 9, 220, 210, 138, 211, 177, 211, 211, 211, - 133, 133, 177, 211, 210, 210, 133, 133, 133, 133, - 137, 183, 183, 183, 183, 142, 183, 183, 177, 183, - 167, 133, 137, 17, 142, 12, 12, 136, 133, 133, - 210, 4, 210, 133, 210, 133, 133, 133, 210, 210, - 136, 177, 183, 183, 211, 133, 137, 133, 133, 137, - 137, 137, 137, 155, 156, 32, 177, 169, 133, 210, - 210, 177, 219, 210, 210, 133, 171, 171, 210, 133, - 211, 211, 211, 219, 210, 137, 137, 183, 183, 183, - 167, 172, 173, 17, 133, 138, 210, 133, 137, 140, - 210, 137, 137, 137, 137, 156, 46, 170, 12, 140, - 153, 216, 167, 177, 169, 140, 169, 4, 210, 208, - 140, 153, 210, 31, 133, 208, 167, 12, 12, 133, - 210, 210, 12, 64, 210, 12, 210 +static const short yycheck[] = { 0, + 25, 205, 111, 183, 184, 302, 4, 239, 23, 79, + 0, 240, 241, 9, 15, 9, 132, 5, 6, 298, + 8, 9, 10, 11, 12, 15, 14, 15, 9, 17, + 18, 206, 16, 9, 104, 416, 111, 316, 29, 326, + 24, 133, 133, 330, 69, 107, 108, 50, 45, 140, + 133, 226, 144, 213, 42, 46, 216, 217, 218, 219, + 220, 144, 59, 223, 224, 46, 128, 129, 93, 134, + 46, 136, 97, 27, 28, 107, 108, 142, 103, 132, + 105, 3, 4, 84, 29, 35, 36, 37, 38, 39, + 40, 41, 133, 43, 119, 127, 128, 129, 278, 21, + 22, 14, 133, 144, 17, 13, 131, 132, 538, 140, + 135, 5, 6, 494, 8, 9, 10, 11, 12, 549, + 14, 15, 133, 17, 18, 354, 133, 132, 143, 5, + 6, 142, 8, 9, 10, 11, 12, 144, 14, 15, + 133, 17, 18, 524, 140, 143, 140, 135, 42, 142, + 138, 133, 134, 141, 136, 143, 144, 17, 318, 134, + 144, 136, 107, 108, 133, 140, 42, 14, 137, 550, + 17, 468, 132, 470, 35, 36, 37, 15, 203, 40, + 18, 131, 127, 128, 129, 365, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 270, 271, 272, 273, 274, 133, 196, 232, 495, 137, + 3, 4, 31, 283, 284, 285, 286, 292, 9, 294, + 295, 12, 297, 383, 138, 385, 386, 387, 460, 304, + 132, 391, 133, 39, 343, 41, 137, 312, 313, 36, + 37, 135, 75, 76, 138, 42, 134, 141, 136, 143, + 144, 48, 134, 278, 136, 542, 138, 544, 131, 135, + 107, 108, 138, 333, 334, 141, 16, 143, 343, 134, + 340, 136, 137, 298, 299, 300, 133, 134, 17, 136, + 17, 128, 129, 103, 104, 17, 136, 447, 107, 108, + 4, 316, 317, 318, 526, 4, 139, 529, 373, 374, + 375, 7, 139, 7, 7, 4, 381, 17, 127, 128, + 129, 133, 137, 473, 474, 475, 142, 392, 393, 523, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 355, 401, 402, 403, 404, 539, 137, 136, 408, 409, + 136, 411, 53, 54, 55, 56, 57, 58, 136, 136, + 136, 17, 427, 136, 429, 0, 136, 432, 383, 384, + 385, 386, 387, 438, 439, 390, 391, 136, 13, 14, + 15, 136, 17, 18, 19, 445, 446, 133, 48, 9, + 25, 26, 136, 142, 136, 410, 133, 136, 463, 464, + 133, 466, 467, 133, 31, 133, 471, 133, 133, 44, + 133, 142, 47, 133, 479, 133, 51, 133, 133, 133, + 133, 294, 295, 483, 297, 485, 486, 31, 133, 444, + 17, 304, 447, 4, 499, 52, 133, 17, 133, 312, + 313, 4, 507, 133, 459, 133, 138, 133, 133, 133, + 465, 142, 133, 12, 137, 12, 136, 133, 473, 474, + 475, 133, 133, 478, 133, 133, 133, 458, 133, 133, + 136, 536, 133, 17, 5, 6, 541, 8, 9, 10, + 11, 12, 137, 14, 15, 133, 17, 18, 137, 140, + 555, 556, 137, 137, 133, 560, 133, 133, 563, 137, + 373, 374, 375, 137, 21, 22, 138, 133, 381, 46, + 525, 42, 137, 137, 137, 12, 46, 4, 140, 392, + 393, 133, 12, 12, 133, 64, 12, 518, 12, 0, + 0, 5, 6, 122, 8, 9, 10, 11, 12, 122, + 14, 15, 518, 17, 18, 122, 122, 209, 84, 495, + 232, 210, 103, 15, 427, 97, 429, 81, 51, 432, + 380, 478, -1, -1, -1, 438, 439, -1, 42, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, -1, -1, -1, -1, -1, -1, -1, + 463, 464, -1, 466, 467, -1, -1, -1, 471, -1, + -1, -1, 0, -1, 135, -1, 479, 138, -1, -1, + 141, -1, 143, 144, -1, 13, 14, 15, -1, 17, + 18, 19, -1, -1, -1, -1, 499, 25, 26, -1, + 5, 6, -1, -1, 507, -1, -1, -1, -1, 14, + 15, -1, 17, 18, -1, 20, 44, -1, -1, 47, + -1, -1, -1, 51, -1, -1, -1, -1, 33, 34, + -1, 135, -1, 536, 138, -1, -1, 141, 541, 143, + 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 555, 556, -1, -1, -1, 560, -1, -1, + 563, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, -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, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, -1, 119, 120, 121, 122, -1, 124, + 125, 126, -1, -1, -1, -1, -1, -1, -1, 134, + -1, 136, -1, 138, -1, -1, 141, -1, 143, -1, + 145, 3, 4, 5, 6, 7, -1, -1, -1, -1, + -1, -1, 14, 15, -1, 17, 18, -1, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 5, 6, 50, 8, + 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, + -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, + -1, -1, -1, 42, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, -1, 17, 18, -1, -1, + -1, -1, -1, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, -1, 119, 120, 121, + 122, 42, 124, 125, 126, -1, 3, 4, 5, 6, + 7, -1, 134, -1, 136, -1, -1, 14, 15, 141, + 17, 18, -1, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 50, -1, -1, 135, -1, -1, 138, + -1, 140, 141, -1, 143, -1, -1, -1, -1, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 135, -1, -1, 138, -1, -1, + 141, -1, 143, -1, -1, -1, -1, -1, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, -1, 119, 120, 121, 122, -1, 124, 125, 126, + 3, 4, -1, -1, 7, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 141, -1, -1, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, 34, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 50, 5, 6, + -1, 8, 9, 10, 11, 12, -1, 14, 15, -1, + 17, 18, -1, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, -1, -1, -1, + -1, -1, -1, -1, -1, 42, -1, -1, 5, 6, + -1, 8, 9, 10, 11, 12, -1, 14, 15, -1, + 17, 18, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 32, 119, 120, 121, 122, + -1, 124, 125, 126, -1, 42, -1, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, 141, 17, + 18, -1, -1, 5, 6, -1, 8, 9, 10, 11, + 12, -1, 14, 15, 32, 17, 18, -1, -1, -1, + -1, -1, 5, 6, 42, 8, 9, 10, 11, 12, + 32, 14, 15, -1, 17, 18, -1, -1, 135, -1, + 42, 138, -1, -1, 141, -1, 143, -1, -1, 32, + -1, 5, 6, -1, 8, 9, 10, 11, 12, 42, + 14, 15, -1, 17, 18, -1, -1, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, 135, 17, + 18, 138, -1, -1, 141, -1, 143, -1, 42, 5, + 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, + -1, 17, 18, -1, 42, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, + 138, -1, -1, 141, -1, 143, 42, -1, -1, -1, + -1, -1, -1, 135, -1, -1, 138, -1, -1, 141, + -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 135, -1, -1, 138, -1, -1, 141, -1, + 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, + -1, -1, -1, -1, -1, -1, -1, 135, 30, -1, + 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 48, 49, -1, 135, + -1, -1, 138, -1, -1, 141, -1, 143, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 100, 101, + 102, -1, -1, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) - #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) #endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ #endif -/* Enable debugging if requested. */ -#if YYDEBUG +/* If nonreentrant, generate the variables here */ -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +#ifndef YYPURE -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; + register char *f = from; + register char *t = to; + register int i = count; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; + while (i-- > 0) + *t++ = *f++; } -# endif - -#endif /* YYERROR_VERBOSE */ - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#else /* __cplusplus */ -#if defined (__STDC__) || defined (__cplusplus) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +__yy_memcpy (char *to, char *from, unsigned int count) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - + register char *t = to; + register char *f = from; + register int i = count; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); + while (i-- > 0) + *t++ = *f++; } -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) +int yyparse (void *); #else -int -yyparse () - +int yyparse (void); #endif #endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else #define YYPOPSTACK (yyvsp--, yyssp--) +#endif - YYSIZE_T yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ int yylen; - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -2801,675 +2126,644 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif - if (yyss + yystacksize - 1 <= yyssp) - { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + yybackup: /* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ +/* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; - if (yyn <= 0) + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) +#if YYDEBUG != 0 + if (yydebug) { - case 29: -#line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} - break; - - case 30: -#line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} - break; + int i; - case 31: -#line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} - break; - - case 32: -#line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} - break; - - case 33: -#line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} - break; - - case 34: -#line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} - break; - - case 35: -#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} - break; - - case 36: -#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} - break; + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); - case 37: -#line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} - break; + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif - case 38: -#line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} - break; - case 39: -#line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} - break; + switch (yyn) { - case 40: -#line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} - break; - - case 41: -#line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} - break; - - case 42: -#line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} - break; - - case 43: -#line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} - break; - - case 44: -#line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} - break; - - case 45: -#line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} - break; - - case 46: -#line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} - break; - - case 47: -#line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} - break; - - case 48: -#line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} - break; - - case 49: -#line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} - break; - - case 50: -#line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} - break; - - case 51: -#line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} - break; - - case 52: -#line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} - break; - - case 53: -#line 1052 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} - break; - - case 54: -#line 1053 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} - break; - - case 61: -#line 1062 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 62: -#line 1066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[-1].StrVal); +case 28: +#line 1038 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; + break;} +case 29: +#line 1038 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_NE; ; + break;} +case 30: +#line 1039 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; + break;} +case 31: +#line 1039 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; + break;} +case 32: +#line 1040 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; + break;} +case 33: +#line 1040 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; + break;} +case 34: +#line 1041 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; + break;} +case 35: +#line 1041 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; + break;} +case 36: +#line 1042 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; + break;} +case 37: +#line 1042 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; + break;} +case 38: +#line 1046 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; + break;} +case 39: +#line 1046 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; + break;} +case 40: +#line 1047 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; + break;} +case 41: +#line 1047 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; + break;} +case 42: +#line 1048 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; + break;} +case 43: +#line 1048 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; + break;} +case 44: +#line 1049 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; + break;} +case 45: +#line 1049 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; + break;} +case 46: +#line 1050 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; + break;} +case 47: +#line 1050 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; + break;} +case 48: +#line 1051 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; + break;} +case 49: +#line 1051 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; + break;} +case 50: +#line 1052 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; + break;} +case 51: +#line 1052 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; + break;} +case 52: +#line 1053 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; + break;} +case 53: +#line 1054 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; + break;} +case 60: +#line 1063 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 61: +#line 1067 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 63: -#line 1070 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 62: +#line 1071 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 66: -#line 1077 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[-1].StrVal); + ; + break;} +case 65: +#line 1078 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 67: -#line 1081 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 66: +#line 1082 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 68: -#line 1087 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 69: -#line 1088 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 70: -#line 1089 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 71: -#line 1090 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 72: -#line 1091 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 73: -#line 1095 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 74: -#line 1096 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 75: -#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 76: -#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 77: -#line 1102 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} - break; - - case 78: -#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 79: -#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 80: -#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 81: -#line 1112 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 82: -#line 1113 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 83: -#line 1114 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 84: -#line 1115 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 85: -#line 1116 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 86: -#line 1119 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 87: -#line 1120 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 88: -#line 1121 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 89: -#line 1122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 90: -#line 1123 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} - break; - - case 91: -#line 1124 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} - break; - - case 92: -#line 1125 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + ; + break;} +case 67: +#line 1088 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 68: +#line 1089 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 69: +#line 1090 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 70: +#line 1091 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 71: +#line 1092 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 72: +#line 1096 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 73: +#line 1097 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 74: +#line 1098 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 75: +#line 1102 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 76: +#line 1103 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::HiddenVisibility; ; + break;} +case 77: +#line 1107 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 78: +#line 1108 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 79: +#line 1109 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 80: +#line 1113 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 81: +#line 1114 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 82: +#line 1115 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 83: +#line 1116 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 84: +#line 1117 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 85: +#line 1120 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 86: +#line 1121 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 87: +#line 1122 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 88: +#line 1123 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 89: +#line 1124 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_StdCall; ; + break;} +case 90: +#line 1125 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_FastCall; ; + break;} +case 91: +#line 1126 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) GEN_ERROR("Calling conv too large!"); - (yyval.UIntVal) = (yyvsp[0].UInt64Val); + yyval.UIntVal = yyvsp[0].UInt64Val; CHECK_FOR_ERROR - ;} - break; - - case 93: -#line 1132 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;} - break; - - case 94: -#line 1133 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;} - break; - - case 95: -#line 1134 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;} - break; - - case 96: -#line 1135 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;} - break; - - case 97: -#line 1138 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} - break; - - case 98: -#line 1139 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); - ;} - break; - - case 99: -#line 1144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;} - break; - - case 101: -#line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} - break; - - case 102: -#line 1149 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); - ;} - break; - - case 103: -#line 1156 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 104: -#line 1157 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 92: +#line 1133 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::ZExtAttribute; ; + break;} +case 93: +#line 1134 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::SExtAttribute; ; + break;} +case 94: +#line 1135 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::InRegAttribute; ; + break;} +case 95: +#line 1136 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::StructRetAttribute; ; + break;} +case 96: +#line 1139 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; + break;} +case 97: +#line 1140 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); + ; + break;} +case 98: +#line 1145 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoReturnAttribute; ; + break;} +case 100: +#line 1149 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; + break;} +case 101: +#line 1150 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); + ; + break;} +case 102: +#line 1157 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 103: +#line 1158 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR -;} - break; - - case 105: -#line 1163 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 106: -#line 1164 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 104: +#line 1164 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 105: +#line 1165 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR -;} - break; - - case 107: -#line 1172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) - if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') +; + break;} +case 106: +#line 1173 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') GEN_ERROR("Invalid character in section name!"); - (yyval.StrVal) = (yyvsp[0].StrVal); + yyval.StrVal = yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 108: -#line 1180 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 109: -#line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[0].StrVal); ;} - break; - - case 110: -#line 1186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 111: -#line 1187 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 112: -#line 1188 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); +; + break;} +case 107: +#line 1181 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 108: +#line 1182 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 109: +#line 1187 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 110: +#line 1188 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 111: +#line 1189 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 113: -#line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) + ; + break;} +case 112: +#line 1194 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two!"); - CurGV->setAlignment((yyvsp[0].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 118: -#line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 117: +#line 1210 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 119: -#line 1213 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); + ; + break;} +case 118: +#line 1214 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 120: -#line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - if (*(yyvsp[-1].TypeVal) == Type::LabelTy) + ; + break;} +case 119: +#line 1218 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + if (*yyvsp[-1].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 121: -#line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - (yyval.TypeVal) = new PATypeHolder(tmp); - ;} - break; - - case 122: -#line 1229 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!"); + ; + break;} +case 120: +#line 1225 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... + const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TypeVal = new PATypeHolder(tmp); + ; + break;} +case 121: +#line 1230 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Type UpReference + if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal) = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... + yyval.TypeVal = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ;} - break; - - case 123: -#line 1237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 122: +#line 1238 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[0].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back(yyvsp[0].ParamAttrs); + for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3477,21 +2771,20 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, Attrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[-4].TypeVal); // Delete the return type handle - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 124: -#line 1255 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, Attrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + delete yyvsp[-4].TypeVal; // Delete the return type handle + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 123: +#line 1256 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[0].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back(yyvsp[0].ParamAttrs); + for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3499,303 +2792,282 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, Attrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 125: -#line 1273 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 126: -#line 1278 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); - if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, Attrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 124: +#line 1274 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Sized array type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 125: +#line 1279 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Packed array type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); - if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2!"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); - delete (yyvsp[-1].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 127: -#line 1290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 126: +#line 1291 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), - E = (yyvsp[-1].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[-1].TypeList); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete yyvsp[-1].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 128: -#line 1300 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ;} - break; - - case 129: -#line 1304 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 127: +#line 1301 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 128: +#line 1305 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Elements; - for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), - E = (yyvsp[-2].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-2].TypeList->begin(), + E = yyvsp[-2].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[-2].TypeList); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete yyvsp[-2].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 130: -#line 1314 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ;} - break; - - case 131: -#line 1321 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); - ;} - break; - - case 132: -#line 1328 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 129: +#line 1315 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ; + break;} +case 130: +#line 1322 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; + yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; + ; + break;} +case 131: +#line 1329 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + if (!(*yyvsp[0].TypeVal)->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types!"); - (yyval.TypeVal) = (yyvsp[0].TypeVal); - ;} - break; - - case 133: -#line 1335 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); - ;} - break; - - case 134: -#line 1340 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 132: +#line 1336 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(Type::VoidTy); + ; + break;} +case 133: +#line 1341 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 135: -#line 1345 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); + ; + break;} +case 134: +#line 1346 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 137: -#line 1353 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); + ; + break;} +case 136: +#line 1354 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 138: -#line 1360 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList; + ; + break;} +case 137: +#line 1361 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 139: -#line 1367 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + ; + break;} +case 138: +#line 1368 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR - ;} - break; - - case 140: -#line 1375 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); + ; + break;} +case 139: +#line 1376 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 141: -#line 1380 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); + ; + break;} +case 140: +#line 1381 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 142: -#line 1391 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 141: +#line 1392 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); + (*yyvsp[-3].TypeVal)->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 143: -#line 1419 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 142: +#line 1420 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); + (*yyvsp[-2].TypeVal)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); - (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[-2].TypeVal); + yyval.ConstVal = ConstantArray::get(ATy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 144: -#line 1435 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 143: +#line 1436 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); + (*yyvsp[-2].TypeVal)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[0].StrVal))) + + itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + itostr(NumElements) + "!"); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); + for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[0].StrVal)); + free(yyvsp[0].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } - free((yyvsp[0].StrVal)); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[-2].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 145: -#line 1464 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + free(yyvsp[0].StrVal); + yyval.ConstVal = ConstantArray::get(ATy, Vals); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 144: +#line 1465 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); + (*yyvsp[-3].TypeVal)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 146: -#line 1492 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); + ; + break;} +case 145: +#line 1493 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); + (*yyvsp[-3].TypeVal)->getDescription() + "'!"); - if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3805,21 +3077,20 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 147: -#line 1517 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 146: +#line 1518 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); + (*yyvsp[-2].TypeVal)->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); @@ -3828,26 +3099,25 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-2].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 148: -#line 1536 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); + ; + break;} +case 147: +#line 1537 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-5].TypeVal))->getDescription() + "'!"); + (*yyvsp[-5].TypeVal)->getDescription() + "'!"); - if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3857,21 +3127,20 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector)); - delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); + delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 149: -#line 1561 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 148: +#line 1562 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-4].TypeVal))->getDescription() + "'!"); + (*yyvsp[-4].TypeVal)->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); @@ -3880,45 +3149,42 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-4].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-4].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 150: -#line 1580 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 149: +#line 1581 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[-1].TypeVal))->getDescription() + "'!"); + (*yyvsp[-1].TypeVal)->getDescription() + "'!"); - (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[-1].TypeVal); + yyval.ConstVal = ConstantPointerNull::get(PTy); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 151: -#line 1592 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 150: +#line 1593 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 152: -#line 1599 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 151: +#line 1600 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type!"); @@ -3932,7 +3198,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getValNonImprovising(Ty, (yyvsp[0].ValIDVal)); + Value *V = getValNonImprovising(Ty, yyvsp[0].ValIDVal); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -3947,16 +3213,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[0].ValIDVal).destroy(); + yyvsp[0].ValIDVal.destroy(); } else { std::string Name; - if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[0].ValIDVal).Name; - else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) + if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) + Name = yyvsp[0].ValIDVal.Name; + else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -3972,312 +3238,282 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); V = GV; } } - (yyval.ConstVal) = cast(V); - delete (yyvsp[-1].TypeVal); // Free the type handle + yyval.ConstVal = cast(V); + delete yyvsp[-1].TypeVal; // Free the type handle CHECK_FOR_ERROR - ;} - break; - - case 153: -#line 1665 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 152: +#line 1666 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[0].ConstVal); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 154: -#line 1675 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); + yyval.ConstVal = yyvsp[0].ConstVal; + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 153: +#line 1676 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[-1].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); - (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[-1].TypeVal); + yyval.ConstVal = Constant::getNullValue(Ty); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 155: -#line 1685 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) + ; + break;} +case 154: +#line 1686 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 156: -#line 1691 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) + ; + break;} +case 155: +#line 1692 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 157: -#line 1697 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ;} - break; - - case 158: -#line 1702 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ;} - break; - - case 159: -#line 1707 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) + ; + break;} +case 156: +#line 1698 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ; + break;} +case 157: +#line 1703 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ; + break;} +case 158: +#line 1708 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Float & Double constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type!!"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); + yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); CHECK_FOR_ERROR - ;} - break; - - case 160: -#line 1715 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 159: +#line 1716 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - Constant *Val = (yyvsp[-3].ConstVal); - const Type *DestTy = (yyvsp[-1].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + Constant *Val = yyvsp[-3].ConstVal; + const Type *DestTy = yyvsp[-1].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'!"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 161: -#line 1727 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[-2].ConstVal)->getType())) + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); + delete yyvsp[-1].TypeVal; + ; + break;} +case 160: +#line 1728 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].ConstVal->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true); + GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), *yyvsp[-1].ValueList, true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); - std::vector IdxVec; - for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) + SmallVector IdxVec; + for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) + if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants!"); - delete (yyvsp[-1].ValueList); - - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec); - CHECK_FOR_ERROR - ;} - break; + delete yyvsp[-1].ValueList; - case 162: -#line 1748 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) + yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); + CHECK_FOR_ERROR + ; + break;} +case 161: +#line 1749 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type!"); - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Select operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 163: -#line 1756 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + ; + break;} +case 162: +#line 1757 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Binary operator types must match!"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 164: -#line 1762 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 163: +#line 1763 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match!"); - if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) { - if (!isa((yyvsp[-3].ConstVal)->getType()) || - !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) { + if (!isa(yyvsp[-3].ConstVal->getType()) || + !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 165: -#line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + ; + break;} +case 164: +#line 1774 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("icmp operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 166: -#line 1778 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 165: +#line 1779 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("fcmp operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 167: -#line 1783 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-1].ConstVal)->getType() != Type::Int8Ty) + yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 166: +#line 1784 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-1].ConstVal->getType() != Type::Int8Ty) GEN_ERROR("Shift count for shift constant must be i8 type!"); - if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].OtherOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 168: -#line 1792 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + ; + break;} +case 167: +#line 1793 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid extractelement operands!"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 169: -#line 1798 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + ; + break;} +case 168: +#line 1799 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid insertelement operands!"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 170: -#line 1804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + ; + break;} +case 169: +#line 1805 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 171: -#line 1813 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); + ; + break;} +case 170: +#line 1814 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 172: -#line 1817 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); + ; + break;} +case 171: +#line 1818 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 173: -#line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 174: -#line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 175: -#line 1836 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 172: +#line 1826 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 173: +#line 1826 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 174: +#line 1837 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 176: -#line 1841 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 175: +#line 1842 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 179: -#line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = false; ;} - break; - - case 180: -#line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 178: +#line 1855 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = false; ; + break;} +case 179: +#line 1855 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 181: -#line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 182: -#line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 180: +#line 1859 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 181: +#line 1859 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 183: -#line 1861 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 182: +#line 1862 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 184: -#line 1864 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 183: +#line 1865 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; @@ -4288,14 +3524,13 @@ } } CHECK_FOR_ERROR - ;} - break; - - case 185: -#line 1876 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 184: +#line 1877 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4305,248 +3540,226 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); + ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); - if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { + if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[0].TypeVal)); + CurModule.Types.push_back(*yyvsp[0].TypeVal); } - delete (yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 186: -#line 1900 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); + ; + break;} +case 185: +#line 1901 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); - if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { + if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[0].PrimType)); + CurModule.Types.push_back(yyvsp[0].PrimType); } CHECK_FOR_ERROR - ;} - break; - - case 187: -#line 1911 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 186: +#line 1912 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ /* "Externally Visible" Linkage */ - if ((yyvsp[0].ConstVal) == 0) + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, + yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 188: -#line 1918 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 187: +#line 1919 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 189: -#line 1921 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].ConstVal) == 0) + ; + break;} +case 188: +#line 1922 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 190: -#line 1926 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 189: +#line 1927 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 191: -#line 1929 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 190: +#line 1930 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal); - ;} - break; - - case 192: -#line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[0].TypeVal; + ; + break;} +case 191: +#line 1936 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; CHECK_FOR_ERROR - ;} - break; - - case 193: -#line 1939 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CHECK_FOR_ERROR - ;} - break; - - case 194: -#line 1942 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 192: +#line 1940 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CHECK_FOR_ERROR + ; + break;} +case 193: +#line 1943 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 195: -#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 194: +#line 1949 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string NewAsm((yyvsp[0].StrVal), EndStr); - free((yyvsp[0].StrVal)); + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string NewAsm(yyvsp[0].StrVal, EndStr); + free(yyvsp[0].StrVal); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -;} - break; - - case 196: -#line 1961 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); - ;} - break; - - case 197: -#line 1965 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); - ;} - break; - - case 199: -#line 1972 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); +; + break;} +case 195: +#line 1962 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 196: +#line 1966 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 198: +#line 1973 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 200: -#line 1977 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + ; + break;} +case 199: +#line 1978 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 201: -#line 1982 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 200: +#line 1983 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 202: -#line 1991 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 201: +#line 1992 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (*(yyvsp[-2].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); - (yyval.ArgList) = (yyvsp[-4].ArgList); - (yyvsp[-4].ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 203: -#line 2001 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = yyvsp[-4].ArgList; + yyvsp[-4].ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 202: +#line 2002 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (*(yyvsp[-2].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); - (yyval.ArgList) = new ArgListType; - (yyval.ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 204: -#line 2012 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[0].ArgList); + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = new ArgListType; + yyval.ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 203: +#line 2013 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR - ;} - break; - - case 205: -#line 2016 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[-2].ArgList); + ; + break;} +case 204: +#line 2017 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 206: -#line 2025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = new ArgListType; + ; + break;} +case 205: +#line 2026 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 207: -#line 2034 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = 0; + ; + break;} +case 206: +#line 2035 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = 0; CHECK_FOR_ERROR - ;} - break; - - case 208: -#line 2040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - UnEscapeLexed((yyvsp[-6].StrVal)); - std::string FunctionName((yyvsp[-6].StrVal)); - free((yyvsp[-6].StrVal)); // Free strdup'd memory! + ; + break;} +case 207: +#line 2041 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + UnEscapeLexed(yyvsp[-6].StrVal); + std::string FunctionName(yyvsp[-6].StrVal); + free(yyvsp[-6].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[-7].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal)) + GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription()); std::vector ParamTypeList; std::vector ParamAttrs; - ParamAttrs.push_back((yyvsp[-2].ParamAttrs)); - if ((yyvsp[-4].ArgList)) { // If there are arguments... - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I) { + ParamAttrs.push_back(yyvsp[-2].ParamAttrs); + if (yyvsp[-4].ArgList) { // If there are arguments... + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4559,10 +3772,10 @@ bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[-7].TypeVal); + delete yyvsp[-7].TypeVal; ValID ID; if (!FunctionName.empty()) { @@ -4607,24 +3820,24 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[-8].UIntVal)); - Fn->setAlignment((yyvsp[0].UIntVal)); - if ((yyvsp[-1].StrVal)) { - Fn->setSection((yyvsp[-1].StrVal)); - free((yyvsp[-1].StrVal)); + Fn->setCallingConv(yyvsp[-8].UIntVal); + Fn->setAlignment(yyvsp[0].UIntVal); + if (yyvsp[-1].StrVal) { + Fn->setSection(yyvsp[-1].StrVal); + free(yyvsp[-1].StrVal); } // Add all of the arguments we parsed to the function... - if ((yyvsp[-4].ArgList)) { // Is null if empty... + if (yyvsp[-4].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[-4].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[-4].ArgList)->back().Name == 0&& + assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0&& "Not a varargs marker!"); - delete (yyvsp[-4].ArgList)->back().Ty; - (yyvsp[-4].ArgList)->pop_back(); // Delete the last entry + delete yyvsp[-4].ArgList->back().Ty; + yyvsp[-4].ArgList->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I, ++ArgIt) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4632,128 +3845,114 @@ Idx++; } - delete (yyvsp[-4].ArgList); // We're now done with the argument list + delete yyvsp[-4].ArgList; // We're now done with the argument list } CHECK_FOR_ERROR -;} - break; - - case 211: -#line 2147 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 210: +#line 2148 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[-3].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[-2].Visibility)); -;} - break; - - case 214: -#line 2158 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); + yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); +; + break;} +case 213: +#line 2159 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR -;} - break; - - case 215: -#line 2163 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 214: +#line 2164 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); + CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); + yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 216: -#line 2175 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; - CHECK_FOR_ERROR - ;} - break; - - case 217: -#line 2179 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; - CHECK_FOR_ERROR - ;} - break; - - case 218: -#line 2184 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 219: -#line 2188 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); + ; + break;} +case 215: +#line 2176 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 220: -#line 2192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); + ; + break;} +case 216: +#line 2180 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 221: -#line 2196 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); + ; + break;} +case 217: +#line 2185 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant + yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); + CHECK_FOR_ERROR + ; + break;} +case 218: +#line 2189 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 222: -#line 2200 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + ; + break;} +case 219: +#line 2193 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? + yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); + CHECK_FOR_ERROR + ; + break;} +case 220: +#line 2197 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ;} - break; - - case 223: -#line 2204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createNull(); + ; + break;} +case 221: +#line 2201 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR - ;} - break; - - case 224: -#line 2208 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createUndef(); + ; + break;} +case 222: +#line 2205 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR - ;} - break; - - case 225: -#line 2212 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // A vector zero constant. - (yyval.ValIDVal) = ValID::createZeroInit(); + ; + break;} +case 223: +#line 2209 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR - ;} - break; - - case 226: -#line 2216 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); - int NumElements = (yyvsp[-1].ConstVector)->size(); + ; + break;} +case 224: +#line 2213 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A vector zero constant. + yyval.ValIDVal = ValID::createZeroInit(); + CHECK_FOR_ERROR + ; + break;} +case 225: +#line 2217 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -4765,131 +3964,119 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector))); - delete PTy; delete (yyvsp[-1].ConstVector); - CHECK_FOR_ERROR - ;} - break; - - case 227: -#line 2241 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 228: -#line 2245 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); - std::string AsmStr = std::string((yyvsp[-2].StrVal), End); - End = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string Constraints = std::string((yyvsp[0].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); - free((yyvsp[-2].StrVal)); - free((yyvsp[0].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 229: -#line 2259 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 230: -#line 2263 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); + yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector)); + delete PTy; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 231: -#line 2267 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); + ; + break;} +case 226: +#line 2242 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 232: -#line 2271 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); + ; + break;} +case 227: +#line 2246 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); + std::string AsmStr = std::string(yyvsp[-2].StrVal, End); + End = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string Constraints = std::string(yyvsp[0].StrVal, End); + yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); + free(yyvsp[-2].StrVal); + free(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 228: +#line 2260 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? + yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); + CHECK_FOR_ERROR + ; + break;} +case 229: +#line 2264 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR - ;} - break; - - case 235: -#line 2283 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 230: +#line 2268 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createLocalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 231: +#line 2272 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createGlobalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 234: +#line 2284 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 236: -#line 2292 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 237: -#line 2296 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 238: -#line 2305 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 235: +#line 2293 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR - InsertValue((yyvsp[0].TermInstVal)); - - (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); - InsertValue((yyvsp[-2].BasicBlockVal)); - (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); + ; + break;} +case 236: +#line 2297 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + CHECK_FOR_ERROR + ; + break;} +case 237: +#line 2306 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - ;} - break; + InsertValue(yyvsp[0].TermInstVal); - case 239: -#line 2316 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + InsertValue(yyvsp[-2].BasicBlockVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 238: +#line 2317 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) if (CI2->getParent() == 0) - (yyvsp[-1].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); - CHECK_FOR_ERROR - ;} - break; - - case 240: -#line 2325 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BasicBlockVal) = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); + yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 239: +#line 2326 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BasicBlockVal = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -4897,15 +4084,14 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); CHECK_FOR_ERROR - ;} - break; - - case 241: -#line 2337 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BasicBlockVal) = getBBVal(ValID::createLocalName((yyvsp[0].StrVal)), true); + ; + break;} +case 240: +#line 2338 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BasicBlockVal = getBBVal(ValID::createLocalName(yyvsp[0].StrVal), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -4913,100 +4099,93 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); - CHECK_FOR_ERROR - ;} - break; - - case 242: -#line 2350 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); CHECK_FOR_ERROR - ;} - break; - - case 243: -#line 2354 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); - CHECK_FOR_ERROR - ;} - break; - - case 244: -#line 2358 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); - CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 245: -#line 2363 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); - CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[-6].ValIDVal)); - CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 246: -#line 2373 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); + ; + break;} +case 241: +#line 2351 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); + CHECK_FOR_ERROR + ; + break;} +case 242: +#line 2355 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + CHECK_FOR_ERROR + ; + break;} +case 243: +#line 2359 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 244: +#line 2364 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ; + break;} +case 245: +#line 2374 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size()); - (yyval.TermInstVal) = S; + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); + yyval.TermInstVal = S; - std::vector >::iterator I = (yyvsp[-1].JumpTable)->begin(), - E = (yyvsp[-1].JumpTable)->end(); + std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), + E = yyvsp[-1].JumpTable->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer!"); } - delete (yyvsp[-1].JumpTable); + delete yyvsp[-1].JumpTable; CHECK_FOR_ERROR - ;} - break; - - case 247: -#line 2392 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); + ; + break;} +case 246: +#line 2393 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - (yyval.TermInstVal) = S; + yyval.TermInstVal = S; CHECK_FOR_ERROR - ;} - break; - - case 248: -#line 2402 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 247: +#line 2403 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[-11].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[-6].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back(yyvsp[-6].ParamAttrs); + for (ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5014,20 +4193,20 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[-10].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); + BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[-8].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-8].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5037,7 +4216,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-8].ValueRefList)->begin(), ArgE = (yyvsp[-8].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-8].ValueRefList->begin(), ArgE = yyvsp[-8].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5056,353 +4235,326 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, Args); - II->setCallingConv((yyvsp[-12].UIntVal)); - (yyval.TermInstVal) = II; - delete (yyvsp[-8].ValueRefList); - CHECK_FOR_ERROR - ;} - break; - - case 249: -#line 2468 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); + II->setCallingConv(yyvsp[-12].UIntVal); + yyval.TermInstVal = II; + delete yyvsp[-8].ValueRefList; + CHECK_FOR_ERROR + ; + break;} +case 248: +#line 2469 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR - ;} - break; - - case 250: -#line 2472 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); + ; + break;} +case 249: +#line 2473 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR - ;} - break; - - case 251: -#line 2479 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = (yyvsp[-5].JumpTable); - Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + ; + break;} +case 250: +#line 2480 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 252: -#line 2490 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 251: +#line 2491 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 253: -#line 2503 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 252: +#line 2504 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is this definition named?? if so, assign the name... - setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); + setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - InsertValue((yyvsp[0].InstVal)); - (yyval.InstVal) = (yyvsp[0].InstVal); + InsertValue(yyvsp[0].InstVal); + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR -;} - break; - - case 254: -#line 2512 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes +; + break;} +case 253: +#line 2513 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); - (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); - CHECK_FOR_ERROR - (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[-5].TypeVal); - ;} - break; - - case 255: -#line 2523 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.PHIList) = (yyvsp[-6].PHIList); - Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); + yyval.PHIList = new std::list >(); + Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + CHECK_FOR_ERROR + yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + delete yyvsp[-5].TypeVal; + ; + break;} +case 254: +#line 2524 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.PHIList = yyvsp[-6].PHIList; + Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyvsp[-6].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - ;} - break; - - case 256: -#line 2533 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 255: +#line 2534 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); // Used for call and invoke instructions - (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - ;} - break; - - case 257: -#line 2541 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyval.ValueRefList = new ValueRefList(); + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + ; + break;} +case 256: +#line 2542 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[-4].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 258: -#line 2549 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueRefList) = new ValueRefList(); ;} - break; - - case 259: -#line 2552 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 260: -#line 2553 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[-2].ValueList); - (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + yyval.ValueRefList = yyvsp[-4].ValueRefList; + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 257: +#line 2550 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueRefList = new ValueRefList(); ; + break;} +case 258: +#line 2553 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 259: +#line 2554 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 261: -#line 2560 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 260: +#line 2561 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 262: -#line 2564 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 261: +#line 2565 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 263: -#line 2569 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 262: +#line 2570 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && + !isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa((*(yyvsp[-3].TypeVal)).get()) && - ((yyvsp[-4].BinaryOpVal) == Instruction::URem || - (yyvsp[-4].BinaryOpVal) == Instruction::SRem || - (yyvsp[-4].BinaryOpVal) == Instruction::FRem)) + if (isa((*yyvsp[-3].TypeVal).get()) && + (yyvsp[-4].BinaryOpVal == Instruction::URem || + yyvsp[-4].BinaryOpVal == Instruction::SRem || + yyvsp[-4].BinaryOpVal == Instruction::FRem)) GEN_ERROR("U/S/FRem not supported on packed types!"); - Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 264: -#line 2590 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 263: +#line 2591 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (!(*(yyvsp[-3].TypeVal))->isInteger()) { - if (!isa((yyvsp[-3].TypeVal)->get()) || - !cast((yyvsp[-3].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger()) { + if (!isa(yyvsp[-3].TypeVal->get()) || + !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 265: -#line 2607 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 264: +#line 2608 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Packed types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("icmp operator returned null!"); - ;} - break; - - case 266: -#line 2620 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 265: +#line 2621 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Packed types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("fcmp operator returned null!"); - ;} - break; - - case 267: -#line 2633 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].ValueVal)->getType() != Type::Int8Ty) + ; + break;} +case 266: +#line 2634 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ValueVal->getType() != Type::Int8Ty) GEN_ERROR("Shift amount must be i8 type!"); - if (!(yyvsp[-2].ValueVal)->getType()->isInteger()) + if (!yyvsp[-2].ValueVal->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; - (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new ShiftInst(yyvsp[-3].OtherOpVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 268: -#line 2642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 267: +#line 2643 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - Value* Val = (yyvsp[-2].ValueVal); - const Type* DestTy = (yyvsp[0].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[-3].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + Value* Val = yyvsp[-2].ValueVal; + const Type* DestTy = yyvsp[0].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'!"); - (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), Val, DestTy); - delete (yyvsp[0].TypeVal); - ;} - break; - - case 269: -#line 2654 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) + yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); + delete yyvsp[0].TypeVal; + ; + break;} +case 268: +#line 2655 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean!"); - if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) + if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) GEN_ERROR("select value types should match!"); - (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 270: -#line 2662 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 269: +#line 2663 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 271: -#line 2669 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 270: +#line 2670 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid extractelement operands!"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 272: -#line 2675 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + ; + break;} +case 271: +#line 2676 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid insertelement operands!"); - (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 273: -#line 2681 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + ; + break;} +case 272: +#line 2682 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 274: -#line 2687 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); + ; + break;} +case 273: +#line 2688 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type!"); - (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[0].PHIList)->size()); - while ((yyvsp[0].PHIList)->begin() != (yyvsp[0].PHIList)->end()) { - if ((yyvsp[0].PHIList)->front().first->getType() != Ty) + yyval.InstVal = new PHINode(Ty); + ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); + while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { + if (yyvsp[0].PHIList->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type!"); - cast((yyval.InstVal))->addIncoming((yyvsp[0].PHIList)->front().first, (yyvsp[0].PHIList)->front().second); - (yyvsp[0].PHIList)->pop_front(); + cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); + yyvsp[0].PHIList->pop_front(); } - delete (yyvsp[0].PHIList); // Free the list... + delete yyvsp[0].PHIList; // Free the list... CHECK_FOR_ERROR - ;} - break; - - case 275: -#line 2703 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 274: +#line 2704 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[-5].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[0].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back(yyvsp[0].ParamAttrs); + for (ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5410,16 +4562,16 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[-4].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[-2].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-2].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5430,7 +4582,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-2].ValueRefList)->begin(), ArgE = (yyvsp[-2].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-2].ValueRefList->begin(), ArgE = yyvsp[-2].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5447,428 +4599,365 @@ } // Create the call node CallInst *CI = new CallInst(V, Args); - CI->setTailCall((yyvsp[-7].BoolVal)); - CI->setCallingConv((yyvsp[-6].UIntVal)); - (yyval.InstVal) = CI; - delete (yyvsp[-2].ValueRefList); - delete (yyvsp[-5].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 276: -#line 2766 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.InstVal) = (yyvsp[0].InstVal); + CI->setTailCall(yyvsp[-7].BoolVal); + CI->setCallingConv(yyvsp[-6].UIntVal); + yyval.InstVal = CI; + delete yyvsp[-2].ValueRefList; + delete yyvsp[-5].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 275: +#line 2767 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 277: -#line 2771 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 276: +#line 2772 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 278: -#line 2775 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 277: +#line 2776 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 279: -#line 2782 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 278: +#line 2783 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 280: -#line 2789 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 279: +#line 2790 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal); - ;} - break; - - case 281: -#line 2797 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 280: +#line 2798 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 282: -#line 2804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 281: +#line 2805 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal); - ;} - break; - - case 283: -#line 2812 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[0].ValueVal)->getType())) + yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 282: +#line 2813 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[0].ValueVal->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[0].ValueVal)->getType()->getDescription() + "!"); - (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); + yyvsp[0].ValueVal->getType()->getDescription() + "!"); + yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 284: -#line 2820 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 283: +#line 2821 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - if (!isa((yyvsp[-1].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (!isa(yyvsp[-1].TypeVal->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) + (*yyvsp[-1].TypeVal)->getDescription()); + if (!cast(yyvsp[-1].TypeVal->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + (*yyvsp[-1].TypeVal)->getDescription()); + Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 285: -#line 2834 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal); + delete yyvsp[-1].TypeVal; + ; + break;} +case 284: +#line 2835 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); + (*yyvsp[-1].TypeVal)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[-3].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + + if (ElTy != yyvsp[-3].ValueVal->getType()) + GEN_ERROR("Can't store '" + yyvsp[-3].ValueVal->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 286: -#line 2851 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, tmpVal, yyvsp[-5].BoolVal); + delete yyvsp[-1].TypeVal; + ; + break;} +case 285: +#line 2852 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (!isa((yyvsp[-2].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), *(yyvsp[0].ValueList), true)) + if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, *yyvsp[0].ValueList, true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[-2].TypeVal))->getDescription()+ "'!"); - Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()+ "'!"); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[0].ValueList)); - delete (yyvsp[-2].TypeVal); - delete (yyvsp[0].ValueList); - ;} - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 5604 "llvmAsmParser.tab.c" + yyval.InstVal = new GetElementPtrInst(tmpVal, *yyvsp[0].ValueList); + delete yyvsp[-2].TypeVal; + delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif - - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if YYERROR_VERBOSE + +#ifdef YYERROR_VERBOSE yyn = yypact[yystate]; - if (YYPACT_NINF < yyn && yyn < YYLAST) + if (yyn > YYFLAG && yyn < YYLAST) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) + strcpy(msg, "parse error"); + + if (count < 5) { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } } - yyerror (yymsg); - YYSTACK_FREE (yymsg); + yyerror(msg); + free(msg); } else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } + yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); + yyerror("parse error"); } - + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ + /* if just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; } - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token + after shifting the error token. */ + yyerrstatus = 3; /* Each real token shifted decrements this */ -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; + goto yyerrhandle; -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif +yyerrpop: /* pop the current state because it cannot handle the error token */ -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif - for (;;) +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - *++yyvsp = yylval; - +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - return yyresult; + } + return 1; } - - -#line 2868 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2869 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -5918,4 +5007,3 @@ GenerateError(errMsg); return 0; } - Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.48 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.49 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.48 Tue Jan 30 14:08:37 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Tue Jan 30 22:44:08 2007 @@ -1,302 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - LOCALVAL_ID = 260, - GLOBALVAL_ID = 261, - FPVAL = 262, - VOID = 263, - INTTYPE = 264, - FLOAT = 265, - DOUBLE = 266, - LABEL = 267, - TYPE = 268, - LOCALVAR = 269, - GLOBALVAR = 270, - LABELSTR = 271, - STRINGCONSTANT = 272, - ATSTRINGCONSTANT = 273, - IMPLEMENTATION = 274, - ZEROINITIALIZER = 275, - TRUETOK = 276, - FALSETOK = 277, - BEGINTOK = 278, - ENDTOK = 279, - DECLARE = 280, - DEFINE = 281, - GLOBAL = 282, - CONSTANT = 283, - SECTION = 284, - VOLATILE = 285, - TO = 286, - DOTDOTDOT = 287, - NULL_TOK = 288, - UNDEF = 289, - INTERNAL = 290, - LINKONCE = 291, - WEAK = 292, - APPENDING = 293, - DLLIMPORT = 294, - DLLEXPORT = 295, - EXTERN_WEAK = 296, - OPAQUE = 297, - EXTERNAL = 298, - TARGET = 299, - TRIPLE = 300, - ALIGN = 301, - DEPLIBS = 302, - CALL = 303, - TAIL = 304, - ASM_TOK = 305, - MODULE = 306, - SIDEEFFECT = 307, - CC_TOK = 308, - CCC_TOK = 309, - FASTCC_TOK = 310, - COLDCC_TOK = 311, - X86_STDCALLCC_TOK = 312, - X86_FASTCALLCC_TOK = 313, - DATALAYOUT = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - UDIV = 324, - SDIV = 325, - FDIV = 326, - UREM = 327, - SREM = 328, - FREM = 329, - AND = 330, - OR = 331, - XOR = 332, - ICMP = 333, - FCMP = 334, - EQ = 335, - NE = 336, - SLT = 337, - SGT = 338, - SLE = 339, - SGE = 340, - ULT = 341, - UGT = 342, - ULE = 343, - UGE = 344, - OEQ = 345, - ONE = 346, - OLT = 347, - OGT = 348, - OLE = 349, - OGE = 350, - ORD = 351, - UNO = 352, - UEQ = 353, - UNE = 354, - MALLOC = 355, - ALLOCA = 356, - FREE = 357, - LOAD = 358, - STORE = 359, - GETELEMENTPTR = 360, - TRUNC = 361, - ZEXT = 362, - SEXT = 363, - FPTRUNC = 364, - FPEXT = 365, - BITCAST = 366, - UITOFP = 367, - SITOFP = 368, - FPTOUI = 369, - FPTOSI = 370, - INTTOPTR = 371, - PTRTOINT = 372, - PHI_TOK = 373, - SELECT = 374, - SHL = 375, - LSHR = 376, - ASHR = 377, - VAARG = 378, - EXTRACTELEMENT = 379, - INSERTELEMENT = 380, - SHUFFLEVECTOR = 381, - NORETURN = 382, - INREG = 383, - SRET = 384, - DEFAULT = 385, - HIDDEN = 386 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define LOCALVAL_ID 260 -#define GLOBALVAL_ID 261 -#define FPVAL 262 -#define VOID 263 -#define INTTYPE 264 -#define FLOAT 265 -#define DOUBLE 266 -#define LABEL 267 -#define TYPE 268 -#define LOCALVAR 269 -#define GLOBALVAR 270 -#define LABELSTR 271 -#define STRINGCONSTANT 272 -#define ATSTRINGCONSTANT 273 -#define IMPLEMENTATION 274 -#define ZEROINITIALIZER 275 -#define TRUETOK 276 -#define FALSETOK 277 -#define BEGINTOK 278 -#define ENDTOK 279 -#define DECLARE 280 -#define DEFINE 281 -#define GLOBAL 282 -#define CONSTANT 283 -#define SECTION 284 -#define VOLATILE 285 -#define TO 286 -#define DOTDOTDOT 287 -#define NULL_TOK 288 -#define UNDEF 289 -#define INTERNAL 290 -#define LINKONCE 291 -#define WEAK 292 -#define APPENDING 293 -#define DLLIMPORT 294 -#define DLLEXPORT 295 -#define EXTERN_WEAK 296 -#define OPAQUE 297 -#define EXTERNAL 298 -#define TARGET 299 -#define TRIPLE 300 -#define ALIGN 301 -#define DEPLIBS 302 -#define CALL 303 -#define TAIL 304 -#define ASM_TOK 305 -#define MODULE 306 -#define SIDEEFFECT 307 -#define CC_TOK 308 -#define CCC_TOK 309 -#define FASTCC_TOK 310 -#define COLDCC_TOK 311 -#define X86_STDCALLCC_TOK 312 -#define X86_FASTCALLCC_TOK 313 -#define DATALAYOUT 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define UDIV 324 -#define SDIV 325 -#define FDIV 326 -#define UREM 327 -#define SREM 328 -#define FREM 329 -#define AND 330 -#define OR 331 -#define XOR 332 -#define ICMP 333 -#define FCMP 334 -#define EQ 335 -#define NE 336 -#define SLT 337 -#define SGT 338 -#define SLE 339 -#define SGE 340 -#define ULT 341 -#define UGT 342 -#define ULE 343 -#define UGE 344 -#define OEQ 345 -#define ONE 346 -#define OLT 347 -#define OGT 348 -#define OLE 349 -#define OGE 350 -#define ORD 351 -#define UNO 352 -#define UEQ 353 -#define UNE 354 -#define MALLOC 355 -#define ALLOCA 356 -#define FREE 357 -#define LOAD 358 -#define STORE 359 -#define GETELEMENTPTR 360 -#define TRUNC 361 -#define ZEXT 362 -#define SEXT 363 -#define FPTRUNC 364 -#define FPEXT 365 -#define BITCAST 366 -#define UITOFP 367 -#define SITOFP 368 -#define FPTOUI 369 -#define FPTOSI 370 -#define INTTOPTR 371 -#define PTRTOINT 372 -#define PHI_TOK 373 -#define SELECT 374 -#define SHL 375 -#define LSHR 376 -#define ASHR 377 -#define VAARG 378 -#define EXTRACTELEMENT 379 -#define INSERTELEMENT 380 -#define SHUFFLEVECTOR 381 -#define NORETURN 382 -#define INREG 383 -#define SRET 384 -#define DEFAULT 385 -#define HIDDEN 386 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -341,14 +43,135 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 346 "llvmAsmParser.tab.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE llvmAsmlval; - +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define LOCALVAL_ID 259 +#define GLOBALVAL_ID 260 +#define FPVAL 261 +#define VOID 262 +#define INTTYPE 263 +#define FLOAT 264 +#define DOUBLE 265 +#define LABEL 266 +#define TYPE 267 +#define LOCALVAR 268 +#define GLOBALVAR 269 +#define LABELSTR 270 +#define STRINGCONSTANT 271 +#define ATSTRINGCONSTANT 272 +#define IMPLEMENTATION 273 +#define ZEROINITIALIZER 274 +#define TRUETOK 275 +#define FALSETOK 276 +#define BEGINTOK 277 +#define ENDTOK 278 +#define DECLARE 279 +#define DEFINE 280 +#define GLOBAL 281 +#define CONSTANT 282 +#define SECTION 283 +#define VOLATILE 284 +#define TO 285 +#define DOTDOTDOT 286 +#define NULL_TOK 287 +#define UNDEF 288 +#define INTERNAL 289 +#define LINKONCE 290 +#define WEAK 291 +#define APPENDING 292 +#define DLLIMPORT 293 +#define DLLEXPORT 294 +#define EXTERN_WEAK 295 +#define OPAQUE 296 +#define EXTERNAL 297 +#define TARGET 298 +#define TRIPLE 299 +#define ALIGN 300 +#define DEPLIBS 301 +#define CALL 302 +#define TAIL 303 +#define ASM_TOK 304 +#define MODULE 305 +#define SIDEEFFECT 306 +#define CC_TOK 307 +#define CCC_TOK 308 +#define FASTCC_TOK 309 +#define COLDCC_TOK 310 +#define X86_STDCALLCC_TOK 311 +#define X86_FASTCALLCC_TOK 312 +#define DATALAYOUT 313 +#define RET 314 +#define BR 315 +#define SWITCH 316 +#define INVOKE 317 +#define UNWIND 318 +#define UNREACHABLE 319 +#define ADD 320 +#define SUB 321 +#define MUL 322 +#define UDIV 323 +#define SDIV 324 +#define FDIV 325 +#define UREM 326 +#define SREM 327 +#define FREM 328 +#define AND 329 +#define OR 330 +#define XOR 331 +#define ICMP 332 +#define FCMP 333 +#define EQ 334 +#define NE 335 +#define SLT 336 +#define SGT 337 +#define SLE 338 +#define SGE 339 +#define ULT 340 +#define UGT 341 +#define ULE 342 +#define UGE 343 +#define OEQ 344 +#define ONE 345 +#define OLT 346 +#define OGT 347 +#define OLE 348 +#define OGE 349 +#define ORD 350 +#define UNO 351 +#define UEQ 352 +#define UNE 353 +#define MALLOC 354 +#define ALLOCA 355 +#define FREE 356 +#define LOAD 357 +#define STORE 358 +#define GETELEMENTPTR 359 +#define TRUNC 360 +#define ZEXT 361 +#define SEXT 362 +#define FPTRUNC 363 +#define FPEXT 364 +#define BITCAST 365 +#define UITOFP 366 +#define SITOFP 367 +#define FPTOUI 368 +#define FPTOSI 369 +#define INTTOPTR 370 +#define PTRTOINT 371 +#define PHI_TOK 372 +#define SELECT 373 +#define SHL 374 +#define LSHR 375 +#define ASHR 376 +#define VAARG 377 +#define EXTRACTELEMENT 378 +#define INSERTELEMENT 379 +#define SHUFFLEVECTOR 380 +#define NORETURN 381 +#define INREG 382 +#define SRET 383 +#define DEFAULT 384 +#define HIDDEN 385 +extern YYSTYPE llvmAsmlval; Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.61 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.62 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.61 Tue Jan 30 14:08:37 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Tue Jan 30 22:44:08 2007 @@ -20,6 +20,7 @@ #include "llvm/SymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" @@ -1733,7 +1734,7 @@ if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); - std::vector IdxVec; + SmallVector IdxVec; for (unsigned i = 0, e = $4->size(); i != e; ++i) if (Constant *C = dyn_cast((*$4)[i])) IdxVec.push_back(C); @@ -1742,7 +1743,7 @@ delete $4; - $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + $$ = ConstantExpr::getGetElementPtr($3, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { From sabre at nondot.org Tue Jan 30 22:45:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 30 Jan 2007 22:45:44 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200701310445.l0V4jiVg001522@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.126 -> 1.127 --- Log message: shutdown at end of run --- Diffs of the changes: (+1 -0) opt.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.126 llvm/tools/opt/opt.cpp:1.127 --- llvm/tools/opt/opt.cpp:1.126 Sun Jan 21 00:28:44 2007 +++ llvm/tools/opt/opt.cpp Tue Jan 30 22:45:28 2007 @@ -263,5 +263,6 @@ } catch (...) { cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } + llvm_shutdown(); return 1; } From sabre at nondot.org Wed Jan 31 00:04:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 00:04:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FoldingSet.cpp Message-ID: <200701310604.l0V64uSJ003274@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FoldingSet.cpp updated: 1.12 -> 1.13 --- Log message: minor cleanups. Fix off-by-one in accounting the number of nodes when the table grows. --- Diffs of the changes: (+5 -4) FoldingSet.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Support/FoldingSet.cpp diff -u llvm/lib/Support/FoldingSet.cpp:1.12 llvm/lib/Support/FoldingSet.cpp:1.13 --- llvm/lib/Support/FoldingSet.cpp:1.12 Tue Jan 30 17:16:22 2007 +++ llvm/lib/Support/FoldingSet.cpp Wed Jan 31 00:04:41 2007 @@ -181,7 +181,7 @@ for (unsigned i = 0; i != OldNumBuckets; ++i) { void *Probe = OldBuckets[i]; if (!Probe) continue; - while (Node *NodeInBucket = GetNextPtr(Probe, OldBuckets, OldNumBuckets)){ + while (Node *NodeInBucket = GetNextPtr(Probe, OldBuckets, OldNumBuckets)) { // Figure out the next link, remove NodeInBucket from the old link. Probe = NodeInBucket->getNextInBucket(); NodeInBucket->SetNextInBucket(0); @@ -224,14 +224,15 @@ /// is not already in the map. InsertPos must be obtained from /// FindNodeOrInsertPos. void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { - ++NumNodes; // Do we need to grow the hashtable? - if (NumNodes > NumBuckets*2) { + if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); NodeID ID; GetNodeProfile(ID, N); InsertPos = GetBucketFor(ID, Buckets, NumBuckets); } + + ++NumNodes; /// The insert position is actually a bucket pointer. void **Bucket = static_cast(InsertPos); @@ -243,7 +244,7 @@ if (Next == 0) Next = Bucket; - // Set the nodes next pointer, and make the bucket point to the node. + // Set the node's next pointer, and make the bucket point to the node. N->SetNextInBucket(Next); *Bucket = N; } From evan.cheng at apple.com Wed Jan 31 02:40:57 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 02:40:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200701310840.l0V8evIa015216@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.8 -> 1.9 --- Log message: Observe -soft-float. --- Diffs of the changes: (+4 -3) ARMISelLowering.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.8 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.9 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.8 Tue Jan 30 14:37:08 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Wed Jan 31 02:40:13 2007 @@ -28,6 +28,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SSARegMap.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/ADT/VectorExtras.h" using namespace llvm; @@ -36,7 +37,7 @@ Subtarget = &TM.getSubtarget(); // Uses VFP for Thumb libfuncs if available. - if (Subtarget->isThumb() && Subtarget->hasVFP2()) { + if (!UseSoftFloat && Subtarget->isThumb() && Subtarget->hasVFP2()) { // Single-precision floating-point arithmetic. setLibcallName(RTLIB::ADD_F32, "__addsf3vfp"); setLibcallName(RTLIB::SUB_F32, "__subsf3vfp"); @@ -91,7 +92,7 @@ } addRegisterClass(MVT::i32, ARM::GPRRegisterClass); - if (Subtarget->hasVFP2() && !Subtarget->isThumb()) { + if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) { addRegisterClass(MVT::f32, ARM::SPRRegisterClass); addRegisterClass(MVT::f64, ARM::DPRRegisterClass); } @@ -173,7 +174,7 @@ } setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); - if (Subtarget->hasVFP2() && !Subtarget->isThumb()) + if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) // Turn f64->i64 into FMRRD iff target supports vfp2. setOperationAction(ISD::BIT_CONVERT, MVT::i64, Custom); From evan.cheng at apple.com Wed Jan 31 03:26:47 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 03:26:47 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/RuntimeLibcalls.h Message-ID: <200701310926.l0V9Qlvf016669@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: RuntimeLibcalls.h updated: 1.1 -> 1.2 --- Log message: Added O_F32 and O_64 in addition to UO_F32 and UO_64 even though by default they call the same libgcc routine. The result of the calls are "tested" differently. --- Diffs of the changes: (+2 -0) RuntimeLibcalls.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/CodeGen/RuntimeLibcalls.h diff -u llvm/include/llvm/CodeGen/RuntimeLibcalls.h:1.1 llvm/include/llvm/CodeGen/RuntimeLibcalls.h:1.2 --- llvm/include/llvm/CodeGen/RuntimeLibcalls.h:1.1 Fri Jan 12 16:49:32 2007 +++ llvm/include/llvm/CodeGen/RuntimeLibcalls.h Wed Jan 31 03:26:31 2007 @@ -98,6 +98,8 @@ OGT_F64, UO_F32, UO_F64, + O_F32, + O_F64, UNKNOWN_LIBCALL }; From evan.cheng at apple.com Wed Jan 31 03:29:28 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 03:29:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp TargetLowering.cpp Message-ID: <200701310929.l0V9TSnL016773@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.462 -> 1.463 TargetLowering.cpp updated: 1.86 -> 1.87 --- Log message: Allow the target to override the ISD::CondCode that's to be used to test the result of the comparison libcall against zero. --- Diffs of the changes: (+29 -18) LegalizeDAG.cpp | 22 ++++------------------ TargetLowering.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 18 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.462 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.463 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.462 Mon Jan 29 16:58:52 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jan 31 03:29:11 2007 @@ -3604,72 +3604,58 @@ if (VT == MVT::f32 || VT == MVT::f64) { // Expand into one or more soft-fp libcall(s). RTLIB::Libcall LC1, LC2 = RTLIB::UNKNOWN_LIBCALL; - ISD::CondCode CC1, CC2 = ISD::SETCC_INVALID; switch (cast(CC)->get()) { case ISD::SETEQ: case ISD::SETOEQ: LC1 = (VT == MVT::f32) ? RTLIB::OEQ_F32 : RTLIB::OEQ_F64; - CC1 = ISD::SETEQ; break; case ISD::SETNE: case ISD::SETUNE: LC1 = (VT == MVT::f32) ? RTLIB::UNE_F32 : RTLIB::UNE_F64; - CC1 = ISD::SETNE; break; case ISD::SETGE: case ISD::SETOGE: LC1 = (VT == MVT::f32) ? RTLIB::OGE_F32 : RTLIB::OGE_F64; - CC1 = ISD::SETGE; break; case ISD::SETLT: case ISD::SETOLT: LC1 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64; - CC1 = ISD::SETLT; break; case ISD::SETLE: case ISD::SETOLE: LC1 = (VT == MVT::f32) ? RTLIB::OLE_F32 : RTLIB::OLE_F64; - CC1 = ISD::SETLE; break; case ISD::SETGT: case ISD::SETOGT: LC1 = (VT == MVT::f32) ? RTLIB::OGT_F32 : RTLIB::OGT_F64; - CC1 = ISD::SETGT; break; case ISD::SETUO: + LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64; + break; case ISD::SETO: LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64; - CC1 = cast(CC)->get() == ISD::SETO - ? ISD::SETEQ : ISD::SETNE; break; default: LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64; - CC1 = ISD::SETNE; switch (cast(CC)->get()) { case ISD::SETONE: // SETONE = SETOLT | SETOGT LC1 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64; - CC1 = ISD::SETLT; // Fallthrough case ISD::SETUGT: LC2 = (VT == MVT::f32) ? RTLIB::OGT_F32 : RTLIB::OGT_F64; - CC2 = ISD::SETGT; break; case ISD::SETUGE: LC2 = (VT == MVT::f32) ? RTLIB::OGE_F32 : RTLIB::OGE_F64; - CC2 = ISD::SETGE; break; case ISD::SETULT: LC2 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64; - CC2 = ISD::SETLT; break; case ISD::SETULE: LC2 = (VT == MVT::f32) ? RTLIB::OLE_F32 : RTLIB::OLE_F64; - CC2 = ISD::SETLE; break; case ISD::SETUEQ: LC2 = (VT == MVT::f32) ? RTLIB::OEQ_F32 : RTLIB::OEQ_F64; - CC2 = ISD::SETEQ; break; default: assert(0 && "Unsupported FP setcc!"); } @@ -3680,14 +3666,14 @@ DAG.getNode(ISD::MERGE_VALUES, VT, LHS, RHS).Val, false /*sign irrelevant*/, Dummy); Tmp2 = DAG.getConstant(0, MVT::i32); - CC = DAG.getCondCode(CC1); + CC = DAG.getCondCode(TLI.getCmpLibcallCC(LC1)); if (LC2 != RTLIB::UNKNOWN_LIBCALL) { Tmp1 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultTy(), Tmp1, Tmp2, CC); LHS = ExpandLibCall(TLI.getLibcallName(LC2), DAG.getNode(ISD::MERGE_VALUES, VT, LHS, RHS).Val, false /*sign irrelevant*/, Dummy); Tmp2 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultTy(), LHS, Tmp2, - DAG.getCondCode(CC2)); + DAG.getCondCode(TLI.getCmpLibcallCC(LC2))); Tmp1 = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp2); Tmp2 = SDOperand(); } Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.86 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.87 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.86 Fri Jan 12 17:30:31 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jan 31 03:29:11 2007 @@ -94,6 +94,30 @@ Names[RTLIB::OGT_F64] = "__gtdf2"; Names[RTLIB::UO_F32] = "__unordsf2"; Names[RTLIB::UO_F64] = "__unorddf2"; + Names[RTLIB::O_F32] = "__unordsf2"; + Names[RTLIB::O_F64] = "__unorddf2"; +} + +/// InitCmpLibcallCCs - Set default comparison libcall CC. +/// +static void InitCmpLibcallCCs(ISD::CondCode *CCs) { + memset(CCs, ISD::SETCC_INVALID, sizeof(ISD::CondCode)*RTLIB::UNKNOWN_LIBCALL); + CCs[RTLIB::OEQ_F32] = ISD::SETEQ; + CCs[RTLIB::OEQ_F64] = ISD::SETEQ; + CCs[RTLIB::UNE_F32] = ISD::SETNE; + CCs[RTLIB::UNE_F64] = ISD::SETNE; + CCs[RTLIB::OGE_F32] = ISD::SETGE; + CCs[RTLIB::OGE_F64] = ISD::SETGE; + CCs[RTLIB::OLT_F32] = ISD::SETLT; + CCs[RTLIB::OLT_F64] = ISD::SETLT; + CCs[RTLIB::OLE_F32] = ISD::SETLE; + CCs[RTLIB::OLE_F64] = ISD::SETLE; + CCs[RTLIB::OGT_F32] = ISD::SETGT; + CCs[RTLIB::OGT_F64] = ISD::SETGT; + CCs[RTLIB::UO_F32] = ISD::SETNE; + CCs[RTLIB::UO_F64] = ISD::SETNE; + CCs[RTLIB::O_F32] = ISD::SETEQ; + CCs[RTLIB::O_F64] = ISD::SETEQ; } TargetLowering::TargetLowering(TargetMachine &tm) @@ -132,6 +156,7 @@ JumpBufAlignment = 0; InitLibcallNames(LibcallRoutineNames); + InitCmpLibcallCCs(CmpLibcallCCs); } TargetLowering::~TargetLowering() {} From evan.cheng at apple.com Wed Jan 31 03:29:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 03:29:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200701310929.l0V9TTru016779@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.104 -> 1.105 --- Log message: Allow the target to override the ISD::CondCode that's to be used to test the result of the comparison libcall against zero. --- Diffs of the changes: (+16 -0) TargetLowering.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.104 llvm/include/llvm/Target/TargetLowering.h:1.105 --- llvm/include/llvm/Target/TargetLowering.h:1.104 Mon Jan 29 16:58:52 2007 +++ llvm/include/llvm/Target/TargetLowering.h Wed Jan 31 03:29:11 2007 @@ -855,6 +855,18 @@ return LibcallRoutineNames[Call]; } + /// setCmpLibcallCC - Override the default CondCode to be used to test the + /// result of the comparison libcall against zero. + void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC) { + CmpLibcallCCs[Call] = CC; + } + + /// getCmpLibcallCC - Get the CondCode that's to be used to test the result of + /// the comparison libcall against zero. + ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const { + return CmpLibcallCCs[Call]; + } + protected: /// addLegalAddressScale - Add a integer (> 1) value which can be used as /// scale in the target addressing mode. Note: the ordering matters so the @@ -992,6 +1004,10 @@ /// const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL]; + /// CmpLibcallCCs - The ISD::CondCode that should be used to test the result + /// of each of the comparison libcall against zero. + ISD::CondCode CmpLibcallCCs[RTLIB::UNKNOWN_LIBCALL]; + protected: /// When lowering %llvm.memset this field specifies the maximum number of /// store operations that may be substituted for the call to memset. Targets From evan.cheng at apple.com Wed Jan 31 03:31:14 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 03:31:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200701310931.l0V9VEdx016833@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.9 -> 1.10 --- Log message: Specify the right CC for comparison libcalls. --- Diffs of the changes: (+20 -0) ARMISelLowering.cpp | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.9 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.10 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.9 Wed Jan 31 02:40:13 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Wed Jan 31 03:30:58 2007 @@ -58,6 +58,16 @@ setLibcallName(RTLIB::OGE_F32, "__gesf2vfp"); setLibcallName(RTLIB::OGT_F32, "__gtsf2vfp"); setLibcallName(RTLIB::UO_F32, "__unordsf2vfp"); + setLibcallName(RTLIB::O_F32, "__unordsf2vfp"); + + setCmpLibcallCC(RTLIB::OEQ_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::UNE_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::OLT_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::OLE_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::OGE_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::OGT_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::UO_F32, ISD::SETNE); + setCmpLibcallCC(RTLIB::O_F32, ISD::SETEQ); // Double-precision comparisons. setLibcallName(RTLIB::OEQ_F64, "__eqdf2vfp"); @@ -67,6 +77,16 @@ setLibcallName(RTLIB::OGE_F64, "__gedf2vfp"); setLibcallName(RTLIB::OGT_F64, "__gtdf2vfp"); setLibcallName(RTLIB::UO_F64, "__unorddf2vfp"); + setLibcallName(RTLIB::O_F64, "__unorddf2vfp"); + + setCmpLibcallCC(RTLIB::OEQ_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::UNE_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::OLT_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::OLE_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::OGE_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::OGT_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::UO_F64, ISD::SETNE); + setCmpLibcallCC(RTLIB::O_F64, ISD::SETEQ); // Floating-point to integer conversions. // i64 conversions are done via library routines even when generating VFP From lauro.venancio at gmail.com Wed Jan 31 07:13:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 31 Jan 2007 07:13:03 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll Message-ID: <200701311313.l0VDD3gt021232@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: hello.ll updated: 1.3 -> 1.4 insn-sched1.ll updated: 1.2 -> 1.3 ldm.ll updated: 1.3 -> 1.4 --- Log message: ARM fix: Miscompilation when frame pointer can't be eliminated. Uninitialized frame pointer register is used. --- Diffs of the changes: (+3 -3) hello.ll | 2 +- insn-sched1.ll | 2 +- ldm.ll | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/ARM/hello.ll diff -u llvm/test/CodeGen/ARM/hello.ll:1.3 llvm/test/CodeGen/ARM/hello.ll:1.4 --- llvm/test/CodeGen/ARM/hello.ll:1.3 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 07:12:46 2007 @@ -1,6 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep mov | wc -l | grep 2 %str = internal constant [12 x sbyte] c"Hello World\00" Index: llvm/test/CodeGen/ARM/insn-sched1.ll diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.2 llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.2 Mon Jan 22 12:56:11 2007 +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 07:12:46 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 int %test(int %x) { %tmp = cast int %x to short Index: llvm/test/CodeGen/ARM/ldm.ll diff -u llvm/test/CodeGen/ARM/ldm.ll:1.3 llvm/test/CodeGen/ARM/ldm.ll:1.4 --- llvm/test/CodeGen/ARM/ldm.ll:1.3 Mon Jan 22 17:01:22 2007 +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 07:12:46 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 %X = external global [0 x int] From lauro.venancio at gmail.com Wed Jan 31 07:13:04 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 31 Jan 2007 07:13:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701311313.l0VDD4Hp021237@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.47 -> 1.48 --- Log message: ARM fix: Miscompilation when frame pointer can't be eliminated. Uninitialized frame pointer register is used. --- Diffs of the changes: (+9 -10) ARMRegisterInfo.cpp | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.47 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.48 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.47 Tue Jan 30 17:01:46 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 07:12:46 2007 @@ -573,8 +573,7 @@ // There is alloca()'s in this function, must reference off the frame // pointer instead. FrameReg = getFrameRegister(MF); - if (STI.isTargetDarwin()) - Offset -= AFI->getFramePtrSpillOffset(); + Offset -= AFI->getFramePtrSpillOffset(); } unsigned Opcode = MI.getOpcode(); @@ -882,6 +881,12 @@ } } + if (hasFP(MF)) { + MF.changePhyRegUsed(FramePtr, true); + NumGPRSpills++; + CanEliminateFrame = false; + } + if (!CanEliminateFrame) { AFI->setHasStackFrame(true); @@ -895,11 +900,6 @@ ForceLRSpill = false; } - if (STI.isTargetDarwin()) { - MF.changePhyRegUsed(FramePtr, true); - NumGPRSpills++; - } - // If stack and double are 8-byte aligned and we are spilling an odd number // of GPRs. Spill one extra callee save GPR so we won't have to pad between // the integer and double callee save areas. @@ -1030,7 +1030,7 @@ ++MBBI; // Point FP to the stack slot that contains the previous FP. - if (STI.isTargetDarwin()) + if (hasFP(MF)) BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri), FramePtr) .addFrameIndex(FramePtrSpillFI).addImm(0); @@ -1116,7 +1116,7 @@ if (isThumb) emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); else { - if (STI.isTargetDarwin()) { + if (hasFP(MF)){ NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; // Reset SP based on frame pointer only if the stack frame extends beyond // frame pointer stack slot. @@ -1131,7 +1131,6 @@ } else if (NumBytes) { emitSPUpdate(MBB, MBBI, NumBytes, false, TII); } - // Move SP to start of integer callee save spill area 2. movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI); emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), false, TII); From sabre at nondot.org Wed Jan 31 12:05:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 12:05:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp Message-ID: <200701311805.l0VI5Ni6025576@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.14 -> 1.15 --- Log message: Fix a minor bug in my patch yesterday that broken ConstProp/bswap.ll --- Diffs of the changes: (+1 -1) ConstantFolding.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.14 llvm/lib/Analysis/ConstantFolding.cpp:1.15 --- llvm/lib/Analysis/ConstantFolding.cpp:1.14 Tue Jan 30 22:42:05 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Wed Jan 31 12:04:55 2007 @@ -210,7 +210,7 @@ case Instruction::Call: if (Function *F = dyn_cast(Ops[0])) if (canConstantFoldCallTo(F)) - return ConstantFoldCall(F, Ops+1, NumOps); + return ConstantFoldCall(F, Ops+1, NumOps-1); return 0; case Instruction::ICmp: case Instruction::FCmp: From sabre at nondot.org Wed Jan 31 12:09:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 12:09:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200701311809.l0VI9ZHF014626@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.616 -> 1.617 --- Log message: Revert another incorrectly applied chunk, which fixes InstCombine/vec_insert_to_shuffle.ll --- Diffs of the changes: (+0 -7) InstructionCombining.cpp | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.616 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.617 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.616 Tue Jan 30 22:40:53 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jan 31 12:09:17 2007 @@ -8992,13 +8992,6 @@ } } - // See if SimplifyDemandedVectorElts can simplify based on this shuffle. For - // example, if this is a splat, then we only demand from one input element. - uint64_t UndefElts; - if (Value *V = SimplifyDemandedVectorElts(&SVI, (1ULL << Mask.size())-1, - UndefElts)) - return ReplaceInstUsesWith(SVI, V); - return MadeChange ? &SVI : 0; } From evan.cheng at apple.com Wed Jan 31 12:19:23 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 12:19:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701311819.l0VIJNGH018657@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.14 -> 1.15 --- Log message: ConstPool island bug: watch out for cases where UserMI is the last MI of the BB. --- Diffs of the changes: (+16 -4) ARMConstantIslandPass.cpp | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.14 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.15 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.14 Tue Jan 30 20:22:22 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 31 12:19:07 2007 @@ -461,6 +461,7 @@ /// is out-of-range. If so, pick it up the constant pool value and move it some /// place in-range. bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &Fn, CPUser &U){ + bool isThumb = AFI->isThumbFunction(); MachineInstr *UserMI = U.MI; MachineInstr *CPEMI = U.CPEMI; @@ -477,7 +478,7 @@ // User before the CPE. if (CPEOffset-UserOffset <= U.MaxDisp) return false; - } else if (!AFI->isThumbFunction()) { + } else if (!isThumb) { // Thumb LDR cannot encode negative offset. if (UserOffset-CPEOffset <= U.MaxDisp) return false; @@ -487,15 +488,26 @@ // Solution guaranteed to work: split the user's MBB right after the user and // insert a clone the CPE into the newly created water. - MachineInstr *NextMI = next(MachineBasicBlock::iterator(UserMI)); + MachineBasicBlock *UserMBB = UserMI->getParent(); + MachineBasicBlock *NewMBB; + // TODO: Search for the best place to split the code. In practice, using // loop nesting information to insert these guys outside of loops would be // sufficient. - MachineBasicBlock *NewBB = SplitBlockBeforeInstr(NextMI); + if (&UserMBB->back() == UserMI) { + assert(BBHasFallthrough(UserMBB) && "Expected a fallthrough BB!"); + NewMBB = next(MachineFunction::iterator(UserMBB)); + // Add an unconditional branch from UserMBB to fallthrough block. + BuildMI(UserMBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewMBB); + BBSizes[UserMBB->getNumber()] += isThumb ? 2 : 4; + } else { + MachineInstr *NextMI = next(MachineBasicBlock::iterator(UserMI)); + NewMBB = SplitBlockBeforeInstr(NextMI); + } // Okay, we know we can put an island before UserMBB now, do it! MachineBasicBlock *NewIsland = new MachineBasicBlock(); - Fn.getBasicBlockList().insert(NewBB, NewIsland); + Fn.getBasicBlockList().insert(NewMBB, NewIsland); // Update internal data structures to account for the newly inserted MBB. UpdateForInsertedWaterBlock(NewIsland); From evan.cheng at apple.com Wed Jan 31 12:29:46 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 12:29:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701311829.l0VITkox020632@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.15 -> 1.16 --- Log message: Some comments. --- Diffs of the changes: (+6 -2) ARMConstantIslandPass.cpp | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.15 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.16 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.15 Wed Jan 31 12:19:07 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 31 12:29:27 2007 @@ -420,6 +420,7 @@ NewBB->splice(NewBB->end(), OrigBB, MI, OrigBB->end()); // Add an unconditional branch from OrigBB to NewBB. + // Note the new unconditional branch is not being recorded. BuildMI(OrigBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewBB); NumSplit++; @@ -498,6 +499,7 @@ assert(BBHasFallthrough(UserMBB) && "Expected a fallthrough BB!"); NewMBB = next(MachineFunction::iterator(UserMBB)); // Add an unconditional branch from UserMBB to fallthrough block. + // Note the new unconditional branch is not being recorded. BuildMI(UserMBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewMBB); BBSizes[UserMBB->getNumber()] += isThumb ? 2 : 4; } else { @@ -590,7 +592,9 @@ return true; } -static inline unsigned getUncondBranchDisp(int Opc) { +/// getUnconditionalBrDisp - Returns the maximum displacement that can fit in the +/// specific unconditional branch instruction. +static inline unsigned getUnconditionalBrDisp(int Opc) { return (Opc == ARM::tB) ? (1<<10)*2 : (1<<23)*4; } @@ -653,7 +657,7 @@ BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB).addImm(CC); Br.MI = &MBB->back(); BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB); - unsigned MaxDisp = getUncondBranchDisp(Br.UncondBr); + unsigned MaxDisp = getUnconditionalBrDisp(Br.UncondBr); ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr)); MI->eraseFromParent(); From clattner at apple.com Wed Jan 31 13:33:44 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 31 Jan 2007 11:33:44 -0800 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes References: <200701312017.37914.baldrick@free.fr> Message-ID: <9776B260-6A34-42AE-99CA-7D743B1576AA@apple.com> Applied, -Chris Begin forwarded message: > From: Duncan Sands > Date: January 31, 2007 11:17:37 AM PST > To: Chris Lattner > Subject: llvm-gcc4: gimplifier fixes > > isAggregateType, defined in llvm-convert, is identical to > isAggregateTreeType, defined in llvm-abi.h. Even the comment > is the same. > > Ciao, > > Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: isaggregate.diff Type: text/x-diff Size: 3579 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070131/d70793ed/attachment.bin -------------- next part -------------- From sabre at nondot.org Wed Jan 31 13:47:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 13:47:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200701311947.l0VJlb8d029817@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.51 -> 1.52 --- Log message: implement the new GEP instruction ctors. --- Diffs of the changes: (+1 -1) Instructions.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.51 llvm/include/llvm/Instructions.h:1.52 --- llvm/include/llvm/Instructions.h:1.51 Tue Jan 30 22:39:29 2007 +++ llvm/include/llvm/Instructions.h Wed Jan 31 13:47:18 2007 @@ -336,7 +336,7 @@ for (unsigned i = 0, E = NumOperands; i != E; ++i) OL[i].init(GEPIOL[i], this); } - void init(Value *Ptr, const std::vector &Idx); + void init(Value *Ptr, Value* const *Idx, unsigned NumIdx); void init(Value *Ptr, Value *Idx0, Value *Idx1); void init(Value *Ptr, Value *Idx); public: From sabre at nondot.org Wed Jan 31 13:47:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 13:47:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200701311947.l0VJlcRb029822@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.67 -> 1.68 --- Log message: implement the new GEP instruction ctors. --- Diffs of the changes: (+23 -5) Instructions.cpp | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.67 llvm/lib/VMCore/Instructions.cpp:1.68 --- llvm/lib/VMCore/Instructions.cpp:1.67 Tue Jan 30 22:40:28 2007 +++ llvm/lib/VMCore/Instructions.cpp Wed Jan 31 13:47:18 2007 @@ -684,12 +684,12 @@ return Ty; } -void GetElementPtrInst::init(Value *Ptr, const std::vector &Idx) { - NumOperands = 1+Idx.size(); +void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx) { + NumOperands = 1+NumIdx; Use *OL = OperandList = new Use[NumOperands]; OL[0].init(Ptr, this); - for (unsigned i = 0, e = Idx.size(); i != e; ++i) + for (unsigned i = 0; i != NumIdx; ++i) OL[i+1].init(Idx[i], this); } @@ -713,7 +713,7 @@ : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), Idx, true))), GetElementPtr, 0, 0, Name, InBe) { - init(Ptr, Idx); + init(Ptr, &Idx[0], Idx.size()); } GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector &Idx, @@ -721,7 +721,25 @@ : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), Idx, true))), GetElementPtr, 0, 0, Name, IAE) { - init(Ptr, Idx); + init(Ptr, &Idx[0], Idx.size()); +} + +GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value* const *Idx, + unsigned NumIdx, + const std::string &Name, Instruction *InBe) +: Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), + Idx, true))), + GetElementPtr, 0, 0, Name, InBe) { + init(Ptr, Idx, NumIdx); +} + +GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value* const *Idx, + unsigned NumIdx, + const std::string &Name, BasicBlock *IAE) +: Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), + Idx, true))), + GetElementPtr, 0, 0, Name, IAE) { + init(Ptr, Idx, NumIdx); } GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, From sabre at nondot.org Wed Jan 31 13:49:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 13:49:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt Message-ID: <200701311949.l0VJncw0029904@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: README.txt updated: 1.108 -> 1.109 --- Log message: A relatively simple PPC optimization. --- Diffs of the changes: (+27 -0) README.txt | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/lib/Target/PowerPC/README.txt diff -u llvm/lib/Target/PowerPC/README.txt:1.108 llvm/lib/Target/PowerPC/README.txt:1.109 --- llvm/lib/Target/PowerPC/README.txt:1.108 Mon Jan 29 15:21:22 2007 +++ llvm/lib/Target/PowerPC/README.txt Wed Jan 31 13:49:20 2007 @@ -595,3 +595,30 @@ it. ===-------------------------------------------------------------------------=== + +We compile this: +int test(_Bool X) { + return X ? 524288 : 0; +} + +to: +_test: + cmplwi cr0, r3, 0 + lis r2, 8 + li r3, 0 + beq cr0, LBB1_2 ;entry +LBB1_1: ;entry + mr r3, r2 +LBB1_2: ;entry + blr + +instead of: +_test: + addic r2,r3,-1 + subfe r0,r2,r3 + slwi r3,r0,19 + blr + +This sort of thing occurs a lot due to globalopt. + +===-------------------------------------------------------------------------=== From sabre at nondot.org Wed Jan 31 13:56:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 13:56:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200701311956.l0VJuViX030076@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.227 -> 1.228 --- Log message: eliminate a temporary vector while parsing gep's from bc files. --- Diffs of the changes: (+6 -3) Reader.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.227 llvm/lib/Bytecode/Reader/Reader.cpp:1.228 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.227 Tue Jan 30 22:43:00 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Jan 31 13:56:15 2007 @@ -30,6 +30,7 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/Compressor.h" #include "llvm/Support/MathExtras.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include #include @@ -799,7 +800,7 @@ if (Oprnds.size() == 0 || !isa(InstTy)) error("Invalid getelementptr instruction!"); - std::vector Idx; + SmallVector Idx; const Type *NextTy = InstTy; for (unsigned i = 1, e = Oprnds.size(); i != e; ++i) { @@ -823,10 +824,12 @@ ValIdx >>= 1; } Idx.push_back(getValue(IdxTy, ValIdx)); - NextTy = GetElementPtrInst::getIndexedType(InstTy, Idx, true); + NextTy = GetElementPtrInst::getIndexedType(InstTy, &Idx[0], Idx.size(), + true); } - Result = new GetElementPtrInst(getValue(iType, Oprnds[0]), Idx); + Result = new GetElementPtrInst(getValue(iType, Oprnds[0]), + &Idx[0], Idx.size()); break; } case 62: // volatile load From evan.cheng at apple.com Wed Jan 31 13:58:01 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 13:58:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701311958.l0VJw1qu030776@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.16 -> 1.17 --- Log message: When determining whether a pc relative branch / load displacement fits in the instruction field, adjust it for PC value (4 for thumb, 8 for arm). --- Diffs of the changes: (+42 -27) ARMConstantIslandPass.cpp | 69 ++++++++++++++++++++++++++++------------------ 1 files changed, 42 insertions(+), 27 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.16 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.17 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.16 Wed Jan 31 12:29:27 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 31 13:57:44 2007 @@ -115,7 +115,8 @@ MachineBasicBlock *SplitBlockBeforeInstr(MachineInstr *MI); void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB); bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); - bool BBIsInBranchRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned D); + bool CPEIsInRange(MachineInstr *MI, MachineInstr *CPEMI, unsigned Disp); + bool BBIsInRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned Disp); bool FixUpImmediateBr(MachineFunction &Fn, ImmBranch &Br); bool FixUpConditionalBr(MachineFunction &Fn, ImmBranch &Br); bool FixUpUnconditionalBr(MachineFunction &Fn, ImmBranch &Br); @@ -458,33 +459,41 @@ return NewBB; } -/// HandleConstantPoolUser - Analyze the specified user, checking to see if it -/// is out-of-range. If so, pick it up the constant pool value and move it some -/// place in-range. -bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &Fn, CPUser &U){ - bool isThumb = AFI->isThumbFunction(); - MachineInstr *UserMI = U.MI; - MachineInstr *CPEMI = U.CPEMI; - - unsigned UserOffset = GetOffsetOf(UserMI); +/// CPEIsInRange - Returns true is the distance between specific MI and +/// specific ConstPool entry instruction can fit in MI's displacement field. +bool ARMConstantIslands::CPEIsInRange(MachineInstr *MI, MachineInstr *CPEMI, + unsigned MaxDisp) { + unsigned PCAdj = AFI->isThumbFunction() ? 4 : 8; + unsigned UserOffset = GetOffsetOf(MI) + PCAdj; unsigned CPEOffset = GetOffsetOf(CPEMI); DEBUG(std::cerr << "User of CPE#" << CPEMI->getOperand(0).getImm() - << " max delta=" << U.MaxDisp + << " max delta=" << MaxDisp << " at offset " << int(UserOffset-CPEOffset) << "\t" - << *UserMI); + << *MI); - // Check to see if the CPE is already in-range. if (UserOffset < CPEOffset) { // User before the CPE. - if (CPEOffset-UserOffset <= U.MaxDisp) - return false; - } else if (!isThumb) { + if (CPEOffset-UserOffset <= MaxDisp) + return true; + } else if (!AFI->isThumbFunction()) { // Thumb LDR cannot encode negative offset. - if (UserOffset-CPEOffset <= U.MaxDisp) - return false; + if (UserOffset-CPEOffset <= MaxDisp) + return true; } - + return false; +} + +/// HandleConstantPoolUser - Analyze the specified user, checking to see if it +/// is out-of-range. If so, pick it up the constant pool value and move it some +/// place in-range. +bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &Fn, CPUser &U){ + MachineInstr *UserMI = U.MI; + MachineInstr *CPEMI = U.CPEMI; + + // Check to see if the CPE is already in-range. + if (CPEIsInRange(UserMI, CPEMI, U.MaxDisp)) + return false; // Solution guaranteed to work: split the user's MBB right after the user and // insert a clone the CPE into the newly created water. @@ -500,6 +509,7 @@ NewMBB = next(MachineFunction::iterator(UserMBB)); // Add an unconditional branch from UserMBB to fallthrough block. // Note the new unconditional branch is not being recorded. + bool isThumb = AFI->isThumbFunction(); BuildMI(UserMBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewMBB); BBSizes[UserMBB->getNumber()] += isThumb ? 2 : 4; } else { @@ -540,15 +550,19 @@ return true; } -/// BBIsInBranchRange - Returns true is the distance between specific MI and +/// BBIsInRange - Returns true is the distance between specific MI and /// specific BB can fit in MI's displacement field. -bool ARMConstantIslands::BBIsInBranchRange(MachineInstr *MI, - MachineBasicBlock *DestBB, - unsigned MaxDisp) { - unsigned BrOffset = GetOffsetOf(MI); +bool ARMConstantIslands::BBIsInRange(MachineInstr *MI,MachineBasicBlock *DestBB, + unsigned MaxDisp) { + unsigned PCAdj = AFI->isThumbFunction() ? 4 : 8; + unsigned BrOffset = GetOffsetOf(MI) + PCAdj; unsigned DestOffset = GetOffsetOf(DestBB); - // Check to see if the destination BB is in range. + DEBUG(std::cerr << "Branch of destination BB#" << DestBB->getNumber() + << " max delta=" << MaxDisp + << " at offset " << int(BrOffset-DestOffset) << "\t" + << *MI); + if (BrOffset < DestOffset) { if (DestOffset - BrOffset < MaxDisp) return true; @@ -565,7 +579,8 @@ MachineInstr *MI = Br.MI; MachineBasicBlock *DestBB = MI->getOperand(0).getMachineBasicBlock(); - if (BBIsInBranchRange(MI, DestBB, Br.MaxDisp)) + // Check to see if the DestBB is already in-range. + if (BBIsInRange(MI, DestBB, Br.MaxDisp)) return false; if (!Br.isCond) @@ -635,7 +650,7 @@ // bne L2 // b L1 MachineBasicBlock *NewDest = BackMI->getOperand(0).getMachineBasicBlock(); - if (BBIsInBranchRange(MI, NewDest, Br.MaxDisp)) { + if (BBIsInRange(MI, NewDest, Br.MaxDisp)) { BackMI->getOperand(0).setMachineBasicBlock(DestBB); MI->getOperand(0).setMachineBasicBlock(NewDest); MI->getOperand(1).setImm(CC); From sabre at nondot.org Wed Jan 31 14:00:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 14:00:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp SimplifyLibCalls.cpp Message-ID: <200701312000.l0VK0BBp030867@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.92 -> 1.93 SimplifyLibCalls.cpp updated: 1.90 -> 1.91 --- Log message: eliminate temporary vectors --- Diffs of the changes: (+8 -12) GlobalOpt.cpp | 11 +++++------ SimplifyLibCalls.cpp | 9 +++------ 2 files changed, 8 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.92 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.93 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.92 Tue Jan 30 22:40:53 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Wed Jan 31 13:59:55 2007 @@ -452,11 +452,11 @@ &Idxs[0], Idxs.size()); } else { GetElementPtrInst *GEPI = cast(GEP); - std::vector Idxs; + SmallVector Idxs; Idxs.push_back(NullInt); for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) Idxs.push_back(GEPI->getOperand(i)); - NewPtr = new GetElementPtrInst(NewPtr, Idxs, + NewPtr = new GetElementPtrInst(NewPtr, &Idxs[0], Idxs.size(), GEPI->getName()+"."+utostr(Val), GEPI); } GEP->replaceAllUsesWith(NewPtr); @@ -684,10 +684,9 @@ MallocInst *NewMI = new MallocInst(NewTy, Constant::getNullValue(Type::Int32Ty), MI->getAlignment(), MI->getName(), MI); - std::vector Indices; - Indices.push_back(Constant::getNullValue(Type::Int32Ty)); - Indices.push_back(Indices[0]); - Value *NewGEP = new GetElementPtrInst(NewMI, Indices, + Value* Indices[2]; + Indices[0] = Indices[1] = Constant::getNullValue(Type::Int32Ty); + Value *NewGEP = new GetElementPtrInst(NewMI, Indices, 2, NewMI->getName()+".el0", MI); MI->replaceAllUsesWith(NewGEP); MI->eraseFromParent(); Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.90 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.91 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.90 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Wed Jan 31 13:59:55 2007 @@ -505,10 +505,8 @@ // Now that we have the destination's length, we must index into the // destination's pointer to get the actual memcpy destination (end of // the string .. we're concatenating). - std::vector idx; - idx.push_back(strlen_inst); GetElementPtrInst* gep = - new GetElementPtrInst(dest,idx,dest->getName()+".indexed",ci); + new GetElementPtrInst(dest, strlen_inst, dest->getName()+".indexed", ci); // We have enough information to now generate the memcpy call to // do the concatenation for us. @@ -596,9 +594,8 @@ // strchr(s,c) -> offset_of_in(c,s) // (if c is a constant integer and s is a constant string) if (char_found) { - std::vector indices; - indices.push_back(ConstantInt::get(Type::Int64Ty,offset)); - GetElementPtrInst* GEP = new GetElementPtrInst(ci->getOperand(1),indices, + Value* Idx = ConstantInt::get(Type::Int64Ty,offset); + GetElementPtrInst* GEP = new GetElementPtrInst(ci->getOperand(1), Idx, ci->getOperand(1)->getName()+".strchr",ci); ci->replaceAllUsesWith(GEP); } else { From sabre at nondot.org Wed Jan 31 14:07:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 14:07:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200701312007.l0VK7npi031373@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CodeExtractor.cpp updated: 1.47 -> 1.48 --- Log message: eliminate temporary vectors --- Diffs of the changes: (+13 -16) CodeExtractor.cpp | 29 +++++++++++++---------------- 1 files changed, 13 insertions(+), 16 deletions(-) Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.47 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.48 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.47 Thu Jan 11 22:24:46 2007 +++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Wed Jan 31 14:07:32 2007 @@ -303,12 +303,12 @@ for (unsigned i = 0, e = inputs.size(); i != e; ++i) { Value *RewriteVal; if (AggregateArgs) { - std::vector Indices; - Indices.push_back(Constant::getNullValue(Type::Int32Ty)); - Indices.push_back(ConstantInt::get(Type::Int32Ty, i)); + Value *Idx0 = Constant::getNullValue(Type::Int32Ty); + Value *Idx1 = ConstantInt::get(Type::Int32Ty, i); std::string GEPname = "gep_" + inputs[i]->getName(); TerminatorInst *TI = newFunction->begin()->getTerminator(); - GetElementPtrInst *GEP = new GetElementPtrInst(AI, Indices, GEPname, TI); + GetElementPtrInst *GEP = new GetElementPtrInst(AI, Idx0, Idx1, + GEPname, TI); RewriteVal = new LoadInst(GEP, "load" + GEPname, TI); } else RewriteVal = AI++; @@ -390,11 +390,10 @@ params.push_back(Struct); for (unsigned i = 0, e = inputs.size(); i != e; ++i) { - std::vector Indices; - Indices.push_back(Constant::getNullValue(Type::Int32Ty)); - Indices.push_back(ConstantInt::get(Type::Int32Ty, i)); + Value *Idx0 = Constant::getNullValue(Type::Int32Ty); + Value *Idx1 = ConstantInt::get(Type::Int32Ty, i); GetElementPtrInst *GEP = - new GetElementPtrInst(Struct, Indices, + new GetElementPtrInst(Struct, Idx0, Idx1, "gep_" + StructValues[i]->getName()); codeReplacer->getInstList().push_back(GEP); StoreInst *SI = new StoreInst(StructValues[i], GEP); @@ -416,11 +415,10 @@ for (unsigned i = 0, e = outputs.size(); i != e; ++i) { Value *Output = 0; if (AggregateArgs) { - std::vector Indices; - Indices.push_back(Constant::getNullValue(Type::Int32Ty)); - Indices.push_back(ConstantInt::get(Type::Int32Ty, FirstOut + i)); + Value *Idx0 = Constant::getNullValue(Type::Int32Ty); + Value *Idx1 = ConstantInt::get(Type::Int32Ty, FirstOut + i); GetElementPtrInst *GEP - = new GetElementPtrInst(Struct, Indices, + = new GetElementPtrInst(Struct, Idx0, Idx1, "gep_reload_" + outputs[i]->getName()); codeReplacer->getInstList().push_back(GEP); Output = GEP; @@ -517,11 +515,10 @@ if (DominatesDef) { if (AggregateArgs) { - std::vector Indices; - Indices.push_back(Constant::getNullValue(Type::Int32Ty)); - Indices.push_back(ConstantInt::get(Type::Int32Ty,FirstOut+out)); + Value *Idx0 = Constant::getNullValue(Type::Int32Ty); + Value *Idx1 = ConstantInt::get(Type::Int32Ty,FirstOut+out); GetElementPtrInst *GEP = - new GetElementPtrInst(OAI, Indices, + new GetElementPtrInst(OAI, Idx0, Idx1, "gep_" + outputs[out]->getName(), NTRet); new StoreInst(outputs[out], GEP, NTRet); From sabre at nondot.org Wed Jan 31 14:08:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 14:08:51 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200701312008.l0VK8pRn031434@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.22 -> 1.23 --- Log message: add missing ctor --- Diffs of the changes: (+7 -0) SmallVector.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.22 llvm/include/llvm/ADT/SmallVector.h:1.23 --- llvm/include/llvm/ADT/SmallVector.h:1.22 Sun Oct 29 23:07:51 2006 +++ llvm/include/llvm/ADT/SmallVector.h Wed Jan 31 14:08:34 2007 @@ -418,6 +418,13 @@ SmallVector() : SmallVectorImpl(NumTsAvailable) { } + SmallVector(unsigned Size, const T &Value) + : SmallVectorImpl(NumTsAvailable) { + this->reserve(Size); + while (Size--) + push_back(Value); + } + template SmallVector(ItTy S, ItTy E) : SmallVectorImpl(NumTsAvailable) { append(S, E); From sabre at nondot.org Wed Jan 31 14:09:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 14:09:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp InstructionCombining.cpp LowerGC.cpp Message-ID: <200701312009.l0VK9BL3031472@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.107 -> 1.108 InstructionCombining.cpp updated: 1.617 -> 1.618 LowerGC.cpp updated: 1.19 -> 1.20 --- Log message: remove temporary vectors. --- Diffs of the changes: (+9 -13) IndVarSimplify.cpp | 3 +-- InstructionCombining.cpp | 4 ++-- LowerGC.cpp | 15 ++++++--------- 3 files changed, 9 insertions(+), 13 deletions(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.107 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.108 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.107 Tue Jan 30 22:40:53 2007 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Jan 31 14:08:52 2007 @@ -197,8 +197,7 @@ std::string Name = PN->getName(); PN->setName(""); Value *PreInc = new GetElementPtrInst(PN->getIncomingValue(PreheaderIdx), - std::vector(1, NewPhi), Name, - InsertPos); + NewPhi, Name, InsertPos); PN->replaceAllUsesWith(PreInc); } Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.617 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.618 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.617 Wed Jan 31 12:09:17 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jan 31 14:08:52 2007 @@ -6418,8 +6418,8 @@ // If we found a path from the src to dest, create the getelementptr now. if (SrcElTy == DstElTy) { - std::vector Idxs(NumZeros+1, ZeroUInt); - return new GetElementPtrInst(Src, Idxs); + SmallVector Idxs(NumZeros+1, ZeroUInt); + return new GetElementPtrInst(Src, &Idxs[0], Idxs.size()); } } } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.19 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.20 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.19 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Wed Jan 31 14:08:52 2007 @@ -229,10 +229,7 @@ Constant *One = ConstantInt::get(Type::Int32Ty, 1); // Get a pointer to the prev pointer. - std::vector Par; - Par.push_back(Zero); - Par.push_back(Zero); - Value *PrevPtrPtr = new GetElementPtrInst(AI, Par, "prevptrptr", IP); + Value *PrevPtrPtr = new GetElementPtrInst(AI, Zero, Zero, "prevptrptr", IP); // Load the previous pointer. Value *PrevPtr = new LoadInst(RootChain, "prevptr", IP); @@ -240,12 +237,12 @@ new StoreInst(PrevPtr, PrevPtrPtr, IP); // Set the number of elements in this record. - Par[1] = ConstantInt::get(Type::Int32Ty, 1); - Value *NumEltsPtr = new GetElementPtrInst(AI, Par, "numeltsptr", IP); + Value *NumEltsPtr = new GetElementPtrInst(AI, Zero, One, "numeltsptr", IP); new StoreInst(ConstantInt::get(Type::Int32Ty, GCRoots.size()), NumEltsPtr,IP); + Value* Par[4]; + Par[0] = Zero; Par[1] = ConstantInt::get(Type::Int32Ty, 2); - Par.resize(4); const PointerType *PtrLocTy = cast(GCRootInt->getFunctionType()->getParamType(0)); @@ -256,13 +253,13 @@ // Initialize the meta-data pointer. Par[2] = ConstantInt::get(Type::Int32Ty, i); Par[3] = One; - Value *MetaDataPtr = new GetElementPtrInst(AI, Par, "MetaDataPtr", IP); + Value *MetaDataPtr = new GetElementPtrInst(AI, Par, 4, "MetaDataPtr", IP); assert(isa(GCRoots[i]->getOperand(2)) && "Must be a constant"); new StoreInst(GCRoots[i]->getOperand(2), MetaDataPtr, IP); // Initialize the root pointer to null on entry to the function. Par[3] = Zero; - Value *RootPtrPtr = new GetElementPtrInst(AI, Par, "RootEntPtr", IP); + Value *RootPtrPtr = new GetElementPtrInst(AI, Par, 4, "RootEntPtr", IP); new StoreInst(Null, RootPtrPtr, IP); // Each occurrance of the llvm.gcroot intrinsic now turns into an From sabre at nondot.org Wed Jan 31 14:11:10 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 14:11:10 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200701312011.l0VKBAMb031611@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.115 -> 1.116 --- Log message: shutdown the app when done. --- Diffs of the changes: (+3 -1) gccld.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.115 llvm/tools/gccld/gccld.cpp:1.116 --- llvm/tools/gccld/gccld.cpp:1.115 Wed Dec 6 19:30:31 2006 +++ llvm/tools/gccld/gccld.cpp Wed Jan 31 14:10:54 2007 @@ -29,6 +29,7 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Streams.h" @@ -420,6 +421,7 @@ cerr << argv[0] << ": An unexpected unknown exception occurred.\n"; exitCode = 3; } - + + llvm_shutdown(); return exitCode; } From evan.cheng at apple.com Wed Jan 31 14:12:46 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 14:12:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td Message-ID: <200701312012.l0VKCkSr031675@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.10 -> 1.11 --- Log message: Thumb asm syntax does not want 's' suffix for flag setting opcodes. --- Diffs of the changes: (+2 -2) ARMInstrThumb.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.10 llvm/lib/Target/ARM/ARMInstrThumb.td:1.11 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.10 Tue Jan 30 14:37:08 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Wed Jan 31 14:12:31 2007 @@ -284,7 +284,7 @@ [(set GPR:$dst, (adde GPR:$lhs, GPR:$rhs))]>; def tADDS : TI<(ops GPR:$dst, GPR:$lhs, GPR:$rhs), - "adds $dst, $lhs, $rhs", + "add $dst, $lhs, $rhs", [(set GPR:$dst, (addc GPR:$lhs, GPR:$rhs))]>; @@ -423,7 +423,7 @@ [(set GPR:$dst, (sube GPR:$lhs, GPR:$rhs))]>; def tSUBS : TI<(ops GPR:$dst, GPR:$lhs, GPR:$rhs), - "subs $dst, $lhs, $rhs", + "sub $dst, $lhs, $rhs", [(set GPR:$dst, (subc GPR:$lhs, GPR:$rhs))]>; From lauro.venancio at gmail.com Wed Jan 31 15:21:07 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 31 Jan 2007 18:21:07 -0300 Subject: [llvm-commits] llvm-gcc patch: fix PR1150 Message-ID: <9c10c9f0701311321o65200d04j6d207f51218c8ec@mail.gmail.com> Fix PR1150. http://llvm.org/bugs/show_bug.cgi?id=1150 Lauro -------------- next part -------------- A non-text attachment was scrubbed... Name: pr1150.patch Type: text/x-patch Size: 29217 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070131/803e3d9d/attachment.bin From reid at x10sys.com Wed Jan 31 15:27:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 31 Jan 2007 15:27:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FoldingSet.cpp Message-ID: <200701312127.l0VLRssl000969@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FoldingSet.cpp updated: 1.13 -> 1.14 --- Log message: Add some debug output. --- Diffs of the changes: (+4 -0) FoldingSet.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Support/FoldingSet.cpp diff -u llvm/lib/Support/FoldingSet.cpp:1.13 llvm/lib/Support/FoldingSet.cpp:1.14 --- llvm/lib/Support/FoldingSet.cpp:1.13 Wed Jan 31 00:04:41 2007 +++ llvm/lib/Support/FoldingSet.cpp Wed Jan 31 15:27:38 2007 @@ -14,8 +14,10 @@ // //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "foldingset" #include "llvm/ADT/FoldingSet.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Debug.h" #include using namespace llvm; @@ -225,6 +227,7 @@ /// FindNodeOrInsertPos. void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { // Do we need to grow the hashtable? + DEBUG(DOUT << "INSERT: " << N << '\n'); if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); NodeID ID; @@ -255,6 +258,7 @@ // Because each bucket is a circular list, we don't need to compute N's hash // to remove it. Chase around the list until we find the node (or bucket) // which points to N. + DEBUG(DOUT << "REMOVE: " << N << '\n'); void *Ptr = N->getNextInBucket(); if (Ptr == 0) return false; // Not in folding set. From evan.cheng at apple.com Wed Jan 31 15:31:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 15:31:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200701312131.l0VLVeqj001048@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.83 -> 1.84 --- Log message: Dead comment. --- Diffs of the changes: (+0 -1) TargetData.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.83 llvm/lib/Target/TargetData.cpp:1.84 --- llvm/lib/Target/TargetData.cpp:1.83 Fri Jan 26 02:11:39 2007 +++ llvm/lib/Target/TargetData.cpp Wed Jan 31 15:31:25 2007 @@ -495,7 +495,6 @@ Alignment = Log2_32(GV->getAlignment()); if (GV->hasInitializer()) { - // Always round up alignment of global doubles to 8 bytes. if (Alignment < 4) { // If the global is not external, see if it is large. If so, give it a // larger alignment. From reid at x10sys.com Wed Jan 31 15:39:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 31 Jan 2007 15:39:28 -0600 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200701312139.l0VLdSvb001224@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.205 -> 1.206 --- Log message: Preview of the shift instructions becoming Binary Operators. --- Diffs of the changes: (+86 -87) LangRef.html | 173 +++++++++++++++++++++++++++++------------------------------ 1 files changed, 86 insertions(+), 87 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.205 llvm/docs/LangRef.html:1.206 --- llvm/docs/LangRef.html:1.205 Sun Jan 28 09:27:21 2007 +++ llvm/docs/LangRef.html Wed Jan 31 15:39:12 2007 @@ -85,6 +85,9 @@
  • 'urem' Instruction
  • 'srem' Instruction
  • 'frem' Instruction
  • +
  • 'shl' Instruction
  • +
  • 'lshr' Instruction
  • +
  • 'ashr' Instruction
  • Bitwise Binary Operations @@ -92,9 +95,6 @@
  • 'and' Instruction
  • 'or' Instruction
  • 'xor' Instruction
  • -
  • 'shl' Instruction
  • -
  • 'lshr' Instruction
  • -
  • 'ashr' Instruction
  • Vector Operations @@ -1952,6 +1952,88 @@
  • + + +
    +
    Syntax:
    +
      <result> = shl <ty> <var1>, <var2>   ; yields {ty}:result
    +
    +
    Overview:
    +

    The 'shl' instruction returns the first operand shifted to +the left a specified number of bits.

    +
    Arguments:
    +

    Both arguments to the 'shl' instruction must be the same integer type.

    +
    Semantics:
    +

    The value produced is var1 * 2var2.

    +
    Example:
    +  <result> = shl i32 4, %var   ; yields {i32}: 4 << %var
    +  <result> = shl i32 4, 2      ; yields {i32}: 16
    +  <result> = shl i32 1, 10     ; yields {i32}: 1024
    +
    +
    + + +
    +
    Syntax:
    +
      <result> = lshr <ty> <var1>, <var2>   ; yields {ty}:result
    +
    + +
    Overview:
    +

    The 'lshr' instruction (logical shift right) returns the first +operand shifted to the right a specified number of bits.

    + +
    Arguments:
    +

    Both arguments to the 'lshr' instruction must be the same +integer type.

    + +
    Semantics:
    +

    This instruction always performs a logical shift right operation. The most +significant bits of the result will be filled with zero bits after the +shift.

    + +
    Example:
    +
    +  <result> = lshr i32 4, 1   ; yields {i32}:result = 2
    +  <result> = lshr i32 4, 2   ; yields {i32}:result = 1
    +  <result> = lshr i8  4, 3   ; yields {i8}:result = 0
    +  <result> = lshr i8 -2, 1   ; yields {i8}:result = 0x7FFFFFFF 
    +
    +
    + + + +
    + +
    Syntax:
    +
      <result> = ashr <ty> <var1>, <var2>   ; yields {ty}:result
    +
    + +
    Overview:
    +

    The 'ashr' instruction (arithmetic shift right) returns the first +operand shifted to the right a specified number of bits.

    + +
    Arguments:
    +

    Both arguments to the 'ashr' instruction must be the same +integer type.

    + +
    Semantics:
    +

    This instruction always performs an arithmetic shift right operation, +The most significant bits of the result will be filled with the sign bit +of var1.

    + +
    Example:
    +
    +  <result> = ashr i32 4, 1   ; yields {i32}:result = 2
    +  <result> = ashr i32 4, 2   ; yields {i32}:result = 1
    +  <result> = ashr i8  4, 3   ; yields {i8}:result = 0
    +  <result> = ashr i8 -2, 1   ; yields {i8}:result = -1
    +
    +
    + @@ -2127,89 +2209,6 @@ <result> = xor i32 %V, -1 ; yields {i32}:result = ~%V - - -
    -
    Syntax:
    -
      <result> = shl <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    -
    Overview:
    -

    The 'shl' instruction returns the first operand shifted to -the left a specified number of bits.

    -
    Arguments:
    -

    The first argument to the 'shl' instruction must be an integer type. The second argument must be an 'i8' -type.

    -
    Semantics:
    -

    The value produced is var1 * 2var2.

    -
    Example:
    -
      <result> = shl i32 4, i8 %var   ; yields {i32}:result = 4 << %var
    -  <result> = shl i32 4, i8 2      ; yields {i32}:result = 16
    -  <result> = shl i32 1, i8 10     ; yields {i32}:result = 1024
    -
    -
    - - -
    -
    Syntax:
    -
      <result> = lshr <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    - -
    Overview:
    -

    The 'lshr' instruction (logical shift right) returns the first -operand shifted to the right a specified number of bits.

    - -
    Arguments:
    -

    The first argument to the 'lshr' instruction must be an integer type. The second argument must be an 'i8' type.

    - -
    Semantics:
    -

    This instruction always performs a logical shift right operation. The -var2 most significant bits will be filled with zero bits after the -shift.

    - -
    Example:
    -
    -  <result> = lshr i32 4, i8 1   ; yields {i32}:result = 2
    -  <result> = lshr i32 4, i8 2    ; yields {i32}:result = 1
    -  <result> = lshr i8  4, i8 3  ; yields {i8 }:result = 0
    -  <result> = lshr i8  -2, i8 1 ; yields {i8 }:result = 0x7FFFFFFF 
    -
    -
    - - - -
    - -
    Syntax:
    -
      <result> = ashr <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    - -
    Overview:
    -

    The 'ashr' instruction (arithmetic shift right) returns the first -operand shifted to the right a specified number of bits.

    - -
    Arguments:
    -

    The first argument to the 'ashr' instruction must be an -integer type. The second argument must be an -'i8' type.

    - -
    Semantics:
    -

    This instruction always performs an arithmetic shift right operation, -regardless of whether the arguments are signed or not. The var2 most -significant bits will be filled with the sign bit of var1.

    - -
    Example:
    -
    -  <result> = ashr i32 4, i8 1    ; yields {i32}:result = 2
    -  <result> = ashr i32 4, i8 2      ; yields {i32}:result = 1
    -  <result> = ashr i8 4, i8 3    ; yields {i8}:result = 0
    -  <result> = ashr i8  -2, i8 1   ; yields {i8 }:result = -1
    -
    -
    @@ -4508,7 +4507,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/01/28 15:27:21 $ + Last modified: $Date: 2007/01/31 21:39:12 $ From evan.cheng at apple.com Wed Jan 31 16:07:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 16:07:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701312207.l0VM7090001669@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.48 -> 1.49 --- Log message: Update comment. --- Diffs of the changes: (+1 -1) ARMRegisterInfo.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.48 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.49 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.48 Wed Jan 31 07:12:46 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 16:06:44 2007 @@ -620,7 +620,7 @@ } else if (Opcode == ARM::tADDrSPi) { Offset += MI.getOperand(i+1).getImm(); assert((Offset & 3) == 0 && - "add/sub sp, #imm immediate must be multiple of 4!"); + "Thumb add/sub sp, #imm immediate must be multiple of 4!"); Offset >>= 2; if (Offset == 0) { // Turn it into a move. From evan.cheng at apple.com Wed Jan 31 16:08:56 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 16:08:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200701312208.l0VM8u7s001706@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.18 -> 1.19 --- Log message: Thumb add sp, #imm requires the immediate value be multiple of 4. For now, change preferred alignment of short, byte, bool to 4. --- Diffs of the changes: (+6 -2) ARMTargetMachine.cpp | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.18 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.19 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.18 Mon Jan 22 17:13:01 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Wed Jan 31 16:08:40 2007 @@ -35,8 +35,12 @@ ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : Subtarget(M, FS), DataLayout(Subtarget.isTargetDarwin() ? - std::string("e-p:32:32-d:32:32-l:32:32") : - std::string("e-p:32:32-d:32:64-l:32:64")), + (Subtarget.isThumb() ? + std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32") : + std::string("e-p:32:32-d:32:32-l:32:32")) : + (Subtarget.isThumb() ? + std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B:8:32") : + std::string("e-p:32:32-d:32:64-l:32:64"))), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From evan.cheng at apple.com Wed Jan 31 16:11:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 16:11:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README-Thumb.txt Message-ID: <200701312211.l0VMBsHk001776@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README-Thumb.txt updated: 1.2 -> 1.3 --- Log message: Add entry. --- Diffs of the changes: (+4 -0) README-Thumb.txt | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/ARM/README-Thumb.txt diff -u llvm/lib/Target/ARM/README-Thumb.txt:1.2 llvm/lib/Target/ARM/README-Thumb.txt:1.3 --- llvm/lib/Target/ARM/README-Thumb.txt:1.2 Fri Jan 26 20:33:22 2007 +++ llvm/lib/Target/ARM/README-Thumb.txt Wed Jan 31 16:11:38 2007 @@ -19,3 +19,7 @@ * If we know function size is less than (1 << 16) * 2 bytes, we can use 16-bit jumptable entries (e.g. (L1 - L2) >> 1). Or even smaller entries if the function is even smaller. This also applies to ARM. + +* In thumb mode, short, byte, and bool preferred alignments are currently set + to 4 to accommodate ISA restriction (i.e. add sp, #imm, imm must be multiple + of 4). From evan.cheng at apple.com Wed Jan 31 16:25:49 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 16:25:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701312225.l0VMPnmY002074@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.49 -> 1.50 --- Log message: Darwin ABI requires FP to point to stack slot of prev FP. --- Diffs of the changes: (+14 -3) ARMRegisterInfo.cpp | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.49 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.50 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.49 Wed Jan 31 16:06:44 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 16:25:33 2007 @@ -900,6 +900,13 @@ ForceLRSpill = false; } + // Darwin ABI requires FP to point to the stack slot that contains the + // previous FP. + if (STI.isTargetDarwin()) { + MF.changePhyRegUsed(FramePtr, true); + NumGPRSpills++; + } + // If stack and double are 8-byte aligned and we are spilling an odd number // of GPRs. Spill one extra callee save GPR so we won't have to pad between // the integer and double callee save areas. @@ -1029,8 +1036,9 @@ } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH) ++MBBI; - // Point FP to the stack slot that contains the previous FP. - if (hasFP(MF)) + // Darwin ABI requires FP to point to the stack slot that contains the + // previous FP. + if (STI.isTargetDarwin() || hasFP(MF)) BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri), FramePtr) .addFrameIndex(FramePtrSpillFI).addImm(0); @@ -1116,7 +1124,9 @@ if (isThumb) emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); else { - if (hasFP(MF)){ + // Darwin ABI requires FP to point to the stack slot that contains the + // previous FP. + if (STI.isTargetDarwin() || hasFP(MF)) { NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; // Reset SP based on frame pointer only if the stack frame extends beyond // frame pointer stack slot. @@ -1131,6 +1141,7 @@ } else if (NumBytes) { emitSPUpdate(MBB, MBBI, NumBytes, false, TII); } + // Move SP to start of integer callee save spill area 2. movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI); emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), false, TII); From evan.cheng at apple.com Wed Jan 31 16:26:42 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 14:26:42 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp In-Reply-To: <200701311313.l0VDD4Hp021237@zion.cs.uiuc.edu> References: <200701311313.l0VDD4Hp021237@zion.cs.uiuc.edu> Message-ID: <5BBD8906-7603-4392-8201-7DFE27E3866E@apple.com> Hi Lauro, FYI. Darwin ABI requires FP to point to the stack slot where previous FP is spilled. I've fixed this. Evan On Jan 31, 2007, at 5:13 AM, Lauro Ramos Venancio wrote: > > > Changes in directory llvm/lib/Target/ARM: > > ARMRegisterInfo.cpp updated: 1.47 -> 1.48 > --- > Log message: > > ARM fix: Miscompilation when frame pointer can't be eliminated. > Uninitialized frame pointer register is used. > > > --- > Diffs of the changes: (+9 -10) > > ARMRegisterInfo.cpp | 19 +++++++++---------- > 1 files changed, 9 insertions(+), 10 deletions(-) > > > Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp > diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.47 llvm/lib/ > Target/ARM/ARMRegisterInfo.cpp:1.48 > --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.47 Tue Jan 30 > 17:01:46 2007 > +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 07:12:46 2007 > @@ -573,8 +573,7 @@ > // There is alloca()'s in this function, must reference off > the frame > // pointer instead. > FrameReg = getFrameRegister(MF); > - if (STI.isTargetDarwin()) > - Offset -= AFI->getFramePtrSpillOffset(); > + Offset -= AFI->getFramePtrSpillOffset(); > } > > unsigned Opcode = MI.getOpcode(); > @@ -882,6 +881,12 @@ > } > } > > + if (hasFP(MF)) { > + MF.changePhyRegUsed(FramePtr, true); > + NumGPRSpills++; > + CanEliminateFrame = false; > + } > + > if (!CanEliminateFrame) { > AFI->setHasStackFrame(true); > > @@ -895,11 +900,6 @@ > ForceLRSpill = false; > } > > - if (STI.isTargetDarwin()) { > - MF.changePhyRegUsed(FramePtr, true); > - NumGPRSpills++; > - } > - > // If stack and double are 8-byte aligned and we are spilling > an odd number > // of GPRs. Spill one extra callee save GPR so we won't have > to pad between > // the integer and double callee save areas. > @@ -1030,7 +1030,7 @@ > ++MBBI; > > // Point FP to the stack slot that contains the previous FP. > - if (STI.isTargetDarwin()) > + if (hasFP(MF)) > BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : > ARM::ADDri), FramePtr) > .addFrameIndex(FramePtrSpillFI).addImm(0); > > @@ -1116,7 +1116,7 @@ > if (isThumb) > emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); > else { > - if (STI.isTargetDarwin()) { > + if (hasFP(MF)){ > NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; > // Reset SP based on frame pointer only if the stack frame > extends beyond > // frame pointer stack slot. > @@ -1131,7 +1131,6 @@ > } else if (NumBytes) { > emitSPUpdate(MBB, MBBI, NumBytes, false, TII); > } > - > // Move SP to start of integer callee save spill area 2. > movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI); > emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), > false, TII); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Wed Jan 31 16:27:23 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 16:27:23 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll Message-ID: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: hello.ll updated: 1.4 -> 1.5 insn-sched1.ll updated: 1.3 -> 1.4 ldm.ll updated: 1.4 -> 1.5 --- Log message: Fix test cases. --- Diffs of the changes: (+11 -10) hello.ll | 17 +++++++++-------- insn-sched1.ll | 2 +- ldm.ll | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) Index: llvm/test/CodeGen/ARM/hello.ll diff -u llvm/test/CodeGen/ARM/hello.ll:1.4 llvm/test/CodeGen/ARM/hello.ll:1.5 --- llvm/test/CodeGen/ARM/hello.ll:1.4 Wed Jan 31 07:12:46 2007 +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 16:27:07 2007 @@ -1,12 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep mov | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | grep mov | wc -l | grep 2 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 -%str = internal constant [12 x sbyte] c"Hello World\00" + at str = internal constant [12 x i8] c"Hello World\00" -int %main() { - %tmp = call int %puts( sbyte* getelementptr ([12 x sbyte]* %str, int 0, uint 0) ) - ret int 0 +define i32 @main() { + %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) ) ; [#uses=0] + ret i32 0 } -declare int %puts(sbyte*) +declare i32 @puts(i8*) Index: llvm/test/CodeGen/ARM/insn-sched1.ll diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 llvm/test/CodeGen/ARM/insn-sched1.ll:1.4 --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 Wed Jan 31 07:12:46 2007 +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 16:27:07 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 2 int %test(int %x) { %tmp = cast int %x to short Index: llvm/test/CodeGen/ARM/ldm.ll diff -u llvm/test/CodeGen/ARM/ldm.ll:1.4 llvm/test/CodeGen/ARM/ldm.ll:1.5 --- llvm/test/CodeGen/ARM/ldm.ll:1.4 Wed Jan 31 07:12:46 2007 +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 16:27:07 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 %X = external global [0 x int] From reid at x10sys.com Wed Jan 31 16:30:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 31 Jan 2007 16:30:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200701312230.l0VMUgNr002188@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.68 -> 1.69 --- Log message: Fix build breakage by using correct arguments to getIndexedType in the GEP constructors. --- Diffs of the changes: (+10 -6) Instructions.cpp | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.68 llvm/lib/VMCore/Instructions.cpp:1.69 --- llvm/lib/VMCore/Instructions.cpp:1.68 Wed Jan 31 13:47:18 2007 +++ llvm/lib/VMCore/Instructions.cpp Wed Jan 31 16:30:26 2007 @@ -711,7 +711,8 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector &Idx, const std::string &Name, Instruction *InBe) : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - Idx, true))), + &Idx[0], Idx.size(), + true))), GetElementPtr, 0, 0, Name, InBe) { init(Ptr, &Idx[0], Idx.size()); } @@ -719,7 +720,8 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector &Idx, const std::string &Name, BasicBlock *IAE) : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - Idx, true))), + &Idx[0], Idx.size(), + true))), GetElementPtr, 0, 0, Name, IAE) { init(Ptr, &Idx[0], Idx.size()); } @@ -728,7 +730,7 @@ unsigned NumIdx, const std::string &Name, Instruction *InBe) : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - Idx, true))), + Idx, NumIdx, true))), GetElementPtr, 0, 0, Name, InBe) { init(Ptr, Idx, NumIdx); } @@ -737,21 +739,23 @@ unsigned NumIdx, const std::string &Name, BasicBlock *IAE) : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - Idx, true))), + Idx, NumIdx, true))), GetElementPtr, 0, 0, Name, IAE) { init(Ptr, Idx, NumIdx); } GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, const std::string &Name, Instruction *InBe) - : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx))), + : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), + Idx))), GetElementPtr, 0, 0, Name, InBe) { init(Ptr, Idx); } GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, const std::string &Name, BasicBlock *IAE) - : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx))), + : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), + Idx))), GetElementPtr, 0, 0, Name, IAE) { init(Ptr, Idx); } From rspencer at reidspencer.com Wed Jan 31 16:41:26 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Wed, 31 Jan 2007 22:41:26 +0000 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll In-Reply-To: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> References: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> Message-ID: <1170283286.545.198.camel@bashful.x10sys.com> Evan / Lauro, I don't know what the issue is, but test/CodeGen/ARM/large-stack.ll is failing and going into an infinite busy loop in llc. This is preventing the dejagnu test suite from completing. Reid. On Wed, 2007-01-31 at 16:27 -0600, Evan Cheng wrote: > > Changes in directory llvm/test/CodeGen/ARM: > > hello.ll updated: 1.4 -> 1.5 > insn-sched1.ll updated: 1.3 -> 1.4 > ldm.ll updated: 1.4 -> 1.5 > --- > Log message: > > Fix test cases. > > --- > Diffs of the changes: (+11 -10) > > hello.ll | 17 +++++++++-------- > insn-sched1.ll | 2 +- > ldm.ll | 2 +- > 3 files changed, 11 insertions(+), 10 deletions(-) > > > Index: llvm/test/CodeGen/ARM/hello.ll > diff -u llvm/test/CodeGen/ARM/hello.ll:1.4 llvm/test/CodeGen/ARM/hello.ll:1.5 > --- llvm/test/CodeGen/ARM/hello.ll:1.4 Wed Jan 31 07:12:46 2007 > +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 16:27:07 2007 > @@ -1,12 +1,13 @@ > -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep mov | wc -l | grep 2 > +; RUN: llvm-as < %s | llc -march=arm && > +; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && > +; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | grep mov | wc -l | grep 2 > +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 > > -%str = internal constant [12 x sbyte] c"Hello World\00" > + at str = internal constant [12 x i8] c"Hello World\00" > > -int %main() { > - %tmp = call int %puts( sbyte* getelementptr ([12 x sbyte]* %str, int 0, uint 0) ) > - ret int 0 > +define i32 @main() { > + %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) ) ; [#uses=0] > + ret i32 0 > } > > -declare int %puts(sbyte*) > +declare i32 @puts(i8*) > > > Index: llvm/test/CodeGen/ARM/insn-sched1.ll > diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 llvm/test/CodeGen/ARM/insn-sched1.ll:1.4 > --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 Wed Jan 31 07:12:46 2007 > +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 16:27:07 2007 > @@ -1,5 +1,5 @@ > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 2 > > int %test(int %x) { > %tmp = cast int %x to short > > > Index: llvm/test/CodeGen/ARM/ldm.ll > diff -u llvm/test/CodeGen/ARM/ldm.ll:1.4 llvm/test/CodeGen/ARM/ldm.ll:1.5 > --- llvm/test/CodeGen/ARM/ldm.ll:1.4 Wed Jan 31 07:12:46 2007 > +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 16:27:07 2007 > @@ -1,7 +1,7 @@ > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 > > %X = external global [0 x int] > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lauro.venancio at gmail.com Wed Jan 31 17:16:19 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 31 Jan 2007 20:16:19 -0300 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll In-Reply-To: <1170283286.545.198.camel@bashful.x10sys.com> References: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> <1170283286.545.198.camel@bashful.x10sys.com> Message-ID: <9c10c9f0701311516y10660afw13ebf7a569648835@mail.gmail.com> large-stack.ll is falling, but the infinite loop occurs compiling function f3 of long.ll with -enable-thumb. Lauro 2007/1/31, Reid Spencer : > Evan / Lauro, > > I don't know what the issue is, but test/CodeGen/ARM/large-stack.ll is > failing and going into an infinite busy loop in llc. This is preventing > the dejagnu test suite from completing. > > Reid. > > On Wed, 2007-01-31 at 16:27 -0600, Evan Cheng wrote: > > > > Changes in directory llvm/test/CodeGen/ARM: > > > > hello.ll updated: 1.4 -> 1.5 > > insn-sched1.ll updated: 1.3 -> 1.4 > > ldm.ll updated: 1.4 -> 1.5 > > --- > > Log message: > > > > Fix test cases. > > > > --- > > Diffs of the changes: (+11 -10) > > > > hello.ll | 17 +++++++++-------- > > insn-sched1.ll | 2 +- > > ldm.ll | 2 +- > > 3 files changed, 11 insertions(+), 10 deletions(-) > > > > > > Index: llvm/test/CodeGen/ARM/hello.ll > > diff -u llvm/test/CodeGen/ARM/hello.ll:1.4 llvm/test/CodeGen/ARM/hello.ll:1.5 > > --- llvm/test/CodeGen/ARM/hello.ll:1.4 Wed Jan 31 07:12:46 2007 > > +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 16:27:07 2007 > > @@ -1,12 +1,13 @@ > > -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && > > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && > > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep mov | wc -l | grep 2 > > +; RUN: llvm-as < %s | llc -march=arm && > > +; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && > > +; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | grep mov | wc -l | grep 2 > > +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 > > > > -%str = internal constant [12 x sbyte] c"Hello World\00" > > + at str = internal constant [12 x i8] c"Hello World\00" > > > > -int %main() { > > - %tmp = call int %puts( sbyte* getelementptr ([12 x sbyte]* %str, int 0, uint 0) ) > > - ret int 0 > > +define i32 @main() { > > + %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) ) ; [#uses=0] > > + ret i32 0 > > } > > > > -declare int %puts(sbyte*) > > +declare i32 @puts(i8*) > > > > > > Index: llvm/test/CodeGen/ARM/insn-sched1.ll > > diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 llvm/test/CodeGen/ARM/insn-sched1.ll:1.4 > > --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 Wed Jan 31 07:12:46 2007 > > +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 16:27:07 2007 > > @@ -1,5 +1,5 @@ > > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && > > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 > > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 2 > > > > int %test(int %x) { > > %tmp = cast int %x to short > > > > > > Index: llvm/test/CodeGen/ARM/ldm.ll > > diff -u llvm/test/CodeGen/ARM/ldm.ll:1.4 llvm/test/CodeGen/ARM/ldm.ll:1.5 > > --- llvm/test/CodeGen/ARM/ldm.ll:1.4 Wed Jan 31 07:12:46 2007 > > +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 16:27:07 2007 > > @@ -1,7 +1,7 @@ > > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && > > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && > > ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && > > -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 > > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 > > > > %X = external global [0 x int] > > > > > > > > > > _______________________________________________ > > 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 > From evan.cheng at apple.com Wed Jan 31 17:17:45 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 17:17:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701312317.l0VNHjCl003093@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.50 -> 1.51 --- Log message: Don't want to add FramePtr to callee save spill list twice. --- Diffs of the changes: (+2 -8) ARMRegisterInfo.cpp | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.50 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.51 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.50 Wed Jan 31 16:25:33 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 17:17:29 2007 @@ -881,13 +881,7 @@ } } - if (hasFP(MF)) { - MF.changePhyRegUsed(FramePtr, true); - NumGPRSpills++; - CanEliminateFrame = false; - } - - if (!CanEliminateFrame) { + if (!CanEliminateFrame || hasFP(MF)) { AFI->setHasStackFrame(true); // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled. @@ -902,7 +896,7 @@ // Darwin ABI requires FP to point to the stack slot that contains the // previous FP. - if (STI.isTargetDarwin()) { + if (STI.isTargetDarwin() || hasFP(MF)) { MF.changePhyRegUsed(FramePtr, true); NumGPRSpills++; } From evan.cheng at apple.com Wed Jan 31 17:23:46 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 15:23:46 -0800 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll In-Reply-To: <1170283286.545.198.camel@bashful.x10sys.com> References: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> <1170283286.545.198.camel@bashful.x10sys.com> Message-ID: I think it's long.ll, right? I am on it now. Evan On Jan 31, 2007, at 2:41 PM, Reid Spencer wrote: > Evan / Lauro, > > I don't know what the issue is, but test/CodeGen/ARM/large-stack.ll is > failing and going into an infinite busy loop in llc. This is > preventing > the dejagnu test suite from completing. > > Reid. > > On Wed, 2007-01-31 at 16:27 -0600, Evan Cheng wrote: >> >> Changes in directory llvm/test/CodeGen/ARM: >> >> hello.ll updated: 1.4 -> 1.5 >> insn-sched1.ll updated: 1.3 -> 1.4 >> ldm.ll updated: 1.4 -> 1.5 >> --- >> Log message: >> >> Fix test cases. >> >> --- >> Diffs of the changes: (+11 -10) >> >> hello.ll | 17 +++++++++-------- >> insn-sched1.ll | 2 +- >> ldm.ll | 2 +- >> 3 files changed, 11 insertions(+), 10 deletions(-) >> >> >> Index: llvm/test/CodeGen/ARM/hello.ll >> diff -u llvm/test/CodeGen/ARM/hello.ll:1.4 llvm/test/CodeGen/ARM/ >> hello.ll:1.5 >> --- llvm/test/CodeGen/ARM/hello.ll:1.4 Wed Jan 31 07:12:46 2007 >> +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 16:27:07 2007 >> @@ -1,12 +1,13 @@ >> -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && >> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | >> grep mov | wc -l | grep 1 && >> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >> darwin --disable-fp-elim | grep mov | wc -l | grep 2 >> +; RUN: llvm-as < %s | llc -march=arm && >> +; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | >> grep 1 && >> +; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | >> grep mov | wc -l | grep 2 >> +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | >> wc -l | grep 2 >> >> -%str = internal constant [12 x sbyte] c"Hello World\00" >> + at str = internal constant [12 x i8] c"Hello World\00" >> >> -int %main() { >> - %tmp = call int %puts( sbyte* getelementptr ([12 x sbyte]* %str, >> int 0, uint 0) ) >> - ret int 0 >> +define i32 @main() { >> + %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 >> 0, i64 0) ) ; [#uses=0] >> + ret i32 0 >> } >> >> -declare int %puts(sbyte*) >> +declare i32 @puts(i8*) >> >> >> Index: llvm/test/CodeGen/ARM/insn-sched1.ll >> diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 llvm/test/CodeGen/ >> ARM/insn-sched1.ll:1.4 >> --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 Wed Jan 31 07:12:46 2007 >> +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 16:27:07 2007 >> @@ -1,5 +1,5 @@ >> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && >> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >> darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 >> +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >> darwin -mattr=+v6 | grep mov | wc -l | grep 2 >> >> int %test(int %x) { >> %tmp = cast int %x to short >> >> >> Index: llvm/test/CodeGen/ARM/ldm.ll >> diff -u llvm/test/CodeGen/ARM/ldm.ll:1.4 llvm/test/CodeGen/ARM/ >> ldm.ll:1.5 >> --- llvm/test/CodeGen/ARM/ldm.ll:1.4 Wed Jan 31 07:12:46 2007 >> +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 16:27:07 2007 >> @@ -1,7 +1,7 @@ >> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && >> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep >> "ldmia" | wc -l | grep 2 && >> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep >> "ldmib" | wc -l | grep 1 && >> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >> darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 >> +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >> darwin | grep "ldmfd sp\!" | wc -l | grep 3 >> >> %X = external global [0 x int] >> >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From clattner at apple.com Wed Jan 31 17:30:22 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 31 Jan 2007 15:30:22 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp In-Reply-To: <200701312230.l0VMUgNr002188@zion.cs.uiuc.edu> References: <200701312230.l0VMUgNr002188@zion.cs.uiuc.edu> Message-ID: On Jan 31, 2007, at 2:30 PM, Reid Spencer wrote: > Instructions.cpp updated: 1.68 -> 1.69 > --- > Log message: > > Fix build breakage by using correct arguments to getIndexedType in the > GEP constructors. Thanks Reid, sorry for the breakage :( -Chris > > > --- > Diffs of the changes: (+10 -6) > > Instructions.cpp | 16 ++++++++++------ > 1 files changed, 10 insertions(+), 6 deletions(-) > > > Index: llvm/lib/VMCore/Instructions.cpp > diff -u llvm/lib/VMCore/Instructions.cpp:1.68 llvm/lib/VMCore/ > Instructions.cpp:1.69 > --- llvm/lib/VMCore/Instructions.cpp:1.68 Wed Jan 31 13:47:18 2007 > +++ llvm/lib/VMCore/Instructions.cpp Wed Jan 31 16:30:26 2007 > @@ -711,7 +711,8 @@ > GetElementPtrInst::GetElementPtrInst(Value *Ptr, const > std::vector &Idx, > const std::string &Name, > Instruction *InBe) > : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > - Idx, > true))), > + &Idx[0], > Idx.size(), > + true))), > GetElementPtr, 0, 0, Name, InBe) { > init(Ptr, &Idx[0], Idx.size()); > } > @@ -719,7 +720,8 @@ > GetElementPtrInst::GetElementPtrInst(Value *Ptr, const > std::vector &Idx, > const std::string &Name, > BasicBlock *IAE) > : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > - Idx, > true))), > + &Idx[0], > Idx.size(), > + true))), > GetElementPtr, 0, 0, Name, IAE) { > init(Ptr, &Idx[0], Idx.size()); > } > @@ -728,7 +730,7 @@ > unsigned NumIdx, > const std::string &Name, > Instruction *InBe) > : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > - Idx, true))), > + Idx, > NumIdx, true))), > GetElementPtr, 0, 0, Name, InBe) { > init(Ptr, Idx, NumIdx); > } > @@ -737,21 +739,23 @@ > unsigned NumIdx, > const std::string &Name, > BasicBlock *IAE) > : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > - Idx, true))), > + Idx, > NumIdx, true))), > GetElementPtr, 0, 0, Name, IAE) { > init(Ptr, Idx, NumIdx); > } > > GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, > const std::string &Name, > Instruction *InBe) > - : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(),Idx))), > + : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > + Idx))), > GetElementPtr, 0, 0, Name, InBe) { > init(Ptr, Idx); > } > > GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, > const std::string &Name, > BasicBlock *IAE) > - : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(),Idx))), > + : Instruction(PointerType::get(checkType(getIndexedType(Ptr- > >getType(), > + Idx))), > GetElementPtr, 0, 0, Name, IAE) { > init(Ptr, Idx); > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Wed Jan 31 17:35:34 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 17:35:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701312335.l0VNZYjb003579@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.17 -> 1.18 --- Log message: Handle an interesting corner case: the constpool_entry being reference is two instructions away, i.e. its address is equal to PC. %r0 = tLDRpci bx CONSTPOOL_ENTRY 0 , 4 --- Diffs of the changes: (+2 -2) ARMConstantIslandPass.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.17 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.18 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.17 Wed Jan 31 13:57:44 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 31 17:35:18 2007 @@ -472,7 +472,7 @@ << " at offset " << int(UserOffset-CPEOffset) << "\t" << *MI); - if (UserOffset < CPEOffset) { + if (UserOffset <= CPEOffset) { // User before the CPE. if (CPEOffset-UserOffset <= MaxDisp) return true; @@ -563,7 +563,7 @@ << " at offset " << int(BrOffset-DestOffset) << "\t" << *MI); - if (BrOffset < DestOffset) { + if (BrOffset <= DestOffset) { if (DestOffset - BrOffset < MaxDisp) return true; } else { From evan.cheng at apple.com Wed Jan 31 17:35:48 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 15:35:48 -0800 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll insn-sched1.ll ldm.ll In-Reply-To: References: <200701312227.l0VMRNrl002112@zion.cs.uiuc.edu> <1170283286.545.198.camel@bashful.x10sys.com> Message-ID: Fixed. Evan On Jan 31, 2007, at 3:23 PM, Evan Cheng wrote: > I think it's long.ll, right? I am on it now. > > Evan > > On Jan 31, 2007, at 2:41 PM, Reid Spencer wrote: > >> Evan / Lauro, >> >> I don't know what the issue is, but test/CodeGen/ARM/large- >> stack.ll is >> failing and going into an infinite busy loop in llc. This is >> preventing >> the dejagnu test suite from completing. >> >> Reid. >> >> On Wed, 2007-01-31 at 16:27 -0600, Evan Cheng wrote: >>> >>> Changes in directory llvm/test/CodeGen/ARM: >>> >>> hello.ll updated: 1.4 -> 1.5 >>> insn-sched1.ll updated: 1.3 -> 1.4 >>> ldm.ll updated: 1.4 -> 1.5 >>> --- >>> Log message: >>> >>> Fix test cases. >>> >>> --- >>> Diffs of the changes: (+11 -10) >>> >>> hello.ll | 17 +++++++++-------- >>> insn-sched1.ll | 2 +- >>> ldm.ll | 2 +- >>> 3 files changed, 11 insertions(+), 10 deletions(-) >>> >>> >>> Index: llvm/test/CodeGen/ARM/hello.ll >>> diff -u llvm/test/CodeGen/ARM/hello.ll:1.4 llvm/test/CodeGen/ARM/ >>> hello.ll:1.5 >>> --- llvm/test/CodeGen/ARM/hello.ll:1.4 Wed Jan 31 07:12:46 2007 >>> +++ llvm/test/CodeGen/ARM/hello.ll Wed Jan 31 16:27:07 2007 >>> @@ -1,12 +1,13 @@ >>> -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && >>> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | >>> grep mov | wc -l | grep 1 && >>> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >>> darwin --disable-fp-elim | grep mov | wc -l | grep 2 >>> +; RUN: llvm-as < %s | llc -march=arm && >>> +; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | >>> grep 1 && >>> +; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | >>> grep mov | wc -l | grep 2 >>> +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | >>> wc -l | grep 2 >>> >>> -%str = internal constant [12 x sbyte] c"Hello World\00" >>> + at str = internal constant [12 x i8] c"Hello World\00" >>> >>> -int %main() { >>> - %tmp = call int %puts( sbyte* getelementptr ([12 x sbyte]* %str, >>> int 0, uint 0) ) >>> - ret int 0 >>> +define i32 @main() { >>> + %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 >>> 0, i64 0) ) ; [#uses=0] >>> + ret i32 0 >>> } >>> >>> -declare int %puts(sbyte*) >>> +declare i32 @puts(i8*) >>> >>> >>> Index: llvm/test/CodeGen/ARM/insn-sched1.ll >>> diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 llvm/test/CodeGen/ >>> ARM/insn-sched1.ll:1.4 >>> --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.3 Wed Jan 31 07:12:46 >>> 2007 >>> +++ llvm/test/CodeGen/ARM/insn-sched1.ll Wed Jan 31 16:27:07 2007 >>> @@ -1,5 +1,5 @@ >>> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && >>> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >>> darwin -mattr=+v6 --disable-fp-elim | grep mov | wc -l | grep 2 >>> +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >>> darwin -mattr=+v6 | grep mov | wc -l | grep 2 >>> >>> int %test(int %x) { >>> %tmp = cast int %x to short >>> >>> >>> Index: llvm/test/CodeGen/ARM/ldm.ll >>> diff -u llvm/test/CodeGen/ARM/ldm.ll:1.4 llvm/test/CodeGen/ARM/ >>> ldm.ll:1.5 >>> --- llvm/test/CodeGen/ARM/ldm.ll:1.4 Wed Jan 31 07:12:46 2007 >>> +++ llvm/test/CodeGen/ARM/ldm.ll Wed Jan 31 16:27:07 2007 >>> @@ -1,7 +1,7 @@ >>> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && >>> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep >>> "ldmia" | wc -l | grep 2 && >>> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep >>> "ldmib" | wc -l | grep 1 && >>> -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >>> darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3 >>> +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple- >>> darwin | grep "ldmfd sp\!" | wc -l | grep 3 >>> >>> %X = external global [0 x int] >>> >>> >>> >>> >>> _______________________________________________ >>> 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 From evan.cheng at apple.com Wed Jan 31 17:39:57 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 17:39:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200701312339.l0VNdv2B003765@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.55 -> 1.56 --- Log message: Don't emit unnecessary .align directive. --- Diffs of the changes: (+1 -3) ARMAsmPrinter.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.55 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.56 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.55 Tue Jan 30 14:37:08 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Wed Jan 31 17:39:39 2007 @@ -694,10 +694,8 @@ } break; default: { - if (InCPMode && AFI->isThumbFunction()) { - EmitAlignment(1); + if (InCPMode && AFI->isThumbFunction()) InCPMode = false; - } switch (Opc) { case ARM::PICADD: case ARM::PICLD: From evan.cheng at apple.com Wed Jan 31 17:51:50 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 17:51:50 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/long.ll Message-ID: <200701312351.l0VNpolu003990@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: long.ll updated: 1.11 -> 1.12 --- Log message: Fix test case. --- Diffs of the changes: (+0 -2) long.ll | 2 -- 1 files changed, 2 deletions(-) Index: llvm/test/CodeGen/ARM/long.ll diff -u llvm/test/CodeGen/ARM/long.ll:1.11 llvm/test/CodeGen/ARM/long.ll:1.12 --- llvm/test/CodeGen/ARM/long.ll:1.11 Fri Jan 26 18:05:14 2007 +++ llvm/test/CodeGen/ARM/long.ll Wed Jan 31 17:51:35 2007 @@ -9,9 +9,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "umull" | wc -l | grep 1 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "mvn" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "adds" | wc -l | grep 1 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "adc" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "subs " | wc -l | grep 1 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "sbc" | wc -l | grep 1 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep "__muldi3" From sabre at nondot.org Wed Jan 31 18:39:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 18:39:12 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll Message-ID: <200702010039.l110dCim004849@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-01-31-InlineAsmAddrMode.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+25 -0) 2007-01-31-InlineAsmAddrMode.ll | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll:1.1 *** /dev/null Wed Jan 31 18:39:06 2007 --- llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll Wed Jan 31 18:38:56 2007 *************** *** 0 **** --- 1,25 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 && + ; RUN: llvm-as < %s | llc -march=ppc64 + + ; Test two things: 1) that a frameidx can be rewritten in an inline asm + ; 2) that inline asms can handle reg+imm addr modes. + + %struct.A = type { i32, i32 } + + implementation ; Functions: + + define void @test1() { + entry: + %Out = alloca %struct.A, align 4 ; <%struct.A*> [#uses=1] + %tmp2 = getelementptr %struct.A* %Out, i32 0, i32 1 + %tmp5 = call i32 asm "lwbrx $0, $1", "=r,m"(i32* %tmp2 ) + ret void + } + + define void @test2() { + entry: + %Out = alloca %struct.A, align 4 ; <%struct.A*> [#uses=1] + %tmp2 = getelementptr %struct.A* %Out, i32 0, i32 0 ; [#uses=1] + %tmp5 = call i32 asm "lwbrx $0, $2, $1", "=r,r,bO,m"( i8* null, i32 0, i32* %tmp2 ) ; [#uses=0] + ret void + } From sabre at nondot.org Wed Jan 31 18:39:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 18:39:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCRegisterInfo.cpp Message-ID: <200702010039.l110dOtL004861@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.232 -> 1.233 PPCRegisterInfo.cpp updated: 1.103 -> 1.104 --- Log message: Fix CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll --- Diffs of the changes: (+7 -1) PPCAsmPrinter.cpp | 5 ++++- PPCRegisterInfo.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.232 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.233 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.232 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed Jan 31 18:39:08 2007 @@ -436,7 +436,10 @@ const char *ExtraCode) { if (ExtraCode && ExtraCode[0]) return true; // Unknown modifier. - printMemRegReg(MI, OpNo); + if (MI->getOperand(OpNo).isRegister()) + printMemRegReg(MI, OpNo); + else + printMemRegImm(MI, OpNo); return false; } Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.103 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.104 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.103 Mon Jan 29 17:20:22 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Wed Jan 31 18:39:08 2007 @@ -522,6 +522,9 @@ } // Take into account whether it's an add or mem instruction unsigned OffIdx = (i == 2) ? 1 : 2; + if (MI.getOpcode() == TargetInstrInfo::INLINEASM) + OffIdx = i-1; + // Get the frame index. int FrameIndex = MI.getOperand(i).getFrameIndex(); From evan.cheng at apple.com Wed Jan 31 19:08:04 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 19:08:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README-Thumb.txt Message-ID: <200702010108.l11184F5005484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README-Thumb.txt updated: 1.3 -> 1.4 --- Log message: Possible JT improvements. --- Diffs of the changes: (+43 -3) README-Thumb.txt | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 43 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/README-Thumb.txt diff -u llvm/lib/Target/ARM/README-Thumb.txt:1.3 llvm/lib/Target/ARM/README-Thumb.txt:1.4 --- llvm/lib/Target/ARM/README-Thumb.txt:1.3 Wed Jan 31 16:11:38 2007 +++ llvm/lib/Target/ARM/README-Thumb.txt Wed Jan 31 19:07:48 2007 @@ -16,10 +16,50 @@ and cmp instructions can use high registers. Also, we can use them as temporaries to spill values into. +* In thumb mode, short, byte, and bool preferred alignments are currently set + to 4 to accommodate ISA restriction (i.e. add sp, #imm, imm must be multiple + of 4). + +//===---------------------------------------------------------------------===// + +Potential jumptable improvements: + * If we know function size is less than (1 << 16) * 2 bytes, we can use 16-bit jumptable entries (e.g. (L1 - L2) >> 1). Or even smaller entries if the function is even smaller. This also applies to ARM. -* In thumb mode, short, byte, and bool preferred alignments are currently set - to 4 to accommodate ISA restriction (i.e. add sp, #imm, imm must be multiple - of 4). +* Thumb jumptable codegen can improve given some help from the assembler. This + is what we generate right now: + + .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) +LPCRELL0: + mov r1, #PCRELV0 + add r1, pc + ldr r0, [r0, r1] + cpy pc, r0 + .align 2 +LJTI1_0_0: + .long LBB1_3 + ... + +Note there is another pc relative add that we can take advantage of. + add r1, pc, #imm_8 * 4 + +We should be able to generate: + +LPCRELL0: + add r1, LJTI1_0_0 + ldr r0, [r0, r1] + cpy pc, r0 + .align 2 +LJTI1_0_0: + .long LBB1_3 + +if the assembler can translate the add to: + add r1, pc, #((LJTI1_0_0-(LPCRELL0+4))&0xfffffffc) + +Note the assembler also does something similar to constpool load: +LPCRELL0: + ldr r0, LCPI1_0 +=> + ldr r0, pc, #((LCPI1_0-(LPCRELL0+4))&0xfffffffc) From evan.cheng at apple.com Wed Jan 31 19:10:03 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 19:10:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200702010110.l111A3X8005560@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.18 -> 1.19 --- Log message: Pessmistically assume the .align 2 before the first constpool entry adds two bytes padding. --- Diffs of the changes: (+12 -2) ARMConstantIslandPass.cpp | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.18 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.19 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.18 Wed Jan 31 17:35:18 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 31 19:09:47 2007 @@ -339,6 +339,13 @@ break; } } + + // In thumb mode, if this block is a constpool island, pessmisticly assume + // it needs to be padded by two byte so it's aligned on 4 byte boundary. + if (AFI->isThumbFunction() && + MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY) + MBBSize += 2; + BBSizes.push_back(MBBSize); } } @@ -465,8 +472,11 @@ unsigned MaxDisp) { unsigned PCAdj = AFI->isThumbFunction() ? 4 : 8; unsigned UserOffset = GetOffsetOf(MI) + PCAdj; - unsigned CPEOffset = GetOffsetOf(CPEMI); - + // In thumb mode, pessmisticly assumes the .align 2 before the first CPE + // in the island adds two byte padding. + unsigned AlignAdj = AFI->isThumbFunction() ? 2 : 0; + unsigned CPEOffset = GetOffsetOf(CPEMI) + AlignAdj; + DEBUG(std::cerr << "User of CPE#" << CPEMI->getOperand(0).getImm() << " max delta=" << MaxDisp << " at offset " << int(UserOffset-CPEOffset) << "\t" From dpatel at apple.com Wed Jan 31 19:19:13 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 31 Jan 2007 19:19:13 -0600 Subject: [llvm-commits] CVS: llvm/tools/lto/Makefile Message-ID: <200702010119.l111JDN1005754@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: Makefile updated: 1.7 -> 1.8 --- Log message: Include Makefile.config before testing OS. --- Diffs of the changes: (+5 -5) Makefile | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/tools/lto/Makefile diff -u llvm/tools/lto/Makefile:1.7 llvm/tools/lto/Makefile:1.8 --- llvm/tools/lto/Makefile:1.7 Mon Jan 8 00:25:29 2007 +++ llvm/tools/lto/Makefile Wed Jan 31 19:18:57 2007 @@ -10,6 +10,11 @@ LEVEL = ../.. LIBRARYNAME = LLVMlto +# Include this here so we can get the configuration of the targets +# that have been configured for construction. We have to do this +# early so we can set up LINK_COMPONENTS before includeing Makefile.rules +include $(LEVEL)/Makefile.config + LINK_LIBS_IN_SHARED = 1 ifeq ($(OS),Darwin) SHARED_LIBRARY = 1 @@ -19,11 +24,6 @@ BUILD_ARCHIVE = 1 endif -# Include this here so we can get the configuration of the targets -# that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before includeing Makefile.rules -include $(LEVEL)/Makefile.config - LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bcreader bcwriter include $(LEVEL)/Makefile.common From sabre at nondot.org Wed Jan 31 19:21:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 19:21:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702010121.l111LRVC005820@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.352 -> 1.353 --- Log message: Emit a better assertion message for PR1133: http://llvm.org/PR1133 --- Diffs of the changes: (+18 -15) SelectionDAGISel.cpp | 33 ++++++++++++++++++--------------- 1 files changed, 18 insertions(+), 15 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.352 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.353 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.352 Tue Jan 30 14:08:37 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jan 31 19:21:12 2007 @@ -2663,23 +2663,26 @@ unsigned NumOps = cast(AsmNodeOperands[CurOp])->getValue(); - assert((NumOps & 7) == 2 /*REGDEF*/ && - "Skipped past definitions?"); + if ((NumOps & 7) == 2 /*REGDEF*/) { + // Add NumOps>>3 registers to MatchedRegs. + RegsForValue MatchedRegs; + MatchedRegs.ValueVT = InOperandVal.getValueType(); + MatchedRegs.RegVT = AsmNodeOperands[CurOp+1].getValueType(); + for (unsigned i = 0, e = NumOps>>3; i != e; ++i) { + unsigned Reg = + cast(AsmNodeOperands[++CurOp])->getReg(); + MatchedRegs.Regs.push_back(Reg); + } - // Add NumOps>>3 registers to MatchedRegs. - RegsForValue MatchedRegs; - MatchedRegs.ValueVT = InOperandVal.getValueType(); - MatchedRegs.RegVT = AsmNodeOperands[CurOp+1].getValueType(); - for (unsigned i = 0, e = NumOps>>3; i != e; ++i) { - unsigned Reg=cast(AsmNodeOperands[++CurOp])->getReg(); - MatchedRegs.Regs.push_back(Reg); + // Use the produced MatchedRegs object to + MatchedRegs.getCopyToRegs(InOperandVal, DAG, Chain, Flag, + TLI.getPointerTy()); + MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, DAG, AsmNodeOperands); + break; + } else { + assert((NumOps & 7) == 4/*MEM*/ && "Unknown matching constraint!"); + assert(0 && "matching constraints for memory operands unimp"); } - - // Use the produced MatchedRegs object to - MatchedRegs.getCopyToRegs(InOperandVal, DAG, Chain, Flag, - TLI.getPointerTy()); - MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, DAG, AsmNodeOperands); - break; } TargetLowering::ConstraintType CTy = TargetLowering::C_RegisterClass; From dpatel at apple.com Wed Jan 31 19:43:55 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 31 Jan 2007 19:43:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200702010143.l111hteW006248@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.81 -> 1.82 --- Log message: Add PrintVersionMessage() that tools can use to print version number without exiting program. --- Diffs of the changes: (+11 -3) CommandLine.cpp | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.81 llvm/lib/Support/CommandLine.cpp:1.82 --- llvm/lib/Support/CommandLine.cpp:1.81 Thu Dec 7 17:41:45 2006 +++ llvm/lib/Support/CommandLine.cpp Wed Jan 31 19:43:37 2007 @@ -980,9 +980,7 @@ namespace { class VersionPrinter { public: - void operator=(bool OptionWasSpecified) { - if (OptionWasSpecified) { - if (OverrideVersionPrinter == 0) { + void print() { cout << "Low Level Virtual Machine (http://llvm.org/):\n"; cout << " " << PACKAGE_NAME << " version " << PACKAGE_VERSION; #ifdef LLVM_VERSION_INFO @@ -998,6 +996,11 @@ cout << " with assertions"; #endif cout << ".\n"; + } + void operator=(bool OptionWasSpecified) { + if (OptionWasSpecified) { + if (OverrideVersionPrinter == 0) { + print(); Options->clear(); // Don't bother making option dtors remove from map. exit(1); } else { @@ -1028,6 +1031,11 @@ NormalPrinter = true; } +/// Utility function for printing version number. +void cl::PrintVersionMessage() { + VersionPrinterInstance.print(); +} + void cl::SetVersionPrinter(void (*func)()) { OverrideVersionPrinter = func; } From dpatel at apple.com Wed Jan 31 19:43:56 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 31 Jan 2007 19:43:56 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h Message-ID: <200702010143.l111huqH006253@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.57 -> 1.58 --- Log message: Add PrintVersionMessage() that tools can use to print version number without exiting program. --- Diffs of the changes: (+1 -0) CommandLine.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.57 llvm/include/llvm/Support/CommandLine.h:1.58 --- llvm/include/llvm/Support/CommandLine.h:1.57 Thu Oct 12 18:50:28 2006 +++ llvm/include/llvm/Support/CommandLine.h Wed Jan 31 19:43:37 2007 @@ -1281,6 +1281,7 @@ extrahelp(const char* help); }; +void PrintVersionMessage(); // This function just prints the help message, exactly the same way as if the // --help option had been given on the command line. // NOTE: THIS FUNCTION TERMINATES THE PROGRAM! From dpatel at apple.com Wed Jan 31 19:46:23 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 31 Jan 2007 19:46:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200702010146.l111kNPH006352@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.32 -> 1.33 --- Log message: Add printVersion(). Linker can use it to print LLVM version number. --- Diffs of the changes: (+4 -0) lto.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.32 llvm/tools/lto/lto.cpp:1.33 --- llvm/tools/lto/lto.cpp:1.32 Tue Jan 30 14:08:39 2007 +++ llvm/tools/lto/lto.cpp Wed Jan 31 19:46:06 2007 @@ -457,6 +457,10 @@ return LTO_OPT_SUCCESS; } +void LTO::printVersion() { + cl::PrintVersionMessage(); +} + /// Unused pure-virtual destructor. Must remain empty. LinkTimeOptimizer::~LinkTimeOptimizer() {} From dpatel at apple.com Wed Jan 31 19:46:24 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 31 Jan 2007 19:46:24 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkTimeOptimizer.h Message-ID: <200702010146.l111kOYH006359@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkTimeOptimizer.h updated: 1.12 -> 1.13 --- Log message: Add printVersion(). Linker can use it to print LLVM version number. --- Diffs of the changes: (+2 -0) LinkTimeOptimizer.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/LinkTimeOptimizer.h diff -u llvm/include/llvm/LinkTimeOptimizer.h:1.12 llvm/include/llvm/LinkTimeOptimizer.h:1.13 --- llvm/include/llvm/LinkTimeOptimizer.h:1.12 Thu Oct 26 15:46:22 2006 +++ llvm/include/llvm/LinkTimeOptimizer.h Wed Jan 31 19:46:06 2007 @@ -96,6 +96,7 @@ const char *) = 0; virtual void getTargetTriple(const std::string &, std::string &) = 0; virtual void removeModule (const std::string &InputFilename) = 0; + virtual void printVersion () = 0; virtual ~LinkTimeOptimizer() = 0; }; @@ -119,6 +120,7 @@ void getTargetTriple(const std::string &InputFilename, std::string &targetTriple); void removeModule (const std::string &InputFilename); + void printVersion(); // Constructors and destructors LTO() { From rspencer at reidspencer.com Wed Jan 31 19:49:47 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 01 Feb 2007 01:49:47 +0000 Subject: [llvm-commits] One more ARM failure Message-ID: <1170294587.545.227.camel@bashful.x10sys.com> The llc infinite loop in long.ll appears to be fixed. But, now I have the one below failing on x86-pc-linux-gnu. Please fix or XFAIL. FAIL: /proj/llvm/llvm-4/test/CodeGen/ARM/large-stack.ll: child process exited abnormally .text .globl test1 .align 2 test1: sub sp, sp, #1, 24 @ 256 add sp, sp, #1, 24 @ 256 bx lr .size test1, .-test1 .globl test2 .align 2 test2: sub sp, sp, #72 sub sp, sp, #1, 20 @ 4096 add sp, sp, #72 add sp, sp, #1, 20 @ 4096 bx lr .size test2, .-test2 .globl test3 .align 2 test3: sub sp, sp, #16 sub sp, sp, #3, 4 @ 805306368 mov r0, #0 add r12, sp, #3, 4 @ 805306368 str r0, [r12, #+8] add sp, sp, #16 add sp, sp, #3, 4 @ 805306368 bx lr .size test3, .-test3 .text .globl test1 .align 1 .code 16 .thumb_func test1 test1: sub sp, #64 * 4 add sp, #64 * 4 bx lr .size test1, .-test1 .globl test2 .align 1 .code 16 .thumb_func test2 test2: cpy r12, r3 ldr r3, .CPI2_0 add sp, r3 cpy r3, r12 cpy r12, r3 ldr r3, .CPI2_1 add sp, r3 cpy r3, r12 bx lr .BB2_1: .align 2 .CPI2_0: .long 4294963128 .CPI2_1: .long 4168 .size test2, .-test2 .globl test3 .align 1 .code 16 .thumb_func test3 test3: cpy r12, r3 ldr r3, .CPI3_0 add sp, r3 cpy r3, r12 mov r0, #0 ldr r3, .CPI3_2 add r3, sp str r0, [r3, #2 * 4] cpy r12, r3 ldr r3, .CPI3_1 add sp, r3 cpy r3, r12 bx lr .BB3_1: .align 2 .CPI3_0: .long 3489660912 .CPI3_1: .long 805306384 .CPI3_2: .long 805306368 .size test3, .-test3 From evan.cheng at apple.com Wed Jan 31 19:50:02 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 19:50:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td ARMRegisterInfo.cpp Message-ID: <200702010150.l111o2on006447@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.11 -> 1.12 ARMRegisterInfo.cpp updated: 1.51 -> 1.52 --- Log message: Special epilogue for vararg functions. We cannot do a pop to pc because there follows a sp increment for the va register save region. Instead issue a separate pop to another register, increment sp, and then return: pop {r4, r5, r6, r7} pop {r3} add sp, #3 * 4 bx r3 --- Diffs of the changes: (+24 -5) ARMInstrThumb.td | 5 ++++- ARMRegisterInfo.cpp | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.11 llvm/lib/Target/ARM/ARMInstrThumb.td:1.12 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.11 Wed Jan 31 14:12:31 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Wed Jan 31 19:49:46 2007 @@ -165,8 +165,11 @@ // Control Flow Instructions. // -let isReturn = 1, isTerminator = 1 in +let isReturn = 1, isTerminator = 1 in { def tBX_RET : TI<(ops), "bx lr", [(ARMretflag)]>; + // Alternative return instruction used by vararg functions. + def tBX_RET_vararg : TI<(ops GPR:$dst), "bx $dst", []>; +} // FIXME: remove when we have a way to marking a MI with these properties. let isLoad = 1, isReturn = 1, isTerminator = 1 in Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.51 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.52 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.51 Wed Jan 31 17:17:29 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 19:49:46 2007 @@ -104,11 +104,15 @@ if (!AFI->isThumbFunction() || CSI.empty()) return false; + bool isVarArg = AFI->getVarArgsRegSaveSize() > 0; MachineInstr *PopMI = new MachineInstr(TII.get(ARM::tPOP)); MBB.insert(MI, PopMI); for (unsigned i = CSI.size(); i != 0; --i) { unsigned Reg = CSI[i-1].getReg(); if (Reg == ARM::LR) { + // Special epilogue for vararg functions. See emitEpilogue + if (isVarArg) + continue; Reg = ARM::PC; PopMI->setInstrDescriptor(TII.get(ARM::tPOP_RET)); MBB.erase(MI); @@ -1115,9 +1119,15 @@ NumBytes -= (AFI->getGPRCalleeSavedArea1Size() + AFI->getGPRCalleeSavedArea2Size() + AFI->getDPRCalleeSavedAreaSize()); - if (isThumb) - emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); - else { + if (isThumb) { + if (MBBI->getOpcode() == ARM::tBX_RET && + &MBB.front() != MBBI && + prior(MBBI)->getOpcode() == ARM::tPOP) { + MachineBasicBlock::iterator PMBBI = prior(MBBI); + emitSPUpdate(MBB, PMBBI, NumBytes, isThumb, TII); + } else + emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); + } else { // Darwin ABI requires FP to point to the stack slot that contains the // previous FP. if (STI.isTargetDarwin() || hasFP(MF)) { @@ -1149,8 +1159,14 @@ emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea1Size(), false, TII); } - if (VARegSaveSize) + if (VARegSaveSize) { + // Epilogue for vararg functions: pop LR to R3 and branch off it. + // FIXME: Verify this is still ok when R3 is no longer being reserved. + BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3); emitSPUpdate(MBB, MBBI, VARegSaveSize, isThumb, TII); + BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3); + MBB.erase(MBBI); + } } unsigned ARMRegisterInfo::getRARegister() const { From evan.cheng at apple.com Wed Jan 31 19:56:59 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 19:56:59 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/vargs2.ll Message-ID: <200702010156.l111ux9X006649@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: vargs2.ll updated: 1.5 -> 1.6 --- Log message: Added a thumb vararg test. --- Diffs of the changes: (+4 -1) vargs2.ll | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/vargs2.ll diff -u llvm/test/CodeGen/ARM/vargs2.ll:1.5 llvm/test/CodeGen/ARM/vargs2.ll:1.6 --- llvm/test/CodeGen/ARM/vargs2.ll:1.5 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/vargs2.ll Wed Jan 31 19:56:43 2007 @@ -1,4 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm %% +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -enable-thumb | grep pop | wc -l | grep 2 + %str = internal constant [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1] implementation ; Functions: From evan.cheng at apple.com Wed Jan 31 20:18:52 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 20:18:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp ARMTargetMachine.cpp Message-ID: <200702010218.l112IqIF007088@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.52 -> 1.53 ARMTargetMachine.cpp updated: 1.19 -> 1.20 --- Log message: Also set alignment of stack-based structs to 4 in thumb mode. --- Diffs of the changes: (+7 -8) ARMRegisterInfo.cpp | 3 +-- ARMTargetMachine.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.52 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.53 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.52 Wed Jan 31 19:49:46 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Jan 31 20:18:36 2007 @@ -708,8 +708,7 @@ } Offset += InstrOffs * Scale; - assert((Scale == 1 || (Offset & (Scale-1)) == 0) && - "Can't encode this offset!"); + assert((Offset & (Scale-1)) == 0 && "Can't encode this offset!"); if (Offset < 0) { Offset = -Offset; isSub = true; Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.19 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.19 Wed Jan 31 16:08:40 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Wed Jan 31 20:18:36 2007 @@ -35,12 +35,12 @@ ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : Subtarget(M, FS), DataLayout(Subtarget.isTargetDarwin() ? - (Subtarget.isThumb() ? - std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32") : - std::string("e-p:32:32-d:32:32-l:32:32")) : - (Subtarget.isThumb() ? - std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B:8:32") : - std::string("e-p:32:32-d:32:64-l:32:64"))), + (Subtarget.isThumb() ? + std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") : + std::string("e-p:32:32-d:32:32-l:32:32")) : + (Subtarget.isThumb() ? + std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B:8:32-A:32") : + std::string("e-p:32:32-d:32:64-l:32:64"))), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From evan.cheng at apple.com Wed Jan 31 20:27:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 20:27:40 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll Message-ID: <200702010227.l112ReVH007286@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-01-31-RegInfoAssert.ll added (r1.1) --- Log message: Add a test case. --- Diffs of the changes: (+16 -0) 2007-01-31-RegInfoAssert.ll | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll:1.1 *** /dev/null Wed Jan 31 20:27:34 2007 --- llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll Wed Jan 31 20:27:24 2007 *************** *** 0 **** --- 1,16 ---- + ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -enable-thumb + + %struct.rtx_def = type { i8 } + @str = external global [7 x i8] + + define void @f1() { + %D = alloca %struct.rtx_def, align 1 + %tmp1 = bitcast %struct.rtx_def* %D to i32* + %tmp7 = load i32* %tmp1 + %tmp14 = lshr i32 %tmp7, i8 1 + %tmp1415 = and i32 %tmp14, 1 + call void (i32, ...)* @printf( i32 undef, i32 0, i32 %tmp1415 ) + ret void + } + + declare void @printf(i32, ...) From evan.cheng at apple.com Wed Jan 31 20:46:36 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 20:46:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README-Thumb.txt Message-ID: <200702010246.l112kalh007698@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README-Thumb.txt updated: 1.4 -> 1.5 --- Log message: Add a note. --- Diffs of the changes: (+61 -0) README-Thumb.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+) Index: llvm/lib/Target/ARM/README-Thumb.txt diff -u llvm/lib/Target/ARM/README-Thumb.txt:1.4 llvm/lib/Target/ARM/README-Thumb.txt:1.5 --- llvm/lib/Target/ARM/README-Thumb.txt:1.4 Wed Jan 31 19:07:48 2007 +++ llvm/lib/Target/ARM/README-Thumb.txt Wed Jan 31 20:46:20 2007 @@ -63,3 +63,64 @@ ldr r0, LCPI1_0 => ldr r0, pc, #((LCPI1_0-(LPCRELL0+4))&0xfffffffc) + + +//===---------------------------------------------------------------------===// + +We compiles the following using a jump table. + +define i16 @func_entry_2E_ce(i32 %i) { +newFuncRoot: + br label %entry.ce + +bb12.exitStub: ; preds = %entry.ce + ret i16 0 + +bb4.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce + ret i16 1 + +bb9.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce + ret i16 2 + +bb.exitStub: ; preds = %entry.ce + ret i16 3 + +entry.ce: ; preds = %newFuncRoot + switch i32 %i, label %bb12.exitStub [ + i32 0, label %bb4.exitStub + i32 1, label %bb9.exitStub + i32 2, label %bb4.exitStub + i32 3, label %bb4.exitStub + i32 7, label %bb9.exitStub + i32 8, label %bb.exitStub + i32 9, label %bb9.exitStub + ] +} + +gcc compiles to: + + cmp r0, #9 + @ lr needed for prologue + bhi L2 + ldr r3, L11 + mov r2, #1 + mov r1, r2, asl r0 + ands r0, r3, r2, asl r0 + movne r0, #2 + bxne lr + tst r1, #13 + beq L9 +L3: + mov r0, r2 + bx lr +L9: + tst r1, #256 + movne r0, #3 + bxne lr +L2: + mov r0, #0 + bx lr +L12: + .align 2 +L11: + .long 642 From evan.cheng at apple.com Wed Jan 31 21:05:04 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 31 Jan 2007 21:05:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td Message-ID: <200702010305.l11354PV008055@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.12 -> 1.13 --- Log message: .set pc relative displacement bug: label should be moved down one instruction to just before the add r1, pc: Before: .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) LPCRELL0: mov r1, #PCRELV0 add r1, pc Now: .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) mov r1, #PCRELV0 LPCRELL0: add r1, pc --- Diffs of the changes: (+6 -6) ARMInstrThumb.td | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.12 llvm/lib/Target/ARM/ARMInstrThumb.td:1.13 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.12 Wed Jan 31 19:49:46 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Wed Jan 31 21:04:49 2007 @@ -480,17 +480,17 @@ // assembler. def tLEApcrel : TIx2<(ops GPR:$dst, i32imm:$label), !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(", - "${:private}PCRELL${:uid}+4))\n"), - !strconcat("${:private}PCRELL${:uid}:\n\t", - "mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), + "${:private}PCRELL${:uid}+6))\n"), + !strconcat("\tmov $dst, #PCRELV${:uid}\n", + "${:private}PCRELL${:uid}:\n\tadd $dst, pc")), []>; def tLEApcrelJT : TIx2<(ops GPR:$dst, i32imm:$label, i32imm:$id), !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(", "${:private}PCRELL${:uid}+4))\n"), - !strconcat("${:private}PCRELL${:uid}:\n\t", - "mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), - []>; + !strconcat("\tmov $dst, #PCRELV${:uid}\n", + "${:private}PCRELL${:uid}:\n\tadd $dst, pc")), + []>; //===----------------------------------------------------------------------===// // Non-Instruction Patterns From clattner at apple.com Wed Jan 31 21:31:47 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 31 Jan 2007 19:31:47 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README-Thumb.txt In-Reply-To: <200702010246.l112kalh007698@zion.cs.uiuc.edu> References: <200702010246.l112kalh007698@zion.cs.uiuc.edu> Message-ID: <65ACC3D1-34A1-4F76-8E1F-216C9A37B4C1@apple.com> > +// > ===------------------------------------------------------------------- > --===// > + > +We compiles the following using a jump table. This is the target-independent "shift trick", which applies any time you have a small number of unique destinations, and a spread smaller than your GPR size. -Chris > +define i16 @func_entry_2E_ce(i32 %i) { > +newFuncRoot: > + br label %entry.ce > + > +bb12.exitStub: ; preds = %entry.ce > + ret i16 0 > + > +bb4.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce > + ret i16 1 > + > +bb9.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce > + ret i16 2 > + > +bb.exitStub: ; preds = %entry.ce > + ret i16 3 > + > +entry.ce: ; preds = %newFuncRoot > + switch i32 %i, label %bb12.exitStub [ > + i32 0, label %bb4.exitStub > + i32 1, label %bb9.exitStub > + i32 2, label %bb4.exitStub > + i32 3, label %bb4.exitStub > + i32 7, label %bb9.exitStub > + i32 8, label %bb.exitStub > + i32 9, label %bb9.exitStub > + ] > +} > + > +gcc compiles to: > + > + cmp r0, #9 > + @ lr needed for prologue > + bhi L2 > + ldr r3, L11 > + mov r2, #1 > + mov r1, r2, asl r0 > + ands r0, r3, r2, asl r0 > + movne r0, #2 > + bxne lr > + tst r1, #13 > + beq L9 > +L3: > + mov r0, r2 > + bx lr > +L9: > + tst r1, #256 > + movne r0, #3 > + bxne lr > +L2: > + mov r0, #0 > + bx lr > +L12: > + .align 2 > +L11: > + .long 642 > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Wed Jan 31 22:56:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 22:56:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ScheduleDAGRRList.cpp ScheduleDAGSimple.cpp SelectionDAG.cpp SelectionDAGISel.cpp TargetLowering.cpp Message-ID: <200702010456.l114uFxo009969@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.463 -> 1.464 ScheduleDAGRRList.cpp updated: 1.25 -> 1.26 ScheduleDAGSimple.cpp updated: 1.23 -> 1.24 SelectionDAG.cpp updated: 1.379 -> 1.380 SelectionDAGISel.cpp updated: 1.353 -> 1.354 TargetLowering.cpp updated: 1.87 -> 1.88 --- Log message: Fit in 80 columns --- Diffs of the changes: (+19 -15) LegalizeDAG.cpp | 8 ++++---- ScheduleDAGRRList.cpp | 12 +++++++----- ScheduleDAGSimple.cpp | 4 ++-- SelectionDAG.cpp | 6 ++++-- SelectionDAGISel.cpp | 2 +- TargetLowering.cpp | 2 +- 6 files changed, 19 insertions(+), 15 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.463 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.464 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.463 Wed Jan 31 03:29:11 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jan 31 22:55:59 2007 @@ -1516,7 +1516,7 @@ Tmp2 = LegalizeOp(Load.getValue(1)); break; } - assert(ExtType != ISD::EXTLOAD && "EXTLOAD should always be supported!"); + assert(ExtType != ISD::EXTLOAD &&"EXTLOAD should always be supported!"); // Turn the unsupported load into an EXTLOAD followed by an explicit // zero/sign extend inreg. Result = DAG.getExtLoad(ISD::EXTLOAD, Node->getValueType(0), @@ -1649,7 +1649,7 @@ // type should be returned by reference! SDOperand Lo, Hi; SplitVectorOp(Tmp2, Lo, Hi); - Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3, Hi, Tmp3); + Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3, Hi,Tmp3); Result = LegalizeOp(Result); } } @@ -4689,7 +4689,7 @@ ISD::LoadExtType ExtType = LD->getExtensionType(); if (ExtType == ISD::NON_EXTLOAD) { - Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), LD->getSrcValueOffset()); + Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(),LD->getSrcValueOffset()); if (VT == MVT::f32 || VT == MVT::f64) { // f32->i32 or f64->i64 one to one expansion. // Remember that we legalized the chain. @@ -4705,7 +4705,7 @@ Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, getIntPtrConstant(IncrementSize)); // FIXME: This creates a bogus srcvalue! - Hi = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), LD->getSrcValueOffset()); + Hi = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(),LD->getSrcValueOffset()); // Build a factor node to remember that this load is independent of the // other one. Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.25 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.26 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.25 Mon Jan 8 17:55:53 2007 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed Jan 31 22:55:59 2007 @@ -696,7 +696,8 @@ /// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number. /// Smaller number is the higher priority. template -unsigned BURegReductionPriorityQueue::CalcNodeSethiUllmanNumber(const SUnit *SU) { +unsigned BURegReductionPriorityQueue:: +CalcNodeSethiUllmanNumber(const SUnit *SU) { unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum]; if (SethiUllmanNumber != 0) return SethiUllmanNumber; @@ -805,7 +806,8 @@ /// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number. /// Smaller number is the higher priority. template -unsigned TDRegReductionPriorityQueue::CalcNodeSethiUllmanNumber(const SUnit *SU) { +unsigned TDRegReductionPriorityQueue:: +CalcNodeSethiUllmanNumber(const SUnit *SU) { unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum]; if (SethiUllmanNumber != 0) return SethiUllmanNumber; @@ -816,8 +818,8 @@ else if (SU->NumSuccsLeft == 0) // If SU does not have a use, i.e. it doesn't produce a value that would // be consumed (e.g. store), then it terminates a chain of computation. - // Give it a small SethiUllman number so it will be scheduled right before its - // predecessors that it doesn't lengthen their live ranges. + // Give it a small SethiUllman number so it will be scheduled right before + // its predecessors that it doesn't lengthen their live ranges. SethiUllmanNumber = 0; else if (SU->NumPredsLeft == 0 && (Opc != ISD::CopyFromReg || isCopyFromLiveIn(SU))) @@ -868,6 +870,6 @@ SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), false, - new TDRegReductionPriorityQueue()); + new TDRegReductionPriorityQueue()); } Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.23 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.24 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.23 Sun Dec 17 05:15:53 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Wed Jan 31 22:55:59 2007 @@ -277,7 +277,7 @@ /// ResourceTally - Manages the use of resources over time intervals. Each /// item (slot) in the tally vector represents the resources used at a given /// moment. A bit set to 1 indicates that a resource is in use, otherwise -/// available. An assumption is made that the tally is large enough to schedule +/// available. An assumption is made that the tally is large enough to schedule /// all current instructions (asserts otherwise.) /// template @@ -377,7 +377,7 @@ // Try at cursor, if successful return position. if (FindAndReserveStages(Cursor, StageBegin, StageEnd)) return Cursor; // Locate a better position - Cursor = RetrySlot(Cursor + 1, StageBegin->Cycles, StageBegin->Units); + Cursor = RetrySlot(Cursor + 1, StageBegin->Cycles, StageBegin->Units); } } Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.379 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.380 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.379 Mon Jan 29 16:58:52 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jan 31 22:55:59 2007 @@ -1577,7 +1577,8 @@ } SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, - SDOperand Chain, SDOperand Ptr, const Value *SV, + SDOperand Chain, SDOperand Ptr, + const Value *SV, int SVOffset, MVT::ValueType EVT, bool isVolatile) { // If they are asking for an extending load from/to the same thing, return a @@ -2228,7 +2229,8 @@ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3) { + SDOperand Op1, SDOperand Op2, + SDOperand Op3) { return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.353 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.354 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.353 Wed Jan 31 19:21:12 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jan 31 22:55:59 2007 @@ -3216,7 +3216,7 @@ // Figure out if there is a Packed type corresponding to this Vector // type. If so, convert to the packed type. - MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems); + MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy),NumElems); if (TVT != MVT::Other && isTypeLegal(TVT)) { // Insert a VBIT_CONVERT of the FORMAL_ARGUMENTS to a // "N x PTyElementVT" MVT::Vector type. Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.87 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.88 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.87 Wed Jan 31 03:29:11 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jan 31 22:55:59 2007 @@ -715,7 +715,7 @@ // If none of the top bits are demanded, convert this into an any_extend. if (NewBits == 0) - return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::ANY_EXTEND,Op.getValueType(), + return TLO.CombineTo(Op,TLO.DAG.getNode(ISD::ANY_EXTEND,Op.getValueType(), Op.getOperand(0))); // Since some of the sign extended bits are demanded, we know that the sign From sabre at nondot.org Wed Jan 31 22:57:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 22:57:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp Message-ID: <200702010457.l114vGdi010031@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: DynamicLibrary.cpp updated: 1.23 -> 1.24 --- Log message: silence warning --- Diffs of the changes: (+1 -0) DynamicLibrary.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/System/DynamicLibrary.cpp diff -u llvm/lib/System/DynamicLibrary.cpp:1.23 llvm/lib/System/DynamicLibrary.cpp:1.24 --- llvm/lib/System/DynamicLibrary.cpp:1.23 Fri Jan 19 16:04:24 2007 +++ llvm/lib/System/DynamicLibrary.cpp Wed Jan 31 22:57:00 2007 @@ -49,6 +49,7 @@ static bool did_initialize_ltdl = false; if (!did_initialize_ltdl) { int Err = lt_dlinit(); + Err = Err; // Silence warning. assert(0 == Err && "Can't init the ltdl library"); did_initialize_ltdl = true; } From sabre at nondot.org Wed Jan 31 22:59:53 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 22:59:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200702010459.l114xr9T010115@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.69 -> 1.70 --- Log message: silence some warnings when assertions are disabled. --- Diffs of the changes: (+8 -2) Instructions.cpp | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.69 llvm/lib/VMCore/Instructions.cpp:1.70 --- llvm/lib/VMCore/Instructions.cpp:1.69 Wed Jan 31 16:30:26 2007 +++ llvm/lib/VMCore/Instructions.cpp Wed Jan 31 22:59:37 2007 @@ -203,6 +203,7 @@ const FunctionType *FTy = cast(cast(Func->getType())->getElementType()); + FTy = FTy; // silence warning. assert((Params.size() == FTy->getNumParams() || (FTy->isVarArg() && Params.size() > FTy->getNumParams())) && @@ -224,6 +225,7 @@ const FunctionType *FTy = cast(cast(Func->getType())->getElementType()); + FTy = FTy; // silence warning. assert((FTy->getNumParams() == 2 || (FTy->isVarArg() && FTy->getNumParams() < 2)) && @@ -244,6 +246,7 @@ const FunctionType *FTy = cast(cast(Func->getType())->getElementType()); + FTy = FTy; // silence warning. assert((FTy->getNumParams() == 1 || (FTy->isVarArg() && FTy->getNumParams() == 0)) && @@ -258,10 +261,11 @@ Use *OL = OperandList = new Use[1]; OL[0].init(Func, this); - const FunctionType *MTy = + const FunctionType *FTy = cast(cast(Func->getType())->getElementType()); + FTy = FTy; // silence warning. - assert(MTy->getNumParams() == 0 && "Calling a function with bad signature"); + assert(FTy->getNumParams() == 0 && "Calling a function with bad signature"); } CallInst::CallInst(Value *Func, const std::vector &Params, @@ -356,6 +360,7 @@ OL[2].init(IfException, this); const FunctionType *FTy = cast(cast(Fn->getType())->getElementType()); + FTy = FTy; // silence warning. assert((Params.size() == FTy->getNumParams()) || (FTy->isVarArg() && Params.size() > FTy->getNumParams()) && @@ -1040,6 +1045,7 @@ void BinaryOperator::init(BinaryOps iType) { Value *LHS = getOperand(0), *RHS = getOperand(1); + LHS = LHS; RHS = RHS; // Silence warnings. assert(LHS->getType() == RHS->getType() && "Binary operator operand types must match!"); #ifndef NDEBUG From sabre at nondot.org Wed Jan 31 23:28:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:28:26 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/IndexedMap.h Message-ID: <200702010528.l115SQmJ010666@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: IndexedMap.h updated: 1.9 -> 1.10 --- Log message: rename DenseMap -> IndexedMap. --- Diffs of the changes: (+7 -7) IndexedMap.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/include/llvm/ADT/IndexedMap.h diff -u llvm/include/llvm/ADT/IndexedMap.h:1.9 llvm/include/llvm/ADT/IndexedMap.h:1.10 --- llvm/include/llvm/ADT/IndexedMap.h:1.9 Thu Sep 30 16:39:47 2004 +++ llvm/include/llvm/ADT/IndexedMap.h Wed Jan 31 23:28:10 2007 @@ -1,4 +1,4 @@ -//===- llvm/ADT/DenseMap.h - A dense map implmentation ----------*- C++ -*-===// +//===- llvm/ADT/IndexedMap.h - An index map implementation ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements a dense map. A dense map template takes two +// This file implements an indexed map. The index map template takes two // types. The first is the mapped type and the second is a functor // that maps its argument to a size_t. On instantiation a "null" value // can be provided to be used as a "does not exist" indicator in the @@ -17,8 +17,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ADT_DENSEMAP_H -#define LLVM_ADT_DENSEMAP_H +#ifndef LLVM_ADT_INDEXEDMAP_H +#define LLVM_ADT_INDEXEDMAP_H #include #include @@ -33,7 +33,7 @@ }; template - class DenseMap { + class IndexMap { typedef typename ToIndexT::argument_type IndexT; typedef std::vector StorageT; StorageT storage_; @@ -41,9 +41,9 @@ ToIndexT toIndex_; public: - DenseMap() : nullVal_(T()) { } + IndexMap() : nullVal_(T()) { } - explicit DenseMap(const T& val) : nullVal_(val) { } + explicit IndexMap(const T& val) : nullVal_(val) { } typename StorageT::reference operator[](IndexT n) { assert(toIndex_(n) < storage_.size() && "index out of bounds!"); From sabre at nondot.org Wed Jan 31 23:31:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:31:12 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/IndexedMap.h DenseMap.h Message-ID: <200702010531.l115VCp9010761@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: IndexedMap.h updated: 1.10 -> 1.11 DenseMap.h (r1.9) removed --- Log message: rename DenseMap to IndexedMap. --- Diffs of the changes: (+3 -3) IndexedMap.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/ADT/IndexedMap.h diff -u llvm/include/llvm/ADT/IndexedMap.h:1.10 llvm/include/llvm/ADT/IndexedMap.h:1.11 --- llvm/include/llvm/ADT/IndexedMap.h:1.10 Wed Jan 31 23:28:10 2007 +++ llvm/include/llvm/ADT/IndexedMap.h Wed Jan 31 23:30:56 2007 @@ -33,7 +33,7 @@ }; template - class IndexMap { + class IndexedMap { typedef typename ToIndexT::argument_type IndexT; typedef std::vector StorageT; StorageT storage_; @@ -41,9 +41,9 @@ ToIndexT toIndex_; public: - IndexMap() : nullVal_(T()) { } + IndexedMap() : nullVal_(T()) { } - explicit IndexMap(const T& val) : nullVal_(val) { } + explicit IndexedMap(const T& val) : nullVal_(val) { } typename StorageT::reference operator[](IndexT n) { assert(toIndex_(n) < storage_.size() && "index out of bounds!"); From sabre at nondot.org Wed Jan 31 23:32:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:32:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PHIElimination.cpp RegAllocLocal.cpp VirtRegMap.h Message-ID: <200702010532.l115W7xG010856@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PHIElimination.cpp updated: 1.53 -> 1.54 RegAllocLocal.cpp updated: 1.99 -> 1.100 VirtRegMap.h updated: 1.25 -> 1.26 --- Log message: rename DenseMap to IndexedMap. --- Diffs of the changes: (+5 -6) PHIElimination.cpp | 1 - RegAllocLocal.cpp | 4 ++-- VirtRegMap.h | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.53 llvm/lib/CodeGen/PHIElimination.cpp:1.54 --- llvm/lib/CodeGen/PHIElimination.cpp:1.53 Tue Dec 19 16:41:21 2006 +++ llvm/lib/CodeGen/PHIElimination.cpp Wed Jan 31 23:31:50 2007 @@ -21,7 +21,6 @@ #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.99 llvm/lib/CodeGen/RegAllocLocal.cpp:1.100 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.99 Tue Dec 19 16:41:21 2006 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Wed Jan 31 23:31:50 2007 @@ -26,7 +26,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include @@ -55,7 +55,7 @@ // Virt2PhysRegMap - This map contains entries for each virtual register // that is currently available in a physical register. - DenseMap Virt2PhysRegMap; + IndexedMap Virt2PhysRegMap; unsigned &getVirt2PhysRegMapSlot(unsigned VirtReg) { return Virt2PhysRegMap[VirtReg]; Index: llvm/lib/CodeGen/VirtRegMap.h diff -u llvm/lib/CodeGen/VirtRegMap.h:1.25 llvm/lib/CodeGen/VirtRegMap.h:1.26 --- llvm/lib/CodeGen/VirtRegMap.h:1.25 Sat Dec 16 23:15:13 2006 +++ llvm/lib/CodeGen/VirtRegMap.h Wed Jan 31 23:31:50 2007 @@ -18,7 +18,7 @@ #define LLVM_CODEGEN_VIRTREGMAP_H #include "llvm/Target/MRegisterInfo.h" -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/IndexedMap.h" #include "llvm/Support/Streams.h" #include @@ -41,12 +41,12 @@ /// it; even spilled virtual registers (the register mapped to a /// spilled register is the temporary used to load it from the /// stack). - DenseMap Virt2PhysMap; + IndexedMap Virt2PhysMap; /// Virt2StackSlotMap - This is virtual register to stack slot /// mapping. Each spilled virtual register has an entry in it /// which corresponds to the stack slot this register is spilled /// at. - DenseMap Virt2StackSlotMap; + IndexedMap Virt2StackSlotMap; /// MI2VirtMap - This is MachineInstr to virtual register /// mapping. In the case of memory spill code being folded into /// instructions, we need to know which virtual register was From sabre at nondot.org Wed Jan 31 23:32:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:32:21 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200702010532.l115WL2L010872@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.89 -> 1.90 --- Log message: rename DenseMap to IndexedMap. --- Diffs of the changes: (+1 -1) MRegisterInfo.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.89 llvm/include/llvm/Target/MRegisterInfo.h:1.90 --- llvm/include/llvm/Target/MRegisterInfo.h:1.89 Thu Jan 25 16:12:41 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Wed Jan 31 23:32:05 2007 @@ -465,7 +465,7 @@ virtual void getInitialFrameState(std::vector &Moves) const; }; -// This is useful when building DenseMaps keyed on virtual registers +// This is useful when building IndexedMaps keyed on virtual registers struct VirtReg2IndexFunctor : std::unary_function { unsigned operator()(unsigned Reg) const { return Reg - MRegisterInfo::FirstVirtualRegister; From sabre at nondot.org Wed Jan 31 23:32:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:32:22 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h SSARegMap.h ScheduleDAG.h Message-ID: <200702010532.l115WMrL010882@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveIntervalAnalysis.h updated: 1.66 -> 1.67 SSARegMap.h updated: 1.12 -> 1.13 ScheduleDAG.h updated: 1.34 -> 1.35 --- Log message: rename DenseMap to IndexedMap. --- Diffs of the changes: (+6 -7) LiveIntervalAnalysis.h | 4 ++-- SSARegMap.h | 4 ++-- ScheduleDAG.h | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.66 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.67 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.66 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed Jan 31 23:32:05 2007 @@ -20,9 +20,9 @@ #ifndef LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H #define LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H -#include "llvm/ADT/DenseMap.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/LiveInterval.h" +#include "llvm/ADT/IndexedMap.h" namespace llvm { @@ -51,7 +51,7 @@ typedef std::map Reg2IntervalMap; Reg2IntervalMap r2iMap_; - typedef DenseMap Reg2RegMap; + typedef IndexedMap Reg2RegMap; Reg2RegMap r2rMap_; std::vector allocatableRegs_; Index: llvm/include/llvm/CodeGen/SSARegMap.h diff -u llvm/include/llvm/CodeGen/SSARegMap.h:1.12 llvm/include/llvm/CodeGen/SSARegMap.h:1.13 --- llvm/include/llvm/CodeGen/SSARegMap.h:1.12 Wed Jan 5 10:27:34 2005 +++ llvm/include/llvm/CodeGen/SSARegMap.h Wed Jan 31 23:32:05 2007 @@ -18,14 +18,14 @@ #define LLVM_CODEGEN_SSAREGMAP_H #include "llvm/Target/MRegisterInfo.h" -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/IndexedMap.h" namespace llvm { class TargetRegisterClass; class SSARegMap { - DenseMap RegClassMap; + IndexedMap RegClassMap; unsigned NextRegNum; public: Index: llvm/include/llvm/CodeGen/ScheduleDAG.h diff -u llvm/include/llvm/CodeGen/ScheduleDAG.h:1.34 llvm/include/llvm/CodeGen/ScheduleDAG.h:1.35 --- llvm/include/llvm/CodeGen/ScheduleDAG.h:1.34 Fri Jan 26 15:22:28 2007 +++ llvm/include/llvm/CodeGen/ScheduleDAG.h Wed Jan 31 23:32:05 2007 @@ -16,8 +16,7 @@ #define LLVM_CODEGEN_SCHEDULEDAG_H #include "llvm/CodeGen/SelectionDAG.h" - -#include +#include "llvm/ADT/SmallSet.h" namespace llvm { struct InstrStage; @@ -183,7 +182,7 @@ // represent noop instructions. std::map SUnitMap; // SDNode to SUnit mapping (n -> 1). std::vector SUnits; // The scheduling units. - std::set CommuteSet; // Nodes the should be commuted. + SmallSet CommuteSet; // Nodes the should be commuted. ScheduleDAG(SelectionDAG &dag, MachineBasicBlock *bb, const TargetMachine &tm) From sabre at nondot.org Wed Jan 31 23:33:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 31 Jan 2007 23:33:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FoldingSet.cpp Message-ID: <200702010533.l115Xb3r010944@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FoldingSet.cpp updated: 1.14 -> 1.15 --- Log message: improve comments, add an assertion --- Diffs of the changes: (+6 -3) FoldingSet.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Support/FoldingSet.cpp diff -u llvm/lib/Support/FoldingSet.cpp:1.14 llvm/lib/Support/FoldingSet.cpp:1.15 --- llvm/lib/Support/FoldingSet.cpp:1.14 Wed Jan 31 15:27:38 2007 +++ llvm/lib/Support/FoldingSet.cpp Wed Jan 31 23:33:21 2007 @@ -226,6 +226,7 @@ /// is not already in the map. InsertPos must be obtained from /// FindNodeOrInsertPos. void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { + assert(N->getNextInBucket() == 0); // Do we need to grow the hashtable? DEBUG(DOUT << "INSERT: " << N << '\n'); if (NumNodes+1 > NumBuckets*2) { @@ -256,16 +257,18 @@ /// removed or false if the node was not in the folding set. bool FoldingSetImpl::RemoveNode(Node *N) { // Because each bucket is a circular list, we don't need to compute N's hash - // to remove it. Chase around the list until we find the node (or bucket) - // which points to N. + // to remove it. DEBUG(DOUT << "REMOVE: " << N << '\n'); void *Ptr = N->getNextInBucket(); if (Ptr == 0) return false; // Not in folding set. --NumNodes; + N->SetNextInBucket(0); + // Remember what N originally pointed to, either a bucket or another node. void *NodeNextPtr = Ptr; - N->SetNextInBucket(0); + + // Chase around the list until we find the node (or bucket) which points to N. while (true) { if (Node *NodeInBucket = GetNextPtr(Ptr, Buckets, NumBuckets)) { // Advance pointer. From sabre at nondot.org Thu Feb 1 01:50:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 1 Feb 2007 01:50:15 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/DenseMap.h Message-ID: <200702010750.l117oFtZ013543@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: DenseMap.h updated: 1.10 -> 1.11 --- Log message: Add a new dense hash table implementation --- Diffs of the changes: (+203 -0) DenseMap.h | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 203 insertions(+) Index: llvm/include/llvm/ADT/DenseMap.h diff -u /dev/null llvm/include/llvm/ADT/DenseMap.h:1.11 --- /dev/null Thu Feb 1 01:50:09 2007 +++ llvm/include/llvm/ADT/DenseMap.h Thu Feb 1 01:49:59 2007 @@ -0,0 +1,203 @@ +//===- llvm/ADT/DenseMap.h - Dense probed hash table ------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Chris Lattner and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the DenseMap class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_DENSEMAP_H +#define LLVM_ADT_DENSEMAP_H + +#include "llvm/Support/DataTypes.h" +#include + +namespace llvm { + +template +struct DenseMapKeyInfo { + //static inline T getEmptyKey(); + //static inline T getTombstoneKey(); + //static unsigned getHashValue(const T &Val); + //static bool isPod() +}; + +template +struct DenseMapKeyInfo { + static inline T* getEmptyKey() { return (T*)-1; } + static inline T* getTombstoneKey() { return (T*)-2; } + static unsigned getHashValue(const T *PtrVal) { + return (unsigned)((uintptr_t)PtrVal >> 4) ^ + (unsigned)((uintptr_t)PtrVal >> 9); + } + static bool isPod() { return true; } +}; + + +template +class DenseMap { + struct BucketT { KeyT Key; ValueT Value; }; + unsigned NumBuckets; + BucketT *Buckets; + + unsigned NumEntries; + DenseMap(const DenseMap &); // not implemented. +public: + explicit DenseMap(unsigned NumInitBuckets = 8) { + init(NumInitBuckets); + } + ~DenseMap() { + const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); + for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { + if (P->Key != EmptyKey && P->Key != TombstoneKey) + P->Value.~ValueT(); + P->Key.~KeyT(); + } + delete[] (char*)Buckets; + } + + unsigned size() const { return NumEntries; } + + void clear() { + const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); + for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { + if (P->Key != EmptyKey && P->Key != TombstoneKey) { + P->Key = EmptyKey; + P->Value.~ValueT(); + --NumEntries; + } + } + assert(NumEntries == 0 && "Node count imbalance!"); + } + + /// count - Return true if the specified key is in the map. + bool count(const KeyT &Val) const { + BucketT *TheBucket; + return LookupBucketFor(Val, TheBucket); + } + + ValueT &operator[](const KeyT &Val) { + BucketT *TheBucket; + if (LookupBucketFor(Val, TheBucket)) + return TheBucket->Value; + + // If the load of the hash table is more than 3/4, grow it. + if (NumEntries*4 >= NumBuckets*3) { + this->grow(); + LookupBucketFor(Val, TheBucket); + } + ++NumEntries; + TheBucket->Key = Val; + new (&TheBucket->Value) ValueT(); + return TheBucket->Value; + } + +private: + unsigned getHashValue(const KeyT &Val) const { + return DenseMapKeyInfo::getHashValue(Val); + } + const KeyT getEmptyKey() const { return DenseMapKeyInfo::getEmptyKey();} + const KeyT getTombstoneKey() const { + return DenseMapKeyInfo::getTombstoneKey(); + } + + /// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in + /// FoundBucket. If the bucket contains the key and a value, this returns + /// true, otherwise it returns a bucket with an empty marker or tombstone and + /// returns false. + bool LookupBucketFor(const KeyT &Val, BucketT *&FoundBucket) const { + unsigned BucketNo = getHashValue(Val); + unsigned ProbeAmt = 1; + BucketT *BucketsPtr = Buckets; + + // FoundTombstone - Keep track of whether we find a tombstone while probing. + BucketT *FoundTombstone = 0; + const KeyT EmptyKey = getEmptyKey(); + const KeyT TombstoneKey = getTombstoneKey(); + assert(Val != EmptyKey && Val != TombstoneKey && + "Empty/Tombstone value shouldn't be inserted into map!"); + + while (1) { + BucketT *ThisBucket = BucketsPtr + (BucketNo & (NumBuckets-1)); + // Found Val's bucket? If so, return it. + if (ThisBucket->Key == Val) { + FoundBucket = ThisBucket; + return true; + } + + // If we found an empty bucket, the key doesn't exist in the set. + // Insert it and return the default value. + if (ThisBucket->Key == EmptyKey) { + // If we've already seen a tombstone while probing, fill it in instead + // of the empty bucket we eventually probed to. + if (FoundTombstone) ThisBucket = FoundTombstone; + FoundBucket = FoundTombstone ? FoundTombstone : ThisBucket; + return false; + } + + // If this is a tombstone, remember it. If Val ends up not in the map, we + // prefer to return it than something that would require more probing. + if (ThisBucket->Key == TombstoneKey && !FoundTombstone) + FoundTombstone = ThisBucket; // Remember the first tombstone found. + + // Otherwise, it's a hash collision or a tombstone, continue quadratic + // probing. + BucketNo += ProbeAmt++; + } + } + + void init(unsigned InitBuckets) { + NumEntries = 0; + NumBuckets = InitBuckets; + assert(InitBuckets && (InitBuckets & InitBuckets-1) == 0 && + "# initial buckets must be a power of two!"); + Buckets = (BucketT*)new char[sizeof(BucketT)*InitBuckets]; + // Initialize all the keys to EmptyKey. + const KeyT EmptyKey = getEmptyKey(); + for (unsigned i = 0; i != InitBuckets; ++i) + new (&Buckets[i].Key) KeyT(EmptyKey); + } + + void grow() { + unsigned OldNumBuckets = NumBuckets; + BucketT *OldBuckets = Buckets; + + // Double the number of buckets. + NumBuckets <<= 1; + Buckets = (BucketT*)new char[sizeof(BucketT)*NumBuckets]; + + // Initialize all the keys to EmptyKey. + const KeyT EmptyKey = getEmptyKey(); + for (unsigned i = 0, e = NumBuckets; i != e; ++i) + new (&Buckets[i].Key) KeyT(EmptyKey); + + // Insert all the old elements. + const KeyT TombstoneKey = getTombstoneKey(); + for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) { + if (B->Key != EmptyKey && B->Key != TombstoneKey) { + // Insert the key/value into the new table. + BucketT *DestBucket; + bool FoundVal = LookupBucketFor(B->Key, DestBucket); + assert(!FoundVal && "Key already in new map?"); + DestBucket->Key = B->Key; + new (&DestBucket->Value) ValueT(B->Value); + + // Free the value. + B->Value.~ValueT(); + } + B->Key.~KeyT(); + } + + // Free the old table. + delete[] (char*)OldBuckets; + } +}; + +} // end namespace llvm + +#endif From asl at math.spbu.ru Thu Feb 1 02:40:22 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 1 Feb 2007 02:40:22 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200702010840.l118eMNe023205@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.105 -> 1.106 --- Log message: Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only affected part is codegen of "memove" inside x86 backend. This fixes PR1144: http://llvm.org/PR1144 --- Diffs of the changes: (+2 -0) TargetLowering.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.105 llvm/include/llvm/Target/TargetLowering.h:1.106 --- llvm/include/llvm/Target/TargetLowering.h:1.105 Wed Jan 31 03:29:11 2007 +++ llvm/include/llvm/Target/TargetLowering.h Thu Feb 1 02:39:52 2007 @@ -732,6 +732,8 @@ bool isSigned; bool isInReg; bool isSRet; + + ArgListEntry():isSigned(false), isInReg(false), isSRet(false) { }; }; typedef std::vector ArgListTy; virtual std::pair From asl at math.spbu.ru Thu Feb 1 02:40:22 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 1 Feb 2007 02:40:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200702010840.l118eMgc023204@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.319 -> 1.320 --- Log message: Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only affected part is codegen of "memove" inside x86 backend. This fixes PR1144: http://llvm.org/PR1144 --- Diffs of the changes: (+4 -0) X86ISelLowering.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.319 llvm/lib/Target/X86/X86ISelLowering.cpp:1.320 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.319 Mon Jan 29 16:58:52 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Feb 1 02:39:52 2007 @@ -777,6 +777,10 @@ } } + // Sanity check: we haven't seen NumSRetBytes > 4 + assert((NumSRetBytes<=4) && + "Too much space for struct-return pointer requested"); + if (!MemOpChains.empty()) Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOpChains[0], MemOpChains.size()); From asl at math.spbu.ru Thu Feb 1 02:40:22 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 1 Feb 2007 02:40:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200702010840.l118eMKa023203@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.464 -> 1.465 --- Log message: Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only affected part is codegen of "memove" inside x86 backend. This fixes PR1144: http://llvm.org/PR1144 --- Diffs of the changes: (+5 -4) LegalizeDAG.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.464 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.465 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.464 Wed Jan 31 22:55:59 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Feb 1 02:39:52 2007 @@ -2178,7 +2178,7 @@ const char *FnName = 0; if (Node->getOpcode() == ISD::MEMSET) { Entry.Node = Tmp2; Entry.isSigned = false; Entry.Ty = IntPtrTy; - Entry.isInReg = false; + Entry.isInReg = false; Entry.isSRet = false; Args.push_back(Entry); // Extend the (previously legalized) ubyte argument to be an int value // for the call. @@ -2187,7 +2187,7 @@ else Tmp3 = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Tmp3); Entry.Node = Tmp3; Entry.Ty = Type::Int32Ty; Entry.isSigned = true; - Entry.isInReg = false; + Entry.isInReg = false; Entry.isSRet = false; Args.push_back(Entry); Entry.Node = Tmp4; Entry.Ty = IntPtrTy; Entry.isSigned = false; Args.push_back(Entry); @@ -2195,7 +2195,8 @@ FnName = "memset"; } else if (Node->getOpcode() == ISD::MEMCPY || Node->getOpcode() == ISD::MEMMOVE) { - Entry.Ty = IntPtrTy; Entry.isSigned = false; Entry.isInReg = false; + Entry.Ty = IntPtrTy; + Entry.isSigned = false; Entry.isInReg = false; Entry.isSRet = false; Entry.Node = Tmp2; Args.push_back(Entry); Entry.Node = Tmp3; Args.push_back(Entry); Entry.Node = Tmp4; Args.push_back(Entry); @@ -4122,7 +4123,7 @@ MVT::ValueType ArgVT = Node->getOperand(i).getValueType(); const Type *ArgTy = MVT::getTypeForValueType(ArgVT); Entry.Node = Node->getOperand(i); Entry.Ty = ArgTy; - Entry.isSigned = isSigned; Entry.isInReg = false; + Entry.isSigned = isSigned; Entry.isInReg = false; Entry.isSRet = false; Args.push_back(Entry); } SDOperand Callee = DAG.getExternalSymbol(Name, TLI.getPointerTy()); From evan.cheng at apple.com Thu Feb 1 04:16:30 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 1 Feb 2007 04:16:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200702011016.l11AGUsV025991@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.19 -> 1.20 --- Log message: - Off by one bugs in maximum displacement calculation / testing. - In thumb mode, a new constpool island BB size should be 4 + 2 to compensate for the potential padding due to alignment requirement. --- Diffs of the changes: (+28 -15) ARMConstantIslandPass.cpp | 43 ++++++++++++++++++++++++++++--------------- 1 files changed, 28 insertions(+), 15 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.19 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.20 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.19 Wed Jan 31 19:09:47 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Feb 1 04:16:15 2007 @@ -281,8 +281,10 @@ Scale = 2; break; } - unsigned MaxDisp = (1 << (Bits-1)) * Scale; - ImmBranches.push_back(ImmBranch(I, MaxDisp, isCond, UOpc)); + + // Record this immediate branch. + unsigned MaxOffs = (1 << (Bits-1)) * Scale; + ImmBranches.push_back(ImmBranch(I, MaxOffs, isCond, UOpc)); } if (Opc == ARM::tPUSH || Opc == ARM::tPOP_RET) @@ -293,9 +295,10 @@ if (I->getOperand(op).isConstantPoolIndex()) { // We found one. The addressing mode tells us the max displacement // from the PC that this instruction permits. - unsigned MaxOffs = 0; // Basic size info comes from the TSFlags field. + unsigned Bits = 0; + unsigned Scale = 1; unsigned TSFlags = I->getInstrDescriptor()->TSFlags; switch (TSFlags & ARMII::AddrModeMask) { default: @@ -304,34 +307,42 @@ continue; assert(0 && "Unknown addressing mode for CP reference!"); case ARMII::AddrMode1: // AM1: 8 bits << 2 - MaxOffs = 1 << (8+2); // Taking the address of a CP entry. + Bits = 8; + Scale = 4; // Taking the address of a CP entry. break; case ARMII::AddrMode2: - MaxOffs = 1 << 12; // +-offset_12 + Bits = 12; + Scale = 2; // +-offset_12 break; case ARMII::AddrMode3: - MaxOffs = 1 << 8; // +-offset_8 + Bits = 8; + Scale = 2; // +-offset_8 break; // addrmode4 has no immediate offset. case ARMII::AddrMode5: - MaxOffs = 1 << (8+2); // +-(offset_8*4) + Bits = 8; + Scale = 4; // +-(offset_8*4) break; case ARMII::AddrModeT1: - MaxOffs = 1 << 5; + Bits = 5; // +offset_5 break; case ARMII::AddrModeT2: - MaxOffs = 1 << (5+1); + Bits = 5; + Scale = 2; // +(offset_5*2) break; case ARMII::AddrModeT4: - MaxOffs = 1 << (5+2); + Bits = 5; + Scale = 4; // +(offset_5*4) break; case ARMII::AddrModeTs: - MaxOffs = 1 << (8+2); + Bits = 8; + Scale = 4; // +(offset_8*4) break; } - + // Remember that this is a user of a CP entry. MachineInstr *CPEMI =CPEMIs[I->getOperand(op).getConstantPoolIndex()]; + unsigned MaxOffs = (1 << (Bits-1)) * Scale; CPUsers.push_back(CPUser(I, CPEMI, MaxOffs)); // Instructions can only use one CP entry, don't bother scanning the @@ -514,12 +525,12 @@ // TODO: Search for the best place to split the code. In practice, using // loop nesting information to insert these guys outside of loops would be // sufficient. + bool isThumb = AFI->isThumbFunction(); if (&UserMBB->back() == UserMI) { assert(BBHasFallthrough(UserMBB) && "Expected a fallthrough BB!"); NewMBB = next(MachineFunction::iterator(UserMBB)); // Add an unconditional branch from UserMBB to fallthrough block. // Note the new unconditional branch is not being recorded. - bool isThumb = AFI->isThumbFunction(); BuildMI(UserMBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewMBB); BBSizes[UserMBB->getNumber()] += isThumb ? 2 : 4; } else { @@ -539,11 +550,13 @@ unsigned ID = NextUID++; unsigned CPI = CPEMI->getOperand(1).getConstantPoolIndex(); unsigned Size = CPEMI->getOperand(2).getImm(); - + // Build a new CPE for this user. U.CPEMI = BuildMI(NewIsland, TII->get(ARM::CONSTPOOL_ENTRY)) .addImm(ID).addConstantPoolIndex(CPI).addImm(Size); + // Compensate for .align 2 in thumb mode. + if (isThumb) Size += 2; // Increase the size of the island block to account for the new entry. BBSizes[NewIsland->getNumber()] += Size; @@ -574,7 +587,7 @@ << *MI); if (BrOffset <= DestOffset) { - if (DestOffset - BrOffset < MaxDisp) + if (DestOffset - BrOffset <= MaxDisp) return true; } else { if (BrOffset - DestOffset <= MaxDisp) From reid at x10sys.com Thu Feb 1 06:10:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 06:10:07 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h Message-ID: <200702011210.l11CA7Q3027979@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Debug.h updated: 1.14 -> 1.15 --- Log message: Fix a homonymo in a comment. --- Diffs of the changes: (+1 -1) Debug.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Support/Debug.h diff -u llvm/include/llvm/Support/Debug.h:1.14 llvm/include/llvm/Support/Debug.h:1.15 --- llvm/include/llvm/Support/Debug.h:1.14 Wed Jan 3 16:37:27 2007 +++ llvm/include/llvm/Support/Debug.h Thu Feb 1 06:09:51 2007 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements a handle way of adding debugging information to your +// This file implements a handy way of adding debugging information to your // code, without it being enabled all of the time, and without having to add // command line options to enable it. // From jlaskey at apple.com Thu Feb 1 10:31:53 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:31:53 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Dwarf.h Message-ID: <200702011631.l11GVrv7032422@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Dwarf.h updated: 1.10 -> 1.11 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+19 -1) Dwarf.h | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/Dwarf.h diff -u llvm/include/llvm/Support/Dwarf.h:1.10 llvm/include/llvm/Support/Dwarf.h:1.11 --- llvm/include/llvm/Support/Dwarf.h:1.10 Mon Aug 21 16:18:10 2006 +++ llvm/include/llvm/Support/Dwarf.h Thu Feb 1 10:31:34 2007 @@ -458,7 +458,25 @@ DW_CFA_val_offset_sf = 0x15, DW_CFA_val_expression = 0x16, DW_CFA_lo_user = 0x1c, - DW_CFA_hi_user = 0x3f + DW_CFA_hi_user = 0x3f, + + DW_EH_PE_absptr = 0x00, + DW_EH_PE_omit = 0xff, + DW_EH_PE_uleb128 = 0x01, + DW_EH_PE_udata2 = 0x02, + DW_EH_PE_udata4 = 0x03, + DW_EH_PE_udata8 = 0x04, + DW_EH_PE_sleb128 = 0x09, + DW_EH_PE_sdata2 = 0x0A, + DW_EH_PE_sdata4 = 0x0B, + DW_EH_PE_sdata8 = 0x0C, + DW_EH_PE_signed = 0x08, + DW_EH_PE_pcrel = 0x10, + DW_EH_PE_textrel = 0x20, + DW_EH_PE_datarel = 0x30, + DW_EH_PE_funcrel = 0x40, + DW_EH_PE_aligned = 0x50, + DW_EH_PE_indirect = 0x80 }; /// TagString - Return the string for the specified tag. From jlaskey at apple.com Thu Feb 1 10:31:59 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:31:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200702011631.l11GVxNX032427@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.17 -> 1.18 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+2 -0) TargetAsmInfo.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.17 llvm/lib/Target/TargetAsmInfo.cpp:1.18 --- llvm/lib/Target/TargetAsmInfo.cpp:1.17 Mon Jan 29 12:51:14 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Thu Feb 1 10:31:34 2007 @@ -24,6 +24,7 @@ AddressSize(4), NeedsSet(false), MaxInstLength(4), + PCSymbol("$"), SeparatorChar(';'), CommentString("#"), GlobalPrefix(""), @@ -84,6 +85,7 @@ DwarfARangesSection(".debug_aranges"), DwarfRangesSection(".debug_ranges"), DwarfMacInfoSection(".debug_macinfo"), + DwarfEHFrameSection(".eh_frame"), AsmTransCBE(0) { } From jlaskey at apple.com Thu Feb 1 10:32:01 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:32:01 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineModuleInfo.h Message-ID: <200702011632.l11GW1gJ032432@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineModuleInfo.h updated: 1.3 -> 1.4 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+0 -5) MachineModuleInfo.h | 5 ----- 1 files changed, 5 deletions(-) Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.3 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.4 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.3 Mon Jan 29 17:40:33 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Thu Feb 1 10:31:34 2007 @@ -1090,11 +1090,6 @@ return Lines; } - // FIXME: nuke this. - void ClearLineInfo() { - Lines.clear(); - } - /// SetupCompileUnits - Set up the unique vector of compile units. /// void SetupCompileUnits(Module &M); From jlaskey at apple.com Thu Feb 1 10:32:01 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:32:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp MachineModuleInfo.cpp Message-ID: <200702011632.l11GW1TV032441@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.141 -> 1.142 DwarfWriter.cpp updated: 1.122 -> 1.123 MachineModuleInfo.cpp updated: 1.2 -> 1.3 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+272 -173) AsmPrinter.cpp | 4 DwarfWriter.cpp | 438 ++++++++++++++++++++++++++++++-------------------- MachineModuleInfo.cpp | 3 3 files changed, 272 insertions(+), 173 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.141 llvm/lib/CodeGen/AsmPrinter.cpp:1.142 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.141 Fri Jan 26 15:22:28 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Feb 1 10:31:34 2007 @@ -1032,8 +1032,8 @@ /// printLabel - This method prints a local label used by debug and /// exception handling tables. void AsmPrinter::printLabel(const MachineInstr *MI) const { - if (AsmVerbose) O << "\n"; - O << TAI->getPrivateGlobalPrefix() + O << "\n" + << TAI->getPrivateGlobalPrefix() << "debug_loc" << MI->getOperand(0).getImmedValue() << ":\n"; Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.122 llvm/lib/CodeGen/DwarfWriter.cpp:1.123 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.122 Mon Jan 29 17:40:33 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Feb 1 10:31:34 2007 @@ -824,62 +824,13 @@ // Accessors. // AsmPrinter *getAsm() const { return Asm; } + MachineModuleInfo *getMMI() const { return MMI; } const TargetAsmInfo *getTargetAsmInfo() const { return TAI; } /// ShouldEmitDwarf - Returns true if Dwarf declarations should be made. /// bool ShouldEmitDwarf() const { return shouldEmit; } -}; - -//===----------------------------------------------------------------------===// -/// DwarfDebug - Emits Dwarf debug directives. -/// -class DwarfDebug : public Dwarf { - -private: - //===--------------------------------------------------------------------===// - // Attributes used to construct specific Dwarf sections. - // - - /// CompileUnits - All the compile units involved in this build. The index - /// of each entry in this vector corresponds to the sources in MMI. - std::vector CompileUnits; - - /// AbbreviationsSet - Used to uniquely define abbreviations. - /// - FoldingSet AbbreviationsSet; - - /// Abbreviations - A list of all the unique abbreviations in use. - /// - std::vector Abbreviations; - - /// ValuesSet - Used to uniquely define values. - /// - FoldingSet ValuesSet; - - /// Values - A list of all the unique values in use. - /// - std::vector Values; - - /// StringPool - A UniqueVector of strings used by indirect references. - /// - UniqueVector StringPool; - - /// UnitMap - Map debug information descriptor to compile unit. - /// - std::map DescToUnitMap; - - /// SectionMap - Provides a unique id per text section. - /// - UniqueVector SectionMap; - - /// SectionSourceLines - Tracks line numbers per text section. - /// - std::vector > SectionSourceLines; - - -public: /// PrintLabelName - Print label name in form used by Dwarf writer. /// @@ -905,24 +856,29 @@ /// EmitReference - Emit a reference to a label. /// - void EmitReference(DWLabel Label) const { - EmitReference(Label.Tag, Label.Number); + void EmitReference(DWLabel Label, bool IsPCRelative = false) const { + EmitReference(Label.Tag, Label.Number, IsPCRelative); } - void EmitReference(const char *Tag, unsigned Number) const { + void EmitReference(const char *Tag, unsigned Number, + bool IsPCRelative = false) const { if (TAI->getAddressSize() == sizeof(int32_t)) O << TAI->getData32bitsDirective(); else O << TAI->getData64bitsDirective(); PrintLabelName(Tag, Number); + + if (IsPCRelative) O << "-" << TAI->getPCSymbol(); } - void EmitReference(const std::string &Name) const { + void EmitReference(const std::string &Name, bool IsPCRelative = false) const { if (TAI->getAddressSize() == sizeof(int32_t)) O << TAI->getData32bitsDirective(); else O << TAI->getData64bitsDirective(); O << Name; + + if (IsPCRelative) O << "-" << TAI->getPCSymbol(); } /// EmitDifference - Emit the difference between two labels. Some @@ -938,7 +894,7 @@ const char *TagLo, unsigned NumberLo, bool IsSmall = false) const { if (TAI->needsSet()) { - static unsigned SetCounter = 0; + static unsigned SetCounter = 1; O << "\t.set\t"; PrintLabelName("set", SetCounter); @@ -968,6 +924,151 @@ } } + /// EmitFrameMoves - Emit frame instructions to describe the layout of the + /// frame. + void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, + std::vector &Moves) { + int stackGrowth = + Asm->TM.getFrameInfo()->getStackGrowthDirection() == + TargetFrameInfo::StackGrowsUp ? + TAI->getAddressSize() : -TAI->getAddressSize(); + bool IsLocal = BaseLabel && strcmp(BaseLabel, "loc") == 0; + + for (unsigned i = 0, N = Moves.size(); i < N; ++i) { + MachineMove &Move = Moves[i]; + unsigned LabelID = Move.getLabelID(); + + if (LabelID) { + LabelID = MMI->MappedLabel(LabelID); + + // Throw out move if the label is invalid. + if (!LabelID) continue; + } + + const MachineLocation &Dst = Move.getDestination(); + const MachineLocation &Src = Move.getSource(); + + // Advance row if new location. + if (BaseLabel && LabelID && (BaseLabelID != LabelID || !IsLocal)) { + Asm->EmitInt8(DW_CFA_advance_loc4); + Asm->EOL("DW_CFA_advance_loc4"); + EmitDifference("loc", LabelID, BaseLabel, BaseLabelID, true); + Asm->EOL(""); + + BaseLabelID = LabelID; + BaseLabel = "loc"; + IsLocal = true; + } + + // If advancing cfa. + if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { + if (!Src.isRegister()) { + if (Src.getRegister() == MachineLocation::VirtualFP) { + Asm->EmitInt8(DW_CFA_def_cfa_offset); + Asm->EOL("DW_CFA_def_cfa_offset"); + } else { + Asm->EmitInt8(DW_CFA_def_cfa); + Asm->EOL("DW_CFA_def_cfa"); + Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister())); + Asm->EOL("Register"); + } + + int Offset = -Src.getOffset(); + + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); + } else { + assert(0 && "Machine move no supported yet."); + } + } else if (Src.isRegister() && + Src.getRegister() == MachineLocation::VirtualFP) { + if (Dst.isRegister()) { + Asm->EmitInt8(DW_CFA_def_cfa_register); + Asm->EOL("DW_CFA_def_cfa_register"); + Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister())); + Asm->EOL("Register"); + } else { + assert(0 && "Machine move no supported yet."); + } + } else { + unsigned Reg = RI->getDwarfRegNum(Src.getRegister()); + int Offset = Dst.getOffset() / stackGrowth; + + if (Offset < 0) { + Asm->EmitInt8(DW_CFA_offset_extended_sf); + Asm->EOL("DW_CFA_offset_extended_sf"); + Asm->EmitULEB128Bytes(Reg); + Asm->EOL("Reg"); + Asm->EmitSLEB128Bytes(Offset); + Asm->EOL("Offset"); + } else if (Reg < 64) { + Asm->EmitInt8(DW_CFA_offset + Reg); + Asm->EOL("DW_CFA_offset + Reg"); + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); + } else { + Asm->EmitInt8(DW_CFA_offset_extended); + Asm->EOL("DW_CFA_offset_extended"); + Asm->EmitULEB128Bytes(Reg); + Asm->EOL("Reg"); + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); + } + } + } + } + +}; + +//===----------------------------------------------------------------------===// +/// DwarfDebug - Emits Dwarf debug directives. +/// +class DwarfDebug : public Dwarf { + +private: + //===--------------------------------------------------------------------===// + // Attributes used to construct specific Dwarf sections. + // + + /// CompileUnits - All the compile units involved in this build. The index + /// of each entry in this vector corresponds to the sources in MMI. + std::vector CompileUnits; + + /// AbbreviationsSet - Used to uniquely define abbreviations. + /// + FoldingSet AbbreviationsSet; + + /// Abbreviations - A list of all the unique abbreviations in use. + /// + std::vector Abbreviations; + + /// ValuesSet - Used to uniquely define values. + /// + FoldingSet ValuesSet; + + /// Values - A list of all the unique values in use. + /// + std::vector Values; + + /// StringPool - A UniqueVector of strings used by indirect references. + /// + UniqueVector StringPool; + + /// UnitMap - Map debug information descriptor to compile unit. + /// + std::map DescToUnitMap; + + /// SectionMap - Provides a unique id per text section. + /// + UniqueVector SectionMap; + + /// SectionSourceLines - Tracks line numbers per text section. + /// + std::vector > SectionSourceLines; + + +public: + /// AssignAbbrevNumber - Define a unique number for the abbreviation. /// void AssignAbbrevNumber(DIEAbbrev &Abbrev) { @@ -1950,98 +2051,6 @@ SizeAndOffsetDie(Unit->getDie(), Offset, true); } - /// EmitFrameMoves - Emit frame instructions to describe the layout of the - /// frame. - void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, - std::vector &Moves) { - int stackGrowth = - Asm->TM.getFrameInfo()->getStackGrowthDirection() == - TargetFrameInfo::StackGrowsUp ? - TAI->getAddressSize() : -TAI->getAddressSize(); - - for (unsigned i = 0, N = Moves.size(); i < N; ++i) { - MachineMove &Move = Moves[i]; - unsigned LabelID = Move.getLabelID(); - - if (LabelID) { - LabelID = MMI->MappedLabel(LabelID); - - // Throw out move if the label is invalid. - if (!LabelID) continue; - } - - const MachineLocation &Dst = Move.getDestination(); - const MachineLocation &Src = Move.getSource(); - - // Advance row if new location. - if (BaseLabel && LabelID && BaseLabelID != LabelID) { - Asm->EmitInt8(DW_CFA_advance_loc4); - Asm->EOL("DW_CFA_advance_loc4"); - EmitDifference("loc", LabelID, BaseLabel, BaseLabelID, true); - Asm->EOL(""); - - BaseLabelID = LabelID; - BaseLabel = "loc"; - } - - // If advancing cfa. - if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { - if (!Src.isRegister()) { - if (Src.getRegister() == MachineLocation::VirtualFP) { - Asm->EmitInt8(DW_CFA_def_cfa_offset); - Asm->EOL("DW_CFA_def_cfa_offset"); - } else { - Asm->EmitInt8(DW_CFA_def_cfa); - Asm->EOL("DW_CFA_def_cfa"); - Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister())); - Asm->EOL("Register"); - } - - int Offset = Src.getOffset() / stackGrowth; - - Asm->EmitULEB128Bytes(Offset); - Asm->EOL("Offset"); - } else { - assert(0 && "Machine move no supported yet."); - } - } else if (Src.isRegister() && - Src.getRegister() == MachineLocation::VirtualFP) { - if (Dst.isRegister()) { - Asm->EmitInt8(DW_CFA_def_cfa_register); - Asm->EOL("DW_CFA_def_cfa_register"); - Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister())); - Asm->EOL("Register"); - } else { - assert(0 && "Machine move no supported yet."); - } - } else { - unsigned Reg = RI->getDwarfRegNum(Src.getRegister()); - int Offset = Dst.getOffset() / stackGrowth; - - if (Offset < 0) { - Asm->EmitInt8(DW_CFA_offset_extended_sf); - Asm->EOL("DW_CFA_offset_extended_sf"); - Asm->EmitULEB128Bytes(Reg); - Asm->EOL("Reg"); - Asm->EmitSLEB128Bytes(Offset); - Asm->EOL("Offset"); - } else if (Reg < 64) { - Asm->EmitInt8(DW_CFA_offset + Reg); - Asm->EOL("DW_CFA_offset + Reg"); - Asm->EmitULEB128Bytes(Offset); - Asm->EOL("Offset"); - } else { - Asm->EmitInt8(DW_CFA_offset_extended); - Asm->EOL("DW_CFA_offset_extended"); - Asm->EmitULEB128Bytes(Reg); - Asm->EOL("Reg"); - Asm->EmitULEB128Bytes(Offset); - Asm->EOL("Offset"); - } - } - } - } - /// EmitDebugInfo - Emit the debug info section. /// void EmitDebugInfo() const { @@ -2317,7 +2326,7 @@ EmitLabel("frame_begin", SubprogramCount); - EmitDifference("frame_common", 0, "section_frame", 0, true); + EmitDifference("frame_common_begin", 0, "section_frame", 0, true); Asm->EOL("FDE CIE offset"); EmitReference("func_begin", SubprogramCount); @@ -2616,19 +2625,13 @@ EmitLabel("func_begin", ++SubprogramCount); } - /// PreExceptionEndFunction - Close off function before exception handling - /// tables. - void PreExceptionEndFunction() { - if (!ShouldEmitDwarf()) return; - - // Define end label for subprogram. - EmitLabel("func_end", SubprogramCount); - } - /// EndFunction - Gather and emit post-function debug information. /// void EndFunction() { if (!ShouldEmitDwarf()) return; + + // Define end label for subprogram. + EmitLabel("func_end", SubprogramCount); // Get function line info. const std::vector &LineInfos = MMI->getSourceLines(); @@ -2648,12 +2651,6 @@ // Emit function frame information. EmitFunctionDebugFrame(); - - // Reset the line numbers for the next function. - MMI->ClearLineInfo(); - - // Clear function debug information. - MMI->EndFunction(); } }; @@ -2662,6 +2659,85 @@ /// class DwarfException : public Dwarf { +private: + + /// EmitInitial - Emit initial exception information. + /// + void EmitInitial() { + int stackGrowth = + Asm->TM.getFrameInfo()->getStackGrowthDirection() == + TargetFrameInfo::StackGrowsUp ? + TAI->getAddressSize() : -TAI->getAddressSize(); + + Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection()); + O << "EH_frame:\n"; + EmitLabel("section_eh_frame", 0); + + EmitLabel("eh_frame_common", 0); + EmitDifference("eh_frame_common_end", 0, + "eh_frame_common_begin", 0, true); + Asm->EOL("Length of Common Information Entry"); + + EmitLabel("eh_frame_common_begin", 0); + Asm->EmitInt32((int)0); + Asm->EOL("CIE Identifier Tag"); + Asm->EmitInt8(DW_CIE_VERSION); + Asm->EOL("CIE Version"); + Asm->EmitString("zR"); + Asm->EOL("CIE Augmentation"); + Asm->EmitULEB128Bytes(1); + Asm->EOL("CIE Code Alignment Factor"); + Asm->EmitSLEB128Bytes(stackGrowth); + Asm->EOL("CIE Data Alignment Factor"); + Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister())); + Asm->EOL("CIE RA Column"); + Asm->EmitULEB128Bytes(1); + Asm->EOL("Augmentation Size"); + Asm->EmitULEB128Bytes(DW_EH_PE_pcrel); + Asm->EOL("FDE Encoding (pcrel)"); + + std::vector Moves; + RI->getInitialFrameState(Moves); + EmitFrameMoves(NULL, 0, Moves); + + Asm->EmitAlignment(2); + EmitLabel("eh_frame_common_end", 0); + + Asm->EOL(""); + + } + + + /// EmitEHFrame - Emit initial exception information. + /// + void EmitEHFrame() { + EmitDifference("eh_frame_end", SubprogramCount, + "eh_frame_begin", SubprogramCount, true); + Asm->EOL("Length of Frame Information Entry"); + + EmitLabel("eh_frame_begin", SubprogramCount); + + EmitDifference("eh_frame_begin", SubprogramCount, + "section_eh_frame", 0, true); + Asm->EOL("FDE CIE offset"); + + EmitReference("eh_func_begin", SubprogramCount, true); + Asm->EOL("FDE initial location"); + EmitDifference("eh_func_end", SubprogramCount, + "eh_func_begin", SubprogramCount); + Asm->EOL("FDE address range"); + + Asm->EmitULEB128Bytes(0); + Asm->EOL("Augmentation size"); + + std::vector &Moves = MMI->getFrameMoves(); + + EmitFrameMoves("eh_func_begin", SubprogramCount, Moves); + + Asm->EmitAlignment(2); + EmitLabel("eh_frame_end", SubprogramCount); + } + public: //===--------------------------------------------------------------------===// // Main entry points. @@ -2675,10 +2751,15 @@ /// SetModuleInfo - Set machine module information when it's known that pass /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { +#if 1 // Not ready for prime time. + return; +#endif // Make sure initial declarations are made. if (!MMI && ExceptionHandling && TAI->getSupportsExceptionHandling()) { MMI = mmi; shouldEmit = true; + + EmitInitial(); } } @@ -2702,21 +2783,32 @@ this->MF = MF; if (!ShouldEmitDwarf()) return; + + // Assumes in correct section after the entry point. + EmitLabel("eh_func_begin", ++SubprogramCount); } /// EndFunction - Gather and emit post-function exception information. /// void EndFunction() { if (!ShouldEmitDwarf()) return; -#if 0 + + EmitLabel("eh_func_end", SubprogramCount); + + Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection()); + if (const char *GlobalDirective = TAI->getGlobalDirective()) O << GlobalDirective << getAsm()->CurrentFnName << ".eh\n"; - - O << getAsm()->CurrentFnName << ".eh = 0\n"; + + if (0) { + O << getAsm()->CurrentFnName << ".eh = 0\n"; + } else { + O << getAsm()->CurrentFnName << ".eh:\n"; + EmitEHFrame(); + } if (const char *UsedDirective = TAI->getUsedDirective()) - O << UsedDirective << getAsm()->CurrentFnName << ".eh\n"; -#endif + O << UsedDirective << getAsm()->CurrentFnName << ".eh\n\n"; } }; @@ -3031,8 +3123,8 @@ /// SetModuleInfo - Set machine module info when it's known that pass manager /// has created it. Set by the target AsmPrinter. void DwarfWriter::SetModuleInfo(MachineModuleInfo *MMI) { - DE->SetModuleInfo(MMI); DD->SetModuleInfo(MMI); + DE->SetModuleInfo(MMI); } /// BeginModule - Emit all Dwarf sections that should come prior to the @@ -3059,7 +3151,11 @@ /// EndFunction - Gather and emit post-function debug information. /// void DwarfWriter::EndFunction() { - DD->PreExceptionEndFunction(); - DE->EndFunction(); DD->EndFunction(); + DE->EndFunction(); + + if (MachineModuleInfo *MMI = DD->getMMI()) { + // Clear function debug information. + MMI->EndFunction(); + } } Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.2 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.3 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.2 Mon Jan 29 17:40:33 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Thu Feb 1 10:31:34 2007 @@ -1505,6 +1505,9 @@ RootScope = NULL; } + // Clean up line info. + Lines.clear(); + // Clean up frame info. FrameMoves.clear(); } From jlaskey at apple.com Thu Feb 1 10:32:02 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:32:02 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200702011632.l11GW2JS032446@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.24 -> 1.25 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+18 -1) TargetAsmInfo.h | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.24 llvm/include/llvm/Target/TargetAsmInfo.h:1.25 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.24 Mon Jan 29 12:51:14 2007 +++ llvm/include/llvm/Target/TargetAsmInfo.h Thu Feb 1 10:31:34 2007 @@ -51,7 +51,7 @@ /// AddressSize - Size of addresses used in file. /// unsigned AddressSize; // Defaults to 4. - + /// NeedsSet - True if target asm can't compute addresses on data /// directives. bool NeedsSet; // Defaults to false. @@ -60,6 +60,10 @@ /// which is needed to compute the size of an inline asm. unsigned MaxInstLength; // Defaults to 4. + /// PCSymbol - The symbol used to represent the current PC. Used in PC + /// relative expressions. + const char *PCSymbol; // Defaults to "$". + /// SeparatorChar - This character, if specified, is used to separate /// instructions from each other when on the same line. This is used to /// measure inline asm instructions. @@ -305,6 +309,10 @@ /// DwarfMacInfoSection - Section directive for Dwarf info. /// const char *DwarfMacInfoSection; // Defaults to ".debug_macinfo". + + /// DwarfEHFrameSection - Section directive for Exception frames. + /// + const char *DwarfEHFrameSection; // Defaults to ".eh_frame". //===--- CBE Asm Translation Table -----------------------------------===// @@ -346,6 +354,12 @@ bool needsSet() const { return NeedsSet; } + const char *getPCSymbol() const { + return PCSymbol; + } + char getSeparatorChar() const { + return SeparatorChar; + } const char *getCommentString() const { return CommentString; } @@ -523,6 +537,9 @@ const char *getDwarfMacInfoSection() const { return DwarfMacInfoSection; } + const char *getDwarfEHFrameSection() const { + return DwarfEHFrameSection; + } const char** getAsmCBE() const { return AsmTransCBE; } From jlaskey at apple.com Thu Feb 1 10:32:02 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 10:32:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCTargetAsmInfo.cpp Message-ID: <200702011632.l11GW2sa032450@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.104 -> 1.105 PPCTargetAsmInfo.cpp updated: 1.16 -> 1.17 --- Log message: Support for non-landing pad exception handling. --- Diffs of the changes: (+7 -0) PPCRegisterInfo.cpp | 4 ++++ PPCTargetAsmInfo.cpp | 3 +++ 2 files changed, 7 insertions(+) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.104 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.105 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.104 Wed Jan 31 18:39:08 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Feb 1 10:31:34 2007 @@ -902,6 +902,10 @@ Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); } + MachineLocation LRDst(MachineLocation::VirtualFP, LROffset); + MachineLocation LRSrc(IsPPC64 ? PPC::LR8 : PPC::LR); + Moves.push_back(MachineMove(FrameLabelId, LRDst, LRSrc)); + // Mark effective beginning of when frame pointer is ready. unsigned ReadyLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(ReadyLabelId); Index: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.16 llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.17 --- llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.16 Tue Jan 30 02:04:53 2007 +++ llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Thu Feb 1 10:31:34 2007 @@ -41,11 +41,14 @@ DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; + DwarfEHFrameSection = + ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support"; } DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) : PPCTargetAsmInfo(TM) { + PCSymbol = "."; CommentString = ";"; GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; From alenhar2 at cs.uiuc.edu Thu Feb 1 11:13:27 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 1 Feb 2007 11:13:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200702011713.l11HDRrS029112@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.130 -> 1.131 --- Log message: preserve sections of globals --- Diffs of the changes: (+10 -1) LinkModules.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletion(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.130 llvm/lib/Linker/LinkModules.cpp:1.131 --- llvm/lib/Linker/LinkModules.cpp:1.130 Tue Jan 30 14:08:37 2007 +++ llvm/lib/Linker/LinkModules.cpp Thu Feb 1 11:12:54 2007 @@ -478,7 +478,10 @@ SGV->getName(), Dest); // Propagate alignment info. NewDGV->setAlignment(SGV->getAlignment()); - + + // Propagate section info. + NewDGV->setSection(SGV->getSection()); + // If the LLVM runtime renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename // it. @@ -503,6 +506,9 @@ // Propagate alignment info. NewDGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment())); + // Propagate section info. + NewDGV->setSection(SGV->getSection()); + // Make sure to remember this mapping... ValueMap.insert(std::make_pair(SGV, NewDGV)); @@ -512,6 +518,9 @@ // Propagate alignment info. DGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment())); + // Propagate section info. + DGV->setSection(SGV->getSection()); + // Otherwise, perform the mapping as instructed by GetLinkageResult. If // the types don't match, and if we are to link from the source, nuke DGV // and create a new one of the appropriate type. From lauro.venancio at gmail.com Thu Feb 1 11:34:55 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 1 Feb 2007 14:34:55 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp In-Reply-To: <200702011016.l11AGUsV025991@zion.cs.uiuc.edu> References: <200702011016.l11AGUsV025991@zion.cs.uiuc.edu> Message-ID: <9c10c9f0702010934o568f60dbl467b8a98e8a9dc4c@mail.gmail.com> Hi Evan, Does this patch is correct? According to ARM manual, AddrMode2 and AddrMode3 don't have scale (scale=1). I think MaxOffs should be ((1 << Bits) - 1) * Scale. Lauro > @@ -304,34 +307,42 @@ > continue; > assert(0 && "Unknown addressing mode for CP reference!"); > case ARMII::AddrMode1: // AM1: 8 bits << 2 > - MaxOffs = 1 << (8+2); // Taking the address of a CP entry. > + Bits = 8; > + Scale = 4; // Taking the address of a CP entry. > break; > case ARMII::AddrMode2: > - MaxOffs = 1 << 12; // +-offset_12 > + Bits = 12; > + Scale = 2; // +-offset_12 > break; > case ARMII::AddrMode3: > - MaxOffs = 1 << 8; // +-offset_8 > + Bits = 8; > + Scale = 2; // +-offset_8 > break; > // addrmode4 has no immediate offset. > case ARMII::AddrMode5: > - MaxOffs = 1 << (8+2); // +-(offset_8*4) > + Bits = 8; > + Scale = 4; // +-(offset_8*4) > break; > case ARMII::AddrModeT1: > - MaxOffs = 1 << 5; > + Bits = 5; // +offset_5 > break; > case ARMII::AddrModeT2: > - MaxOffs = 1 << (5+1); > + Bits = 5; > + Scale = 2; // +(offset_5*2) > break; > case ARMII::AddrModeT4: > - MaxOffs = 1 << (5+2); > + Bits = 5; > + Scale = 4; // +(offset_5*4) > break; > case ARMII::AddrModeTs: > - MaxOffs = 1 << (8+2); > + Bits = 8; > + Scale = 4; // +(offset_8*4) > break; > } > - > + > // Remember that this is a user of a CP entry. > MachineInstr *CPEMI =CPEMIs[I->getOperand(op).getConstantPoolIndex()]; > + unsigned MaxOffs = (1 << (Bits-1)) * Scale; > CPUsers.push_back(CPUser(I, CPEMI, MaxOffs)); From jlaskey at apple.com Thu Feb 1 11:46:27 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 11:46:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp Message-ID: <200702011746.l11HkRZJ003100@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.142 -> 1.143 DwarfWriter.cpp updated: 1.123 -> 1.124 --- Log message: Emit labels as label_n and not as debug_n --- Diffs of the changes: (+9 -9) AsmPrinter.cpp | 2 +- DwarfWriter.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.142 llvm/lib/CodeGen/AsmPrinter.cpp:1.143 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.142 Thu Feb 1 10:31:34 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Feb 1 11:46:10 2007 @@ -1034,7 +1034,7 @@ void AsmPrinter::printLabel(const MachineInstr *MI) const { O << "\n" << TAI->getPrivateGlobalPrefix() - << "debug_loc" + << "label_" << MI->getOperand(0).getImmedValue() << ":\n"; } Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.123 llvm/lib/CodeGen/DwarfWriter.cpp:1.124 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.123 Thu Feb 1 10:31:34 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Feb 1 11:46:10 2007 @@ -80,7 +80,7 @@ if (O) print(*O); } void print(std::ostream &O) const { - O << ".debug_" << Tag; + O << ".D" << Tag; if (Number) O << Number; } #endif @@ -839,7 +839,7 @@ } void PrintLabelName(const char *Tag, unsigned Number) const { O << TAI->getPrivateGlobalPrefix() - << "debug_" + << ((Tag && *Tag) ? "debug_" : "label_") << Tag; if (Number) O << Number; } @@ -932,7 +932,7 @@ Asm->TM.getFrameInfo()->getStackGrowthDirection() == TargetFrameInfo::StackGrowsUp ? TAI->getAddressSize() : -TAI->getAddressSize(); - bool IsLocal = BaseLabel && strcmp(BaseLabel, "loc") == 0; + bool IsLocal = BaseLabel && strcmp(BaseLabel, "") == 0; for (unsigned i = 0, N = Moves.size(); i < N; ++i) { MachineMove &Move = Moves[i]; @@ -952,11 +952,11 @@ if (BaseLabel && LabelID && (BaseLabelID != LabelID || !IsLocal)) { Asm->EmitInt8(DW_CFA_advance_loc4); Asm->EOL("DW_CFA_advance_loc4"); - EmitDifference("loc", LabelID, BaseLabel, BaseLabelID, true); + EmitDifference("", LabelID, BaseLabel, BaseLabelID, true); Asm->EOL(""); BaseLabelID = LabelID; - BaseLabel = "loc"; + BaseLabel = ""; IsLocal = true; } @@ -1850,14 +1850,14 @@ // Add the scope bounds. if (StartID) { AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("loc", StartID)); + DWLabel("", StartID)); } else { AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, DWLabel("func_begin", SubprogramCount)); } if (EndID) { AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("loc", EndID)); + DWLabel("", EndID)); } else { AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, DWLabel("func_end", SubprogramCount)); @@ -2217,7 +2217,7 @@ Asm->EmitInt8(0); Asm->EOL("Extended Op"); Asm->EmitInt8(TAI->getAddressSize() + 1); Asm->EOL("Op size"); Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); - EmitReference("loc", LabelID); Asm->EOL("Location label"); + EmitReference("", LabelID); Asm->EOL("Location label"); // If change of source, then switch to the new source. if (Source != LineInfo.getSourceID()) { From jlaskey at apple.com Thu Feb 1 11:48:37 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 1 Feb 2007 11:48:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200702011748.l11HmbKS003164@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.124 -> 1.125 --- Log message: Slip up --- Diffs of the changes: (+1 -1) DwarfWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.124 llvm/lib/CodeGen/DwarfWriter.cpp:1.125 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.124 Thu Feb 1 11:46:10 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Feb 1 11:48:20 2007 @@ -80,7 +80,7 @@ if (O) print(*O); } void print(std::ostream &O) const { - O << ".D" << Tag; + O << ".debug_" << Tag; if (Number) O << Number; } #endif From lauro.venancio at gmail.com Thu Feb 1 12:25:52 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 1 Feb 2007 12:25:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200702011825.l11IPqg5006110@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.56 -> 1.57 --- Log message: Fix .thumb_func directive on linux. --- Diffs of the changes: (+4 -1) ARMAsmPrinter.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.56 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.57 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.56 Wed Jan 31 17:39:39 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Feb 1 12:25:34 2007 @@ -208,7 +208,10 @@ if (AFI->isThumbFunction()) { EmitAlignment(1, F); O << "\t.code\t16\n"; - O << "\t.thumb_func\t" << CurrentFnName << "\n"; + O << "\t.thumb_func"; + if (Subtarget->isTargetDarwin()) + O << "\t" << CurrentFnName; + O << "\n"; InCPMode = false; } else EmitAlignment(2, F); From sabre at nondot.org Thu Feb 1 12:48:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 1 Feb 2007 12:48:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneFunction.cpp Message-ID: <200702011848.l11ImskH006694@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneFunction.cpp updated: 1.39 -> 1.40 --- Log message: Fix bugs in the inliner having to do with single-entry phi nodes and valuemap updating. These were exposed by Devang's recent passmgr changes (with non-default passorderings) because now the inliner can be interleved with the LCSSA pass. --- Diffs of the changes: (+12 -12) CloneFunction.cpp | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Utils/CloneFunction.cpp diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.39 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.40 --- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.39 Tue Jan 30 17:46:24 2007 +++ llvm/lib/Transforms/Utils/CloneFunction.cpp Thu Feb 1 12:48:38 2007 @@ -431,18 +431,12 @@ PN->eraseFromParent(); ++OldI; } - } else if (PN->getNumIncomingValues() == 1) { - BasicBlock::iterator I = NewBB->begin(); - BasicBlock::const_iterator OldI = OldBB->begin(); - while ((PN = dyn_cast(I++))) { - Value *NV = PN->getIncomingValue(0); - PN->replaceAllUsesWith(NV); - assert(ValueMap[OldI] == PN && "ValueMap mismatch"); - ValueMap[OldI] = NV; - PN->eraseFromParent(); - ++OldI; - } } + // NOTE: We cannot eliminate single entry phi nodes here, because of + // ValueMap. Single entry phi nodes can have multiple ValueMap entries + // pointing at them. Thus, deleting one would require scanning the ValueMap + // to update any entries in it that would require that. This would be + // really slow. } // Now that the inlined function body has been fully constructed, go through @@ -454,8 +448,14 @@ BranchInst *BI = dyn_cast(I->getTerminator()); if (!BI || BI->isConditional()) { ++I; continue; } + // Note that we can't eliminate uncond branches if the destination has + // single-entry PHI nodes. Eliminating the single-entry phi nodes would + // require scanning the ValueMap to update any entries that point to the phi + // node. BasicBlock *Dest = BI->getSuccessor(0); - if (!Dest->getSinglePredecessor()) { ++I; continue; } + if (!Dest->getSinglePredecessor() || isa(Dest->begin())) { + ++I; continue; + } // We know all single-entry PHI nodes in the inlined function have been // removed, so we just need to splice the blocks. From reid at x10sys.com Thu Feb 1 13:15:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 13:15:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp Message-ID: <200702011915.l11JFAxZ007468@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.122 -> 1.123 --- Log message: Ensure that ConvertOperandToType generates a result conversion by initializing the Res variable to 0 and asserting it is not zero after the result should have been created. --- Diffs of the changes: (+3 -1) ExprTypeConvert.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.122 llvm/lib/Transforms/ExprTypeConvert.cpp:1.123 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.122 Sat Jan 20 18:29:25 2007 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Thu Feb 1 13:14:51 2007 @@ -697,7 +697,7 @@ assert(BB != 0 && "Instruction not embedded in basic block!"); std::string Name = I->getName(); I->setName(""); - Instruction *Res; // Result of conversion + Instruction *Res = 0; // Result of conversion //cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I // << "BB Before: " << BB << endl; @@ -917,6 +917,8 @@ return; } + assert(Res != 0 && "We didn't get a result conversion?"); + // If the instruction was newly created, insert it into the instruction // stream. // From evan.cheng at apple.com Thu Feb 1 14:37:45 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 1 Feb 2007 12:37:45 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp In-Reply-To: <9c10c9f0702010934o568f60dbl467b8a98e8a9dc4c@mail.gmail.com> References: <200702011016.l11AGUsV025991@zion.cs.uiuc.edu> <9c10c9f0702010934o568f60dbl467b8a98e8a9dc4c@mail.gmail.com> Message-ID: Yep. I shouldn't have checked in stuff just before I went to bed. :-) You can tell there is a definite mismatch between comments and code. Lots of copy and paste bugs. Thanks, Evan On Feb 1, 2007, at 9:34 AM, Lauro Ramos Venancio wrote: > Hi Evan, > > Does this patch is correct? According to ARM manual, AddrMode2 and > AddrMode3 don't have scale (scale=1). > I think MaxOffs should be ((1 << Bits) - 1) * Scale. > > Lauro > >> @@ -304,34 +307,42 @@ >> continue; >> assert(0 && "Unknown addressing mode for CP >> reference!"); >> case ARMII::AddrMode1: // AM1: 8 bits << 2 >> - MaxOffs = 1 << (8+2); // Taking the address of a CP >> entry. >> + Bits = 8; >> + Scale = 4; // Taking the address of a CP entry. >> break; >> case ARMII::AddrMode2: >> - MaxOffs = 1 << 12; // +-offset_12 >> + Bits = 12; >> + Scale = 2; // +-offset_12 >> break; >> case ARMII::AddrMode3: >> - MaxOffs = 1 << 8; // +-offset_8 >> + Bits = 8; >> + Scale = 2; // +-offset_8 >> break; >> // addrmode4 has no immediate offset. >> case ARMII::AddrMode5: >> - MaxOffs = 1 << (8+2); // +-(offset_8*4) >> + Bits = 8; >> + Scale = 4; // +-(offset_8*4) >> break; >> case ARMII::AddrModeT1: >> - MaxOffs = 1 << 5; >> + Bits = 5; // +offset_5 >> break; >> case ARMII::AddrModeT2: >> - MaxOffs = 1 << (5+1); >> + Bits = 5; >> + Scale = 2; // +(offset_5*2) >> break; >> case ARMII::AddrModeT4: >> - MaxOffs = 1 << (5+2); >> + Bits = 5; >> + Scale = 4; // +(offset_5*4) >> break; >> case ARMII::AddrModeTs: >> - MaxOffs = 1 << (8+2); >> + Bits = 8; >> + Scale = 4; // +(offset_8*4) >> break; >> } >> - >> + >> // Remember that this is a user of a CP entry. >> MachineInstr *CPEMI =CPEMIs[I->getOperand >> (op).getConstantPoolIndex()]; >> + unsigned MaxOffs = (1 << (Bits-1)) * Scale; >> CPUsers.push_back(CPUser(I, CPEMI, MaxOffs)); From evan.cheng at apple.com Thu Feb 1 14:45:18 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 1 Feb 2007 14:45:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200702012045.l11KjI4Q010393@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.20 -> 1.21 --- Log message: Pasto. Lots of it. --- Diffs of the changes: (+3 -5) ARMConstantIslandPass.cpp | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.20 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.21 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.20 Thu Feb 1 04:16:15 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Feb 1 14:44:52 2007 @@ -311,12 +311,10 @@ Scale = 4; // Taking the address of a CP entry. break; case ARMII::AddrMode2: - Bits = 12; - Scale = 2; // +-offset_12 + Bits = 12; // +-offset_12 break; case ARMII::AddrMode3: - Bits = 8; - Scale = 2; // +-offset_8 + Bits = 8; // +-offset_8 break; // addrmode4 has no immediate offset. case ARMII::AddrMode5: @@ -342,7 +340,7 @@ // Remember that this is a user of a CP entry. MachineInstr *CPEMI =CPEMIs[I->getOperand(op).getConstantPoolIndex()]; - unsigned MaxOffs = (1 << (Bits-1)) * Scale; + unsigned MaxOffs = ((1 << Bits)-1) * Scale; CPUsers.push_back(CPUser(I, CPEMI, MaxOffs)); // Instructions can only use one CP entry, don't bother scanning the From lauro.venancio at gmail.com Thu Feb 1 15:44:10 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 1 Feb 2007 15:44:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Message-ID: <200702012144.l11LiA9A012231@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetAsmInfo.cpp updated: 1.10 -> 1.11 --- Log message: Define PrivateGlobalPrefix for ARM Linux. (Fix CodeGen/ARM/large_stack.ll) --- Diffs of the changes: (+1 -0) ARMTargetAsmInfo.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.10 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.11 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.10 Tue Jan 30 02:04:53 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Thu Feb 1 15:43:53 2007 @@ -56,6 +56,7 @@ DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; } else { + PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits"; StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits"; From reid at x10sys.com Thu Feb 1 15:59:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 15:59:02 -0600 Subject: [llvm-commits] CVS: llvm/test/ExecutionEngine/test-fp.ll Message-ID: <200702012159.l11Lx2hI012840@zion.cs.uiuc.edu> Changes in directory llvm/test/ExecutionEngine: test-fp.ll updated: 1.6 -> 1.7 --- Log message: Make sure the value passed to test function is initialized. --- Diffs of the changes: (+1 -0) test-fp.ll | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/ExecutionEngine/test-fp.ll diff -u llvm/test/ExecutionEngine/test-fp.ll:1.6 llvm/test/ExecutionEngine/test-fp.ll:1.7 --- llvm/test/ExecutionEngine/test-fp.ll:1.6 Sun Dec 3 10:17:19 2006 +++ llvm/test/ExecutionEngine/test-fp.ll Thu Feb 1 15:58:46 2007 @@ -18,6 +18,7 @@ int %main() { %X = alloca double + store double 0.0, double* %X call double %test(double* %X, double 2.0) ret int 0 } From dpatel at apple.com Thu Feb 1 16:08:41 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 1 Feb 2007 16:08:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200702012208.l11M8fJH013794@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.132 -> 1.133 --- Log message: cvs commit --- Diffs of the changes: (+8 -0) PassManager.cpp | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.132 llvm/lib/VMCore/PassManager.cpp:1.133 --- llvm/lib/VMCore/PassManager.cpp:1.132 Tue Jan 30 14:08:38 2007 +++ llvm/lib/VMCore/PassManager.cpp Thu Feb 1 16:08:25 2007 @@ -78,6 +78,10 @@ bool doFinalization(Module &M); bool doFinalization(Function &F); + virtual const char *getPassName() const { + return "BasicBlock Pass Manager"; + } + // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; @@ -185,6 +189,10 @@ Info.setPreservesAll(); } + virtual const char *getPassName() const { + return "Module Pass Manager"; + } + // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "ModulePass Manager\n"; From dpatel at apple.com Thu Feb 1 16:09:53 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 1 Feb 2007 16:09:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200702012209.l11M9rQs013938@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.16 -> 1.17 --- Log message: Pretty print pass manager --- Diffs of the changes: (+4 -0) CallGraphSCCPass.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.16 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.17 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.16 Mon Jan 29 17:29:54 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Thu Feb 1 16:09:37 2007 @@ -45,6 +45,10 @@ Info.setPreservesAll(); } + virtual const char *getPassName() const { + return "CallGraph Pass Manager"; + } + // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "Call Graph SCC Pass Manager\n"; From dpatel at apple.com Thu Feb 1 16:10:28 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 1 Feb 2007 16:10:28 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200702012210.l11MASW9014004@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.6 -> 1.7 --- Log message: Pretty print pass managers. --- Diffs of the changes: (+4 -0) PassManagers.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.6 llvm/include/llvm/PassManagers.h:1.7 --- llvm/include/llvm/PassManagers.h:1.6 Mon Jan 29 17:10:37 2007 +++ llvm/include/llvm/PassManagers.h Thu Feb 1 16:10:12 2007 @@ -312,6 +312,10 @@ // Print passes managed by this manager void dumpPassStructure(unsigned Offset); + virtual const char *getPassName() const { + return "Function Pass Manager"; + } + FunctionPass *getContainedPass(unsigned N) { assert ( N < PassVector.size() && "Pass number out of range!"); FunctionPass *FP = static_cast(PassVector[N]); From reid at x10sys.com Thu Feb 1 16:11:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 16:11:02 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/large-stack.ll Message-ID: <200702012211.l11MB2Ts014056@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: large-stack.ll updated: 1.3 -> 1.4 --- Log message: XFAIL this on x86 linux as it continues to fail. --- Diffs of the changes: (+3 -1) large-stack.ll | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/large-stack.ll diff -u llvm/test/CodeGen/ARM/large-stack.ll:1.3 llvm/test/CodeGen/ARM/large-stack.ll:1.4 --- llvm/test/CodeGen/ARM/large-stack.ll:1.3 Tue Jan 30 17:06:22 2007 +++ llvm/test/CodeGen/ARM/large-stack.ll Thu Feb 1 16:10:46 2007 @@ -1,6 +1,8 @@ ; RUN: llvm-as < %s | llc -march=arm && ; RUN: llvm-as < %s | llc -march=arm -enable-thumb && -; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep 'ldr.*LCP' | wc -l | grep 5 +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | \ +; RUN: grep 'ldr.*LCP' | wc -l | grep 5 +; XFAIL: *86-pc-linux-gnu define void @test1() { %tmp = alloca [ 64 x i32 ] , align 4 From clattner at apple.com Thu Feb 1 16:10:57 2007 From: clattner at apple.com (clattner at apple.com) Date: Thu, 1 Feb 2007 14:10:57 -0800 (PST) Subject: [llvm-commits] [123265] fix copyright block. Message-ID: <20070201221057.6A294217FDBD@src> An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070201/90eb2f45/attachment.html From clattner at apple.com Thu Feb 1 16:14:43 2007 From: clattner at apple.com (clattner at apple.com) Date: Thu, 1 Feb 2007 14:14:43 -0800 (PST) Subject: [llvm-commits] [123266] test commit Message-ID: <20070201221443.22D8C218CE00@src> An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070201/a1575ff6/attachment.html From reid at x10sys.com Thu Feb 1 16:26:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 16:26:58 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/large-stack.ll Message-ID: <200702012226.l11MQwIc014779@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: large-stack.ll updated: 1.4 -> 1.5 --- Log message: My mistake, my environment wasn't up to date. This passes now. --- Diffs of the changes: (+0 -1) large-stack.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/CodeGen/ARM/large-stack.ll diff -u llvm/test/CodeGen/ARM/large-stack.ll:1.4 llvm/test/CodeGen/ARM/large-stack.ll:1.5 --- llvm/test/CodeGen/ARM/large-stack.ll:1.4 Thu Feb 1 16:10:46 2007 +++ llvm/test/CodeGen/ARM/large-stack.ll Thu Feb 1 16:26:42 2007 @@ -2,7 +2,6 @@ ; RUN: llvm-as < %s | llc -march=arm -enable-thumb && ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | \ ; RUN: grep 'ldr.*LCP' | wc -l | grep 5 -; XFAIL: *86-pc-linux-gnu define void @test1() { %tmp = alloca [ 64 x i32 ] , align 4 From sabre at nondot.org Thu Feb 1 16:29:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 1 Feb 2007 16:29:42 -0600 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll Message-ID: <200702012229.l11MTgAL014959@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: 2007-02-01-LoadSinkAlloca.ll added (r1.1) --- Log message: new testcase for serious code pessimization --- Diffs of the changes: (+43 -0) 2007-02-01-LoadSinkAlloca.ll | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+) Index: llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll diff -c /dev/null llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll:1.1 *** /dev/null Thu Feb 1 16:29:36 2007 --- llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll Thu Feb 1 16:29:26 2007 *************** *** 0 **** --- 1,43 ---- + ; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep '%A = alloca' && + ; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep '%B = alloca' + + ; Ensure that instcombine doesn't sink the loads in entry/cond_true into + ; cond_next. Doing so prevents mem2reg from promoting the B alloca. + + define i32 @test2(i32 %C) { + entry: + %A = alloca i32 + %B = alloca i32 + %tmp = call i32 (...)* @bar( i32* %A ) ; [#uses=0] + %T = load i32* %A ; [#uses=1] + %tmp = icmp eq i32 %C, 0 ; [#uses=1] + br i1 %tmp, label %cond_next, label %cond_true + + cond_true: ; preds = %entry + store i32 123, i32* %B + call i32 @test2( i32 123 ) ; :0 [#uses=0] + %T1 = load i32* %B ; [#uses=1] + br label %cond_next + + cond_next: ; preds = %cond_true, %entry + %tmp1.0 = phi i32 [ %T1, %cond_true ], [ %T, %entry ] ; [#uses=1] + %tmp7 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp8 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp9 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp10 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp11 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp12 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp13 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp14 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp15 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp16 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp17 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp18 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp19 = call i32 (...)* @baq( ) ; [#uses=0] + %tmp20 = call i32 (...)* @baq( ) ; [#uses=0] + ret i32 %tmp1.0 + } + + declare i32 @bar(...) + + declare i32 @baq(...) From sabre at nondot.org Thu Feb 1 16:30:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 1 Feb 2007 16:30:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200702012230.l11MUNtQ015012@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.618 -> 1.619 --- Log message: Fix Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll, a serious code pessimization where instcombine can sink a load (good for code size) that prevents an alloca from being promoted by mem2reg (bad for everything). --- Diffs of the changes: (+24 -0) InstructionCombining.cpp | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.618 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.619 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.618 Wed Jan 31 14:08:52 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Feb 1 16:30:07 2007 @@ -7464,12 +7464,36 @@ /// of the block that defines it. This means that it must be obvious the value /// of the load is not changed from the point of the load to the end of the /// block it is in. +/// +/// Finally, it is safe, but not profitable, to sink a load targetting a +/// non-address-taken alloca. Doing so will cause us to not promote the alloca +/// to a register. static bool isSafeToSinkLoad(LoadInst *L) { BasicBlock::iterator BBI = L, E = L->getParent()->end(); for (++BBI; BBI != E; ++BBI) if (BBI->mayWriteToMemory()) return false; + + // Check for non-address taken alloca. If not address-taken already, it isn't + // profitable to do this xform. + if (AllocaInst *AI = dyn_cast(L->getOperand(0))) { + bool isAddressTaken = false; + for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end(); + UI != E; ++UI) { + if (isa(UI)) continue; + if (StoreInst *SI = dyn_cast(*UI)) { + // If storing TO the alloca, then the address isn't taken. + if (SI->getOperand(1) == AI) continue; + } + isAddressTaken = true; + break; + } + + if (!isAddressTaken) + return false; + } + return true; } From clattner at apple.com Thu Feb 1 16:30:07 2007 From: clattner at apple.com (clattner at apple.com) Date: Thu, 1 Feb 2007 14:30:07 -0800 (PST) Subject: [llvm-commits] [123267] now with less html! Message-ID: <20070201223007.399A62193D47@src> Revision: 123267 Author: clattner Date: 2007-02-01 14:30:07 -0800 (Thu, 01 Feb 2007) Log Message: ----------- now with less html! Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-main.cpp Modified: apple-local/branches/llvm/gcc/llvm-main.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-main.cpp 2007-02-01 22:14:42 UTC (rev 123266) +++ apple-local/branches/llvm/gcc/llvm-main.cpp 2007-02-01 22:30:07 UTC (rev 123267) @@ -18,6 +18,7 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include extern "C" { From dpatel at apple.com Thu Feb 1 16:38:48 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 1 Feb 2007 16:38:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200702012238.l11Mcm2e015238@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.17 -> 1.18 --- Log message: Dump function names when debug-pass=Executions is used. --- Diffs of the changes: (+5 -1) CallGraphSCCPass.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.17 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.18 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.17 Thu Feb 1 16:09:37 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Thu Feb 1 16:38:33 2007 @@ -19,6 +19,7 @@ #include "llvm/Analysis/CallGraph.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/PassManagers.h" +#include "llvm/Function.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -107,8 +108,11 @@ std::vector &SCC = *I; for (unsigned i = 0, e = SCC.size(); i != e; ++i) { Function *F = SCC[i]->getFunction(); - if (F) + if (F) { + std::string Msg4 = "' on Function '" + F->getName() + "'...\n"; + dumpPassInfo(P, Msg1, Msg4); Changed |= FPP->runOnFunction(*F); + } } } StopPassTimer(P); From evan.cheng at apple.com Thu Feb 1 17:34:19 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 1 Feb 2007 17:34:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200702012334.l11NYJMn016827@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.10 -> 1.11 --- Log message: Thumb does not have clz. --- Diffs of the changes: (+1 -1) ARMISelLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.10 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.11 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.10 Wed Jan 31 03:30:58 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu Feb 1 17:34:03 2007 @@ -154,7 +154,7 @@ setOperationAction(ISD::ROTL, MVT::i32, Expand); setOperationAction(ISD::CTTZ , MVT::i32, Expand); setOperationAction(ISD::CTPOP, MVT::i32, Expand); - if (!Subtarget->hasV5TOps()) + if (!Subtarget->hasV5TOps() || Subtarget->isThumb()) setOperationAction(ISD::CTLZ, MVT::i32, Expand); // These are expanded into libcalls. From dpatel at apple.com Thu Feb 1 17:46:38 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 1 Feb 2007 17:46:38 -0600 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs TEST.nightly.Makefile Message-ID: <200702012346.l11NkciN017284@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.250 -> 1.251 TEST.nightly.Makefile updated: 1.43 -> 1.44 --- Log message: Provide hook to add gccas switch (e.g. -inline-threshold=xyz). --- Diffs of the changes: (+4 -4) Makefile.programs | 4 ++-- TEST.nightly.Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.250 llvm-test/Makefile.programs:1.251 --- llvm-test/Makefile.programs:1.250 Tue Jan 16 14:25:51 2007 +++ llvm-test/Makefile.programs Thu Feb 1 17:46:22 2007 @@ -237,7 +237,7 @@ # raw output from the C frontend, optimize it. $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \ Output/%.linked.bc: Output/%.linked.rll $(LGCCAS) - -$(LGCCAS) $(STATS) $< -o $@ + -$(LGCCAS) $(STATS) $(EXTRA_GCCAS_OPTIONS) $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.llvm.stripped.bc): \ Output/%.llvm.stripped.bc: Output/%.llvm.bc $(LOPT) @@ -286,7 +286,7 @@ # Targets to get the pass arguments that gccas and gccld are using... Output/gccas-pass-args: $(LGCCAS) Output/.dir - -$(LGCCAS) /dev/null -o /dev/null -debug-pass=Arguments > $@.1 2>&1 + -$(LGCCAS) $(EXTRA_GCCAS_OPTIONS) /dev/null -o /dev/null -debug-pass=Arguments > $@.1 2>&1 sed 's/Pass Arguments: //' < $@.1 | sed 's/-emitbytecode//' > $@ Output/gccld-pass-args: $(LGCCLDPROG) Output/.dir $(LLVMAS) < /dev/null > Output/gccld.test.bc Index: llvm-test/TEST.nightly.Makefile diff -u llvm-test/TEST.nightly.Makefile:1.43 llvm-test/TEST.nightly.Makefile:1.44 --- llvm-test/TEST.nightly.Makefile:1.43 Sat Nov 25 02:53:53 2006 +++ llvm-test/TEST.nightly.Makefile Thu Feb 1 17:46:22 2007 @@ -33,8 +33,8 @@ $(PROGRAMS_TO_TEST:%=Output/%.nightly.compile.report.txt): \ Output/%.nightly.compile.report.txt: Output/%.llvm.bc $(LGCCAS) @echo > $@ - @echo '$(LGCCAS) Output/$*.linked.rll -o /dev/null $(TIMEOPT) >>$@ 2>&1' - @-if ($(LGCCAS) Output/$*.linked.rll -o /dev/null $(TIMEOPT) >>$@ 2>&1)\ + @echo '$(LGCCAS) Output/$*.linked.rll -o /dev/null $(TIMEOPT) $(EXTRA_GCCAS_OPTIONS) >>$@ 2>&1' + @-if ($(LGCCAS) Output/$*.linked.rll -o /dev/null $(TIMEOPT) $(EXTRA_GCCAS_OPTIONS) >>$@ 2>&1)\ ;then \ echo "TEST-PASS: compile $(RELDIR)/$*" >> $@;\ printf "TEST-RESULT-compile: " >> $@;\ From evan.cheng at apple.com Thu Feb 1 19:53:42 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 1 Feb 2007 19:53:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200702020153.l121rghR019637@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.11 -> 1.12 --- Log message: Fix a bug in getARMCMP (which translate CondCode to ARM specific CC) when the RHS is a constant. --- Diffs of the changes: (+18 -20) ARMISelLowering.cpp | 38 ++++++++++++++++++-------------------- 1 files changed, 18 insertions(+), 20 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.11 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.12 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.11 Thu Feb 1 17:34:03 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu Feb 1 19:53:26 2007 @@ -859,7 +859,7 @@ return false; } -static bool isLegalCmpImmediate(int C, bool isThumb) { +static bool isLegalCmpImmediate(unsigned C, bool isThumb) { return ( isThumb && (C & ~255U) == 0) || (!isThumb && ARM_AM::getSOImmVal(C) != -1); } @@ -869,38 +869,36 @@ static SDOperand getARMCmp(SDOperand LHS, SDOperand RHS, ISD::CondCode CC, SDOperand &ARMCC, SelectionDAG &DAG, bool isThumb) { if (ConstantSDNode *RHSC = dyn_cast(RHS.Val)) { - int C = (int)RHSC->getValue(); + unsigned C = RHSC->getValue(); if (!isLegalCmpImmediate(C, isThumb)) { // Constant does not fit, try adjusting it by one? switch (CC) { default: break; case ISD::SETLT: - case ISD::SETULT: case ISD::SETGE: - case ISD::SETUGE: if (isLegalCmpImmediate(C-1, isThumb)) { - switch (CC) { - default: break; - case ISD::SETLT: CC = ISD::SETLE; break; - case ISD::SETULT: CC = ISD::SETULE; break; - case ISD::SETGE: CC = ISD::SETGT; break; - case ISD::SETUGE: CC = ISD::SETUGT; break; - } + CC = (CC == ISD::SETLT) ? ISD::SETLE : ISD::SETGT; + RHS = DAG.getConstant(C-1, MVT::i32); + } + break; + case ISD::SETULT: + case ISD::SETUGE: + if (C > 0 && isLegalCmpImmediate(C-1, isThumb)) { + CC = (CC == ISD::SETULT) ? ISD::SETULE : ISD::SETUGT; RHS = DAG.getConstant(C-1, MVT::i32); } break; case ISD::SETLE: - case ISD::SETULE: case ISD::SETGT: - case ISD::SETUGT: if (isLegalCmpImmediate(C+1, isThumb)) { - switch (CC) { - default: break; - case ISD::SETLE: CC = ISD::SETLT; break; - case ISD::SETULE: CC = ISD::SETULT; break; - case ISD::SETGT: CC = ISD::SETGE; break; - case ISD::SETUGT: CC = ISD::SETUGE; break; - } + CC = (CC == ISD::SETLE) ? ISD::SETLT : ISD::SETGE; + RHS = DAG.getConstant(C+1, MVT::i32); + } + break; + case ISD::SETULE: + case ISD::SETUGT: + if (C < 0xffffffff && isLegalCmpImmediate(C+1, isThumb)) { + CC = (CC == ISD::SETULE) ? ISD::SETULT : ISD::SETUGE; RHS = DAG.getConstant(C+1, MVT::i32); } break; From reid at x10sys.com Thu Feb 1 20:17:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Makefile Message-ID: <200702020217.l122HVCj020151@zion.cs.uiuc.edu> Changes in directory llvm/lib: Makefile updated: 1.22 -> 1.23 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Makefile diff -u llvm/lib/Makefile:1.22 llvm/lib/Makefile:1.23 --- llvm/lib/Makefile:1.22 Wed May 17 17:55:35 2006 +++ llvm/lib/Makefile Thu Feb 1 20:16:21 2007 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = .. -PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target \ +PARALLEL_DIRS = VMCore AsmParser Bytecode Analysis Transforms CodeGen Target \ ExecutionEngine Debugger Linker include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Feb 1 20:17:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702020217.l122HYa0020156@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.354 -> 1.355 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+4 -1) SelectionDAGISel.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.354 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.355 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.354 Wed Jan 31 22:55:59 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Feb 1 20:16:22 2007 @@ -1420,7 +1420,10 @@ SDOperand Op1 = getValue(I.getOperand(0)); SDOperand Op2 = getValue(I.getOperand(1)); - Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); + if (TLI.getShiftAmountTy() < Op2.getValueType()) + Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2); + else if (TLI.getShiftAmountTy() > Op2.getValueType()) + Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2)); } From reid at x10sys.com Thu Feb 1 20:17:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp Message-ID: <200702020217.l122HZux020169@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.123 -> 1.124 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+5 -5) ExprTypeConvert.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.123 llvm/lib/Transforms/ExprTypeConvert.cpp:1.124 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.123 Thu Feb 1 13:14:51 2007 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Thu Feb 1 20:16:22 2007 @@ -251,8 +251,8 @@ case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - Res = new ShiftInst(cast(I)->getOpcode(), Dummy, - I->getOperand(1), Name); + Res = BinaryOperator::create(cast(I)->getOpcode(), Dummy, + I->getOperand(1), Name); VMC.ExprMap[I] = Res; Res->setOperand(0, ConvertExpressionToType(I->getOperand(0), Ty, VMC, TD)); break; @@ -472,9 +472,9 @@ } return false; } + case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - case Instruction::Shl: if (I->getOperand(1) == V) return false; // Cannot change shift amount type if (!Ty->isInteger()) return false; return ValueConvertibleToType(I, Ty, CTMap, TD); @@ -747,8 +747,8 @@ case Instruction::LShr: case Instruction::AShr: assert(I->getOperand(0) == OldVal); - Res = new ShiftInst(cast(I)->getOpcode(), NewVal, - I->getOperand(1), Name); + Res = BinaryOperator::create(cast(I)->getOpcode(), NewVal, + I->getOperand(1), Name); break; case Instruction::Free: // Free can free any pointer type! From reid at x10sys.com Thu Feb 1 20:17:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:35 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/add.ll Message-ID: <200702020217.l122HZbR020167@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: add.ll updated: 1.6 -> 1.7 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+16 -16) add.ll | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/test/CodeGen/Alpha/add.ll diff -u llvm/test/CodeGen/Alpha/add.ll:1.6 llvm/test/CodeGen/Alpha/add.ll:1.7 --- llvm/test/CodeGen/Alpha/add.ll:1.6 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/Alpha/add.ll Thu Feb 1 20:16:22 2007 @@ -69,112 +69,112 @@ define i32 @a4l(i32 sext %x.s, i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 2 ; [#uses=1] %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } define i32 @a8l(i32 sext %x.s, i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 3 ; [#uses=1] %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } define i64 @a4q(i64 %x.s, i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 2 ; [#uses=1] %tmp.3.s = add i64 %tmp.1.s, %x.s ; [#uses=1] ret i64 %tmp.3.s } define i64 @a8q(i64 %x.s, i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 3 ; [#uses=1] %tmp.3.s = add i64 %tmp.1.s, %x.s ; [#uses=1] ret i64 %tmp.3.s } define i32 @a4li(i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 2 ; [#uses=1] %tmp.3.s = add i32 100, %tmp.1.s ; [#uses=1] ret i32 %tmp.3.s } define i32 @a8li(i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 3 ; [#uses=1] %tmp.3.s = add i32 100, %tmp.1.s ; [#uses=1] ret i32 %tmp.3.s } define i64 @a4qi(i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 2 ; [#uses=1] %tmp.3.s = add i64 100, %tmp.1.s ; [#uses=1] ret i64 %tmp.3.s } define i64 @a8qi(i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 3 ; [#uses=1] %tmp.3.s = add i64 100, %tmp.1.s ; [#uses=1] ret i64 %tmp.3.s } define i32 @s4l(i32 sext %x.s, i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 2 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } define i32 @s8l(i32 sext %x.s, i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 3 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } define i64 @s4q(i64 %x.s, i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 2 ; [#uses=1] %tmp.3.s = sub i64 %tmp.1.s, %x.s ; [#uses=1] ret i64 %tmp.3.s } define i64 @s8q(i64 %x.s, i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 3 ; [#uses=1] %tmp.3.s = sub i64 %tmp.1.s, %x.s ; [#uses=1] ret i64 %tmp.3.s } define i32 @s4li(i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 2 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, 100 ; [#uses=1] ret i32 %tmp.3.s } define i32 @s8li(i32 sext %y.s) sext { entry: - %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i32 %y.s, 3 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, 100 ; [#uses=1] ret i32 %tmp.3.s } define i64 @s4qi(i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 2 ; [#uses=1] %tmp.3.s = sub i64 %tmp.1.s, 100 ; [#uses=1] ret i64 %tmp.3.s } define i64 @s8qi(i64 %y.s) { entry: - %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1] + %tmp.1.s = shl i64 %y.s, 3 ; [#uses=1] %tmp.3.s = sub i64 %tmp.1.s, 100 ; [#uses=1] ret i64 %tmp.3.s } From reid at x10sys.com Thu Feb 1 20:17:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200702020217.l122HZOZ020183@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.323 -> 1.324 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+8 -9) CBackend.cpp | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.323 llvm/lib/Target/CBackend/CBackend.cpp:1.324 --- llvm/lib/Target/CBackend/CBackend.cpp:1.323 Tue Jan 30 14:08:37 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Thu Feb 1 20:16:22 2007 @@ -225,7 +225,6 @@ void visitSelectInst(SelectInst &I); void visitCallInst (CallInst &I); void visitInlineAsm(CallInst &I); - void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); } void visitMallocInst(MallocInst &I); void visitAllocaInst(AllocaInst &I); @@ -2160,18 +2159,18 @@ writeOperandWithCast(I.getOperand(0), I.getOpcode()); switch (I.getOpcode()) { - case Instruction::Add: Out << " + "; break; - case Instruction::Sub: Out << " - "; break; - case Instruction::Mul: Out << '*'; break; + case Instruction::Add: Out << " + "; break; + case Instruction::Sub: Out << " - "; break; + case Instruction::Mul: Out << " * "; break; case Instruction::URem: case Instruction::SRem: - case Instruction::FRem: Out << '%'; break; + case Instruction::FRem: Out << " % "; break; case Instruction::UDiv: case Instruction::SDiv: - case Instruction::FDiv: Out << '/'; break; - case Instruction::And: Out << " & "; break; - case Instruction::Or: Out << " | "; break; - case Instruction::Xor: Out << " ^ "; break; + case Instruction::FDiv: Out << " / "; break; + case Instruction::And: Out << " & "; break; + case Instruction::Or: Out << " | "; break; + case Instruction::Xor: Out << " ^ "; break; case Instruction::Shl : Out << " << "; break; case Instruction::LShr: case Instruction::AShr: Out << " >> "; break; From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll 2007-01-31-RegInfoAssert.ll bits.ll long_shift.ll sxt_rot.ll uxt_rot.ll Message-ID: <200702020217.l122Ha42020196@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-01-19-InfiniteLoop.ll updated: 1.3 -> 1.4 2007-01-31-RegInfoAssert.ll updated: 1.1 -> 1.2 bits.ll updated: 1.2 -> 1.3 long_shift.ll updated: 1.2 -> 1.3 sxt_rot.ll updated: 1.2 -> 1.3 uxt_rot.ll updated: 1.2 -> 1.3 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+42 -42) 2007-01-19-InfiniteLoop.ll | 12 ++++++------ 2007-01-31-RegInfoAssert.ll | 2 +- bits.ll | 42 +++++++++++++++++++++--------------------- long_shift.ll | 16 ++++++++-------- sxt_rot.ll | 8 ++++---- uxt_rot.ll | 4 ++-- 6 files changed, 42 insertions(+), 42 deletions(-) Index: llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll diff -u llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.3 llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.4 --- llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll:1.3 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll Thu Feb 1 20:16:22 2007 @@ -19,13 +19,13 @@ %tmp502 = load i32* null ; [#uses=1] %tmp542 = getelementptr [6 x [4 x [4 x i32]]]* @quant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1] %tmp543 = load i32* %tmp542 ; [#uses=1] - %tmp548 = ashr i32 0, i8 0 ; [#uses=3] + %tmp548 = ashr i32 0, 0 ; [#uses=3] %tmp561 = sub i32 0, %tmp496 ; [#uses=3] %abscond563 = icmp sgt i32 %tmp561, -1 ; [#uses=1] %abs564 = select i1 %abscond563, i32 %tmp561, i32 0 ; [#uses=1] %tmp572 = mul i32 %abs564, %tmp543 ; [#uses=1] %tmp574 = add i32 %tmp572, 0 ; [#uses=1] - %tmp576 = ashr i32 %tmp574, i8 0 ; [#uses=7] + %tmp576 = ashr i32 %tmp574, 0 ; [#uses=7] %tmp579 = icmp eq i32 %tmp548, %tmp576 ; [#uses=1] br i1 %tmp579, label %bb712, label %cond_next589 @@ -40,8 +40,8 @@ %tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; [#uses=1] %tmp650 = mul i32 %tmp606, %tmp642 ; [#uses=1] %tmp656 = mul i32 %tmp650, %tmp612 ; [#uses=1] - %tmp658 = shl i32 %tmp656, i8 0 ; [#uses=1] - %tmp659 = ashr i32 %tmp658, i8 6 ; [#uses=1] + %tmp658 = shl i32 %tmp656, 0 ; [#uses=1] + %tmp659 = ashr i32 %tmp658, 6 ; [#uses=1] %tmp660 = sub i32 0, %tmp659 ; [#uses=1] %tmp666 = sub i32 %tmp660, %tmp496 ; [#uses=1] %tmp667 = sitofp i32 %tmp666 to double ; [#uses=2] @@ -85,8 +85,8 @@ %tmp786 = load i32* %tmp785 ; [#uses=1] %tmp781 = mul i32 %tmp780, %tmp761 ; [#uses=1] %tmp787 = mul i32 %tmp781, %tmp786 ; [#uses=1] - %tmp789 = shl i32 %tmp787, i8 0 ; [#uses=1] - %tmp790 = ashr i32 %tmp789, i8 6 ; [#uses=1] + %tmp789 = shl i32 %tmp787, 0 ; [#uses=1] + %tmp790 = ashr i32 %tmp789, 6 ; [#uses=1] br label %cond_next791 cond_next791: ; preds = %cond_true740, %bb737 Index: llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll diff -u llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll:1.1 llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll:1.2 --- llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll:1.1 Wed Jan 31 20:27:24 2007 +++ llvm/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll Thu Feb 1 20:16:22 2007 @@ -7,7 +7,7 @@ %D = alloca %struct.rtx_def, align 1 %tmp1 = bitcast %struct.rtx_def* %D to i32* %tmp7 = load i32* %tmp1 - %tmp14 = lshr i32 %tmp7, i8 1 + %tmp14 = lshr i32 %tmp7, 1 %tmp1415 = and i32 %tmp14, 1 call void (i32, ...)* @printf( i32 undef, i32 0, i32 %tmp1415 ) ret void Index: llvm/test/CodeGen/ARM/bits.ll diff -u llvm/test/CodeGen/ARM/bits.ll:1.2 llvm/test/CodeGen/ARM/bits.ll:1.3 --- llvm/test/CodeGen/ARM/bits.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/ARM/bits.ll Thu Feb 1 20:16:22 2007 @@ -1,36 +1,36 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep and | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep orr | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep eor | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mov.*lsl | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mov.*asr | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm | grep and | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep orr | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep eor | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep mov.*lsl | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep mov.*asr | wc -l | grep 1 -int %f1(int %a, int %b) { +define i32 @f1(i32 %a, i32 %b) { entry: - %tmp2 = and int %b, %a ; [#uses=1] - ret int %tmp2 + %tmp2 = and i32 %b, %a ; [#uses=1] + ret i32 %tmp2 } -int %f2(int %a, int %b) { +define i32 @f2(i32 %a, i32 %b) { entry: - %tmp2 = or int %b, %a ; [#uses=1] - ret int %tmp2 + %tmp2 = or i32 %b, %a ; [#uses=1] + ret i32 %tmp2 } -int %f3(int %a, int %b) { +define i32 @f3(i32 %a, i32 %b) { entry: - %tmp2 = xor int %b, %a ; [#uses=1] - ret int %tmp2 + %tmp2 = xor i32 %b, %a ; [#uses=1] + ret i32 %tmp2 } -int %f4(int %a, ubyte %b) { +define i32 @f4(i32 %a, i32 %b) { entry: - %tmp3 = shl int %a, ubyte %b ; [#uses=1] - ret int %tmp3 + %tmp3 = shl i32 %a, %b ; [#uses=1] + ret i32 %tmp3 } -int %f5(int %a, ubyte %b) { +define i32 @f5(i32 %a, i32 %b) { entry: - %tmp3 = shr int %a, ubyte %b ; [#uses=1] - ret int %tmp3 + %tmp3 = ashr i32 %a, %b ; [#uses=1] + ret i32 %tmp3 } Index: llvm/test/CodeGen/ARM/long_shift.ll diff -u llvm/test/CodeGen/ARM/long_shift.ll:1.2 llvm/test/CodeGen/ARM/long_shift.ll:1.3 --- llvm/test/CodeGen/ARM/long_shift.ll:1.2 Fri Jan 26 18:04:57 2007 +++ llvm/test/CodeGen/ARM/long_shift.ll Thu Feb 1 20:16:22 2007 @@ -5,27 +5,27 @@ ; RUN: llvm-as < %s | llc -march=arm | grep __lshrdi3 && ; RUN: llvm-as < %s | llc -march=arm -enable-thumb -define i64 @f00(i64 %A, i64 %B) { +define i64 @f0(i64 %A, i64 %B) { %tmp = bitcast i64 %A to i64 - %tmp2 = lshr i64 %B, i8 1 + %tmp2 = lshr i64 %B, 1 %tmp3 = sub i64 %tmp, %tmp2 ret i64 %tmp3 } -define i32 @f1(i64 %x, i8 %y) { - %a = shl i64 %x, i8 %y +define i32 @f1(i64 %x, i64 %y) { + %a = shl i64 %x, %y %b = trunc i64 %a to i32 ret i32 %b } -define i32 @f2(i64 %x, i8 %y) { - %a = ashr i64 %x, i8 %y +define i32 @f2(i64 %x, i64 %y) { + %a = ashr i64 %x, %y %b = trunc i64 %a to i32 ret i32 %b } -define i32 @f3(i64 %x, i8 %y) { - %a = lshr i64 %x, i8 %y +define i32 @f3(i64 %x, i64 %y) { + %a = lshr i64 %x, %y %b = trunc i64 %a to i32 ret i32 %b } Index: llvm/test/CodeGen/ARM/sxt_rot.ll diff -u llvm/test/CodeGen/ARM/sxt_rot.ll:1.2 llvm/test/CodeGen/ARM/sxt_rot.ll:1.3 --- llvm/test/CodeGen/ARM/sxt_rot.ll:1.2 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/sxt_rot.ll Thu Feb 1 20:16:22 2007 @@ -4,16 +4,16 @@ ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep "sxtab" | wc -l | grep 1 define i8 @test1(i32 %A) sext { - %B = lshr i32 %A, i8 8 - %C = shl i32 %A, i8 24 + %B = lshr i32 %A, 8 + %C = shl i32 %A, 24 %D = or i32 %B, %C %E = trunc i32 %D to i8 ret i8 %E } define i32 @test2(i32 %A, i32 %X) sext { - %B = lshr i32 %A, i8 8 - %C = shl i32 %A, i8 24 + %B = lshr i32 %A, 8 + %C = shl i32 %A, 24 %D = or i32 %B, %C %E = trunc i32 %D to i8 %F = sext i8 %E to i32 Index: llvm/test/CodeGen/ARM/uxt_rot.ll diff -u llvm/test/CodeGen/ARM/uxt_rot.ll:1.2 llvm/test/CodeGen/ARM/uxt_rot.ll:1.3 --- llvm/test/CodeGen/ARM/uxt_rot.ll:1.2 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/uxt_rot.ll Thu Feb 1 20:16:22 2007 @@ -17,8 +17,8 @@ } define i32 @test3(i32 %A.u) zext { - %B.u = lshr i32 %A.u, i8 8 - %C.u = shl i32 %A.u, i8 24 + %B.u = lshr i32 %A.u, 8 + %C.u = shl i32 %A.u, 24 %D.u = or i32 %B.u, %C.u %E.u = trunc i32 %D.u to i16 %F.u = zext i16 %E.u to i32 From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200702020217.l122Hai9020205@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.62 -> 1.63 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+32 -32) IntrinsicLowering.cpp | 64 +++++++++++++++++++++++++------------------------- 1 files changed, 32 insertions(+), 32 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.62 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.63 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.62 Tue Jan 30 14:08:37 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Thu Feb 1 20:16:22 2007 @@ -118,22 +118,22 @@ switch(BitSize) { default: assert(0 && "Unhandled type size of value to byteswap!"); case 16: { - Value *Tmp1 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.2",IP); - Value *Tmp2 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.1",IP); + Value *Tmp1 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),8),"bswap.2",IP); + Value *Tmp2 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),8),"bswap.1",IP); V = BinaryOperator::createOr(Tmp1, Tmp2, "bswap.i16", IP); break; } case 32: { - Value *Tmp4 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,24),"bswap.4", IP); - Value *Tmp3 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.3",IP); - Value *Tmp2 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.2",IP); - Value *Tmp1 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,24),"bswap.1", IP); + Value *Tmp4 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),24),"bswap.4", IP); + Value *Tmp3 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),8),"bswap.3",IP); + Value *Tmp2 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),8),"bswap.2",IP); + Value *Tmp1 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),24),"bswap.1", IP); Tmp3 = BinaryOperator::createAnd(Tmp3, ConstantInt::get(Type::Int32Ty, 0xFF0000), "bswap.and3", IP); @@ -146,22 +146,22 @@ break; } case 64: { - Value *Tmp8 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,56),"bswap.8", IP); - Value *Tmp7 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,40),"bswap.7", IP); - Value *Tmp6 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,24),"bswap.6", IP); - Value *Tmp5 = new ShiftInst(Instruction::Shl, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.5", IP); - Value* Tmp4 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,8),"bswap.4", IP); - Value* Tmp3 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,24),"bswap.3", IP); - Value* Tmp2 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,40),"bswap.2", IP); - Value* Tmp1 = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty,56),"bswap.1", IP); + Value *Tmp8 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),56),"bswap.8", IP); + Value *Tmp7 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),40),"bswap.7", IP); + Value *Tmp6 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),24),"bswap.6", IP); + Value *Tmp5 = BinaryOperator::create(Instruction::Shl, V, + ConstantInt::get(V->getType(),8),"bswap.5", IP); + Value* Tmp4 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),8),"bswap.4", IP); + Value* Tmp3 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),24),"bswap.3", IP); + Value* Tmp2 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),40),"bswap.2", IP); + Value* Tmp1 = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(),56),"bswap.1", IP); Tmp7 = BinaryOperator::createAnd(Tmp7, ConstantInt::get(Type::Int64Ty, 0xFF000000000000ULL), @@ -210,8 +210,8 @@ for (unsigned i = 1, ct = 0; i != BitSize; i <<= 1, ++ct) { Value *MaskCst = ConstantInt::get(V->getType(), MaskValues[ct]); Value *LHS = BinaryOperator::createAnd(V, MaskCst, "cppop.and1", IP); - Value *VShift = new ShiftInst(Instruction::LShr, V, - ConstantInt::get(Type::Int8Ty, i), "ctpop.sh", IP); + Value *VShift = BinaryOperator::create(Instruction::LShr, V, + ConstantInt::get(V->getType(), i), "ctpop.sh", IP); Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP); V = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP); } @@ -225,8 +225,8 @@ unsigned BitSize = V->getType()->getPrimitiveSizeInBits(); for (unsigned i = 1; i != BitSize; i <<= 1) { - Value *ShVal = ConstantInt::get(Type::Int8Ty, i); - ShVal = new ShiftInst(Instruction::LShr, V, ShVal, "ctlz.sh", IP); + Value *ShVal = ConstantInt::get(V->getType(), i); + ShVal = BinaryOperator::create(Instruction::LShr, V, ShVal, "ctlz.sh", IP); V = BinaryOperator::createOr(V, ShVal, "ctlz.step", IP); } From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/and-elim.ll and_sext.ll rlwinm2.ll rotl.ll Message-ID: <200702020217.l122HaY6020219@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: and-elim.ll updated: 1.6 -> 1.7 and_sext.ll updated: 1.7 -> 1.8 rlwinm2.ll updated: 1.2 -> 1.3 rotl.ll updated: 1.5 -> 1.6 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+50 -68) and-elim.ll | 4 +-- and_sext.ll | 4 +-- rlwinm2.ll | 43 +++++++++++++++++--------------------- rotl.ll | 67 +++++++++++++++++++++++------------------------------------- 4 files changed, 50 insertions(+), 68 deletions(-) Index: llvm/test/CodeGen/PowerPC/and-elim.ll diff -u llvm/test/CodeGen/PowerPC/and-elim.ll:1.6 llvm/test/CodeGen/PowerPC/and-elim.ll:1.7 --- llvm/test/CodeGen/PowerPC/and-elim.ll:1.6 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/and-elim.ll Thu Feb 1 20:16:22 2007 @@ -3,7 +3,7 @@ define void @test(i8* %P) { %W = load i8* %P - %X = shl i8 %W, i8 1 + %X = shl i8 %W, 1 %Y = add i8 %X, 2 %Z = and i8 %Y, 254 ; dead and store i8 %Z, i8* %P @@ -12,7 +12,7 @@ define i16 @test2(i16 zext %crc) zext { ; No and's should be needed for the i16s here. - %tmp.1 = lshr i16 %crc, i8 1 + %tmp.1 = lshr i16 %crc, 1 %tmp.7 = xor i16 %tmp.1, 40961 ret i16 %tmp.7 } Index: llvm/test/CodeGen/PowerPC/and_sext.ll diff -u llvm/test/CodeGen/PowerPC/and_sext.ll:1.7 llvm/test/CodeGen/PowerPC/and_sext.ll:1.8 --- llvm/test/CodeGen/PowerPC/and_sext.ll:1.7 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/PowerPC/and_sext.ll Thu Feb 1 20:16:22 2007 @@ -14,7 +14,7 @@ %tmp = sext i16 %X to i32 %tmp1 = sext i16 %x to i32 %tmp2 = add i32 %tmp, %tmp1 - %tmp4 = ashr i32 %tmp2, i8 1 + %tmp4 = ashr i32 %tmp2, 1 %tmp5 = trunc i32 %tmp4 to i16 %tmp45 = sext i16 %tmp5 to i32 %retval = trunc i32 %tmp45 to i16 @@ -22,7 +22,7 @@ } define i16 @test3(i32 zext %X) sext { - %tmp1 = lshr i32 %X, i8 16 + %tmp1 = lshr i32 %X, 16 %tmp2 = trunc i32 %tmp1 to i16 ret i16 %tmp2 } Index: llvm/test/CodeGen/PowerPC/rlwinm2.ll diff -u llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.2 llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.3 --- llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/rlwinm2.ll Thu Feb 1 20:16:22 2007 @@ -1,30 +1,27 @@ ; All of these ands and shifts should be folded into rlw[i]nm instructions -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srwi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep slwi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwnm | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwinm | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep and && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep srwi && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 1 - -implementation ; Functions: - -uint %test1(uint %X, int %Y) { +define i32 @test1(i32 %X, i32 %Y) { entry: - %tmp = cast int %Y to ubyte ; [#uses=2] - %tmp1 = shl uint %X, ubyte %tmp ; [#uses=1] - %tmp2 = sub ubyte 32, %tmp ; [#uses=1] - %tmp3 = shr uint %X, ubyte %tmp2 ; [#uses=1] - %tmp4 = or uint %tmp1, %tmp3 ; [#uses=1] - %tmp6 = and uint %tmp4, 127 ; [#uses=1] - ret uint %tmp6 + %tmp = trunc i32 %Y to i8 ; [#uses=2] + %tmp1 = shl i32 %X, %Y ; [#uses=1] + %tmp2 = sub i32 32, %Y ; [#uses=1] + %tmp3 = lshr i32 %X, %tmp2 ; [#uses=1] + %tmp4 = or i32 %tmp1, %tmp3 ; [#uses=1] + %tmp6 = and i32 %tmp4, 127 ; [#uses=1] + ret i32 %tmp6 } -uint %test2(uint %X) { +define i32 @test2(i32 %X) { entry: - %tmp1 = shr uint %X, ubyte 27 ; [#uses=1] - %tmp2 = shl uint %X, ubyte 5 ; [#uses=1] - %tmp2.masked = and uint %tmp2, 96 ; [#uses=1] - %tmp5 = or uint %tmp1, %tmp2.masked ; [#uses=1] - ret uint %tmp5 + %tmp1 = lshr i32 %X, 27 ; [#uses=1] + %tmp2 = shl i32 %X, 5 ; [#uses=1] + %tmp2.masked = and i32 %tmp2, 96 ; [#uses=1] + %tmp5 = or i32 %tmp1, %tmp2.masked ; [#uses=1] + ret i32 %tmp5 } Index: llvm/test/CodeGen/PowerPC/rotl.ll diff -u llvm/test/CodeGen/PowerPC/rotl.ll:1.5 llvm/test/CodeGen/PowerPC/rotl.ll:1.6 --- llvm/test/CodeGen/PowerPC/rotl.ll:1.5 Fri Jan 5 12:33:43 2007 +++ llvm/test/CodeGen/PowerPC/rotl.ll Thu Feb 1 20:16:22 2007 @@ -1,53 +1,38 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep or && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ -; RUN: grep rlwnm | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ -; RUN: grep rlwinm | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep or && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 2 -implementation ; Functions: - -int %rotlw(uint %x, int %sh) { +define i32 @rotlw(i32 %x, i32 %sh) { entry: - %tmp.3 = cast int %sh to ubyte ; [#uses=1] - %x = cast uint %x to int ; [#uses=1] - %tmp.7 = sub int 32, %sh ; [#uses=1] - %tmp.9 = cast int %tmp.7 to ubyte ; [#uses=1] - %tmp.10 = shr uint %x, ubyte %tmp.9 ; [#uses=1] - %tmp.4 = shl int %x, ubyte %tmp.3 ; [#uses=1] - %tmp.10 = cast uint %tmp.10 to int ; [#uses=1] - %tmp.12 = or int %tmp.10, %tmp.4 ; [#uses=1] - ret int %tmp.12 + %tmp.7 = sub i32 32, %sh ; [#uses=1] + %tmp.10 = lshr i32 %x, %tmp.7 ; [#uses=2] + %tmp.4 = shl i32 %x, %sh ; [#uses=1] + %tmp.12 = or i32 %tmp.10, %tmp.4 ; [#uses=1] + ret i32 %tmp.12 } -int %rotrw(uint %x, int %sh) { +define i32 @rotrw(i32 %x, i32 %sh) { entry: - %tmp.3 = cast int %sh to ubyte ; [#uses=1] - %tmp.4 = shr uint %x, ubyte %tmp.3 ; [#uses=1] - %tmp.7 = sub int 32, %sh ; [#uses=1] - %tmp.9 = cast int %tmp.7 to ubyte ; [#uses=1] - %x = cast uint %x to int ; [#uses=1] - %tmp.4 = cast uint %tmp.4 to int ; [#uses=1] - %tmp.10 = shl int %x, ubyte %tmp.9 ; [#uses=1] - %tmp.12 = or int %tmp.4, %tmp.10 ; [#uses=1] - ret int %tmp.12 + %tmp.3 = trunc i32 %sh to i8 ; [#uses=1] + %tmp.4 = lshr i32 %x, %sh ; [#uses=2] + %tmp.7 = sub i32 32, %sh ; [#uses=1] + %tmp.10 = shl i32 %x, %tmp.7 ; [#uses=1] + %tmp.12 = or i32 %tmp.4, %tmp.10 ; [#uses=1] + ret i32 %tmp.12 } -int %rotlwi(uint %x) { +define i32 @rotlwi(i32 %x) { entry: - %x = cast uint %x to int ; [#uses=1] - %tmp.7 = shr uint %x, ubyte 27 ; [#uses=1] - %tmp.3 = shl int %x, ubyte 5 ; [#uses=1] - %tmp.7 = cast uint %tmp.7 to int ; [#uses=1] - %tmp.9 = or int %tmp.3, %tmp.7 ; [#uses=1] - ret int %tmp.9 + %tmp.7 = lshr i32 %x, 27 ; [#uses=2] + %tmp.3 = shl i32 %x, 5 ; [#uses=1] + %tmp.9 = or i32 %tmp.3, %tmp.7 ; [#uses=1] + ret i32 %tmp.9 } -int %rotrwi(uint %x) { +define i32 @rotrwi(i32 %x) { entry: - %tmp.3 = shr uint %x, ubyte 5 ; [#uses=1] - %x = cast uint %x to int ; [#uses=1] - %tmp.3 = cast uint %tmp.3 to int ; [#uses=1] - %tmp.7 = shl int %x, ubyte 27 ; [#uses=1] - %tmp.9 = or int %tmp.3, %tmp.7 ; [#uses=1] - ret int %tmp.9 + %tmp.3 = lshr i32 %x, 5 ; [#uses=2] + %tmp.7 = shl i32 %x, 27 ; [#uses=1] + %tmp.9 = or i32 %tmp.3, %tmp.7 ; [#uses=1] + ret i32 %tmp.9 } From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp Message-ID: <200702020217.l122HaRP020190@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.43 -> 1.44 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+0 -3) Andersens.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.43 llvm/lib/Analysis/IPA/Andersens.cpp:1.44 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.43 Tue Jan 30 14:08:37 2007 +++ llvm/lib/Analysis/IPA/Andersens.cpp Thu Feb 1 20:16:22 2007 @@ -776,9 +776,6 @@ case Instruction::Unwind: case Instruction::Unreachable: case Instruction::Free: - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: case Instruction::ICmp: case Instruction::FCmp: return; From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LICM.cpp SCCP.cpp ScalarReplAggregates.cpp Message-ID: <200702020217.l122HbLA020290@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.619 -> 1.620 LICM.cpp updated: 1.85 -> 1.86 SCCP.cpp updated: 1.155 -> 1.156 ScalarReplAggregates.cpp updated: 1.68 -> 1.69 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+164 -146) InstructionCombining.cpp | 295 +++++++++++++++++++++++++---------------------- LICM.cpp | 2 SCCP.cpp | 1 ScalarReplAggregates.cpp | 12 - 4 files changed, 164 insertions(+), 146 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.619 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.620 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.619 Thu Feb 1 16:30:07 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Feb 1 20:16:22 2007 @@ -145,15 +145,18 @@ Instruction *visitAnd(BinaryOperator &I); Instruction *visitOr (BinaryOperator &I); Instruction *visitXor(BinaryOperator &I); + Instruction *visitShl(BinaryOperator &I); + Instruction *visitAShr(BinaryOperator &I); + Instruction *visitLShr(BinaryOperator &I); + Instruction *commonShiftTransforms(BinaryOperator &I); Instruction *visitFCmpInst(FCmpInst &I); Instruction *visitICmpInst(ICmpInst &I); Instruction *visitICmpInstWithCastAndCast(ICmpInst &ICI); Instruction *FoldGEPICmp(User *GEPLHS, Value *RHS, ICmpInst::Predicate Cond, Instruction &I); - Instruction *visitShiftInst(ShiftInst &I); Instruction *FoldShiftByConstant(Value *Op0, ConstantInt *Op1, - ShiftInst &I); + BinaryOperator &I); Instruction *commonCastTransforms(CastInst &CI); Instruction *commonIntCastTransforms(CastInst &CI); Instruction *visitTrunc(CastInst &CI); @@ -1197,8 +1200,8 @@ // the shift amount is >= the size of the datatype, which is undefined. if (DemandedMask == 1) { // Perform the logical shift right. - Value *NewVal = new ShiftInst(Instruction::LShr, I->getOperand(0), - I->getOperand(1), I->getName()); + Value *NewVal = BinaryOperator::create(Instruction::LShr, + I->getOperand(0), I->getOperand(1), I->getName()); InsertNewInstBefore(cast(NewVal), *I); return UpdateValueUsesWith(I, NewVal); } @@ -1229,8 +1232,8 @@ // are demanded, turn this into an unsigned shift right. if ((KnownZero & SignBit) || (HighBits & ~DemandedMask) == HighBits) { // Perform the logical shift right. - Value *NewVal = new ShiftInst(Instruction::LShr, I->getOperand(0), - SA, I->getName()); + Value *NewVal = BinaryOperator::create(Instruction::LShr, + I->getOperand(0), SA, I->getName()); InsertNewInstBefore(cast(NewVal), *I); return UpdateValueUsesWith(I, NewVal); } else if (KnownOne & SignBit) { // New bits are known one. @@ -1546,8 +1549,8 @@ AddRHS(Value *rhs) : RHS(rhs) {} bool shouldApply(Value *LHS) const { return LHS == RHS; } Instruction *apply(BinaryOperator &Add) const { - return new ShiftInst(Instruction::Shl, Add.getOperand(0), - ConstantInt::get(Type::Int8Ty, 1)); + return BinaryOperator::create(Instruction::Shl, Add.getOperand(0), + ConstantInt::get(Add.getType(), 1)); } }; @@ -1595,8 +1598,6 @@ else if (CmpInst *CI = dyn_cast(&I)) New = CmpInst::create(CI->getOpcode(), CI->getPredicate(), Op0, Op1, SO->getName()+".cmp"); - else if (ShiftInst *SI = dyn_cast(&I)) - New = new ShiftInst(SI->getOpcode(), Op0, Op1, SO->getName()+".sh"); else { assert(0 && "Unknown binary instruction type!"); abort(); @@ -1688,10 +1689,6 @@ CI->getPredicate(), PN->getIncomingValue(i), C, "phitmp", NonConstBB->getTerminator()); - else if (ShiftInst *SI = dyn_cast(&I)) - InV = new ShiftInst(SI->getOpcode(), - PN->getIncomingValue(i), C, "phitmp", - NonConstBB->getTerminator()); else assert(0 && "Unknown binop!"); @@ -1958,15 +1955,15 @@ // -(X >>u 31) -> (X >>s 31) // -(X >>s 31) -> (X >>u 31) if (C->isNullValue()) { - if (ShiftInst *SI = dyn_cast(Op1)) + if (BinaryOperator *SI = dyn_cast(Op1)) if (SI->getOpcode() == Instruction::LShr) { if (ConstantInt *CU = dyn_cast(SI->getOperand(1))) { // Check to see if we are shifting out everything but the sign bit. if (CU->getZExtValue() == SI->getType()->getPrimitiveSizeInBits()-1) { // Ok, the transformation is safe. Insert AShr. - return new ShiftInst(Instruction::AShr, SI->getOperand(0), CU, - SI->getName()); + return BinaryOperator::create(Instruction::AShr, + SI->getOperand(0), CU, SI->getName()); } } } @@ -1976,8 +1973,8 @@ if (CU->getZExtValue() == SI->getType()->getPrimitiveSizeInBits()-1) { // Ok, the transformation is safe. Insert LShr. - return new ShiftInst(Instruction::LShr, SI->getOperand(0), CU, - SI->getName()); + return BinaryOperator::create(Instruction::LShr, + SI->getOperand(0), CU, SI->getName()); } } } @@ -2113,7 +2110,7 @@ if (ConstantInt *CI = dyn_cast(Op1)) { // ((X << C1)*C2) == (X * (C2 << C1)) - if (ShiftInst *SI = dyn_cast(Op0)) + if (BinaryOperator *SI = dyn_cast(Op0)) if (SI->getOpcode() == Instruction::Shl) if (Constant *ShOp = dyn_cast(SI->getOperand(1))) return BinaryOperator::createMul(SI->getOperand(0), @@ -2129,8 +2126,8 @@ int64_t Val = (int64_t)cast(CI)->getZExtValue(); if (isPowerOf2_64(Val)) { // Replace X*(2^C) with X << C uint64_t C = Log2_64(Val); - return new ShiftInst(Instruction::Shl, Op0, - ConstantInt::get(Type::Int8Ty, C)); + return BinaryOperator::create(Instruction::Shl, Op0, + ConstantInt::get(Op0->getType(), C)); } } else if (ConstantFP *Op1F = dyn_cast(Op1)) { if (Op1F->isNullValue()) @@ -2191,10 +2188,11 @@ if (isa(SCIOp1) && isSignBitCheck(SCI->getPredicate(), cast(SCIOp1))) { // Shift the X value right to turn it into "all signbits". - Constant *Amt = ConstantInt::get(Type::Int8Ty, + Constant *Amt = ConstantInt::get(SCIOp0->getType(), SCOpTy->getPrimitiveSizeInBits()-1); Value *V = - InsertNewInstBefore(new ShiftInst(Instruction::AShr, SCIOp0, Amt, + InsertNewInstBefore( + BinaryOperator::create(Instruction::AShr, SCIOp0, Amt, BoolCast->getOperand(0)->getName()+ ".mask"), I); @@ -2324,13 +2322,13 @@ if (uint64_t Val = C->getZExtValue()) // Don't break X / 0 if (isPowerOf2_64(Val)) { uint64_t ShiftAmt = Log2_64(Val); - return new ShiftInst(Instruction::LShr, Op0, - ConstantInt::get(Type::Int8Ty, ShiftAmt)); + return BinaryOperator::create(Instruction::LShr, Op0, + ConstantInt::get(Op0->getType(), ShiftAmt)); } } // X udiv (C1 << N), where C1 is "1< X >> (N+C2) - if (ShiftInst *RHSI = dyn_cast(I.getOperand(1))) { + if (BinaryOperator *RHSI = dyn_cast(I.getOperand(1))) { if (RHSI->getOpcode() == Instruction::Shl && isa(RHSI->getOperand(0))) { uint64_t C1 = cast(RHSI->getOperand(0))->getZExtValue(); @@ -2341,7 +2339,7 @@ Constant *C2V = ConstantInt::get(NTy, C2); N = InsertNewInstBefore(BinaryOperator::createAdd(N, C2V, "tmp"), I); } - return new ShiftInst(Instruction::LShr, Op0, N); + return BinaryOperator::create(Instruction::LShr, Op0, N); } } } @@ -2357,15 +2355,15 @@ // Compute the shift amounts unsigned TSA = Log2_64(TVA), FSA = Log2_64(FVA); // Construct the "on true" case of the select - Constant *TC = ConstantInt::get(Type::Int8Ty, TSA); - Instruction *TSI = - new ShiftInst(Instruction::LShr, Op0, TC, SI->getName()+".t"); + Constant *TC = ConstantInt::get(Op0->getType(), TSA); + Instruction *TSI = BinaryOperator::create(Instruction::LShr, + Op0, TC, SI->getName()+".t"); TSI = InsertNewInstBefore(TSI, I); // Construct the "on false" case of the select - Constant *FC = ConstantInt::get(Type::Int8Ty, FSA); - Instruction *FSI = - new ShiftInst(Instruction::LShr, Op0, FC, SI->getName()+".f"); + Constant *FC = ConstantInt::get(Op0->getType(), FSA); + Instruction *FSI = BinaryOperator::create(Instruction::LShr, + Op0, FC, SI->getName()+".f"); FSI = InsertNewInstBefore(FSI, I); // construct the select instruction and return it. @@ -2437,7 +2435,7 @@ unsigned Zeros = CountTrailingZeros_64(RHS->getZExtValue()); if (Zeros != V->getType()->getPrimitiveSizeInBits()) return ConstantExpr::getShl(Result, - ConstantInt::get(Type::Int8Ty, Zeros)); + ConstantInt::get(Result->getType(), Zeros)); } } else if (CastInst *CI = dyn_cast(I)) { // Only handle int->int casts. @@ -2801,14 +2799,14 @@ // OptAndOp - This handles expressions of the form ((val OP C1) & C2). Where // the Op parameter is 'OP', OpRHS is 'C1', and AndRHS is 'C2'. Op is -// guaranteed to be either a shift instruction or a binary operator. +// guaranteed to be a binary operator. Instruction *InstCombiner::OptAndOp(Instruction *Op, ConstantInt *OpRHS, ConstantInt *AndRHS, BinaryOperator &TheAnd) { Value *X = Op->getOperand(0); Constant *Together = 0; - if (!isa(Op)) + if (!Op->isShift()) Together = ConstantExpr::getAnd(AndRHS, OpRHS); switch (Op->getOpcode()) { @@ -2917,8 +2915,9 @@ // (Val ashr C1) & C2 -> (Val lshr C1) & C2 // Make the argument unsigned. Value *ShVal = Op->getOperand(0); - ShVal = InsertNewInstBefore(new ShiftInst(Instruction::LShr, ShVal, - OpRHS, Op->getName()), TheAnd); + ShVal = InsertNewInstBefore( + BinaryOperator::create(Instruction::LShr, ShVal, OpRHS, + Op->getName()), TheAnd); return BinaryOperator::createAnd(ShVal, AndRHS, TheAnd.getName()); } } @@ -3082,7 +3081,7 @@ uint64_t NotAndRHS = AndRHSMask^TypeMask; // Optimize a variety of ((val OP C1) & C2) combinations... - if (isa(Op0) || isa(Op0)) { + if (isa(Op0)) { Instruction *Op0I = cast(Op0); Value *Op0LHS = Op0I->getOperand(0); Value *Op0RHS = Op0I->getOperand(1); @@ -3391,16 +3390,17 @@ } // (X >> Z) & (Y >> Z) -> (X&Y) >> Z for all shifts. - if (ShiftInst *SI1 = dyn_cast(Op1)) { - if (ShiftInst *SI0 = dyn_cast(Op0)) - if (SI0->getOpcode() == SI1->getOpcode() && + if (BinaryOperator *SI1 = dyn_cast(Op1)) { + if (BinaryOperator *SI0 = dyn_cast(Op0)) + if (SI0->isShift() && SI0->getOpcode() == SI1->getOpcode() && SI0->getOperand(1) == SI1->getOperand(1) && (SI0->hasOneUse() || SI1->hasOneUse())) { Instruction *NewOp = InsertNewInstBefore(BinaryOperator::createAnd(SI0->getOperand(0), SI1->getOperand(0), SI0->getName()), I); - return new ShiftInst(SI1->getOpcode(), NewOp, SI1->getOperand(1)); + return BinaryOperator::create(SI1->getOpcode(), NewOp, + SI1->getOperand(1)); } } @@ -3421,7 +3421,7 @@ // If this is a shift by a constant int, and it is "24", then its operand // defines a byte. We only handle unsigned types here. - if (isa(I) && isa(I->getOperand(1))) { + if (I->isShift() && isa(I->getOperand(1))) { // Not shifting the entire input by N-1 bytes? if (cast(I->getOperand(1))->getZExtValue() != 8*(ByteValues.size()-1)) @@ -3488,7 +3488,7 @@ /// MatchBSwap - Given an OR instruction, check to see if this is a bswap idiom. /// If so, insert the new bswap intrinsic and return it. Instruction *InstCombiner::MatchBSwap(BinaryOperator &I) { - // We can only handle bswap of unsigned integers, and cannot bswap one byte. + // We cannot bswap one byte. if (I.getType() == Type::Int8Ty) return 0; @@ -3647,16 +3647,17 @@ } // (X >> Z) | (Y >> Z) -> (X|Y) >> Z for all shifts. - if (ShiftInst *SI1 = dyn_cast(Op1)) { - if (ShiftInst *SI0 = dyn_cast(Op0)) - if (SI0->getOpcode() == SI1->getOpcode() && + if (BinaryOperator *SI1 = dyn_cast(Op1)) { + if (BinaryOperator *SI0 = dyn_cast(Op0)) + if (SI0->isShift() && SI0->getOpcode() == SI1->getOpcode() && SI0->getOperand(1) == SI1->getOperand(1) && (SI0->hasOneUse() || SI1->hasOneUse())) { Instruction *NewOp = InsertNewInstBefore(BinaryOperator::createOr(SI0->getOperand(0), SI1->getOperand(0), SI0->getName()), I); - return new ShiftInst(SI1->getOpcode(), NewOp, SI1->getOperand(1)); + return BinaryOperator::create(SI1->getOpcode(), NewOp, + SI1->getOperand(1)); } } @@ -4025,16 +4026,17 @@ } // (X >> Z) ^ (Y >> Z) -> (X^Y) >> Z for all shifts. - if (ShiftInst *SI1 = dyn_cast(Op1)) { - if (ShiftInst *SI0 = dyn_cast(Op0)) - if (SI0->getOpcode() == SI1->getOpcode() && + if (BinaryOperator *SI1 = dyn_cast(Op1)) { + if (BinaryOperator *SI0 = dyn_cast(Op0)) + if (SI0->isShift() && SI0->getOpcode() == SI1->getOpcode() && SI0->getOperand(1) == SI1->getOperand(1) && (SI0->hasOneUse() || SI1->hasOneUse())) { Instruction *NewOp = InsertNewInstBefore(BinaryOperator::createXor(SI0->getOperand(0), SI1->getOperand(0), SI0->getName()), I); - return new ShiftInst(SI1->getOpcode(), NewOp, SI1->getOperand(1)); + return BinaryOperator::create(SI1->getOpcode(), NewOp, + SI1->getOperand(1)); } } @@ -4599,13 +4601,18 @@ // could exist), turn it into (X & (C2 << C1)) != (C3 << C1). This // happens a LOT in code produced by the C front-end, for bitfield // access. - ShiftInst *Shift = dyn_cast(LHSI->getOperand(0)); + BinaryOperator *Shift = dyn_cast(LHSI->getOperand(0)); + if (Shift && !Shift->isShift()) + Shift = 0; // Check to see if there is a noop-cast between the shift and the and. if (!Shift) { if (CastInst *CI = dyn_cast(LHSI->getOperand(0))) - if (CI->getOpcode() == Instruction::BitCast) - Shift = dyn_cast(CI->getOperand(0)); + if (CI->getOpcode() == Instruction::BitCast) { + Shift = dyn_cast(CI->getOperand(0)); + if (Shift && !Shift->isShift()) + Shift = 0; + } } ConstantInt *ShAmt; @@ -4624,7 +4631,7 @@ int ShAmtVal = Ty->getPrimitiveSizeInBits()-ShAmt->getZExtValue(); if (ShAmtVal < 0) ShAmtVal = 0; // Out of range shift. - Constant *OShAmt = ConstantInt::get(Type::Int8Ty, ShAmtVal); + Constant *OShAmt = ConstantInt::get(AndTy, ShAmtVal); Constant *ShVal = ConstantExpr::getShl(ConstantInt::getAllOnesValue(AndTy), OShAmt); @@ -4674,12 +4681,12 @@ // Compute C << Y. Value *NS; if (Shift->getOpcode() == Instruction::LShr) { - NS = new ShiftInst(Instruction::Shl, AndCST, Shift->getOperand(1), - "tmp"); + NS = BinaryOperator::create(Instruction::Shl, AndCST, + Shift->getOperand(1), "tmp"); } else { // Insert a logical shift. - NS = new ShiftInst(Instruction::LShr, AndCST, - Shift->getOperand(1), "tmp"); + NS = BinaryOperator::create(Instruction::LShr, AndCST, + Shift->getOperand(1), "tmp"); } InsertNewInstBefore(cast(NS), I); @@ -5368,13 +5375,25 @@ } } -Instruction *InstCombiner::visitShiftInst(ShiftInst &I) { - assert(I.getOperand(1)->getType() == Type::Int8Ty); +Instruction *InstCombiner::visitShl(BinaryOperator &I) { + return commonShiftTransforms(I); +} + +Instruction *InstCombiner::visitLShr(BinaryOperator &I) { + return commonShiftTransforms(I); +} + +Instruction *InstCombiner::visitAShr(BinaryOperator &I) { + return commonShiftTransforms(I); +} + +Instruction *InstCombiner::commonShiftTransforms(BinaryOperator &I) { + assert(I.getOperand(1)->getType() == I.getOperand(0)->getType()); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); // shl X, 0 == X and shr X, 0 == X // shl 0, X == 0 and shr 0, X == 0 - if (Op1 == Constant::getNullValue(Type::Int8Ty) || + if (Op1 == Constant::getNullValue(Op1->getType()) || Op0 == Constant::getNullValue(Op0->getType())) return ReplaceInstUsesWith(I, Op0); @@ -5407,7 +5426,7 @@ if (I.isArithmeticShift()) { if (MaskedValueIsZero(Op0, 1ULL << (I.getType()->getPrimitiveSizeInBits()-1))) { - return new ShiftInst(Instruction::LShr, Op0, Op1, I.getName()); + return BinaryOperator::create(Instruction::LShr, Op0, Op1, I.getName()); } } @@ -5418,7 +5437,7 @@ } Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1, - ShiftInst &I) { + BinaryOperator &I) { bool isLeftShift = I.getOpcode() == Instruction::Shl; bool isSignedShift = I.getOpcode() == Instruction::AShr; bool isUnsignedShift = !isSignedShift; @@ -5474,7 +5493,7 @@ if (isLeftShift && Op0BO->getOperand(1)->hasOneUse() && match(Op0BO->getOperand(1), m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) { - Instruction *YS = new ShiftInst(Instruction::Shl, + Instruction *YS = BinaryOperator::create(Instruction::Shl, Op0BO->getOperand(0), Op1, Op0BO->getName()); InsertNewInstBefore(YS, I); // (Y << C) @@ -5489,13 +5508,12 @@ // Turn (Y + ((X >> C) & CC)) << C -> ((X & (CC << C)) + (Y << C)) if (isLeftShift && Op0BO->getOperand(1)->hasOneUse() && - match(Op0BO->getOperand(1), - m_And(m_Shr(m_Value(V1), m_Value(V2)), - m_ConstantInt(CC))) && V2 == Op1 && + match(Op0BO->getOperand(1), m_And(m_Shr(m_Value(V1), m_Value(V2)), + m_ConstantInt(CC))) && V2 == Op1 && cast(Op0BO->getOperand(1))->getOperand(0)->hasOneUse()) { - Instruction *YS = new ShiftInst(Instruction::Shl, - Op0BO->getOperand(0), Op1, - Op0BO->getName()); + Instruction *YS = BinaryOperator::create(Instruction::Shl, + Op0BO->getOperand(0), Op1, + Op0BO->getName()); InsertNewInstBefore(YS, I); // (Y << C) Instruction *XM = BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1), @@ -5511,9 +5529,9 @@ if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() && match(Op0BO->getOperand(0), m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) { - Instruction *YS = new ShiftInst(Instruction::Shl, - Op0BO->getOperand(1), Op1, - Op0BO->getName()); + Instruction *YS = BinaryOperator::create(Instruction::Shl, + Op0BO->getOperand(1), Op1, + Op0BO->getName()); InsertNewInstBefore(YS, I); // (Y << C) Instruction *X = BinaryOperator::create(Op0BO->getOpcode(), V1, YS, @@ -5531,9 +5549,9 @@ m_ConstantInt(CC))) && V2 == Op1 && cast(Op0BO->getOperand(0)) ->getOperand(0)->hasOneUse()) { - Instruction *YS = new ShiftInst(Instruction::Shl, - Op0BO->getOperand(1), Op1, - Op0BO->getName()); + Instruction *YS = BinaryOperator::create(Instruction::Shl, + Op0BO->getOperand(1), Op1, + Op0BO->getName()); InsertNewInstBefore(YS, I); // (Y << C) Instruction *XM = BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1), @@ -5582,8 +5600,8 @@ Constant *NewRHS = ConstantExpr::get(I.getOpcode(), Op0C, Op1); Instruction *NewShift = - new ShiftInst(I.getOpcode(), Op0BO->getOperand(0), Op1, - Op0BO->getName()); + BinaryOperator::create(I.getOpcode(), Op0BO->getOperand(0), Op1, + Op0BO->getName()); Op0BO->setName(""); InsertNewInstBefore(NewShift, I); @@ -5595,15 +5613,15 @@ } // Find out if this is a shift of a shift by a constant. - ShiftInst *ShiftOp = 0; - if (ShiftInst *Op0SI = dyn_cast(Op0)) - ShiftOp = Op0SI; - else if (BitCastInst *CI = dyn_cast(Op0)) { - // If this is a noop-integer cast of a shift instruction, use the shift. - if (isa(CI->getOperand(0))) { - ShiftOp = cast(CI->getOperand(0)); - } - } + BinaryOperator *ShiftOp = dyn_cast(Op0); + if (ShiftOp && !ShiftOp->isShift()) + ShiftOp = 0; + if (!ShiftOp) + if (BitCastInst *CI = dyn_cast(Op0)) + // If this is a noop-integer cast of a shift instruction, use the shift. + if (BinaryOperator *SI = dyn_cast(CI->getOperand(0))) + if (SI->isShift()) + ShiftOp = SI; if (ShiftOp && isa(ShiftOp->getOperand(1))) { // Find the operands and properties of the input shift. Note that the @@ -5631,8 +5649,9 @@ Amt = Op0->getType()->getPrimitiveSizeInBits(); Value *Op = ShiftOp->getOperand(0); - ShiftInst *ShiftResult = new ShiftInst(I.getOpcode(), Op, - ConstantInt::get(Type::Int8Ty, Amt)); + BinaryOperator *ShiftResult = + BinaryOperator::create(I.getOpcode(), Op, + ConstantInt::get(Op->getType(), Amt)); if (I.getType() == ShiftResult->getType()) return ShiftResult; InsertNewInstBefore(ShiftResult, I); @@ -5660,21 +5679,25 @@ if (ShiftAmt1 == ShiftAmt2) { return ReplaceInstUsesWith(I, Mask); // (A << c) >> c === A & c2 } else if (ShiftAmt1 < ShiftAmt2) { - return new ShiftInst(I.getOpcode(), Mask, - ConstantInt::get(Type::Int8Ty, ShiftAmt2-ShiftAmt1)); + return BinaryOperator::create(I.getOpcode(), Mask, + ConstantInt::get(Mask->getType(), + ShiftAmt2-ShiftAmt1)); } else if (isShiftOfUnsignedShift || isShiftOfLeftShift) { if (isShiftOfUnsignedShift && !isShiftOfLeftShift && isSignedShift) { - return new ShiftInst(Instruction::LShr, Mask, - ConstantInt::get(Type::Int8Ty, ShiftAmt1-ShiftAmt2)); + return BinaryOperator::create(Instruction::LShr, Mask, + ConstantInt::get(Mask->getType(), + ShiftAmt1-ShiftAmt2)); } else { - return new ShiftInst(ShiftOp->getOpcode(), Mask, - ConstantInt::get(Type::Int8Ty, ShiftAmt1-ShiftAmt2)); + return BinaryOperator::create(ShiftOp->getOpcode(), Mask, + ConstantInt::get(Mask->getType(), + ShiftAmt1-ShiftAmt2)); } } else { // (X >>s C1) << C2 where C1 > C2 === (X >>s (C1-C2)) & mask Instruction *Shift = - new ShiftInst(ShiftOp->getOpcode(), Mask, - ConstantInt::get(Type::Int8Ty, ShiftAmt1-ShiftAmt2)); + BinaryOperator::create(ShiftOp->getOpcode(), Mask, + ConstantInt::get(Mask->getType(), + ShiftAmt1-ShiftAmt2)); InsertNewInstBefore(Shift, I); C = ConstantInt::getAllOnesValue(Shift->getType()); @@ -5928,8 +5951,8 @@ case Instruction::LShr: case Instruction::Shl: { Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned); - Res = new ShiftInst((Instruction::OtherOps)I->getOpcode(), LHS, - I->getOperand(1), I->getName()); + Res = BinaryOperator::create(Instruction::BinaryOps(I->getOpcode()), LHS, + I->getOperand(1), I->getName()); break; } case Instruction::Trunc: @@ -6167,7 +6190,8 @@ Instruction::CastOps opcode = (DestBitSize == SrcBitSize ? Instruction::BitCast : Instruction::Trunc); Value *Op0c = InsertOperandCastBefore(opcode, Op0, DestTy, SrcI); - return new ShiftInst(Instruction::Shl, Op0c, Op1); + Value *Op1c = InsertOperandCastBefore(opcode, Op1, DestTy, SrcI); + return BinaryOperator::create(Instruction::Shl, Op0c, Op1c); } break; case Instruction::AShr: @@ -6179,7 +6203,7 @@ unsigned ShiftAmt = cast(Op1)->getZExtValue(); if (SrcBitSize > ShiftAmt && SrcBitSize-ShiftAmt >= DestBitSize) { // Insert the new logical shift right. - return new ShiftInst(Instruction::LShr, Op0, Op1); + return BinaryOperator::create(Instruction::LShr, Op0, Op1); } } break; @@ -6225,9 +6249,9 @@ // Perform a logical shr by shiftamt. // Insert the shift to put the result in the low bit. In = InsertNewInstBefore( - new ShiftInst(Instruction::LShr, In, - ConstantInt::get(Type::Int8Ty, ShiftAmt), - In->getName()+".lobit"), CI); + BinaryOperator::create(Instruction::LShr, In, + ConstantInt::get(In->getType(), ShiftAmt), + In->getName()+".lobit"), CI); } if ((Op1CV != 0) == isNE) { // Toggle the low bit. @@ -6274,8 +6298,10 @@ // Okay, we can shrink this. Truncate the input, then return a new // shift. - Value *V = InsertCastBefore(Instruction::Trunc, SrcIOp0, Ty, CI); - return new ShiftInst(Instruction::LShr, V, SrcI->getOperand(1)); + Value *V1 = InsertCastBefore(Instruction::Trunc, SrcIOp0, Ty, CI); + Value *V2 = InsertCastBefore(Instruction::Trunc, SrcI->getOperand(1), + Ty, CI); + return BinaryOperator::create(Instruction::LShr, V1, V2); } } else { // This is a variable shr. @@ -6285,9 +6311,9 @@ if (CI.getType() == Type::Int1Ty && SrcI->hasOneUse()) { Value *One = ConstantInt::get(SrcI->getType(), 1); - Value *V = InsertNewInstBefore(new ShiftInst(Instruction::Shl, One, - SrcI->getOperand(1), - "tmp"), CI); + Value *V = InsertNewInstBefore( + BinaryOperator::create(Instruction::Shl, One, SrcI->getOperand(1), + "tmp"), CI); V = InsertNewInstBefore(BinaryOperator::createAnd(V, SrcI->getOperand(0), "tmp"), CI); @@ -6491,11 +6517,10 @@ case Instruction::Sub: case Instruction::Or: case Instruction::Xor: - return Constant::getNullValue(I->getType()); case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - return Constant::getNullValue(Type::Int8Ty); + return Constant::getNullValue(I->getType()); case Instruction::And: return ConstantInt::getAllOnesValue(I->getType()); case Instruction::Mul: @@ -6525,8 +6550,8 @@ TI->getType()); } - // Only handle binary, compare and shift operators here. - if (!isa(TI) && !isa(TI)) + // Only handle binary operators here. + if (!isa(TI)) return 0; // Figure out if the operations have any operands in common. @@ -6570,11 +6595,13 @@ return BinaryOperator::create(BO->getOpcode(), NewSI, MatchOp); } - assert(isa(TI) && "Should only have Shift here"); + assert(TI->isShift() && "Should only have Shift here"); if (MatchIsOpZero) - return new ShiftInst(cast(TI)->getOpcode(), MatchOp, NewSI); + return BinaryOperator::create(Instruction::BinaryOps(TI->getOpcode()), + MatchOp, NewSI); else - return new ShiftInst(cast(TI)->getOpcode(), NewSI, MatchOp); + return BinaryOperator::create(Instruction::BinaryOps(TI->getOpcode()), + NewSI, MatchOp); } Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { @@ -6663,9 +6690,9 @@ // same width. Make an all-ones value by inserting a AShr. Value *X = IC->getOperand(0); unsigned Bits = X->getType()->getPrimitiveSizeInBits(); - Constant *ShAmt = ConstantInt::get(Type::Int8Ty, Bits-1); - Instruction *SRA = new ShiftInst(Instruction::AShr, X, - ShAmt, "ones"); + Constant *ShAmt = ConstantInt::get(X->getType(), Bits-1); + Instruction *SRA = BinaryOperator::create(Instruction::AShr, X, + ShAmt, "ones"); InsertNewInstBefore(SRA, SI); // Finally, convert to the type of the select RHS. We figure out @@ -6829,8 +6856,6 @@ InsertNewInstBefore(NewSel, SI); if (BinaryOperator *BO = dyn_cast(TVI)) return BinaryOperator::create(BO->getOpcode(), FalseVal, NewSel); - else if (ShiftInst *SI = dyn_cast(TVI)) - return new ShiftInst(SI->getOpcode(), FalseVal, NewSel); else { assert(0 && "Unknown instruction!!"); } @@ -6850,18 +6875,16 @@ if (OpToFold) { Constant *C = GetSelectFoldableConstant(FVI); - std::string Name = FVI->getName(); FVI->setName(""); + std::string Name = FVI->getName(); + FVI->setName(""); Instruction *NewSel = new SelectInst(SI.getCondition(), C, FVI->getOperand(2-OpToFold), Name); InsertNewInstBefore(NewSel, SI); if (BinaryOperator *BO = dyn_cast(FVI)) return BinaryOperator::create(BO->getOpcode(), TrueVal, NewSel); - else if (ShiftInst *SI = dyn_cast(FVI)) - return new ShiftInst(SI->getOpcode(), TrueVal, NewSel); - else { + else assert(0 && "Unknown instruction!!"); - } } } } @@ -7377,8 +7400,8 @@ /// and a single binop. Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) { Instruction *FirstInst = cast(PN.getIncomingValue(0)); - assert(isa(FirstInst) || isa(FirstInst) || - isa(FirstInst) || isa(FirstInst)); + assert(isa(FirstInst) || isa(FirstInst) || + isa(FirstInst)); unsigned Opc = FirstInst->getOpcode(); Value *LHSVal = FirstInst->getOperand(0); Value *RHSVal = FirstInst->getOperand(1); @@ -7452,8 +7475,6 @@ else if (CmpInst *CIOp = dyn_cast(FirstInst)) return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal, RHSVal); - else if (ShiftInst *SI = dyn_cast(FirstInst)) - return new ShiftInst(SI->getOpcode(), LHSVal, RHSVal); else { assert(isa(FirstInst)); return new GetElementPtrInst(LHSVal, RHSVal); @@ -7513,8 +7534,7 @@ bool isVolatile = false; if (isa(FirstInst)) { CastSrcTy = FirstInst->getOperand(0)->getType(); - } else if (isa(FirstInst) || isa(FirstInst) || - isa(FirstInst)) { + } else if (isa(FirstInst) || isa(FirstInst)) { // Can fold binop, compare or shift here if the RHS is a constant, // otherwise call FoldPHIArgBinOpIntoPHI. ConstantOp = dyn_cast(FirstInst->getOperand(1)); @@ -7596,8 +7616,7 @@ return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(), PhiVal, ConstantOp); else - return new ShiftInst(cast(FirstInst)->getOpcode(), - PhiVal, ConstantOp); + assert(0 && "Unknown operation"); } /// DeadPHICycle - Return true if this PHI node is only used by a PHI node cycle Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.85 llvm/lib/Transforms/Scalar/LICM.cpp:1.86 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.85 Tue Jan 30 17:46:24 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Thu Feb 1 20:16:22 2007 @@ -384,7 +384,7 @@ } // Otherwise these instructions are hoistable/sinkable - return isa(I) || isa(I) || isa(I) || + return isa(I) || isa(I) || isa(I) || isa(I) || isa(I); } Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.155 llvm/lib/Transforms/Scalar/SCCP.cpp:1.156 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.155 Tue Jan 30 17:46:24 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Thu Feb 1 20:16:22 2007 @@ -377,7 +377,6 @@ void visitSelectInst(SelectInst &I); void visitBinaryOperator(Instruction &I); void visitCmpInst(CmpInst &I); - void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); } void visitExtractElementInst(ExtractElementInst &I); void visitInsertElementInst(InsertElementInst &I); void visitShuffleVectorInst(ShuffleVectorInst &I); Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.68 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.69 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.68 Sat Jan 20 18:29:25 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu Feb 1 20:16:22 2007 @@ -655,9 +655,9 @@ } else { assert(NV->getType()->isInteger() && "Unknown promotion!"); if (Offset && Offset < TD.getTypeSize(NV->getType())*8) { - NV = new ShiftInst(Instruction::LShr, NV, - ConstantInt::get(Type::Int8Ty, Offset), - LI->getName(), LI); + NV = BinaryOperator::create(Instruction::LShr, NV, + ConstantInt::get(NV->getType(), Offset), + LI->getName(), LI); } // If the result is an integer, this is a trunc or bitcast. @@ -740,9 +740,9 @@ SV = CastInst::createZExtOrBitCast(SV, AllocaType, SV->getName(), SI); if (Offset && Offset < AllocaType->getPrimitiveSizeInBits()) - SV = new ShiftInst(Instruction::Shl, SV, - ConstantInt::get(Type::Int8Ty, Offset), - SV->getName()+".adj", SI); + SV = BinaryOperator::create(Instruction::Shl, SV, + ConstantInt::get(SV->getType(), Offset), + SV->getName()+".adj", SI); // Mask out the bits we are about to insert from the old value. unsigned TotalBits = TD.getTypeSize(SV->getType())*8; if (TotalBits != SrcSize) { From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200702020217.l122Hai0020229@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.93 -> 1.94 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+0 -4) GlobalOpt.cpp | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.93 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.94 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.93 Wed Jan 31 13:59:55 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Feb 1 20:16:22 2007 @@ -1728,10 +1728,6 @@ InstResult = ConstantExpr::get(BO->getOpcode(), getVal(Values, BO->getOperand(0)), getVal(Values, BO->getOperand(1))); - } else if (ShiftInst *SI = dyn_cast(CurInst)) { - InstResult = ConstantExpr::get(SI->getOpcode(), - getVal(Values, SI->getOperand(0)), - getVal(Values, SI->getOperand(1))); } else if (CmpInst *CI = dyn_cast(CurInst)) { InstResult = ConstantExpr::getCompare(CI->getPredicate(), getVal(Values, CI->getOperand(0)), From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200702020217.l122HaNM020202@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.228 -> 1.229 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+0 -7) Reader.cpp | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.228 llvm/lib/Bytecode/Reader/Reader.cpp:1.229 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.228 Wed Jan 31 13:56:15 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Thu Feb 1 20:16:22 2007 @@ -607,13 +607,6 @@ static_cast(Oprnds[2]), getValue(iType, Oprnds[0]), getValue(iType, Oprnds[1])); break; - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: - Result = new ShiftInst(Instruction::OtherOps(Opcode), - getValue(iType, Oprnds[0]), - getValue(Int8TySlot, Oprnds[1])); - break; case Instruction::Ret: if (Oprnds.size() == 0) Result = new ReturnInst(); From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/test/Integer/BitBit.ll a1.ll a15.ll a17.ll a31.ll a33.ll a63.ll a7.ll a9.ll testarith_bt.ll testlogical_new_bt.ll Message-ID: <200702020217.l122HbBA020356@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: BitBit.ll updated: 1.2 -> 1.3 a1.ll updated: 1.3 -> 1.4 a15.ll updated: 1.3 -> 1.4 a17.ll updated: 1.3 -> 1.4 a31.ll updated: 1.3 -> 1.4 a33.ll updated: 1.3 -> 1.4 a63.ll updated: 1.3 -> 1.4 a7.ll updated: 1.4 -> 1.5 a9.ll updated: 1.3 -> 1.4 testarith_bt.ll updated: 1.3 -> 1.4 testlogical_new_bt.ll updated: 1.2 -> 1.3 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+58 -57) BitBit.ll | 9 +++++---- a1.ll | 8 ++++---- a15.ll | 12 ++++++------ a17.ll | 12 ++++++------ a31.ll | 12 ++++++------ a33.ll | 12 ++++++------ a63.ll | 12 ++++++------ a7.ll | 14 +++++++------- a9.ll | 12 ++++++------ testarith_bt.ll | 6 +++--- testlogical_new_bt.ll | 6 +++--- 11 files changed, 58 insertions(+), 57 deletions(-) Index: llvm/test/Integer/BitBit.ll diff -u llvm/test/Integer/BitBit.ll:1.2 llvm/test/Integer/BitBit.ll:1.3 --- llvm/test/Integer/BitBit.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/BitBit.ll Thu Feb 1 20:16:22 2007 @@ -14,11 +14,12 @@ %t3 = sext i31 %i to i33 %t4 = or i33 %t3, %j %t5 = xor i31 %t2, 7 - %t6 = shl i31 %i, i8 2 + %t6 = shl i31 %i, 2 %t7 = trunc i31 %i to i8 - %t8 = shl i8 %t7, i8 3 - %t9 = lshr i33 %j, i8 31 - %t10 = ashr i33 %j, i8 %t7 + %t8 = shl i8 %t7, 3 + %t9 = lshr i33 %j, 31 + %t7z = zext i8 %t7 to i33 + %t10 = ashr i33 %j, %t7z ret void end Index: llvm/test/Integer/a1.ll diff -u llvm/test/Integer/a1.ll:1.3 llvm/test/Integer/a1.ll:1.4 --- llvm/test/Integer/a1.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a1.ll Thu Feb 1 20:16:22 2007 @@ -10,10 +10,10 @@ @f = constant i1 sub(i1 1 , i1 -1) @g = constant i1 sub(i1 1 , i1 1) - at h = constant i1 shl(i1 1 , i8 1) - at i = constant i1 shl(i1 1 , i8 0) - at j = constant i1 lshr(i1 1, i8 1) - at m = constant i1 ashr(i1 1, i8 1) + at h = constant i1 shl(i1 1 , i1 1) + at i = constant i1 shl(i1 1 , i1 0) + at j = constant i1 lshr(i1 1, i1 1) + at m = constant i1 ashr(i1 1, i1 1) @n = constant i1 mul(i1 -1, i1 1) @o = constant i1 sdiv(i1 -1, i1 1) Index: llvm/test/Integer/a15.ll diff -u llvm/test/Integer/a15.ll:1.3 llvm/test/Integer/a15.ll:1.4 --- llvm/test/Integer/a15.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a15.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i15 sub(i15 0 , i15 32767) @g = constant i15 sub(i15 2 , i15 32767) - at h = constant i15 shl(i15 1 , i8 15) - at i = constant i15 shl(i15 1 , i8 14) - at j = constant i15 lshr(i15 32767 , i8 14) - at k = constant i15 lshr(i15 32767 , i8 15) - at l = constant i15 ashr(i15 32767 , i8 14) - at m = constant i15 ashr(i15 32767 , i8 15) + at h = constant i15 shl(i15 1 , i15 15) + at i = constant i15 shl(i15 1 , i15 14) + at j = constant i15 lshr(i15 32767 , i15 14) + at k = constant i15 lshr(i15 32767 , i15 15) + at l = constant i15 ashr(i15 32767 , i15 14) + at m = constant i15 ashr(i15 32767 , i15 15) @n = constant i15 mul(i15 32767, i15 2) @q = constant i15 mul(i15 -16383,i15 -3) Index: llvm/test/Integer/a17.ll diff -u llvm/test/Integer/a17.ll:1.3 llvm/test/Integer/a17.ll:1.4 --- llvm/test/Integer/a17.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a17.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i17 sub(i17 0 , i17 131071) @g = constant i17 sub(i17 2 , i17 131071) - at h = constant i17 shl(i17 1 , i8 17) - at i = constant i17 shl(i17 1 , i8 16) - at j = constant i17 lshr(i17 131071 , i8 16) - at k = constant i17 lshr(i17 131071 , i8 17) - at l = constant i17 ashr(i17 131071 , i8 16) - at m = constant i17 ashr(i17 131071 , i8 17) + at h = constant i17 shl(i17 1 , i17 17) + at i = constant i17 shl(i17 1 , i17 16) + at j = constant i17 lshr(i17 131071 , i17 16) + at k = constant i17 lshr(i17 131071 , i17 17) + at l = constant i17 ashr(i17 131071 , i17 16) + at m = constant i17 ashr(i17 131071 , i17 17) @n = constant i17 mul(i17 131071, i17 2) @q = constant i17 sdiv(i17 -1, i17 65535) Index: llvm/test/Integer/a31.ll diff -u llvm/test/Integer/a31.ll:1.3 llvm/test/Integer/a31.ll:1.4 --- llvm/test/Integer/a31.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a31.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i31 sub(i31 0 , i31 2147483647) @g = constant i31 sub(i31 2 , i31 2147483647) - at h = constant i31 shl(i31 1 , i8 31) - at i = constant i31 shl(i31 1 , i8 30) - at j = constant i31 lshr(i31 2147483647 , i8 30) - at k = constant i31 lshr(i31 2147483647 , i8 31) - at l = constant i31 ashr(i31 2147483647 , i8 30) - at m = constant i31 ashr(i31 2147483647 , i8 31) + at h = constant i31 shl(i31 1 , i31 31) + at i = constant i31 shl(i31 1 , i31 30) + at j = constant i31 lshr(i31 2147483647 , i31 30) + at k = constant i31 lshr(i31 2147483647 , i31 31) + at l = constant i31 ashr(i31 2147483647 , i31 30) + at m = constant i31 ashr(i31 2147483647 , i31 31) @n = constant i31 mul(i31 2147483647, i31 2) @q = constant i31 sdiv(i31 -1, i31 1073741823) Index: llvm/test/Integer/a33.ll diff -u llvm/test/Integer/a33.ll:1.3 llvm/test/Integer/a33.ll:1.4 --- llvm/test/Integer/a33.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a33.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i33 sub(i33 0 , i33 8589934591) @g = constant i33 sub(i33 2 , i33 8589934591) - at h = constant i33 shl(i33 1 , i8 33) - at i = constant i33 shl(i33 1 , i8 32) - at j = constant i33 lshr(i33 8589934591 , i8 32) - at k = constant i33 lshr(i33 8589934591 , i8 33) - at l = constant i33 ashr(i33 8589934591 , i8 32) - at m = constant i33 ashr(i33 8589934591 , i8 33) + at h = constant i33 shl(i33 1 , i33 33) + at i = constant i33 shl(i33 1 , i33 32) + at j = constant i33 lshr(i33 8589934591 , i33 32) + at k = constant i33 lshr(i33 8589934591 , i33 33) + at l = constant i33 ashr(i33 8589934591 , i33 32) + at m = constant i33 ashr(i33 8589934591 , i33 33) @n = constant i33 mul(i33 8589934591, i33 2) @q = constant i33 sdiv(i33 -1, i33 4294967295) Index: llvm/test/Integer/a63.ll diff -u llvm/test/Integer/a63.ll:1.3 llvm/test/Integer/a63.ll:1.4 --- llvm/test/Integer/a63.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a63.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i63 sub(i63 0 , i63 9223372036854775807) @g = constant i63 sub(i63 2 , i63 9223372036854775807) - at h = constant i63 shl(i63 1 , i8 63) - at i = constant i63 shl(i63 1 , i8 62) - at j = constant i63 lshr(i63 9223372036854775807 , i8 62) - at k = constant i63 lshr(i63 9223372036854775807 , i8 63) - at l = constant i63 ashr(i63 9223372036854775807 , i8 62) - at m = constant i63 ashr(i63 9223372036854775807 , i8 63) + at h = constant i63 shl(i63 1 , i63 63) + at i = constant i63 shl(i63 1 , i63 62) + at j = constant i63 lshr(i63 9223372036854775807 , i63 62) + at k = constant i63 lshr(i63 9223372036854775807 , i63 63) + at l = constant i63 ashr(i63 9223372036854775807 , i63 62) + at m = constant i63 ashr(i63 9223372036854775807 , i63 63) @n = constant i63 mul(i63 9223372036854775807, i63 2) @q = constant i63 sdiv(i63 -1, i63 4611686018427387903) Index: llvm/test/Integer/a7.ll diff -u llvm/test/Integer/a7.ll:1.4 llvm/test/Integer/a7.ll:1.5 --- llvm/test/Integer/a7.ll:1.4 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a7.ll Thu Feb 1 20:16:22 2007 @@ -13,13 +13,13 @@ @r = constant i7 sub(i7 -3, i7 120) @s = constant i7 sub(i7 -3, i7 -8) - at h = constant i7 shl(i7 1 , i8 7) - at i = constant i7 shl(i7 1 , i8 6) - at j = constant i7 lshr(i7 127 , i8 6) - at k = constant i7 lshr(i7 127 , i8 7) - at l = constant i7 ashr(i7 127 , i8 6) - at m = constant i7 ashr(i7 127 , i8 7) - at m2= constant i7 ashr(i7 -1 , i8 3) + at h = constant i7 shl(i7 1 , i7 7) + at i = constant i7 shl(i7 1 , i7 6) + at j = constant i7 lshr(i7 127 , i7 6) + at k = constant i7 lshr(i7 127 , i7 7) + at l = constant i7 ashr(i7 127 , i7 6) + at m = constant i7 ashr(i7 127 , i7 7) + at m2= constant i7 ashr(i7 -1 , i7 3) @n = constant i7 mul(i7 127, i7 2) @t = constant i7 mul(i7 -63, i7 -2) Index: llvm/test/Integer/a9.ll diff -u llvm/test/Integer/a9.ll:1.3 llvm/test/Integer/a9.ll:1.4 --- llvm/test/Integer/a9.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/a9.ll Thu Feb 1 20:16:22 2007 @@ -10,12 +10,12 @@ @f = constant i9 sub(i9 0 , i9 511) @g = constant i9 sub(i9 2 , i9 511) - at h = constant i9 shl(i9 1 , i8 9) - at i = constant i9 shl(i9 1 , i8 8) - at j = constant i9 lshr(i9 511 , i8 8) - at k = constant i9 lshr(i9 511 , i8 9) - at l = constant i9 ashr(i9 511 , i8 8) - at m = constant i9 ashr(i9 511 , i8 9) + at h = constant i9 shl(i9 1 , i9 9) + at i = constant i9 shl(i9 1 , i9 8) + at j = constant i9 lshr(i9 511 , i9 8) + at k = constant i9 lshr(i9 511 , i9 9) + at l = constant i9 ashr(i9 511 , i9 8) + at m = constant i9 ashr(i9 511 , i9 9) @n = constant i9 mul(i9 511, i9 2) @q = constant i9 sdiv(i9 511, i9 2) Index: llvm/test/Integer/testarith_bt.ll diff -u llvm/test/Integer/testarith_bt.ll:1.3 llvm/test/Integer/testarith_bt.ll:1.4 --- llvm/test/Integer/testarith_bt.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/testarith_bt.ll Thu Feb 1 20:16:22 2007 @@ -13,9 +13,9 @@ %t5 = sdiv i31 %t1, %t2 %t6 = urem i31 %t1, %t2 %t7 = srem i31 %t1, %t2 - %t8 = shl i31 %t1, i8 9 - %t9 = lshr i31 %t1, i8 9 - %t10= ashr i31 %t1, i8 9 + %t8 = shl i31 %t1, 9 + %t9 = lshr i31 %t1, 9 + %t10= ashr i31 %t1, 9 %f1 = sitofp i31 %t1 to float %f2 = fdiv float 4.0, %f1 ret i31 %t3 Index: llvm/test/Integer/testlogical_new_bt.ll diff -u llvm/test/Integer/testlogical_new_bt.ll:1.2 llvm/test/Integer/testlogical_new_bt.ll:1.3 --- llvm/test/Integer/testlogical_new_bt.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Integer/testlogical_new_bt.ll Thu Feb 1 20:16:22 2007 @@ -9,8 +9,8 @@ %t1 = xor i31 %i0, %j0 %t2 = or i31 %i0, %j0 %t3 = and i31 %t1, %t2 - %t4 = shl i31 %i0, i8 2 - %t5 = ashr i31 %i0, i8 2 - %t6 = lshr i31 %j0, i8 22 + %t4 = shl i31 %i0, 2 + %t5 = ashr i31 %i0, 2 + %t6 = lshr i31 %j0, 22 ret i31 %t3 end From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm-stacker/lib/compiler/StackerCompiler.cpp Message-ID: <200702020217.l122Haxn020247@zion.cs.uiuc.edu> Changes in directory llvm-stacker/lib/compiler: StackerCompiler.cpp updated: 1.31 -> 1.32 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+4 -2) StackerCompiler.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-stacker/lib/compiler/StackerCompiler.cpp diff -u llvm-stacker/lib/compiler/StackerCompiler.cpp:1.31 llvm-stacker/lib/compiler/StackerCompiler.cpp:1.32 --- llvm-stacker/lib/compiler/StackerCompiler.cpp:1.31 Tue Jan 30 14:08:39 2007 +++ llvm-stacker/lib/compiler/StackerCompiler.cpp Thu Feb 1 20:16:22 2007 @@ -1247,7 +1247,8 @@ LoadInst* op2 = cast(pop_integer(bb)); CastInst* castop = new TruncInst( op1, Type::Int8Ty ); bb->getInstList().push_back( castop ); - ShiftInst* shlop = new ShiftInst( Instruction::Shl, op2, castop ); + BinaryOperator* shlop = + BinaryOperator::create( Instruction::Shl, op2, castop ); bb->getInstList().push_back( shlop ); push_value( bb, shlop ); break; @@ -1259,7 +1260,8 @@ LoadInst* op2 = cast(pop_integer(bb)); CastInst* castop = new TruncInst( op1, Type::Int8Ty ); bb->getInstList().push_back( castop ); - ShiftInst* shrop = new ShiftInst( Instruction::AShr, op2, castop ); + BinaryOperator* shrop = + BinaryOperator::create( Instruction::AShr, op2, castop ); bb->getInstList().push_back( shrop ); push_value( bb, shrop ); break; From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Interpreter.h Message-ID: <200702020217.l122HbP9020259@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.166 -> 1.167 Interpreter.h updated: 1.81 -> 1.82 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+7 -6) Execution.cpp | 6 +++--- Interpreter.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.166 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.167 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.166 Tue Jan 30 14:08:37 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Thu Feb 1 20:16:22 2007 @@ -1275,7 +1275,7 @@ return Dest; } -void Interpreter::visitShl(ShiftInst &I) { +void Interpreter::visitShl(BinaryOperator &I) { ExecutionContext &SF = ECStack.back(); const Type *Ty = I.getOperand(0)->getType(); GenericValue Src1 = getOperandValue(I.getOperand(0), SF); @@ -1285,7 +1285,7 @@ SetValue(&I, Dest, SF); } -void Interpreter::visitLShr(ShiftInst &I) { +void Interpreter::visitLShr(BinaryOperator &I) { ExecutionContext &SF = ECStack.back(); const Type *Ty = I.getOperand(0)->getType(); GenericValue Src1 = getOperandValue(I.getOperand(0), SF); @@ -1295,7 +1295,7 @@ SetValue(&I, Dest, SF); } -void Interpreter::visitAShr(ShiftInst &I) { +void Interpreter::visitAShr(BinaryOperator &I) { ExecutionContext &SF = ECStack.back(); const Type *Ty = I.getOperand(0)->getType(); GenericValue Src1 = getOperandValue(I.getOperand(0), SF); Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.81 llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.82 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.81 Wed Jan 17 20:12:10 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.h Thu Feb 1 20:16:22 2007 @@ -165,9 +165,10 @@ void visitUnwindInst(UnwindInst &I); void visitUnreachableInst(UnreachableInst &I); - void visitShl(ShiftInst &I); - void visitLShr(ShiftInst &I); - void visitAShr(ShiftInst &I); + void visitShl(BinaryOperator &I); + void visitLShr(BinaryOperator &I); + void visitAShr(BinaryOperator &I); + void visitVAArgInst(VAArgInst &I); void visitInstruction(Instruction &I) { cerr << I; From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Constants.cpp Instructions.cpp Verifier.cpp Message-ID: <200702020217.l122HbZk020255@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.257 -> 1.258 Constants.cpp updated: 1.206 -> 1.207 Instructions.cpp updated: 1.70 -> 1.71 Verifier.cpp updated: 1.188 -> 1.189 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+26 -52) AsmWriter.cpp | 3 +-- Constants.cpp | 37 ++----------------------------------- Instructions.cpp | 9 ++++++++- Verifier.cpp | 29 +++++++++++++++-------------- 4 files changed, 26 insertions(+), 52 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.257 llvm/lib/VMCore/AsmWriter.cpp:1.258 --- llvm/lib/VMCore/AsmWriter.cpp:1.257 Tue Jan 30 14:08:38 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Thu Feb 1 20:16:22 2007 @@ -1272,8 +1272,7 @@ // Shift Left & Right print both types even for Ubyte LHS, and select prints // types even if all operands are bools. - if (isa(I) || isa(I) || isa(I) || - isa(I)) { + if (isa(I) || isa(I) || isa(I)) { PrintAllTypes = true; } else { for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) { Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.206 llvm/lib/VMCore/Constants.cpp:1.207 --- llvm/lib/VMCore/Constants.cpp:1.206 Tue Jan 30 22:40:28 2007 +++ llvm/lib/VMCore/Constants.cpp Thu Feb 1 20:16:22 2007 @@ -1302,10 +1302,7 @@ if (Instruction::isCast(V.opcode)) return new UnaryConstantExpr(V.opcode, V.operands[0], Ty); if ((V.opcode >= Instruction::BinaryOpsBegin && - V.opcode < Instruction::BinaryOpsEnd) || - V.opcode == Instruction::Shl || - V.opcode == Instruction::LShr || - V.opcode == Instruction::AShr) + V.opcode < Instruction::BinaryOpsEnd)) return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1]); if (V.opcode == Instruction::Select) return new SelectConstantExpr(V.operands[0], V.operands[1], @@ -1362,12 +1359,6 @@ OldC->getOperand(1), OldC->getOperand(2)); break; - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: - New = ConstantExpr::getShiftTy(NewTy, OldC->getOpcode(), - OldC->getOperand(0), OldC->getOperand(1)); - break; default: assert(OldC->getOpcode() >= Instruction::BinaryOpsBegin && OldC->getOpcode() < Instruction::BinaryOpsEnd); @@ -1603,10 +1594,6 @@ Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode, Constant *C1, Constant *C2) { - if (Opcode == Instruction::Shl || Opcode == Instruction::LShr || - Opcode == Instruction::AShr) - return getShiftTy(ReqTy, Opcode, C1, C2); - // Check the operands for consistency first assert(Opcode >= Instruction::BinaryOpsBegin && Opcode < Instruction::BinaryOpsEnd && @@ -1689,7 +1676,7 @@ case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - assert(C2->getType() == Type::Int8Ty && "Shift should be by i8!"); + assert(C1->getType() == C2->getType() && "Op types should be identical!"); assert(C1->getType()->isInteger() && "Tried to create a shift operation on a non-integer type!"); break; @@ -1724,26 +1711,6 @@ return ExprConstants->getOrCreate(ReqTy, Key); } -/// getShiftTy - Return a shift left or shift right constant expr -Constant *ConstantExpr::getShiftTy(const Type *ReqTy, unsigned Opcode, - Constant *C1, Constant *C2) { - // Check the operands for consistency first - assert((Opcode == Instruction::Shl || - Opcode == Instruction::LShr || - Opcode == Instruction::AShr) && - "Invalid opcode in binary constant expression"); - assert(C1->getType()->isInteger() && C2->getType() == Type::Int8Ty && - "Invalid operand types for Shift constant expr!"); - - if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) - return FC; // Fold a few common cases... - - // Look up the constant in the table first to ensure uniqueness - std::vector argVec(1, C1); argVec.push_back(C2); - ExprMapKeyType Key(Opcode, argVec); - return ExprConstants->getOrCreate(ReqTy, Key); -} - Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, Value* const *Idxs, unsigned NumIdx) { Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.70 llvm/lib/VMCore/Instructions.cpp:1.71 --- llvm/lib/VMCore/Instructions.cpp:1.70 Wed Jan 31 22:59:37 2007 +++ llvm/lib/VMCore/Instructions.cpp Thu Feb 1 20:16:22 2007 @@ -1088,6 +1088,14 @@ cast(getType())->getElementType()->isFloatingPoint())) && "Incorrect operand type (not floating point) for FREM"); break; + case Shl: + case LShr: + case AShr: + assert(getType() == LHS->getType() && + "Shift operation should return same type as operands!"); + assert(getType()->isInteger() && + "Shift operation requires integer operands"); + break; case And: case Or: case Xor: assert(getType() == LHS->getType() && @@ -2299,7 +2307,6 @@ CastInst *IntToPtrInst::clone() const { return new IntToPtrInst(*this); } CastInst *BitCastInst::clone() const { return new BitCastInst(*this); } CallInst *CallInst::clone() const { return new CallInst(*this); } -ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); } SelectInst *SelectInst::clone() const { return new SelectInst(*this); } VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.188 llvm/lib/VMCore/Verifier.cpp:1.189 --- llvm/lib/VMCore/Verifier.cpp:1.188 Tue Jan 30 14:08:38 2007 +++ llvm/lib/VMCore/Verifier.cpp Thu Feb 1 20:16:22 2007 @@ -196,7 +196,6 @@ void visitBinaryOperator(BinaryOperator &B); void visitICmpInst(ICmpInst &IC); void visitFCmpInst(FCmpInst &FC); - void visitShiftInst(ShiftInst &SI); void visitExtractElementInst(ExtractElementInst &EI); void visitInsertElementInst(InsertElementInst &EI); void visitShuffleVectorInst(ShuffleVectorInst &EI); @@ -713,9 +712,11 @@ Assert1(B.getOperand(0)->getType() == B.getOperand(1)->getType(), "Both operands to a binary operator are not of the same type!", &B); + switch (B.getOpcode()) { // Check that logical operators are only used with integral operands. - if (B.getOpcode() == Instruction::And || B.getOpcode() == Instruction::Or || - B.getOpcode() == Instruction::Xor) { + case Instruction::And: + case Instruction::Or: + case Instruction::Xor: Assert1(B.getType()->isInteger() || (isa(B.getType()) && cast(B.getType())->getElementType()->isInteger()), @@ -723,7 +724,16 @@ Assert1(B.getType() == B.getOperand(0)->getType(), "Logical operators must have same type for operands and result!", &B); - } else { + break; + case Instruction::Shl: + case Instruction::LShr: + case Instruction::AShr: + Assert1(B.getType()->isInteger(), + "Shift must return an integer result!", &B); + Assert1(B.getType() == B.getOperand(0)->getType(), + "Shift return type must be same as operands!", &B); + /* FALL THROUGH */ + default: // Arithmetic operators only work on integer or fp values Assert1(B.getType() == B.getOperand(0)->getType(), "Arithmetic operators must have same type for operands and result!", @@ -731,6 +741,7 @@ Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() || isa(B.getType()), "Arithmetic operators must have integer, fp, or packed type!", &B); + break; } visitInstruction(B); @@ -760,16 +771,6 @@ visitInstruction(FC); } -void Verifier::visitShiftInst(ShiftInst &SI) { - Assert1(SI.getType()->isInteger(), - "Shift must return an integer result!", &SI); - Assert1(SI.getType() == SI.getOperand(0)->getType(), - "Shift return type must be same as first operand!", &SI); - Assert1(SI.getOperand(1)->getType() == Type::Int8Ty, - "Second operand to shift must be ubyte type!", &SI); - visitInstruction(SI); -} - void Verifier::visitExtractElementInst(ExtractElementInst &EI) { Assert1(ExtractElementInst::isValidOperands(EI.getOperand(0), EI.getOperand(1)), From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp ScalarEvolution.cpp Message-ID: <200702020217.l122Hb3A020320@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.15 -> 1.16 ScalarEvolution.cpp updated: 1.92 -> 1.93 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+1 -5) ConstantFolding.cpp | 4 ---- ScalarEvolution.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.15 llvm/lib/Analysis/ConstantFolding.cpp:1.16 --- llvm/lib/Analysis/ConstantFolding.cpp:1.15 Wed Jan 31 12:04:55 2007 +++ llvm/lib/Analysis/ConstantFolding.cpp Thu Feb 1 20:16:21 2007 @@ -216,10 +216,6 @@ case Instruction::FCmp: return ConstantExpr::getCompare(cast(I)->getPredicate(), Ops[0], Ops[1]); - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: - return ConstantExpr::get(Opc, Ops[0], Ops[1]); case Instruction::Trunc: case Instruction::ZExt: case Instruction::SExt: Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.92 llvm/lib/Analysis/ScalarEvolution.cpp:1.93 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.92 Tue Jan 30 17:52:44 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Thu Feb 1 20:16:21 2007 @@ -1736,7 +1736,7 @@ /// CanConstantFold - Return true if we can constant fold an instruction of the /// specified type, assuming that all operands were constants. static bool CanConstantFold(const Instruction *I) { - if (isa(I) || isa(I) || isa(I) || + if (isa(I) || isa(I) || isa(I) || isa(I) || isa(I)) return true; From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/test/Assembler/2007-02-01-UpgradeShift.ll 2003-05-21-MalformedShiftCrash.llx Message-ID: <200702020217.l122HbHt020306@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2007-02-01-UpgradeShift.ll added (r1.1) 2003-05-21-MalformedShiftCrash.llx updated: 1.5 -> 1.6 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+20 -2) 2003-05-21-MalformedShiftCrash.llx | 4 ++-- 2007-02-01-UpgradeShift.ll | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) Index: llvm/test/Assembler/2007-02-01-UpgradeShift.ll diff -c /dev/null llvm/test/Assembler/2007-02-01-UpgradeShift.ll:1.1 *** /dev/null Thu Feb 1 20:16:33 2007 --- llvm/test/Assembler/2007-02-01-UpgradeShift.ll Thu Feb 1 20:16:22 2007 *************** *** 0 **** --- 1,18 ---- + ; Test that upgrading shift instructions and constant expressions works + ; correctly. + ; RUN: llvm-upgrade < %s | grep 'ashr i32 .X, 2' && + ; RUN: llvm-upgrade < %s | grep 'lshr i32 .X, 2' && + ; RUN: llvm-upgrade < %s | grep 'shl i32 .X, 2' && + ; RUN: llvm-upgrade < %s | grep 'ashr i32 .X, 6' && + ; RUN: llvm-upgrade < %s | grep 'lshr i32 .X, 1' && + ; RUN: llvm-upgrade < %s | grep 'shl i32 .X, 1' + + void %test(int %X) { + %A = ashr int %X, ubyte 2 + %B = lshr int %X, ubyte 2 + %C = shl int %X, ubyte 2 + %D = ashr int %X, ubyte trunc ( int shl (int 3, ubyte 1) to ubyte ) + %E = lshr int %X, ubyte trunc ( int ashr (int 3, ubyte 1) to ubyte ) + %F = shl int %X, ubyte trunc ( int lshr (int 3, ubyte 1) to ubyte ) + ret void + } Index: llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx diff -u llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.5 llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.6 --- llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.5 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx Thu Feb 1 20:16:22 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Shift constant expression" +; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Logical operator requires integral" -global i32 ashr (float 1.0, i8 2) +global i32 ashr (float 1.0, float 2.0) From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/InstVisitor.h PatternMatch.h Message-ID: <200702020217.l122Hb39020303@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: InstVisitor.h updated: 1.45 -> 1.46 PatternMatch.h updated: 1.17 -> 1.18 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+16 -17) InstVisitor.h | 1 - PatternMatch.h | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.45 llvm/include/llvm/Support/InstVisitor.h:1.46 --- llvm/include/llvm/Support/InstVisitor.h:1.45 Sat Dec 23 00:05:40 2006 +++ llvm/include/llvm/Support/InstVisitor.h Thu Feb 1 20:16:21 2007 @@ -190,7 +190,6 @@ RetTy visitBitCastInst(BitCastInst &I) { DELEGATE(CastInst); } RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); } RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); } - RetTy visitShiftInst(ShiftInst &I) { DELEGATE(Instruction); } RetTy visitVAArgInst(VAArgInst &I) { DELEGATE(Instruction); } RetTy visitExtractElementInst(ExtractElementInst &I) { DELEGATE(Instruction);} RetTy visitInsertElementInst(InsertElementInst &I) { DELEGATE(Instruction); } Index: llvm/include/llvm/Support/PatternMatch.h diff -u llvm/include/llvm/Support/PatternMatch.h:1.17 llvm/include/llvm/Support/PatternMatch.h:1.18 --- llvm/include/llvm/Support/PatternMatch.h:1.17 Sat Jan 20 18:29:25 2007 +++ llvm/include/llvm/Support/PatternMatch.h Thu Feb 1 20:16:21 2007 @@ -166,27 +166,27 @@ } template -inline BinaryOp_match m_Shl(const LHS &L, const RHS &R) { - return BinaryOp_match(L, R); +inline BinaryOp_match m_Shl(const LHS &L, + const RHS &R) { + return BinaryOp_match(L, R); } template -inline BinaryOp_match m_LShr(const LHS &L, const RHS &R) { - return BinaryOp_match(L, R); +inline BinaryOp_match m_LShr(const LHS &L, + const RHS &R) { + return BinaryOp_match(L, R); } template -inline BinaryOp_match m_AShr(const LHS &L, const RHS &R) { - return BinaryOp_match(L, R); +inline BinaryOp_match m_AShr(const LHS &L, + const RHS &R) { + return BinaryOp_match(L, R); } //===----------------------------------------------------------------------===// // Matchers for either AShr or LShr .. for convenience // -template +template struct Shr_match { LHS_t L; RHS_t R; @@ -248,18 +248,18 @@ }; template -inline BinaryOpClass_match -m_Shift(Instruction::OtherOps &Op, const LHS &L, const RHS &R) { +inline BinaryOpClass_match +m_Shift(Instruction::BinaryOps &Op, const LHS &L, const RHS &R) { return BinaryOpClass_match(Op, L, R); + BinaryOperator, Instruction::BinaryOps>(Op, L, R); } template -inline BinaryOpClass_match +inline BinaryOpClass_match m_Shift(const LHS &L, const RHS &R) { - Instruction::OtherOps Op; + Instruction::BinaryOps Op; return BinaryOpClass_match(Op, L, R); + BinaryOperator, Instruction::BinaryOps>(Op, L, R); } //===----------------------------------------------------------------------===// From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll trunc-to-bool.ll Message-ID: <200702020217.l122HbVI020363@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-01-13-StackPtrIndex.ll updated: 1.3 -> 1.4 trunc-to-bool.ll updated: 1.9 -> 1.10 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+12 -13) 2007-01-13-StackPtrIndex.ll | 22 +++++++++++----------- trunc-to-bool.ll | 3 +-- 2 files changed, 12 insertions(+), 13 deletions(-) Index: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll diff -u llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.3 llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.4 --- llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.3 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll Thu Feb 1 20:16:22 2007 @@ -29,19 +29,19 @@ %r22 = select i1 %r20, i64 1, i64 %r19h %r23 = mul i64 %r22, 0 %r23a = trunc i64 %r23 to i32 - %r24 = shl i32 %r23a, i8 0 + %r24 = shl i32 %r23a, 0 %r25 = add i32 %r24, 0 %ras2 = alloca i8, i32 %r25, align 16 %r28 = getelementptr i8* %ras2, i32 0 - %r38 = shl i64 %r12, i8 0 + %r38 = shl i64 %r12, 0 %s2013 = add i64 %r38, 0 %c22012 = getelementptr i8* %ras2, i64 %s2013 - %r42 = shl i64 %r12, i8 0 + %r42 = shl i64 %r12, 0 %s2011 = add i64 %r42, 16 %c22010 = getelementptr i8* %ras2, i64 %s2011 %r50 = add i64 %r16, 0 %r51 = icmp slt i64 %r50, 0 - %r50sh = shl i64 %r50, i8 0 + %r50sh = shl i64 %r50, 0 %r50j = add i64 %r50sh, 0 %r54 = select i1 %r51, i64 0, i64 %r50j %r56 = mul i64 %r54, %r12 @@ -69,7 +69,7 @@ br label %a25b140 a25b: %w1989 = phi i64 [ 0, %b63 ], [ %v1990, %a25b ] - %e642 = shl i64 %w1989, i8 0 + %e642 = shl i64 %w1989, 0 %r129 = add i64 %e642, 0 %r132 = add i64 %e642, 0 %r134 = icmp slt i64 %r132, 0 @@ -112,7 +112,7 @@ br label %a30b294 a30b: %w = phi i64 [ 0, %b179 ], [ %v, %a30b ] - %b2 = shl i64 %w, i8 0 + %b2 = shl i64 %w, 0 %r283 = add i64 %b2, 0 %r286 = add i64 %b2, 0 %r288 = icmp slt i64 %r286, 0 @@ -152,7 +152,7 @@ br i1 %r462, label %a35b465, label %b463 a35b: %w1865 = phi i64 [ 0, %b341 ], [ %v1866, %a35b ] - %e785 = shl i64 %w1865, i8 0 + %e785 = shl i64 %w1865, 0 %b1877 = mul i64 %w1865, 0 %s795 = add i64 %b1877, 0 %r399 = add float %r354, 0.000000e+00 @@ -196,7 +196,7 @@ br i1 %r711, label %a45b714, label %b712 a45b: %w1852 = phi i64 [ 0, %b535 ], [ %v1853, %a45b ] - %e945 = shl i64 %w1852, i8 0 + %e945 = shl i64 %w1852, 0 %r609 = add i64 %r562, 0 %r703 = add i64 %e945, 0 %r706 = add i64 %e945, 0 @@ -261,7 +261,7 @@ %w1891 = phi i64 [ 0, %b820 ], [ %v1892, %b1016 ] %s1193 = phi i64 [ 0, %b820 ], [ %r1068, %b1016 ] %b1894 = mul i64 %r834, 0 - %b1896 = shl i64 %r823, i8 0 + %b1896 = shl i64 %r823, 0 %b1902 = mul i64 %w1891, 0 %s1173 = add i64 %b1902, 0 %r859 = add i64 %r856, 0 @@ -285,7 +285,7 @@ br label %a53b1019 a53b: %w1881 = phi i64 [ 0, %b858 ], [ %v1882, %a53b ] - %e1205 = shl i64 %w1881, i8 0 + %e1205 = shl i64 %w1881, 0 %r1007 = add i64 %e1205, 0 %r1010 = add i64 %e1205, 0 %r1012 = icmp slt i64 %r1010, 0 @@ -365,7 +365,7 @@ %b1907 = mul i64 %r1101, 0 %b1929 = mul i64 %w1904, 0 %s1395 = add i64 %b1929, 0 - %e1365 = shl i64 %w1904, i8 0 + %e1365 = shl i64 %w1904, 0 %r1163 = add i64 %r1090, 0 %r1167 = add i64 %s1375, 0 %r1191 = add i64 %r1163, 0 Index: llvm/test/CodeGen/X86/trunc-to-bool.ll diff -u llvm/test/CodeGen/X86/trunc-to-bool.ll:1.9 llvm/test/CodeGen/X86/trunc-to-bool.ll:1.10 --- llvm/test/CodeGen/X86/trunc-to-bool.ll:1.9 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/X86/trunc-to-bool.ll Thu Feb 1 20:16:22 2007 @@ -12,8 +12,7 @@ define i1 @test2(i32 %val, i32 %mask) { entry: - %maski8 = trunc i32 %mask to i8 - %shifted = ashr i32 %val, i8 %maski8 + %shifted = ashr i32 %val, %mask %anded = and i32 %shifted, 1 %trunced = trunc i32 %anded to i1 br i1 %trunced, label %ret_true, label %ret_false From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Instruction.def Instruction.h Instructions.h Message-ID: <200702020217.l122HbuI020288@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.122 -> 1.123 Instruction.def updated: 1.28 -> 1.29 Instruction.h updated: 1.78 -> 1.79 Instructions.h updated: 1.52 -> 1.53 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+56 -114) Constants.h | 2 - Instruction.def | 70 +++++++++++++++++++++++++------------------------- Instruction.h | 21 +++++++++++++++ Instructions.h | 77 -------------------------------------------------------- 4 files changed, 56 insertions(+), 114 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.122 llvm/include/llvm/Constants.h:1.123 --- llvm/include/llvm/Constants.h:1.122 Tue Jan 30 22:39:29 2007 +++ llvm/include/llvm/Constants.h Thu Feb 1 20:16:21 2007 @@ -442,8 +442,6 @@ Constant *C1, Constant *C2); static Constant *getCompareTy(unsigned short pred, Constant *C1, Constant *C2); - static Constant *getShiftTy(const Type *Ty, - unsigned Opcode, Constant *C1, Constant *C2); static Constant *getSelectTy(const Type *Ty, Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, Index: llvm/include/llvm/Instruction.def diff -u llvm/include/llvm/Instruction.def:1.28 llvm/include/llvm/Instruction.def:1.29 --- llvm/include/llvm/Instruction.def:1.28 Sat Dec 23 00:05:40 2006 +++ llvm/include/llvm/Instruction.def Thu Feb 1 20:16:21 2007 @@ -114,49 +114,49 @@ HANDLE_BINARY_INST(14, SRem , BinaryOperator) HANDLE_BINARY_INST(15, FRem , BinaryOperator) -// Logical operators... -HANDLE_BINARY_INST(16, And , BinaryOperator) -HANDLE_BINARY_INST(17, Or , BinaryOperator) -HANDLE_BINARY_INST(18, Xor , BinaryOperator) - LAST_BINARY_INST(18) +// Logical operators (integer operands) +HANDLE_BINARY_INST(16, Shl , BinaryOperator) // Shift left (logical) +HANDLE_BINARY_INST(17, LShr , BinaryOperator) // Shift right (logical) +HANDLE_BINARY_INST(18, AShr , BinaryOperator) // shift right (arithmetic) +HANDLE_BINARY_INST(19, And , BinaryOperator) +HANDLE_BINARY_INST(20, Or , BinaryOperator) +HANDLE_BINARY_INST(21, Xor , BinaryOperator) + LAST_BINARY_INST(21) // Memory operators... - FIRST_MEMORY_INST(19) -HANDLE_MEMORY_INST(19, Malloc, MallocInst) // Heap management instructions -HANDLE_MEMORY_INST(20, Free , FreeInst ) -HANDLE_MEMORY_INST(21, Alloca, AllocaInst) // Stack management -HANDLE_MEMORY_INST(22, Load , LoadInst ) // Memory manipulation instrs -HANDLE_MEMORY_INST(23, Store , StoreInst ) -HANDLE_MEMORY_INST(24, GetElementPtr, GetElementPtrInst) - LAST_MEMORY_INST(24) + FIRST_MEMORY_INST(22) +HANDLE_MEMORY_INST(22, Malloc, MallocInst) // Heap management instructions +HANDLE_MEMORY_INST(23, Free , FreeInst ) +HANDLE_MEMORY_INST(24, Alloca, AllocaInst) // Stack management +HANDLE_MEMORY_INST(25, Load , LoadInst ) // Memory manipulation instrs +HANDLE_MEMORY_INST(26, Store , StoreInst ) +HANDLE_MEMORY_INST(27, GetElementPtr, GetElementPtrInst) + LAST_MEMORY_INST(27) // Cast operators ... // NOTE: The order matters here because CastInst::isEliminableCastPair // NOTE: (see Instructions.cpp) encodes a table based on this ordering. - FIRST_CAST_INST(25) -HANDLE_CAST_INST(25, Trunc , TruncInst ) // Truncate integers -HANDLE_CAST_INST(26, ZExt , ZExtInst ) // Zero extend integers -HANDLE_CAST_INST(27, SExt , SExtInst ) // Sign extend integers -HANDLE_CAST_INST(28, FPToUI , FPToUIInst ) // floating point -> UInt -HANDLE_CAST_INST(29, FPToSI , FPToSIInst ) // floating point -> SInt -HANDLE_CAST_INST(30, UIToFP , UIToFPInst ) // UInt -> floating point -HANDLE_CAST_INST(31, SIToFP , SIToFPInst ) // SInt -> floating point -HANDLE_CAST_INST(32, FPTrunc , FPTruncInst ) // Truncate floating point -HANDLE_CAST_INST(33, FPExt , FPExtInst ) // Extend floating point -HANDLE_CAST_INST(34, PtrToInt, PtrToIntInst) // Pointer -> Integer -HANDLE_CAST_INST(35, IntToPtr, IntToPtrInst) // Integer -> Pointer -HANDLE_CAST_INST(36, BitCast , BitCastInst ) // Type cast - LAST_CAST_INST(36) + FIRST_CAST_INST(28) +HANDLE_CAST_INST(28, Trunc , TruncInst ) // Truncate integers +HANDLE_CAST_INST(29, ZExt , ZExtInst ) // Zero extend integers +HANDLE_CAST_INST(30, SExt , SExtInst ) // Sign extend integers +HANDLE_CAST_INST(31, FPToUI , FPToUIInst ) // floating point -> UInt +HANDLE_CAST_INST(32, FPToSI , FPToSIInst ) // floating point -> SInt +HANDLE_CAST_INST(33, UIToFP , UIToFPInst ) // UInt -> floating point +HANDLE_CAST_INST(34, SIToFP , SIToFPInst ) // SInt -> floating point +HANDLE_CAST_INST(35, FPTrunc , FPTruncInst ) // Truncate floating point +HANDLE_CAST_INST(36, FPExt , FPExtInst ) // Extend floating point +HANDLE_CAST_INST(37, PtrToInt, PtrToIntInst) // Pointer -> Integer +HANDLE_CAST_INST(38, IntToPtr, IntToPtrInst) // Integer -> Pointer +HANDLE_CAST_INST(39, BitCast , BitCastInst ) // Type cast + LAST_CAST_INST(39) // Other operators... - FIRST_OTHER_INST(37) -HANDLE_OTHER_INST(37, ICmp , ICmpInst ) // Integer comparison instruction -HANDLE_OTHER_INST(38, FCmp , FCmpInst ) // Floating point comparison instr. -HANDLE_OTHER_INST(39, PHI , PHINode ) // PHI node instruction -HANDLE_OTHER_INST(40, Call , CallInst ) // Call a function -HANDLE_OTHER_INST(41, Shl , ShiftInst ) // Shift Left operations (logical) -HANDLE_OTHER_INST(42, LShr , ShiftInst ) // Logical Shift right (unsigned) -HANDLE_OTHER_INST(43, AShr , ShiftInst ) // Arithmetic shift right (signed) + FIRST_OTHER_INST(40) +HANDLE_OTHER_INST(40, ICmp , ICmpInst ) // Integer comparison instruction +HANDLE_OTHER_INST(41, FCmp , FCmpInst ) // Floating point comparison instr. +HANDLE_OTHER_INST(42, PHI , PHINode ) // PHI node instruction +HANDLE_OTHER_INST(43, Call , CallInst ) // Call a function HANDLE_OTHER_INST(44, Select , SelectInst ) // select instruction HANDLE_OTHER_INST(45, UserOp1, Instruction) // May be used internally in a pass HANDLE_OTHER_INST(46, UserOp2, Instruction) // Internal to passes only Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.78 llvm/include/llvm/Instruction.h:1.79 --- llvm/include/llvm/Instruction.h:1.78 Wed Jan 3 20:15:37 2007 +++ llvm/include/llvm/Instruction.h Thu Feb 1 20:16:21 2007 @@ -129,6 +129,27 @@ return getOpcode() >= BinaryOpsBegin && getOpcode() < BinaryOpsEnd; } + /// @brief Determine if the Opcode is one of the shift instructions. + static inline bool isShift(unsigned Opcode) { + return Opcode >= Shl && Opcode <= AShr; + } + + /// @brief Determine if the instruction's opcode is one of the shift + /// instructions. + inline bool isShift() { return isShift(getOpcode()); } + + /// isLogicalShift - Return true if this is a logical shift left or a logical + /// shift right. + inline bool isLogicalShift() { + return getOpcode() == Shl || getOpcode() == LShr; + } + + /// isLogicalShift - Return true if this is a logical shift left or a logical + /// shift right. + inline bool isArithmeticShift() { + return getOpcode() == AShr; + } + /// @brief Determine if the OpCode is one of the CastInst instructions. static inline bool isCast(unsigned OpCode) { return OpCode >= CastOpsBegin && OpCode < CastOpsEnd; Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.52 llvm/include/llvm/Instructions.h:1.53 --- llvm/include/llvm/Instructions.h:1.52 Wed Jan 31 13:47:18 2007 +++ llvm/include/llvm/Instructions.h Thu Feb 1 20:16:21 2007 @@ -760,83 +760,6 @@ } }; - -//===----------------------------------------------------------------------===// -// ShiftInst Class -//===----------------------------------------------------------------------===// - -/// ShiftInst - This class represents left and right shift instructions. -/// -class ShiftInst : public Instruction { - Use Ops[2]; - ShiftInst(const ShiftInst &SI) - : Instruction(SI.getType(), SI.getOpcode(), Ops, 2) { - Ops[0].init(SI.Ops[0], this); - Ops[1].init(SI.Ops[1], this); - } - void init(OtherOps Opcode, Value *S, Value *SA) { - assert((Opcode == Shl || Opcode == LShr || Opcode == AShr) && - "ShiftInst Opcode invalid!"); - Ops[0].init(S, this); - Ops[1].init(SA, this); - } - -public: - ShiftInst(OtherOps Opcode, Value *S, Value *SA, const std::string &Name = "", - Instruction *InsertBefore = 0) - : Instruction(S->getType(), Opcode, Ops, 2, Name, InsertBefore) { - init(Opcode, S, SA); - } - ShiftInst(OtherOps Opcode, Value *S, Value *SA, const std::string &Name, - BasicBlock *InsertAtEnd) - : Instruction(S->getType(), Opcode, Ops, 2, Name, InsertAtEnd) { - init(Opcode, S, SA); - } - - OtherOps getOpcode() const { - return static_cast(Instruction::getOpcode()); - } - - /// Transparently provide more efficient getOperand methods. - Value *getOperand(unsigned i) const { - assert(i < 2 && "getOperand() out of range!"); - return Ops[i]; - } - void setOperand(unsigned i, Value *Val) { - assert(i < 2 && "setOperand() out of range!"); - Ops[i] = Val; - } - unsigned getNumOperands() const { return 2; } - - /// isLogicalShift - Return true if this is a logical shift left or a logical - /// shift right. - bool isLogicalShift() const { - unsigned opcode = getOpcode(); - return opcode == Instruction::Shl || opcode == Instruction::LShr; - } - - - /// isArithmeticShift - Return true if this is a sign-extending shift right - /// operation. - bool isArithmeticShift() const { - return !isLogicalShift(); - } - - - virtual ShiftInst *clone() const; - - // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const ShiftInst *) { return true; } - static inline bool classof(const Instruction *I) { - return (I->getOpcode() == Instruction::LShr) | - (I->getOpcode() == Instruction::AShr) | - (I->getOpcode() == Instruction::Shl); - } - static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); - } -}; - //===----------------------------------------------------------------------===// // SelectInst Class //===----------------------------------------------------------------------===// From reid at x10sys.com Thu Feb 1 20:17:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:37 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeInternals.h UpgradeLexer.cpp.cvs UpgradeLexer.l UpgradeLexer.l.cvs UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y UpgradeParser.y.cvs Message-ID: <200702020217.l122HbM2020327@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeInternals.h updated: 1.7 -> 1.8 UpgradeLexer.cpp.cvs updated: 1.18 -> 1.19 UpgradeLexer.l updated: 1.17 -> 1.18 UpgradeLexer.l.cvs updated: 1.17 -> 1.18 UpgradeParser.cpp.cvs updated: 1.53 -> 1.54 UpgradeParser.h.cvs updated: 1.39 -> 1.40 UpgradeParser.y updated: 1.54 -> 1.55 UpgradeParser.y.cvs updated: 1.52 -> 1.53 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+1854 -2000) UpgradeInternals.h | 6 UpgradeLexer.cpp.cvs | 2167 +++++++++++++++++++++++--------------------------- UpgradeLexer.l | 9 UpgradeLexer.l.cvs | 9 UpgradeParser.cpp.cvs | 1480 +++++++++++++++++----------------- UpgradeParser.h.cvs | 82 - UpgradeParser.y | 50 - UpgradeParser.y.cvs | 50 - 8 files changed, 1853 insertions(+), 2000 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeInternals.h diff -u llvm/tools/llvm-upgrade/UpgradeInternals.h:1.7 llvm/tools/llvm-upgrade/UpgradeInternals.h:1.8 --- llvm/tools/llvm-upgrade/UpgradeInternals.h:1.7 Sun Jan 28 23:41:09 2007 +++ llvm/tools/llvm-upgrade/UpgradeInternals.h Thu Feb 1 20:16:22 2007 @@ -194,6 +194,7 @@ DivOp, UDivOp, SDivOp, FDivOp, RemOp, URemOp, SRemOp, FRemOp, AndOp, OrOp, XorOp, + ShlOp, ShrOp, LShrOp, AShrOp, SetEQ, SetNE, SetLE, SetGE, SetLT, SetGT }; @@ -202,10 +203,9 @@ }; enum OtherOps { - PHIOp, CallOp, ShlOp, ShrOp, SelectOp, UserOp1, UserOp2, VAArg, + PHIOp, CallOp, SelectOp, UserOp1, UserOp2, VAArg, ExtractElementOp, InsertElementOp, ShuffleVectorOp, - ICmpOp, FCmpOp, - LShrOp, AShrOp + ICmpOp, FCmpOp }; enum CastOps { Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.18 llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.19 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.18 Sun Jan 28 07:36:57 2007 +++ llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs Thu Feb 1 20:16:22 2007 @@ -1,94 +1,51 @@ -#line 2 "UpgradeLexer.cpp" +#define yy_create_buffer Upgrade_create_buffer +#define yy_delete_buffer Upgrade_delete_buffer +#define yy_scan_buffer Upgrade_scan_buffer +#define yy_scan_string Upgrade_scan_string +#define yy_scan_bytes Upgrade_scan_bytes +#define yy_flex_debug Upgrade_flex_debug +#define yy_init_buffer Upgrade_init_buffer +#define yy_flush_buffer Upgrade_flush_buffer +#define yy_load_buffer_state Upgrade_load_buffer_state +#define yy_switch_to_buffer Upgrade_switch_to_buffer +#define yyin Upgradein +#define yyleng Upgradeleng +#define yylex Upgradelex +#define yyout Upgradeout +#define yyrestart Upgraderestart +#define yytext Upgradetext +#define yylineno Upgradelineno -#line 4 "UpgradeLexer.cpp" +#line 20 "UpgradeLexer.cpp" +/* A lexical scanner generated by flex*/ -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ +/* Scanner skeleton version: + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.19 2007/02/02 02:16:22 reid Exp $ + */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ -/* begin standard C headers. */ #include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +#include -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus #endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ #ifdef __cplusplus +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -96,17 +53,34 @@ #if __STDC__ +#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -121,88 +95,80 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN (yy_start) = 1 + 2 * +#define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START (((yy_start) - 1) / 2) +#define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE Upgraderestart(Upgradein ) +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ -#ifndef YY_BUF_SIZE #define YY_BUF_SIZE (16384*64) -#endif -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int Upgradeleng; -extern FILE *Upgradein, *Upgradeout; +extern int yyleng; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE Upgradelex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-Upgradelineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < Upgradeleng; ++yyl )\ - if ( Upgradetext[yyl] == '\n' )\ - --Upgradelineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + #define yyless(n) \ do \ { \ - /* Undo effects of setting up Upgradetext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up Upgradetext again */ \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define unput(c) yyunput( c, yytext_ptr ) + +/* Some routines like yy_flex_realloc() are emitted as static but are + not called by all lexers. This generates warnings in some compilers, + notably GCC. Arrange to suppress these. */ +#ifdef __GNUC__ +#define YY_MAY_BE_UNUSED __attribute__((unused)) +#else +#define YY_MAY_BE_UNUSED +#endif /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; -#endif -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE + struct yy_buffer_state { FILE *yy_input_file; @@ -239,16 +205,12 @@ */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; - #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -258,209 +220,207 @@ * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via Upgraderestart()), so that the user can continue scanning by - * just pointing Upgradein at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". - * - * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) +#define YY_CURRENT_BUFFER yy_current_buffer -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when Upgradetext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; + static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int Upgradeleng; + + +int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ +static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow Upgradewrap()'s to do buffer switches - * instead of setting up a fresh Upgradein. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void Upgraderestart (FILE *input_file ); -void Upgrade_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE Upgrade_create_buffer (FILE *file,int size ); -void Upgrade_delete_buffer (YY_BUFFER_STATE b ); -void Upgrade_flush_buffer (YY_BUFFER_STATE b ); -void Upgradepush_buffer_state (YY_BUFFER_STATE new_buffer ); -void Upgradepop_buffer_state (void ); - -static void Upgradeensure_buffer_stack (void ); -static void Upgrade_load_buffer_state (void ); -static void Upgrade_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER Upgrade_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE Upgrade_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE Upgrade_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE Upgrade_scan_bytes (yyconst char *bytes,int len ); - -void *Upgradealloc (yy_size_t ); -void *Upgraderealloc (void *,yy_size_t ); -void Upgradefree (void * ); +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; +static void yy_flex_free YY_PROTO(( void * )); -#define yy_new_buffer Upgrade_create_buffer +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - Upgradeensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - Upgrade_create_buffer(Upgradein,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - Upgradeensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - Upgrade_create_buffer(Upgradein,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) -/* Begin user sect3 */ -#define Upgradewrap(n) 1 -#define YY_SKIP_YYWRAP +#define YY_USES_REJECT +#define yywrap() 1 +#define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; - -FILE *Upgradein = (FILE *) 0, *Upgradeout = (FILE *) 0; - +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; - -extern int Upgradelineno; - -int Upgradelineno = 1; - -extern char *Upgradetext; -#define yytext_ptr Upgradetext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the - * corresponding action - sets up Upgradetext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - Upgradeleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + yy_c_buf_p = yy_cp; #define YY_NUM_RULES 156 #define YY_END_OF_BUFFER 157 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[610] = +static yyconst short int yy_acclist[234] = { 0, - 0, 0, 157, 155, 154, 154, 155, 155, 155, 155, - 155, 155, 147, 147, 1, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 0, 146, 0, 144, - 143, 143, 150, 0, 148, 0, 152, 147, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, - 41, 0, 0, 0, 0, 0, 0, 0, 0, 85, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, - 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 146, 143, 143, 152, 20, 152, 0, - 153, 63, 0, 0, 74, 0, 0, 39, 0, 34, - 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 25, 0, 95, 100, 98, 99, 97, 96, 0, - - 101, 105, 0, 0, 70, 128, 0, 0, 0, 0, - 0, 0, 0, 90, 88, 121, 0, 122, 0, 0, - 0, 89, 87, 0, 0, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 103, 94, 92, 0, 0, 93, - 0, 91, 0, 104, 0, 102, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, - 145, 152, 0, 0, 0, 152, 0, 0, 0, 124, - 0, 0, 57, 106, 107, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84, 69, 0, 0, 0, 0, 136, 73, 0, 0, - - 83, 0, 0, 0, 0, 0, 0, 0, 0, 137, - 54, 123, 0, 0, 22, 0, 0, 0, 149, 0, - 68, 0, 0, 0, 0, 0, 0, 110, 0, 0, - 0, 0, 72, 0, 0, 26, 0, 0, 4, 0, - 61, 0, 67, 53, 0, 0, 0, 0, 0, 0, - 71, 0, 0, 0, 0, 56, 0, 11, 0, 0, - 109, 152, 36, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 58, 112, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, - - 0, 0, 48, 0, 0, 78, 82, 80, 81, 79, - 77, 50, 0, 0, 0, 138, 0, 0, 0, 108, - 49, 0, 55, 21, 0, 0, 0, 0, 0, 126, - 0, 0, 0, 0, 0, 135, 0, 0, 45, 0, - 0, 0, 0, 0, 0, 0, 59, 30, 24, 0, - 0, 44, 114, 113, 0, 0, 7, 0, 0, 0, - 0, 131, 0, 33, 134, 38, 62, 0, 0, 0, - 120, 0, 0, 116, 130, 27, 28, 115, 0, 0, - 132, 51, 127, 125, 0, 0, 0, 0, 0, 119, - 0, 43, 0, 6, 29, 0, 0, 0, 0, 0, - - 111, 0, 0, 0, 0, 0, 0, 0, 0, 37, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 9, - 118, 10, 0, 117, 0, 0, 0, 0, 35, 0, - 0, 0, 12, 0, 14, 13, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 31, 0, - 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 139, 0, 141, 142, 16, + 157, 155, 156, 154, 155, 156, 154, 156, 155, 156, + 155, 156, 155, 156, 155, 156, 155, 156, 155, 156, + 147, 155, 156, 147, 155, 156, 1, 155, 156, 155, + 156, 155, 156, 155, 156, 155, 156, 155, 156, 155, + 156, 155, 156, 155, 156, 155, 156, 155, 156, 155, + 156, 155, 156, 155, 156, 155, 156, 155, 156, 155, + 156, 155, 156, 155, 156, 155, 156, 155, 156, 155, + 156, 146, 144, 143, 143, 150, 148, 152, 147, 1, + 129, 41, 89, 90, 75, 23, 146, 143, 143, 151, + 152, 20, 152, 153, 63, 74, 39, 34, 42, 66, + + 3, 52, 65, 25, 99, 104, 102, 103, 101, 100, + 105, 109, 70, 128, 94, 92, 83, 84, 93, 91, + 64, 107, 98, 96, 97, 95, 108, 106, 76, 145, + 152, 152, 86, 57, 110, 111, 88, 69, 136, 73, + 87, 137, 54, 85, 22, 149, 68, 114, 72, 26, + 4, 61, 67, 53, 71, 56, 11, 113, 152, 36, + 2, 5, 58, 116, 60, 48, 78, 82, 80, 81, + 79, 77, 50, 138, 112, 49, 55, 21, 126, 135, + 45, 59, 30, 24, 44, 118, 117, 7, 131, 33, + 134, 38, 62, 124, 120, 130, 27, 28, 119, 132, + + 51, 127, 125, 123, 43, 6, 29, 115, 37, 8, + 17, 9, 122, 10, 121, 35, 12, 14, 13, 32, + 40, 15, 31, 133, 139, 141, 142, 16, 46, 140, + 18, 47, 19 + } ; - 0, 46, 0, 140, 18, 47, 0, 19, 0 +static yyconst short int yy_accept[611] = + { 0, + 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, + 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 72, 73, 73, + 74, 75, 76, 77, 77, 78, 78, 79, 80, 80, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, + 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 88, 89, 91, 92, 93, 94, + 94, 95, 96, 96, 96, 97, 97, 97, 98, 98, + 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, + 100, 100, 101, 101, 101, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 104, 105, 105, 106, 107, 108, 109, 110, 111, + + 111, 112, 113, 113, 113, 114, 115, 115, 115, 115, + 115, 115, 115, 115, 116, 117, 118, 118, 119, 119, + 119, 119, 120, 121, 121, 121, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 123, 124, 125, 125, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 130, 130, + 130, 131, 132, 132, 132, 132, 133, 133, 133, 133, + 134, 134, 134, 135, 136, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 138, 139, 139, 139, 139, 139, 140, 141, 141, + + 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, + 143, 144, 145, 145, 145, 146, 146, 146, 146, 147, + 147, 148, 148, 148, 148, 148, 148, 148, 149, 149, + 149, 149, 149, 150, 150, 150, 151, 151, 151, 152, + 152, 153, 153, 154, 155, 155, 155, 155, 155, 155, + 155, 156, 156, 156, 156, 156, 157, 157, 158, 158, + 158, 159, 160, 161, 161, 161, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 163, 163, 164, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, + + 166, 166, 166, 167, 167, 167, 168, 169, 170, 171, + 172, 173, 174, 174, 174, 174, 175, 175, 175, 175, + 176, 177, 177, 178, 179, 179, 179, 179, 179, 179, + 180, 180, 180, 180, 180, 180, 181, 181, 181, 182, + 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, + 185, 185, 186, 187, 188, 188, 188, 189, 189, 189, + 189, 189, 190, 190, 191, 192, 193, 194, 194, 194, + 194, 195, 195, 195, 196, 197, 198, 199, 200, 200, + 200, 201, 202, 203, 204, 204, 204, 204, 204, 204, + 205, 205, 206, 206, 207, 208, 208, 208, 208, 208, + + 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, + 213, 214, 215, 215, 216, 216, 216, 216, 216, 217, + 217, 217, 217, 218, 218, 219, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 221, 221, 221, 221, 221, 221, 221, 221, 222, 222, + 222, 222, 222, 222, 223, 223, 223, 223, 223, 224, + 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 226, 226, 227, 228, + + 229, 229, 230, 230, 231, 232, 233, 233, 234, 234 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -492,7 +452,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[44] = +static yyconst int yy_meta[44] = { 0, 1, 1, 2, 1, 3, 1, 1, 3, 3, 3, 3, 3, 3, 4, 1, 3, 3, 3, 3, 3, @@ -501,7 +461,7 @@ 3, 3, 3 } ; -static yyconst flex_int16_t yy_base[615] = +static yyconst short int yy_base[615] = { 0, 0, 0, 1308, 1309, 1309, 1309, 1303, 1292, 36, 40, 44, 50, 56, 62, 0, 63, 66, 81, 89, 47, @@ -573,7 +533,7 @@ 1179, 143, 1183, 57 } ; -static yyconst flex_int16_t yy_def[615] = +static yyconst short int yy_def[615] = { 0, 609, 1, 609, 609, 609, 609, 610, 611, 612, 609, 611, 611, 611, 611, 613, 611, 611, 611, 611, 611, @@ -645,7 +605,7 @@ 609, 609, 609, 609 } ; -static yyconst flex_int16_t yy_nxt[1353] = +static yyconst short int yy_nxt[1353] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 4, 15, 8, 8, 8, 16, 17, @@ -798,7 +758,7 @@ 609, 609 } ; -static yyconst flex_int16_t yy_chk[1353] = +static yyconst short int yy_chk[1353] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -951,33 +911,22 @@ 609, 609 } ; -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[157] = - { 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, 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, 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, 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, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int Upgrade_flex_debug; -int Upgrade_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *Upgradetext; -#line 1 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +char *yytext; +#line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#define INITIAL 0 /*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===// // // The LLVM Compiler Infrastructure @@ -990,7 +939,8 @@ // This file implements the flex scanner for LLVM 1.9 assembly languages files. // //===----------------------------------------------------------------------===*/ -#line 28 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#define YY_NEVER_INTERACTIVE 1 +#line 28 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" #include "UpgradeInternals.h" #include "llvm/Module.h" #include @@ -1126,23 +1076,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1130 "UpgradeLexer.cpp" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); +#line 1080 "UpgradeLexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1150,30 +1084,65 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int Upgradewrap (void ); +extern "C" int yywrap YY_PROTO(( void )); #else -extern int Upgradewrap (void ); +extern int yywrap YY_PROTO(( void )); #endif #endif - static inline void yyunput (int c,char *buf_ptr ); - +#ifndef YY_NO_UNPUT +static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput YY_PROTO(( void )); #else -static int input (void ); +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 #endif +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -1182,11 +1151,12 @@ #endif /* Copy whatever the last rule matched to the standard output. */ + #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( Upgradetext, Upgradeleng, 1, Upgradeout ) +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1194,35 +1164,21 @@ */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + if ( yy_current_buffer->yy_is_interactive ) \ { \ - int c = '*'; \ - size_t n; \ + int c = '*', n; \ for ( n = 0; n < max_size && \ - (c = getc( Upgradein )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( Upgradein ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, Upgradein))==0 && ferror(Upgradein)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(Upgradein); \ - } \ - }\ -\ - + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1243,20 +1199,14 @@ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int Upgradelex (void); - -#define YY_DECL int Upgradelex (void) -#endif /* !YY_DECL */ +#define YY_DECL int yylex YY_PROTO(( void )) +#endif -/* Code executed at the beginning of each rule, after Upgradetext and Upgradeleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1271,67 +1221,60 @@ #define YY_RULE_SETUP \ YY_USER_ACTION -/** The main scanner function which does all the work. - */ YY_DECL -{ + { register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; + register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; - -#line 189 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" + +#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -#line 1286 "UpgradeLexer.cpp" +#line 1234 "UpgradeLexer.cpp" - if ( !(yy_init) ) + if ( yy_init ) { - (yy_init) = 1; + yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ - if ( ! Upgradein ) - Upgradein = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! Upgradeout ) - Upgradeout = stdout; + if ( ! yyout ) + yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { - Upgradeensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - Upgrade_create_buffer(Upgradein,YY_BUF_SIZE ); - } + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); - Upgrade_load_buffer_state( ); + yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = (yy_c_buf_p); + yy_cp = yy_c_buf_p; - /* Support of Upgradetext. */ - *yy_cp = (yy_hold_char); + /* Support of yytext. */ + *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -1339,802 +1282,807 @@ yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; ++yy_cp; } while ( yy_current_state != 609 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); yy_find_action: - yy_act = yy_accept[yy_current_state]; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } YY_DO_BEFORE_ACTION; - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + if ( yy_act != YY_END_OF_BUFFER ) { int yyl; - for ( yyl = 0; yyl < Upgradeleng; ++yyl ) - if ( Upgradetext[yyl] == '\n' ) - - Upgradelineno++; -; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; } do_action: /* This label is used only to access EOF actions. */ + switch ( yy_act ) { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - case 1: YY_RULE_SETUP -#line 191 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 193 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 194 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 195 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 196 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 197 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 198 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 199 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 200 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 201 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 202 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 203 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 204 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DLLIMPORT; } YY_BREAK case 14: YY_RULE_SETUP -#line 205 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DLLEXPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 206 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return EXTERN_WEAK; } YY_BREAK case 16: YY_RULE_SETUP -#line 207 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return EXTERNAL; } /* Deprecated, turn into external */ YY_BREAK case 17: YY_RULE_SETUP -#line 208 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return EXTERNAL; } YY_BREAK case 18: YY_RULE_SETUP -#line 209 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return IMPLEMENTATION; } YY_BREAK case 19: YY_RULE_SETUP -#line 210 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return ZEROINITIALIZER; } YY_BREAK case 20: YY_RULE_SETUP -#line 211 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DOTDOTDOT; } YY_BREAK case 21: YY_RULE_SETUP -#line 212 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return UNDEF; } YY_BREAK case 22: YY_RULE_SETUP -#line 213 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return NULL_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 214 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TO; } YY_BREAK case 24: YY_RULE_SETUP -#line 215 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return EXCEPT; } YY_BREAK case 25: YY_RULE_SETUP -#line 216 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return NOT; } /* Deprecated, turned into XOR */ YY_BREAK case 26: YY_RULE_SETUP -#line 217 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TAIL; } YY_BREAK case 27: YY_RULE_SETUP -#line 218 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TARGET; } YY_BREAK case 28: YY_RULE_SETUP -#line 219 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TRIPLE; } YY_BREAK case 29: YY_RULE_SETUP -#line 220 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DEPLIBS; } YY_BREAK case 30: YY_RULE_SETUP -#line 221 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return ENDIAN; } YY_BREAK case 31: YY_RULE_SETUP -#line 222 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return POINTERSIZE; } YY_BREAK case 32: YY_RULE_SETUP -#line 223 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return DATALAYOUT; } YY_BREAK case 33: YY_RULE_SETUP -#line 224 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return LITTLE; } YY_BREAK case 34: YY_RULE_SETUP -#line 225 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return BIG; } YY_BREAK case 35: YY_RULE_SETUP -#line 226 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return VOLATILE; } YY_BREAK case 36: YY_RULE_SETUP -#line 227 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return ALIGN; } YY_BREAK case 37: YY_RULE_SETUP -#line 228 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return SECTION; } YY_BREAK case 38: YY_RULE_SETUP -#line 229 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return MODULE; } YY_BREAK case 39: YY_RULE_SETUP -#line 230 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 230 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return ASM_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 231 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 231 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return SIDEEFFECT; } YY_BREAK case 41: YY_RULE_SETUP -#line 233 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return CC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 234 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return CCC_TOK; } YY_BREAK case 43: YY_RULE_SETUP -#line 235 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 235 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return CSRETCC_TOK; } YY_BREAK case 44: YY_RULE_SETUP -#line 236 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return FASTCC_TOK; } YY_BREAK case 45: YY_RULE_SETUP -#line 237 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 237 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return COLDCC_TOK; } YY_BREAK case 46: YY_RULE_SETUP -#line 238 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return X86_STDCALLCC_TOK; } YY_BREAK case 47: YY_RULE_SETUP -#line 239 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 239 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return X86_FASTCALLCC_TOK; } YY_BREAK case 48: YY_RULE_SETUP -#line 241 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(SBYTE, Type::Int8Ty, Signed); } YY_BREAK case 49: YY_RULE_SETUP -#line 242 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 242 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(UBYTE, Type::Int8Ty, Unsigned); } YY_BREAK case 50: YY_RULE_SETUP -#line 243 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 243 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(SHORT, Type::Int16Ty, Signed); } YY_BREAK case 51: YY_RULE_SETUP -#line 244 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 244 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(USHORT, Type::Int16Ty, Unsigned); } YY_BREAK case 52: YY_RULE_SETUP -#line 245 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 245 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(INT, Type::Int32Ty, Signed); } YY_BREAK case 53: YY_RULE_SETUP -#line 246 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 246 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(UINT, Type::Int32Ty, Unsigned); } YY_BREAK case 54: YY_RULE_SETUP -#line 247 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 247 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(LONG, Type::Int64Ty, Signed); } YY_BREAK case 55: YY_RULE_SETUP -#line 248 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 248 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(ULONG, Type::Int64Ty, Unsigned); } YY_BREAK case 56: YY_RULE_SETUP -#line 249 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 249 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(VOID, Type::VoidTy, Signless ); } YY_BREAK case 57: YY_RULE_SETUP -#line 250 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 250 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(BOOL, Type::Int1Ty, Unsigned ); } YY_BREAK case 58: YY_RULE_SETUP -#line 251 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(FLOAT, Type::FloatTy, Signless ); } YY_BREAK case 59: YY_RULE_SETUP -#line 252 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 252 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(DOUBLE, Type::DoubleTy,Signless); } YY_BREAK case 60: YY_RULE_SETUP -#line 253 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 253 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TY(LABEL, Type::LabelTy, Signless ); } YY_BREAK case 61: YY_RULE_SETUP -#line 254 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 254 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return TYPE; } YY_BREAK case 62: YY_RULE_SETUP -#line 255 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 255 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return OPAQUE; } YY_BREAK case 63: YY_RULE_SETUP -#line 257 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 257 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, AddOp, ADD); } YY_BREAK case 64: YY_RULE_SETUP -#line 258 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 258 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SubOp, SUB); } YY_BREAK case 65: YY_RULE_SETUP -#line 259 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, MulOp, MUL); } YY_BREAK case 66: YY_RULE_SETUP -#line 260 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 260 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, DivOp, DIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 261 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 261 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, UDivOp, UDIV); } YY_BREAK case 68: YY_RULE_SETUP -#line 262 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 262 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SDivOp, SDIV); } YY_BREAK case 69: YY_RULE_SETUP -#line 263 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 263 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, FDivOp, FDIV); } YY_BREAK case 70: YY_RULE_SETUP -#line 264 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, RemOp, REM); } YY_BREAK case 71: YY_RULE_SETUP -#line 265 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 265 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, URemOp, UREM); } YY_BREAK case 72: YY_RULE_SETUP -#line 266 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 266 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SRemOp, SREM); } YY_BREAK case 73: YY_RULE_SETUP -#line 267 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 267 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, FRemOp, FREM); } YY_BREAK case 74: YY_RULE_SETUP -#line 268 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 268 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, AndOp, AND); } YY_BREAK case 75: YY_RULE_SETUP -#line 269 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, OrOp , OR ); } YY_BREAK case 76: YY_RULE_SETUP -#line 270 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 270 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, XorOp, XOR); } YY_BREAK case 77: YY_RULE_SETUP -#line 271 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 271 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 78: YY_RULE_SETUP -#line 272 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 272 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 79: YY_RULE_SETUP -#line 273 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 273 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 80: YY_RULE_SETUP -#line 274 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 274 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 81: YY_RULE_SETUP -#line 275 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 275 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 82: YY_RULE_SETUP -#line 276 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 276 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 83: YY_RULE_SETUP -#line 277 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, ICmpOp, ICMP); } +#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(BinaryOpVal, ShlOp, SHL); } YY_BREAK case 84: YY_RULE_SETUP -#line 278 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, FCmpOp, FCMP); } +#line 278 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(BinaryOpVal, ShrOp, SHR); } YY_BREAK case 85: YY_RULE_SETUP -#line 280 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return EQ; } +#line 279 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(BinaryOpVal, LShrOp, LSHR); } YY_BREAK case 86: YY_RULE_SETUP -#line 281 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return NE; } +#line 280 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(BinaryOpVal, AShrOp, ASHR); } YY_BREAK case 87: YY_RULE_SETUP -#line 282 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return SLT; } +#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(OtherOpVal, ICmpOp, ICMP); } YY_BREAK case 88: YY_RULE_SETUP -#line 283 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return SGT; } +#line 283 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(OtherOpVal, FCmpOp, FCMP); } YY_BREAK case 89: YY_RULE_SETUP -#line 284 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return SLE; } +#line 285 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return EQ; } YY_BREAK case 90: YY_RULE_SETUP -#line 285 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return SGE; } +#line 286 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return NE; } YY_BREAK case 91: YY_RULE_SETUP -#line 286 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return ULT; } +#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return SLT; } YY_BREAK case 92: YY_RULE_SETUP -#line 287 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return UGT; } +#line 288 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return SGT; } YY_BREAK case 93: YY_RULE_SETUP -#line 288 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return ULE; } +#line 289 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return SLE; } YY_BREAK case 94: YY_RULE_SETUP -#line 289 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return UGE; } +#line 290 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return SGE; } YY_BREAK case 95: YY_RULE_SETUP -#line 290 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return OEQ; } +#line 291 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return ULT; } YY_BREAK case 96: YY_RULE_SETUP -#line 291 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return ONE; } +#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return UGT; } YY_BREAK case 97: YY_RULE_SETUP -#line 292 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return OLT; } +#line 293 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return ULE; } YY_BREAK case 98: YY_RULE_SETUP -#line 293 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return OGT; } +#line 294 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return UGE; } YY_BREAK case 99: YY_RULE_SETUP -#line 294 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return OLE; } +#line 295 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return OEQ; } YY_BREAK case 100: YY_RULE_SETUP -#line 295 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return OGE; } +#line 296 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return ONE; } YY_BREAK case 101: YY_RULE_SETUP -#line 296 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return ORD; } +#line 297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return OLT; } YY_BREAK case 102: YY_RULE_SETUP -#line 297 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return UNO; } +#line 298 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return OGT; } YY_BREAK case 103: YY_RULE_SETUP -#line 298 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return UEQ; } +#line 299 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return OLE; } YY_BREAK case 104: YY_RULE_SETUP -#line 299 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return UNE; } +#line 300 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return OGE; } YY_BREAK case 105: YY_RULE_SETUP -#line 301 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, PHIOp, PHI_TOK); } +#line 301 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return ORD; } YY_BREAK case 106: YY_RULE_SETUP -#line 302 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, CallOp, CALL); } +#line 302 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return UNO; } YY_BREAK case 107: YY_RULE_SETUP -#line 303 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, CastOp, CAST); } +#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return UEQ; } YY_BREAK case 108: YY_RULE_SETUP -#line 304 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, TruncOp, TRUNC); } +#line 304 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return UNE; } YY_BREAK case 109: YY_RULE_SETUP -#line 305 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, ZExtOp , ZEXT); } +#line 306 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(OtherOpVal, PHIOp, PHI_TOK); } YY_BREAK case 110: YY_RULE_SETUP -#line 306 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, SExtOp, SEXT); } +#line 307 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(OtherOpVal, CallOp, CALL); } YY_BREAK case 111: YY_RULE_SETUP -#line 307 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, FPTruncOp, FPTRUNC); } +#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, CastOp, CAST); } YY_BREAK case 112: YY_RULE_SETUP -#line 308 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, FPExtOp, FPEXT); } +#line 309 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, TruncOp, TRUNC); } YY_BREAK case 113: YY_RULE_SETUP -#line 309 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, FPToUIOp, FPTOUI); } +#line 310 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, ZExtOp , ZEXT); } YY_BREAK case 114: YY_RULE_SETUP -#line 310 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, FPToSIOp, FPTOSI); } +#line 311 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, SExtOp, SEXT); } YY_BREAK case 115: YY_RULE_SETUP -#line 311 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, UIToFPOp, UITOFP); } +#line 312 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, FPTruncOp, FPTRUNC); } YY_BREAK case 116: YY_RULE_SETUP -#line 312 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, SIToFPOp, SITOFP); } +#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, FPExtOp, FPEXT); } YY_BREAK case 117: YY_RULE_SETUP -#line 313 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, PtrToIntOp, PTRTOINT); } +#line 314 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, FPToUIOp, FPTOUI); } YY_BREAK case 118: YY_RULE_SETUP -#line 314 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, IntToPtrOp, INTTOPTR); } +#line 315 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, FPToSIOp, FPTOSI); } YY_BREAK case 119: YY_RULE_SETUP -#line 315 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(CastOpVal, BitCastOp, BITCAST); } +#line 316 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, UIToFPOp, UITOFP); } YY_BREAK case 120: YY_RULE_SETUP -#line 316 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, SelectOp, SELECT); } +#line 317 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, SIToFPOp, SITOFP); } YY_BREAK case 121: YY_RULE_SETUP -#line 317 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, ShlOp, SHL); } +#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, PtrToIntOp, PTRTOINT); } YY_BREAK case 122: YY_RULE_SETUP -#line 318 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, ShrOp, SHR); } +#line 319 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, IntToPtrOp, INTTOPTR); } YY_BREAK case 123: YY_RULE_SETUP -#line 319 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, LShrOp, LSHR); } +#line 320 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(CastOpVal, BitCastOp, BITCAST); } YY_BREAK case 124: YY_RULE_SETUP -#line 320 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK(OtherOpVal, AShrOp, ASHR); } +#line 321 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(OtherOpVal, SelectOp, SELECT); } YY_BREAK case 125: YY_RULE_SETUP -#line 321 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 322 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return VANEXT_old; } YY_BREAK case 126: YY_RULE_SETUP -#line 322 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return VAARG_old; } YY_BREAK case 127: YY_RULE_SETUP -#line 323 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 324 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 128: YY_RULE_SETUP -#line 324 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 325 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(TermOpVal, RetOp, RET); } YY_BREAK case 129: YY_RULE_SETUP -#line 325 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 326 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(TermOpVal, BrOp, BR); } YY_BREAK case 130: YY_RULE_SETUP -#line 326 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 327 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(TermOpVal, SwitchOp, SWITCH); } YY_BREAK case 131: YY_RULE_SETUP -#line 327 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 328 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(TermOpVal, InvokeOp, INVOKE); } YY_BREAK case 132: YY_RULE_SETUP -#line 328 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 329 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return UNWIND; } YY_BREAK case 133: YY_RULE_SETUP -#line 329 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(TermOpVal, UnreachableOp, UNREACHABLE); } YY_BREAK case 134: YY_RULE_SETUP -#line 331 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, MallocOp, MALLOC); } YY_BREAK case 135: YY_RULE_SETUP -#line 332 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 333 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, AllocaOp, ALLOCA); } YY_BREAK case 136: YY_RULE_SETUP -#line 333 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 334 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, FreeOp, FREE); } YY_BREAK case 137: YY_RULE_SETUP -#line 334 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 335 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, LoadOp, LOAD); } YY_BREAK case 138: YY_RULE_SETUP -#line 335 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, StoreOp, STORE); } YY_BREAK case 139: YY_RULE_SETUP -#line 336 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 337 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(MemOpVal, GetElementPtrOp, GETELEMENTPTR); } YY_BREAK case 140: YY_RULE_SETUP -#line 338 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 339 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(OtherOpVal, ExtractElementOp, EXTRACTELEMENT); } YY_BREAK case 141: YY_RULE_SETUP -#line 339 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(OtherOpVal, InsertElementOp, INSERTELEMENT); } YY_BREAK case 142: YY_RULE_SETUP -#line 340 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK(OtherOpVal, ShuffleVectorOp, SHUFFLEVECTOR); } YY_BREAK case 143: YY_RULE_SETUP -#line 343 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 344 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - UnEscapeLexed(Upgradetext+1); - Upgradelval.StrVal = strdup(Upgradetext+1); // Skip % + UnEscapeLexed(yytext+1); + Upgradelval.StrVal = strdup(yytext+1); // Skip % return VAR_ID; } YY_BREAK case 144: YY_RULE_SETUP -#line 348 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 349 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - Upgradetext[strlen(Upgradetext)-1] = 0; // nuke colon - UnEscapeLexed(Upgradetext); - Upgradelval.StrVal = strdup(Upgradetext); + yytext[strlen(yytext)-1] = 0; // nuke colon + UnEscapeLexed(yytext); + Upgradelval.StrVal = strdup(yytext); return LABELSTR; } YY_BREAK case 145: -/* rule 145 can match eol */ YY_RULE_SETUP -#line 354 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 355 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - Upgradetext[strlen(Upgradetext)-2] = 0; // nuke colon, end quote - UnEscapeLexed(Upgradetext+1); - Upgradelval.StrVal = strdup(Upgradetext+1); + yytext[strlen(yytext)-2] = 0; // nuke colon, end quote + UnEscapeLexed(yytext+1); + Upgradelval.StrVal = strdup(yytext+1); return LABELSTR; } YY_BREAK case 146: -/* rule 146 can match eol */ YY_RULE_SETUP -#line 361 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 362 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a // [sbyte] c"Hello World\00" constant, for example. // - Upgradetext[strlen(Upgradetext)-1] = 0; // nuke end quote - Upgradelval.StrVal = strdup(Upgradetext+1); // Nuke start quote + yytext[strlen(yytext)-1] = 0; // nuke end quote + Upgradelval.StrVal = strdup(yytext+1); // Nuke start quote return STRINGCONSTANT; } YY_BREAK case 147: YY_RULE_SETUP -#line 372 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ Upgradelval.UInt64Val = atoull(Upgradetext); return EUINT64VAL; } +#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ Upgradelval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK case 148: YY_RULE_SETUP -#line 373 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 374 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - uint64_t Val = atoull(Upgradetext+1); + uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range if (Val > (uint64_t)INT64_MAX+1) error("Constant too large for signed 64 bits!"); @@ -2144,17 +2092,17 @@ YY_BREAK case 149: YY_RULE_SETUP -#line 381 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 382 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - Upgradelval.UInt64Val = HexIntToVal(Upgradetext+3); - return Upgradetext[0] == 's' ? ESINT64VAL : EUINT64VAL; + Upgradelval.UInt64Val = HexIntToVal(yytext+3); + return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; } YY_BREAK case 150: YY_RULE_SETUP -#line 386 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 387 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - uint64_t Val = atoull(Upgradetext+1); + uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) error("Invalid value number (too large)!"); Upgradelval.UIntVal = unsigned(Val); @@ -2163,9 +2111,9 @@ YY_BREAK case 151: YY_RULE_SETUP -#line 393 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 394 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { - uint64_t Val = atoull(Upgradetext+2); + uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range if (Val > (uint64_t)INT32_MAX+1) error("Constant too large for signed 32 bits!"); @@ -2175,65 +2123,64 @@ YY_BREAK case 152: YY_RULE_SETUP -#line 402 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ Upgradelval.FPVal = atof(Upgradetext); return FPVAL; } +#line 403 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ Upgradelval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 153: YY_RULE_SETUP -#line 403 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ Upgradelval.FPVal = HexToFP(Upgradetext); return FPVAL; } +#line 404 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ Upgradelval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 405 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! */ - Upgrade_delete_buffer(YY_CURRENT_BUFFER); + yy_delete_buffer(YY_CURRENT_BUFFER); return EOF; } YY_BREAK case 154: -/* rule 154 can match eol */ YY_RULE_SETUP -#line 413 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 414 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore whitespace */ } YY_BREAK case 155: YY_RULE_SETUP -#line 414 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" -{ return Upgradetext[0]; } +#line 415 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ return yytext[0]; } YY_BREAK case 156: YY_RULE_SETUP -#line 416 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" +#line 417 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2213 "UpgradeLexer.cpp" +#line 2160 "UpgradeLexer.cpp" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); + *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed Upgradein at a new source and called - * Upgradelex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = Upgradein; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2243,13 +2190,13 @@ * end-of-buffer state). Contrast this with the test * in input(). */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2262,42 +2209,41 @@ yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); + yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + yy_cp = yy_c_buf_p; goto yy_find_action; } } - else switch ( yy_get_next_buffer( ) ) + else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { - (yy_did_buffer_switch_on_eof) = 0; + yy_did_buffer_switch_on_eof = 0; - if ( Upgradewrap( ) ) + if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * Upgradetext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2305,30 +2251,30 @@ else { - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2339,7 +2285,8 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of Upgradelex */ + } /* end of yylex */ + /* yy_get_next_buffer - try to read in a new buffer * @@ -2348,20 +2295,21 @@ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; register int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2381,30 +2329,34 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -2417,7 +2369,8 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - Upgraderealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2427,35 +2380,35 @@ YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - +#endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + yy_current_buffer->yy_n_chars = yy_n_chars; } - if ( (yy_n_chars) == 0 ) + if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - Upgraderestart(Upgradein ); + yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2463,32 +2416,30 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; -} + } + /* yy_get_previous_state - get the state just before the EOB char was reached */ - static yy_state_type yy_get_previous_state (void) -{ +static yy_state_type yy_get_previous_state() + { register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = (yy_start); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -2496,27 +2447,29 @@ yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; } return yy_current_state; -} + } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -2525,79 +2478,87 @@ } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 609); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; -} + } - static inline void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - /* undo effects of setting up Upgradetext */ - *yy_cp = (yy_hold_char); +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static inline void yyunput( int c, register char *yy_bp ) +#else +static inline void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + &yy_current_buffer->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; - if ( c == '\n' ){ - --Upgradelineno; - } + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (void) +static int yyinput() #else - static int input (void) +static int input() #endif - -{ + { int c; - - *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; + *yy_c_buf_p = '\0'; else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; - switch ( yy_get_next_buffer( ) ) + switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2611,16 +2572,16 @@ */ /* Reset buffer status. */ - Upgraderestart(Upgradein ); + yyrestart( yyin ); - /*FALLTHROUGH*/ + /* fall through */ case EOB_ACT_END_OF_FILE: { - if ( Upgradewrap( ) ) + if ( yywrap() ) return EOF; - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2630,170 +2591,169 @@ } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; + yy_c_buf_p = yytext_ptr + offset; break; } } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve Upgradetext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; if ( c == '\n' ) - - Upgradelineno++; -; + ++yylineno; return c; -} -#endif /* ifndef YY_NO_INPUT */ + } +#endif /* YY_NO_INPUT */ -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void Upgraderestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - Upgradeensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - Upgrade_create_buffer(Upgradein,YY_BUF_SIZE ); +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); } - Upgrade_init_buffer(YY_CURRENT_BUFFER,input_file ); - Upgrade_load_buffer_state( ); -} -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void Upgrade_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * Upgradepop_buffer_state(); - * Upgradepush_buffer_state(new_buffer); - */ - Upgradeensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) return; - if ( YY_CURRENT_BUFFER ) + if ( yy_current_buffer ) { /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; } - YY_CURRENT_BUFFER_LVALUE = new_buffer; - Upgrade_load_buffer_state( ); + yy_current_buffer = new_buffer; + yy_load_buffer_state(); /* We don't actually know whether we did this switch during - * EOF (Upgradewrap()) processing, but the only time this flag - * is looked at is after Upgradewrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - (yy_did_buffer_switch_on_eof) = 1; -} + yy_did_buffer_switch_on_eof = 1; + } -static void Upgrade_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - Upgradein = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE Upgrade_create_buffer (FILE * file, int size ) -{ +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) Upgradealloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in Upgrade_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) Upgradealloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in Upgrade_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - Upgrade_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; -} + } -/** Destroy the buffer. - * @param b a buffer created with Upgrade_create_buffer() - * - */ - void Upgrade_delete_buffer (YY_BUFFER_STATE b ) -{ - + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { if ( ! b ) return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - Upgradefree((void *) b->yy_ch_buf ); + yy_flex_free( (void *) b->yy_ch_buf ); - Upgradefree((void *) b ); -} + yy_flex_free( (void *) b ); + } -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a Upgraderestart() or at EOF. - */ - static void Upgrade_init_buffer (YY_BUFFER_STATE b, FILE * file ) -{ - int oerrno = errno; - - Upgrade_flush_buffer(b ); + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then Upgrade_init_buffer was _probably_ - * called from Upgraderestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } - b->yy_is_interactive = 0; - - errno = oerrno; -} -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void Upgrade_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) return; b->yy_n_chars = 0; @@ -2810,123 +2770,31 @@ b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - Upgrade_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void Upgradepush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - Upgradeensure_buffer_stack(); - - /* This block is copied from Upgrade_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from Upgrade_switch_to_buffer. */ - Upgrade_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void Upgradepop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - Upgrade_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - Upgrade_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + if ( b == yy_current_buffer ) + yy_load_buffer_state(); } -} -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void Upgradeensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)Upgradealloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)Upgraderealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE Upgrade_scan_buffer (char * base, yy_size_t size ) -{ +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) Upgradealloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in Upgrade_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -2938,53 +2806,58 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - Upgrade_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; -} + } +#endif -/** Setup the input buffer state to scan a string. The next call to Upgradelex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * Upgrade_scan_bytes() instead. - */ -YY_BUFFER_STATE Upgrade_scan_string (yyconst char * yystr ) -{ - - return Upgrade_scan_bytes(yystr,strlen(yystr) ); -} -/** Setup the input buffer state to scan the given bytes. The next call to Upgradelex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE Upgrade_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) Upgradealloc(n ); + n = len + 2; + buf = (char *) yy_flex_alloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in Upgrade_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = Upgrade_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in Upgrade_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2992,199 +2865,148 @@ b->yy_is_our_buffer = 1; return b; -} + } +#endif -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; #endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); -/* Redefine yyless() so it works in section 3 code. */ + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up Upgradetext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - Upgradetext[Upgradeleng] = (yy_hold_char); \ - (yy_c_buf_p) = Upgradetext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - Upgradeleng = yyless_macro_arg; \ - } \ - while ( 0 ) + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); -/* Accessor methods (get/set functions) to struct members. */ + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } -/** Get the current line number. - * - */ -int Upgradeget_lineno (void) -{ - - return Upgradelineno; -} + yy_start_stack[yy_start_stack_ptr++] = YY_START; -/** Get the input stream. - * - */ -FILE *Upgradeget_in (void) -{ - return Upgradein; -} + BEGIN(new_state); + } +#endif -/** Get the output stream. - * - */ -FILE *Upgradeget_out (void) -{ - return Upgradeout; -} -/** Get the length of the current token. - * - */ -int Upgradeget_leng (void) -{ - return Upgradeleng; -} +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); -/** Get the current token. - * - */ + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif -char *Upgradeget_text (void) -{ - return Upgradetext; -} -/** Set the current line number. - * @param line_number - * - */ -void Upgradeset_lineno (int line_number ) -{ - - Upgradelineno = line_number; -} +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see Upgrade_switch_to_buffer - */ -void Upgradeset_in (FILE * in_str ) -{ - Upgradein = in_str ; -} +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif -void Upgradeset_out (FILE * out_str ) -{ - Upgradeout = out_str ; -} +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } -int Upgradeget_debug (void) -{ - return Upgrade_flex_debug; -} -void Upgradeset_debug (int bdebug ) -{ - Upgrade_flex_debug = bdebug ; -} -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from Upgradelex_destroy(), so don't allocate here. - */ - - /* We do not touch Upgradelineno unless the option is enabled. */ - Upgradelineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - Upgradein = stdin; - Upgradeout = stdout; -#else - Upgradein = (FILE *) 0; - Upgradeout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * Upgradelex_init() - */ - return 0; -} +/* Redefine yyless() so it works in section 3 code. */ -/* Upgradelex_destroy is for both reentrant and non-reentrant scanners. */ -int Upgradelex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - Upgrade_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - Upgradepop_buffer_state(); - } - - /* Destroy the stack itself. */ - Upgradefree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * Upgradelex() is called, initialization will occur. */ - yy_init_globals( ); +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) - return 0; -} -/* - * Internal utility routines. - */ +/* Internal utility routines. */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; -} + } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { register int n; for ( n = 0; s[n]; ++n ) ; return n; -} + } #endif -void *Upgradealloc (yy_size_t size ) -{ + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { return (void *) malloc( size ); -} + } -void *Upgraderealloc (void * ptr, yy_size_t size ) -{ +#ifdef YY_USE_PROTOS +static inline void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static inline void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3193,16 +3015,24 @@ * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); -} - -void Upgradefree (void * ptr ) -{ - free( (char *) ptr ); /* see Upgraderealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 416 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeLexer.l" + } +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 417 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" Index: llvm/tools/llvm-upgrade/UpgradeLexer.l diff -u llvm/tools/llvm-upgrade/UpgradeLexer.l:1.17 llvm/tools/llvm-upgrade/UpgradeLexer.l:1.18 --- llvm/tools/llvm-upgrade/UpgradeLexer.l:1.17 Fri Jan 26 02:18:33 2007 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l Thu Feb 1 20:16:22 2007 @@ -274,6 +274,11 @@ setgt { RET_TOK(BinaryOpVal, SetGT, SETGT); } setle { RET_TOK(BinaryOpVal, SetLE, SETLE); } setge { RET_TOK(BinaryOpVal, SetGE, SETGE); } +shl { RET_TOK(BinaryOpVal, ShlOp, SHL); } +shr { RET_TOK(BinaryOpVal, ShrOp, SHR); } +lshr { RET_TOK(BinaryOpVal, LShrOp, LSHR); } +ashr { RET_TOK(BinaryOpVal, AShrOp, ASHR); } + icmp { RET_TOK(OtherOpVal, ICmpOp, ICMP); } fcmp { RET_TOK(OtherOpVal, FCmpOp, FCMP); } @@ -314,10 +319,6 @@ inttoptr { RET_TOK(CastOpVal, IntToPtrOp, INTTOPTR); } bitcast { RET_TOK(CastOpVal, BitCastOp, BITCAST); } select { RET_TOK(OtherOpVal, SelectOp, SELECT); } -shl { RET_TOK(OtherOpVal, ShlOp, SHL); } -shr { RET_TOK(OtherOpVal, ShrOp, SHR); } -lshr { RET_TOK(OtherOpVal, LShrOp, LSHR); } -ashr { RET_TOK(OtherOpVal, AShrOp, ASHR); } vanext { return VANEXT_old; } vaarg { return VAARG_old; } va_arg { RET_TOK(OtherOpVal, VAArg , VAARG); } Index: llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.17 llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.18 --- llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.17 Fri Jan 26 02:19:09 2007 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs Thu Feb 1 20:16:22 2007 @@ -274,6 +274,11 @@ setgt { RET_TOK(BinaryOpVal, SetGT, SETGT); } setle { RET_TOK(BinaryOpVal, SetLE, SETLE); } setge { RET_TOK(BinaryOpVal, SetGE, SETGE); } +shl { RET_TOK(BinaryOpVal, ShlOp, SHL); } +shr { RET_TOK(BinaryOpVal, ShrOp, SHR); } +lshr { RET_TOK(BinaryOpVal, LShrOp, LSHR); } +ashr { RET_TOK(BinaryOpVal, AShrOp, ASHR); } + icmp { RET_TOK(OtherOpVal, ICmpOp, ICMP); } fcmp { RET_TOK(OtherOpVal, FCmpOp, FCMP); } @@ -314,10 +319,6 @@ inttoptr { RET_TOK(CastOpVal, IntToPtrOp, INTTOPTR); } bitcast { RET_TOK(CastOpVal, BitCastOp, BITCAST); } select { RET_TOK(OtherOpVal, SelectOp, SELECT); } -shl { RET_TOK(OtherOpVal, ShlOp, SHL); } -shr { RET_TOK(OtherOpVal, ShrOp, SHR); } -lshr { RET_TOK(OtherOpVal, LShrOp, LSHR); } -ashr { RET_TOK(OtherOpVal, AShrOp, ASHR); } vanext { return VANEXT_old; } vaarg { return VAARG_old; } va_arg { RET_TOK(OtherOpVal, VAArg , VAARG); } Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.53 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.54 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.53 Tue Jan 30 14:08:38 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Thu Feb 1 20:16:22 2007 @@ -154,26 +154,26 @@ AND = 345, OR = 346, XOR = 347, - SETLE = 348, - SETGE = 349, - SETLT = 350, - SETGT = 351, - SETEQ = 352, - SETNE = 353, - ICMP = 354, - FCMP = 355, - MALLOC = 356, - ALLOCA = 357, - FREE = 358, - LOAD = 359, - STORE = 360, - GETELEMENTPTR = 361, - PHI_TOK = 362, - SELECT = 363, - SHL = 364, - SHR = 365, - ASHR = 366, - LSHR = 367, + SHL = 348, + SHR = 349, + ASHR = 350, + LSHR = 351, + SETLE = 352, + SETGE = 353, + SETLT = 354, + SETGT = 355, + SETEQ = 356, + SETNE = 357, + ICMP = 358, + FCMP = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + PHI_TOK = 366, + SELECT = 367, VAARG = 368, EXTRACTELEMENT = 369, INSERTELEMENT = 370, @@ -306,26 +306,26 @@ #define AND 345 #define OR 346 #define XOR 347 -#define SETLE 348 -#define SETGE 349 -#define SETLT 350 -#define SETGT 351 -#define SETEQ 352 -#define SETNE 353 -#define ICMP 354 -#define FCMP 355 -#define MALLOC 356 -#define ALLOCA 357 -#define FREE 358 -#define LOAD 359 -#define STORE 360 -#define GETELEMENTPTR 361 -#define PHI_TOK 362 -#define SELECT 363 -#define SHL 364 -#define SHR 365 -#define ASHR 366 -#define LSHR 367 +#define SHL 348 +#define SHR 349 +#define ASHR 350 +#define LSHR 351 +#define SETLE 352 +#define SETGE 353 +#define SETLT 354 +#define SETGT 355 +#define SETEQ 356 +#define SETNE 357 +#define ICMP 358 +#define FCMP 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define PHI_TOK 366 +#define SELECT 367 #define VAARG 368 #define EXTRACTELEMENT 369 #define INSERTELEMENT 370 @@ -370,7 +370,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" #include "UpgradeInternals.h" #include "llvm/CallingConv.h" @@ -1368,6 +1368,13 @@ case URemOp : return Instruction::URem; case SRemOp : return Instruction::SRem; case FRemOp : return Instruction::FRem; + case LShrOp : return Instruction::LShr; + case AShrOp : return Instruction::AShr; + case ShlOp : return Instruction::Shl; + case ShrOp : + if (Sign == Signed) + return Instruction::AShr; + return Instruction::LShr; case AndOp : return Instruction::And; case OrOp : return Instruction::Or; case XorOp : return Instruction::Xor; @@ -1462,11 +1469,6 @@ default : assert(0 && "Invalid OldOtherOps"); case PHIOp : return Instruction::PHI; case CallOp : return Instruction::Call; - case ShlOp : return Instruction::Shl; - case ShrOp : - if (Sign == Signed) - return Instruction::AShr; - return Instruction::LShr; case SelectOp : return Instruction::Select; case UserOp1 : return Instruction::UserOp1; case UserOp2 : return Instruction::UserOp2; @@ -1476,8 +1478,6 @@ case ShuffleVectorOp : return Instruction::ShuffleVector; case ICmpOp : return Instruction::ICmp; case FCmpOp : return Instruction::FCmp; - case LShrOp : return Instruction::LShr; - case AShrOp : return Instruction::AShr; }; } @@ -1553,7 +1553,6 @@ error("Invalid prototype for " + Name + " prototype"); return new FCmpInst(FCmpInst::FCMP_UNO, Args[0], Args[1]); } else { - static unsigned upgradeCount = 1; const Type* PtrTy = PointerType::get(Type::Int8Ty); std::vector Params; if (Name == "llvm.va_start" || Name == "llvm.va_end") { @@ -1563,9 +1562,7 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName("va_upgrade"); - InstName += llvm::utostr(upgradeCount++); - Args[0] = new BitCastInst(Args[0], PtrTy, InstName, CurBB); + Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); return new CallInst(Func, Args); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) @@ -1575,10 +1572,8 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName0("va_upgrade"); - InstName0 += llvm::utostr(upgradeCount++); - std::string InstName1("va_upgrade"); - InstName1 += llvm::utostr(upgradeCount++); + std::string InstName0(makeNameUnique("va0")); + std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); return new CallInst(Func, Args); @@ -1623,7 +1618,7 @@ cast(Index), Type::Int64Ty); else Index = CastInst::create(Instruction::ZExt, Index, Type::Int64Ty, - makeNameUnique("gep_upgrade"), CurBB); + makeNameUnique("gep"), CurBB); VIndices[i] = Index; } } @@ -1816,7 +1811,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1435 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1859,7 +1854,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1863 "UpgradeParser.tab.c" +#line 1858 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1871,7 +1866,7 @@ /* Line 219 of yacc.c. */ -#line 1875 "UpgradeParser.tab.c" +#line 1870 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2022,7 +2017,7 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1712 +#define YYLAST 1736 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 166 @@ -2130,14 +2125,14 @@ 200, 0, -1, 5, -1, 6, -1, 3, -1, 4, -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, - -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, - -1, 94, -1, 95, -1, 96, -1, 97, -1, 98, + -1, 89, -1, 90, -1, 91, -1, 92, -1, 97, + -1, 98, -1, 99, -1, 100, -1, 101, -1, 102, -1, 119, -1, 120, -1, 121, -1, 122, -1, 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, 129, -1, 130, -1, 131, -1, 132, -1, 133, -1, 134, -1, 135, -1, 136, -1, 137, -1, 138, -1, 125, -1, 126, -1, 127, -1, 128, -1, 27, - -1, 28, -1, 109, -1, 110, -1, 111, -1, 112, + -1, 28, -1, 93, -1, 94, -1, 95, -1, 96, -1, 140, -1, 141, -1, 142, -1, 143, -1, 144, -1, 145, -1, 146, -1, 147, -1, 148, -1, 149, -1, 150, -1, 151, -1, 139, -1, 16, -1, 14, @@ -2166,11 +2161,11 @@ 191, 39, -1, 191, 227, -1, 191, 197, -1, 191, 26, -1, 176, 168, -1, 177, 4, -1, 9, 27, -1, 9, 28, -1, 179, 7, -1, 175, 155, 196, - 36, 191, 156, -1, 106, 155, 196, 242, 156, -1, - 108, 155, 196, 153, 196, 153, 196, 156, -1, 169, + 36, 191, 156, -1, 110, 155, 196, 242, 156, -1, + 112, 155, 196, 153, 196, 153, 196, 156, -1, 169, 155, 196, 153, 196, 156, -1, 170, 155, 196, 153, 196, 156, -1, 171, 155, 196, 153, 196, 156, -1, - 99, 172, 155, 196, 153, 196, 156, -1, 100, 173, + 103, 172, 155, 196, 153, 196, 156, -1, 104, 173, 155, 196, 153, 196, 156, -1, 174, 155, 196, 153, 196, 156, -1, 114, 155, 196, 153, 196, 156, -1, 115, 155, 196, 153, 196, 153, 196, 156, -1, 116, @@ -2211,55 +2206,55 @@ 238, 153, 229, -1, 238, -1, -1, 60, 59, -1, 59, -1, 169, 191, 228, 153, 228, -1, 170, 191, 228, 153, 228, -1, 171, 191, 228, 153, 228, -1, - 99, 172, 191, 228, 153, 228, -1, 100, 173, 191, + 103, 172, 191, 228, 153, 228, -1, 104, 173, 191, 228, 153, 228, -1, 49, 229, -1, 174, 229, 153, - 229, -1, 175, 229, 36, 191, -1, 108, 229, 153, + 229, -1, 175, 229, 36, 191, -1, 112, 229, 153, 229, 153, 229, -1, 113, 229, 153, 191, -1, 117, 229, 153, 191, -1, 118, 229, 153, 191, -1, 114, 229, 153, 229, -1, 115, 229, 153, 229, 153, 229, - -1, 116, 229, 153, 229, 153, 229, -1, 107, 237, + -1, 116, 229, 153, 229, 153, 229, -1, 111, 237, -1, 240, 182, 189, 228, 155, 239, 156, -1, 244, - -1, 153, 238, -1, -1, 35, -1, -1, 101, 191, - 184, -1, 101, 191, 153, 15, 228, 184, -1, 102, - 191, 184, -1, 102, 191, 153, 15, 228, 184, -1, - 103, 229, -1, 243, 104, 191, 228, -1, 243, 105, - 229, 153, 191, 228, -1, 106, 191, 228, 242, -1 + -1, 153, 238, -1, -1, 35, -1, -1, 105, 191, + 184, -1, 105, 191, 153, 15, 228, 184, -1, 106, + 191, 184, -1, 106, 191, 153, 15, 228, 184, -1, + 107, 229, -1, 243, 108, 191, 228, -1, 243, 109, + 229, 153, 191, 228, -1, 110, 191, 228, 242, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1580, 1580, 1581, 1589, 1590, 1600, 1600, 1600, 1600, - 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1604, 1604, 1604, - 1608, 1608, 1608, 1608, 1608, 1608, 1612, 1612, 1613, 1613, - 1614, 1614, 1615, 1615, 1616, 1616, 1620, 1620, 1621, 1621, - 1622, 1622, 1623, 1623, 1624, 1624, 1625, 1625, 1626, 1626, - 1627, 1628, 1631, 1631, 1631, 1631, 1635, 1635, 1635, 1635, - 1635, 1635, 1635, 1636, 1636, 1636, 1636, 1636, 1636, 1642, - 1642, 1642, 1642, 1646, 1646, 1646, 1646, 1650, 1650, 1654, - 1654, 1659, 1662, 1667, 1668, 1669, 1670, 1671, 1672, 1673, - 1674, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1695, - 1696, 1704, 1705, 1713, 1722, 1723, 1730, 1731, 1735, 1739, - 1755, 1756, 1763, 1764, 1771, 1779, 1779, 1779, 1779, 1779, - 1779, 1779, 1780, 1780, 1780, 1780, 1780, 1785, 1789, 1793, - 1798, 1807, 1828, 1834, 1847, 1856, 1860, 1871, 1875, 1888, - 1892, 1899, 1900, 1906, 1913, 1925, 1955, 1968, 1991, 2019, - 2041, 2052, 2074, 2085, 2094, 2099, 2157, 2164, 2172, 2179, - 2186, 2190, 2194, 2203, 2218, 2231, 2240, 2268, 2281, 2290, - 2296, 2302, 2311, 2317, 2323, 2334, 2335, 2344, 2345, 2357, - 2366, 2367, 2368, 2369, 2370, 2386, 2406, 2408, 2410, 2410, - 2417, 2417, 2424, 2424, 2431, 2431, 2439, 2441, 2443, 2448, - 2462, 2463, 2467, 2470, 2478, 2482, 2489, 2493, 2497, 2501, - 2509, 2509, 2513, 2514, 2518, 2526, 2531, 2539, 2540, 2547, - 2554, 2558, 2673, 2673, 2677, 2687, 2687, 2691, 2695, 2697, - 2698, 2702, 2702, 2714, 2715, 2720, 2721, 2722, 2723, 2724, - 2725, 2726, 2727, 2728, 2749, 2752, 2767, 2768, 2773, 2773, - 2781, 2790, 2793, 2802, 2812, 2817, 2826, 2837, 2837, 2840, - 2843, 2846, 2850, 2856, 2871, 2877, 2933, 2936, 2942, 2952, - 2965, 2994, 3002, 3010, 3014, 3021, 3022, 3026, 3029, 3035, - 3052, 3068, 3082, 3094, 3106, 3117, 3126, 3135, 3144, 3151, - 3172, 3196, 3202, 3208, 3214, 3230, 3308, 3316, 3317, 3321, - 3322, 3326, 3332, 3338, 3344, 3350, 3357, 3369, 3383 + 0, 1575, 1575, 1576, 1584, 1585, 1595, 1595, 1595, 1595, + 1595, 1595, 1595, 1595, 1595, 1595, 1595, 1599, 1599, 1599, + 1603, 1603, 1603, 1603, 1603, 1603, 1607, 1607, 1608, 1608, + 1609, 1609, 1610, 1610, 1611, 1611, 1615, 1615, 1616, 1616, + 1617, 1617, 1618, 1618, 1619, 1619, 1620, 1620, 1621, 1621, + 1622, 1623, 1626, 1626, 1626, 1626, 1630, 1630, 1630, 1630, + 1630, 1630, 1630, 1631, 1631, 1631, 1631, 1631, 1631, 1637, + 1637, 1637, 1637, 1641, 1641, 1641, 1641, 1645, 1645, 1649, + 1649, 1654, 1657, 1662, 1663, 1664, 1665, 1666, 1667, 1668, + 1669, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1690, + 1691, 1699, 1700, 1708, 1717, 1718, 1725, 1726, 1730, 1734, + 1750, 1751, 1758, 1759, 1766, 1774, 1774, 1774, 1774, 1774, + 1774, 1774, 1775, 1775, 1775, 1775, 1775, 1780, 1784, 1788, + 1793, 1802, 1823, 1829, 1842, 1851, 1855, 1866, 1870, 1883, + 1887, 1894, 1895, 1901, 1908, 1920, 1950, 1963, 1986, 2014, + 2036, 2047, 2069, 2080, 2089, 2094, 2152, 2159, 2167, 2174, + 2181, 2185, 2189, 2198, 2213, 2226, 2235, 2263, 2276, 2285, + 2291, 2297, 2308, 2314, 2320, 2331, 2332, 2341, 2342, 2354, + 2363, 2364, 2365, 2366, 2367, 2383, 2403, 2405, 2407, 2407, + 2414, 2414, 2421, 2421, 2428, 2428, 2436, 2438, 2440, 2445, + 2459, 2460, 2464, 2467, 2475, 2479, 2486, 2490, 2494, 2498, + 2506, 2506, 2510, 2511, 2515, 2523, 2528, 2536, 2537, 2544, + 2551, 2555, 2670, 2670, 2674, 2684, 2684, 2688, 2692, 2694, + 2695, 2699, 2699, 2711, 2712, 2717, 2718, 2719, 2720, 2721, + 2722, 2723, 2724, 2725, 2746, 2749, 2764, 2765, 2770, 2770, + 2778, 2787, 2790, 2799, 2809, 2814, 2823, 2834, 2834, 2837, + 2840, 2843, 2847, 2853, 2868, 2874, 2930, 2933, 2939, 2949, + 2962, 2991, 2999, 3007, 3011, 3018, 3019, 3023, 3026, 3032, + 3049, 3065, 3079, 3091, 3103, 3114, 3132, 3141, 3150, 3157, + 3178, 3202, 3208, 3214, 3220, 3236, 3314, 3322, 3323, 3327, + 3328, 3332, 3338, 3344, 3350, 3356, 3363, 3375, 3389 }; #endif @@ -2282,10 +2277,10 @@ "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNREACHABLE", "UNWIND", "EXCEPT", "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM", - "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT", - "SETEQ", "SETNE", "ICMP", "FCMP", "MALLOC", "ALLOCA", "FREE", "LOAD", - "STORE", "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", - "LSHR", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", + "SREM", "FREM", "AND", "OR", "XOR", "SHL", "SHR", "ASHR", "LSHR", + "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "ICMP", "FCMP", + "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", + "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "VAARG_old", "VANEXT_old", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "CAST", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", @@ -2427,9 +2422,9 @@ 0, 0, 232, 130, 0, 0, 0, 113, 135, 139, 0, 0, 144, 138, 299, 0, 278, 0, 0, 0, 0, 91, 267, 257, 258, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, - 0, 0, 0, 52, 53, 54, 55, 0, 0, 0, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 52, + 53, 54, 55, 20, 21, 22, 23, 24, 25, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 266, 253, 91, 270, 0, 296, 204, 201, 200, @@ -2491,83 +2486,83 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -508 +#define YYPACT_NINF -541 static const short int yypact[] = { - -508, 18, 144, 546, -508, -508, -508, -508, -508, -508, - -508, -508, -508, -508, 2, 152, 47, -508, -508, -15, - -508, -508, -30, -75, 29, 69, -10, -508, 98, 104, - 151, -508, -508, -508, -508, -508, -508, 1307, -8, -508, - -508, 149, -508, -508, -508, -508, 11, 20, 22, 24, - -508, 27, 104, 1307, 0, 0, 0, 0, -508, -508, - -508, 152, -508, -508, -508, -508, -508, 37, -508, -508, - -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, - -508, 194, 200, 3, 695, -508, 149, 54, -508, -508, - -81, -508, -508, -508, -508, -508, 1561, -508, 186, -19, - 210, 188, 203, -508, -508, -508, -508, -508, 1368, 1368, - 1368, 1409, -508, -508, 66, 70, 715, -508, -508, -81, - -85, 75, 781, -508, -508, 1368, -508, 172, 1429, 58, - 255, 152, -508, -508, -508, -508, -508, -508, -508, -508, - -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, - -508, -508, -508, -508, -508, 208, 394, 1368, 1368, 1368, - 1368, 1368, 1368, -508, -508, -508, -508, 1368, 1368, 1368, - 1368, 1368, 1368, -508, -508, -508, -508, -508, -508, -508, - -508, -508, -508, -508, -508, -508, 1368, 1368, 1368, 1368, - 1368, -508, -508, 152, -508, 55, -508, -508, -508, -508, - -508, -508, -508, -508, -50, -508, -508, -508, 153, 179, - 228, 191, 229, 193, 230, 197, 231, 233, 234, 199, - 232, 235, 537, -508, 1368, 1368, 84, -45, 1368, -508, - 1149, -508, 93, 91, 898, -508, -508, 37, -508, 898, - 898, -508, -508, -508, -508, -508, -508, -508, -508, -508, - -508, 898, 1307, -508, -508, -508, -508, -508, -508, -508, - -508, -508, -508, 1368, -508, -508, -508, -508, -508, -508, - -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, - 1368, 95, 96, -508, 898, 99, 97, 105, 106, 107, - 120, 123, 126, 127, 898, 898, 898, 128, 221, 1307, - 1368, 1368, 258, -508, 132, 132, 132, -508, -508, -508, - -508, -508, -508, -508, -508, -508, -508, 208, 394, 131, - 134, 135, 136, 137, 1190, 1470, 736, 259, 139, 140, - 141, 142, 148, -508, -508, 132, -130, -23, -508, 143, - -81, -508, 149, -508, 155, 154, 1210, -508, -508, -508, - -508, -508, -508, -508, -508, -508, 224, 1409, -508, -508, - -508, -508, 156, -508, 163, 898, 898, 898, 4, -508, - 5, -508, 164, 898, 162, 1368, 1368, 1368, 1368, 1368, - 1368, 1368, 167, 168, 169, 1368, 1368, 898, 898, 170, - -508, -17, -508, -508, -508, 150, 182, 1409, 1409, 1409, - 1409, 1409, -508, -508, -13, 756, -24, -508, -36, -508, - 1409, 1409, 1409, 1409, 1409, -508, -508, -508, -508, -508, - -508, 1251, 290, -508, -508, 301, -14, 324, 325, 198, - 201, 202, 898, 348, 898, 1368, -508, 204, 898, 205, - -508, -508, 211, 214, -508, -508, 898, 898, 898, -508, - -508, 213, -508, 1368, 332, 365, -508, 132, 1409, 1409, - 164, 217, 222, 223, 225, 1409, -508, 216, -71, -27, - -508, -508, 226, 236, 237, 240, 338, -508, -508, -508, - 326, 241, -508, 898, 898, 1368, 898, 898, 242, -508, - 242, -508, 243, 898, 244, 1368, 1368, 1368, -508, -508, - -508, 1368, 898, -508, -508, -508, 246, 247, 245, 1409, - 1409, 1409, 1409, -508, -508, 220, 1409, 1409, 1409, 1409, - 1368, 378, -508, 361, 249, 248, 243, 250, -508, -508, - 329, -508, -508, 1368, 256, 898, -508, -508, -508, 251, - -508, 1409, 1409, -508, 261, 252, 270, 271, -508, 269, - 272, 275, 279, 280, -508, -508, 367, 40, 368, -508, - -508, 267, -508, 281, 282, 1409, -508, 1409, 1409, -508, - -508, -508, -508, -508, 898, -508, 996, 85, 382, -508, - -508, -508, 283, 285, 288, -508, 274, -508, 996, 898, - -508, -508, -508, 424, 293, 130, 898, 426, 430, -508, - 898, 898, -508, -508 + -541, 28, 61, 478, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, 23, 152, 45, -541, -541, -9, + -541, -541, -20, -51, 76, 69, 12, -541, 97, 149, + 172, -541, -541, -541, -541, -541, -541, 1331, -19, -541, + -541, 137, -541, -541, -541, -541, 49, 58, 60, 62, + -541, 72, 149, 1331, 88, 88, 88, 88, -541, -541, + -541, 152, -541, -541, -541, -541, -541, 75, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, 227, 228, 3, 691, -541, 137, 79, -541, -541, + -46, -541, -541, -541, -541, -541, 1585, -541, 212, 136, + 233, 214, 216, -541, -541, -541, -541, -541, 1392, 1392, + 1392, 1433, -541, -541, 83, 87, 711, -541, -541, -46, + -70, 89, 777, -541, -541, 1392, -541, 183, 1453, 6, + 309, 152, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, 59, + 142, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, 1392, 1392, 1392, 1392, + 1392, -541, -541, 152, -541, 86, -541, -541, -541, -541, + -541, -541, -541, -541, -129, -541, -541, -541, 169, 196, + 242, 200, 246, 203, 252, 205, 253, 251, 258, 221, + 255, 259, 533, -541, 1392, 1392, 99, -63, 1392, -541, + 1173, -541, 128, 126, 894, -541, -541, 75, -541, 894, + 894, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, 894, 1331, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, 1392, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + 1392, 130, 133, -541, 894, 132, 138, 139, 143, 144, + 151, 155, 156, 157, 894, 894, 894, 163, 254, 1331, + 1392, 1392, 271, -541, 164, 164, 164, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, 59, 142, 173, + 174, 175, 176, 177, 1214, 1494, 732, 281, 178, 179, + 180, 182, 190, -541, -541, 164, -42, -135, -541, 166, + -46, -541, 137, -541, 193, 191, 1234, -541, -541, -541, + -541, -541, -541, -541, -541, -541, 290, 1433, -541, -541, + -541, -541, 201, -541, 202, 894, 894, 894, 7, -541, + 10, -541, 204, 894, 199, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 211, 215, 217, 1392, 1392, 894, 894, 223, + -541, -21, -541, -541, -541, 210, 219, 1433, 1433, 1433, + 1433, 1433, -541, -541, 4, 752, -91, -541, -8, -541, + 1433, 1433, 1433, 1433, 1433, -541, -541, -541, -541, -541, + -541, 1275, 324, -541, -541, 343, 37, 348, 356, 224, + 225, 229, 894, 376, 894, 1392, -541, 230, 894, 232, + -541, -541, 234, 235, -541, -541, 894, 894, 894, -541, + -541, 226, -541, 1392, 362, 385, -541, 164, 1433, 1433, + 204, 238, 239, 240, 241, 1433, -541, 243, -17, -5, + -541, -541, 247, 250, 261, 262, 359, -541, -541, -541, + 339, 268, -541, 894, 894, 1392, 894, 894, 269, -541, + 269, -541, 270, 894, 272, 1392, 1392, 1392, -541, -541, + -541, 1392, 894, -541, -541, -541, 273, 274, 249, 1433, + 1433, 1433, 1433, -541, -541, 245, 1433, 1433, 1433, 1433, + 1392, 395, -541, 383, 275, 267, 270, 279, -541, -541, + 351, -541, -541, 1392, 277, 894, -541, -541, -541, 282, + -541, 1433, 1433, -541, 278, 283, 284, 288, -541, 289, + 291, 295, 296, 297, -541, -541, 423, 43, 410, -541, + -541, 298, -541, 300, 305, 1433, -541, 1433, 1433, -541, + -541, -541, -541, -541, 894, -541, 1020, 64, 441, -541, + -541, -541, 307, 311, 314, -541, 312, -541, 1020, 894, + -541, -541, -541, 450, 319, 150, 894, 452, 453, -541, + 894, 894, -541, -541 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { - -508, -508, -508, 356, 357, 360, 145, 147, 371, 374, - -128, -127, -497, -508, 416, 436, -117, -508, -277, 41, - -508, -296, -508, -47, -508, -37, -508, -58, 46, -508, - -99, 253, -298, 49, -508, -508, -508, -508, -508, -508, - -508, 419, -508, -508, -508, -508, 8, -508, 51, -508, - -508, 412, -508, -508, -508, -508, -508, 471, -508, -508, - -507, -209, 67, -124, -508, 457, -508, -118, -508, -508, - -508, -508, 43, -22, -508, -508, 21, -508, -508 + -541, -541, -541, 379, 380, 381, 161, 162, 386, 388, + -128, -127, -540, -541, 438, 456, -111, -541, -277, 63, + -541, -297, -541, -47, -541, -37, -541, -53, 40, -541, + -99, 264, -307, 84, -541, -541, -541, -541, -541, -541, + -541, 435, -541, -541, -541, -541, 8, -541, 68, -541, + -541, 427, -541, -541, -541, -541, -541, 487, -541, -541, + -489, -199, 67, -124, -541, 472, -541, -103, -541, -541, + -541, -541, 71, -7, -541, -541, 33, -541, -541 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -2577,354 +2572,358 @@ #define YYTABLE_NINF -180 static const short int yytable[] = { - 88, 235, 249, 250, 238, 371, 105, 115, 39, 393, - 394, 26, 223, 334, 252, 42, 88, 454, 4, 432, - 434, 93, 46, 47, 48, 360, 119, 406, 408, 416, - 360, 360, 106, 107, 123, 283, 198, 199, 287, 415, - 455, 49, 360, 288, 289, 290, 291, 292, 293, 26, - 241, 242, 243, 244, 245, 246, 247, 248, 119, 426, - 576, 433, 433, 29, 119, 297, 298, 239, 228, 586, - 39, 205, 206, 207, -112, 360, 299, 51, 229, 240, - 588, 594, -139, 123, -112, 360, 360, 360, 234, 53, - 52, 234, -139, 123, 121, 241, 242, 243, 244, 245, - 246, 247, 248, 302, 109, 110, 111, 469, 228, 303, - 7, 8, 9, 10, 54, 12, 55, 465, 339, 56, - 281, 282, 234, 284, 285, 234, 465, 471, 62, 465, - 234, 234, 234, 234, 234, 234, 515, 470, 417, 465, - 465, 123, 58, 59, -179, 60, 466, 482, 43, 294, - 295, 296, 234, 234, 94, 64, 360, 360, 360, 300, - 301, 505, 227, 98, 360, 116, 336, 337, 232, 5, - 340, 20, 99, 21, 100, 6, 101, 389, 360, 360, - 307, 308, -72, -72, 102, 7, 8, 9, 10, 11, - 12, 13, -113, 342, -71, -71, -70, -70, 113, 575, - -69, -69, 309, 310, 114, 365, 14, 133, 134, 122, - 197, 531, 202, 532, 201, 88, 30, 31, 32, 33, - 34, 35, 36, 360, 224, 360, 366, 203, 225, 360, - 230, 236, -76, -75, -74, -73, 312, 360, 360, 360, - -79, -80, 313, 367, 587, 338, 346, 347, 368, 370, - 374, 439, 387, 441, 442, 443, 373, 386, 375, 376, - 377, 449, 88, 388, 234, 241, 242, 243, 244, 245, - 246, 247, 248, 378, 360, 360, 379, 360, 360, 380, - 381, 385, 390, 409, 360, 391, 397, 424, 340, 398, - 399, 400, 401, 360, 410, 411, 412, 413, 460, 461, - 462, 463, 464, 414, 418, 458, 362, 363, 421, 427, - 422, 472, 473, 474, 475, 476, 428, 435, 364, 438, - 446, 447, 448, 453, 454, 481, 360, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 459, 234, 440, - 234, 234, 234, 444, 445, 483, 484, 468, 234, 450, - 419, 372, 489, 485, 486, 487, 503, 493, 495, 506, - 507, 382, 383, 384, 496, 360, 513, 497, 501, 504, - 509, 536, 537, 538, 520, 510, 511, 514, 512, 516, - 360, 548, 554, 521, 342, 555, 433, 360, 574, 517, - 518, 360, 360, 519, 523, 530, 533, 535, 234, 541, - 542, 543, 556, 589, 578, 557, 558, 562, 566, 559, - 544, 545, 546, 547, 565, 560, 502, 549, 550, 551, - 552, 264, 265, 567, 568, 569, 579, 593, 570, 249, - 250, 571, 429, 430, 431, 572, 573, 580, 581, 590, - 437, 591, 563, 564, 592, 596, 597, 600, 234, 249, - 250, 601, 186, 187, 451, 452, 188, 96, 234, 234, - 234, 57, 395, 479, 234, 396, 582, 189, 583, 584, - 190, 104, 478, 112, 27, 333, 45, 598, 492, 539, - 0, 508, 0, 553, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 234, 0, 0, 488, - 0, 490, 0, 0, 0, 494, 0, 0, 0, 0, - 0, 0, 0, 498, 499, 500, 0, 0, 0, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 65, 66, 0, 0, 0, 0, 0, 0, - 524, 525, 0, 528, 529, 0, 0, 0, 0, 20, - 534, 21, 0, 314, 0, 0, -82, 0, 20, 540, - 21, 0, 0, 0, 0, 315, 316, 6, -82, -82, - 0, 0, 0, 0, 0, 0, 0, -82, -82, -82, - -82, -82, -82, -82, 0, 0, -82, 22, 0, 0, - 0, 0, 561, 0, 23, 0, 0, 0, 24, 0, - 0, 0, 0, 0, 0, 0, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 317, 318, 0, 0, - 0, 585, 0, 319, 0, 320, 163, 164, 165, 166, - 0, 321, 322, 323, 0, 0, 595, 0, 0, 0, + 88, 235, 249, 250, 238, 371, 105, 115, 393, 394, + 93, 26, 223, 454, 39, 239, 88, 576, 406, 408, + 252, 42, 432, 334, 302, 434, 417, 240, 4, 123, + 303, 119, 46, 47, 48, 360, 455, 588, 415, 283, + 360, 360, 287, 288, 289, 290, 291, 292, 293, 26, + 426, 49, 360, 241, 242, 243, 244, 245, 246, 247, + 248, -179, 465, 119, 433, 297, 298, 433, 39, 119, + 470, 205, 206, 207, 241, 242, 243, 244, 245, 246, + 247, 248, 299, 228, 29, 360, 5, 586, 234, 53, + 228, 234, 6, 229, 121, 360, 360, 360, 469, 594, + 339, 51, 7, 8, 9, 10, 11, 12, 13, -112, + 7, 8, 9, 10, 54, 12, 55, 416, 123, 56, + 106, 107, 123, 14, 281, 282, 234, 284, 285, 234, + 234, 234, 234, 234, 234, 234, -139, 52, -112, 109, + 110, 111, 59, 94, 60, 465, -139, 123, 465, 294, + 295, 296, 234, 234, 43, 471, 227, 465, 515, 20, + 505, 21, 232, 466, 58, 116, 360, 360, 360, 264, + 265, 336, 337, 62, 360, 340, 64, 389, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 360, 360, + 465, 198, 199, 342, 300, 301, 307, 308, 482, -72, + -72, 98, 575, -71, -71, 365, -70, -70, -69, -69, + 99, 531, 100, 532, 101, 88, 30, 31, 32, 33, + 34, 35, 36, 587, 309, 310, 366, 133, 134, 102, + -113, 113, 114, 360, 122, 360, 197, 201, 202, 360, + 203, 224, 236, 367, 230, 225, -76, 360, 360, 360, + -75, 439, 387, 441, 442, 443, -74, -73, -79, 312, + 338, 449, 88, 388, 234, -80, 313, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 346, 347, 368, 360, 360, 370, 360, 360, 373, + 386, 374, 375, 340, 360, 390, 376, 377, 460, 461, + 462, 463, 464, 360, 378, 409, 362, 363, 379, 380, + 381, 472, 473, 474, 475, 476, 385, 391, 364, 241, + 242, 243, 244, 245, 246, 247, 248, 418, 397, 398, + 399, 400, 401, 410, 411, 412, 360, 413, 234, 440, + 234, 234, 234, 444, 445, 414, 421, 422, 234, 450, + 419, 372, 468, 424, 427, 428, 438, 435, 454, 506, + 507, 382, 383, 384, 446, 458, 513, 481, 447, 483, + 448, 536, 537, 538, 459, 360, 453, 484, 486, 485, + 489, 501, 487, 493, 342, 495, 503, 496, 497, 504, + 360, 509, 510, 511, 512, 520, 521, 360, 234, 554, + 516, 360, 360, 517, 514, 543, 548, 555, 433, 559, + 544, 545, 546, 547, 518, 519, 502, 549, 550, 551, + 552, 523, 530, 533, 557, 535, 541, 542, 556, 249, + 250, 565, 429, 430, 431, 558, 560, 567, 562, 566, + 437, 568, 563, 564, 574, 569, 578, 570, 234, 249, + 250, 571, 572, 573, 451, 452, 580, 579, 234, 234, + 234, 581, 589, 590, 234, 593, 582, 591, 583, 584, + 592, 596, 597, 600, 601, 186, 187, 188, 395, 96, + 396, 57, 189, 553, 190, 479, 333, 104, 112, 478, + 27, 45, 598, 508, 539, 0, 234, 0, -82, 488, + 20, 490, 21, 0, 0, 494, 492, 0, 0, 6, + -82, -82, 0, 498, 499, 500, 0, 0, 0, -82, + -82, -82, -82, -82, -82, -82, 0, 0, -82, 22, + 0, 0, 0, 0, 0, 0, 23, 0, 65, 66, + 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 524, 525, 0, 528, 529, 20, 0, 21, 0, 314, + 534, 0, 0, 0, 0, 0, 0, 0, 0, 540, + 0, 315, 316, 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, 561, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 317, 318, 0, 0, + 0, 585, 0, 319, 0, 320, 0, 321, 322, 323, + 0, 0, 0, 0, 0, 0, 595, 0, 0, 0, 0, 0, 0, 599, 0, 0, 0, 602, 603, 0, - 0, 0, 0, 0, 0, 0, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 0, - 0, 0, 0, 0, 324, 0, 0, 325, 0, 326, - 65, 66, 327, 117, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, - 65, 66, 0, 117, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, - 0, 65, 66, 80, 117, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 0, 79, 20, 0, - 21, 65, 66, 80, 117, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 0, 79, 20, 0, - 21, 0, 0, 0, 80, 0, 65, 66, 0, 117, + 0, 0, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, + 324, 0, 0, 325, 0, 326, 65, 66, 327, 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 79, 20, 80, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, + 78, 0, 79, 20, 0, 21, 65, 66, 0, 117, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 0, 79, 20, 0, 21, 0, 65, 66, 80, + 117, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 0, 79, 20, 0, 21, 65, 66, 80, + 117, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 0, 79, 20, 0, 21, 0, 0, 0, + 80, 0, 65, 66, 0, 117, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, + 80, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, - 0, 0, 82, 0, 0, 83, 0, 84, 118, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, - 0, 0, 82, 0, 0, 83, 0, 84, 226, 0, + 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, + 0, 83, 0, 84, 118, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, + 0, 83, 0, 84, 226, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 81, 0, 0, 82, + 0, 0, 83, 0, 84, 407, 0, 348, 349, 65, + 66, 350, 0, 0, 0, 0, 81, 0, 0, 82, + 0, 0, 83, 0, 84, 467, 20, 0, 21, 0, + 351, 352, 353, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 354, 355, 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 0, 0, 82, 0, 0, 83, 0, 84, 407, - 0, 348, 349, 65, 66, 350, 0, 0, 0, 0, - 81, 0, 0, 82, 0, 0, 83, 0, 84, 467, - 20, 0, 21, 0, 351, 352, 353, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 354, 355, 82, 0, - 0, 83, 0, 84, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, + 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 317, 318, 348, - 349, 0, 0, 350, 319, 0, 320, 163, 164, 165, - 166, 0, 321, 322, 323, 0, 0, 0, 0, 0, - 0, 0, 351, 352, 353, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 354, 355, 0, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 0, 0, 0, 0, 0, 0, 0, 356, 357, 0, + 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 317, 318, 0, + 0, 0, 0, 0, 319, 0, 320, 0, 321, 322, + 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 348, 349, 0, 0, 350, 0, 0, + 0, 0, 0, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 351, 352, 353, 0, + 0, 0, 0, 0, 357, 0, 0, 0, 354, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 317, 318, 0, 0, 0, - 0, 0, 319, 0, 320, 163, 164, 165, 166, 0, - 321, 322, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, - 0, 0, 0, 0, 65, 66, 357, 117, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, - 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 341, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 0, 79, 20, 0, 21, 65, 66, 0, 117, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 0, 79, 20, 0, 21, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 66, 80, 117, + 0, 356, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 317, 318, 0, 0, 0, 0, 0, + 319, 0, 320, 0, 321, 322, 323, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 0, 0, 0, 0, 0, 0, 65, 66, + 357, 117, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 341, 0, 0, 0, 0, 0, 0, 0, 0, 65, + 66, 80, 117, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 0, 79, 20, 0, 21, 65, + 66, 0, 117, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 0, 79, 20, 0, 21, 0, + 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, + 0, 423, 0, 0, 0, 0, 0, 0, 0, 0, + 65, 66, 80, 117, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 477, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 80, 0, 0, 0, 81, 0, 0, + 82, 0, 0, 83, 0, 84, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 477, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 65, 66, 0, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, - 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 0, 0, 82, 0, 402, - 83, 0, 84, 0, 0, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 0, 0, 82, 0, 0, - 83, 0, 84, 65, 66, 0, 117, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, - 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, - 0, 83, 0, 84, 65, 66, 80, 117, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, - 79, 20, 0, 21, 65, 66, 0, 237, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, - 79, 20, 0, 21, 0, 0, 0, 80, 0, 0, - 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, - 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 0, 79, 20, 0, 21, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, - 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, - 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, + 0, 82, 0, 402, 83, 0, 84, 0, 0, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, + 0, 82, 0, 0, 83, 0, 84, 65, 66, 0, + 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 0, 79, 20, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, + 0, 0, 82, 0, 0, 83, 0, 84, 65, 66, + 80, 117, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 0, 79, 20, 0, 21, 65, 66, + 0, 237, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, + 0, 80, 0, 0, 0, 81, 0, 0, 82, 0, + 0, 83, 0, 84, 0, 0, 0, 0, 0, 65, + 66, 80, 117, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 0, 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 0, 0, 0, 0, 124, 0, 0, 0, + 0, 0, 80, 0, 0, 0, 81, 0, 0, 82, + 0, 0, 83, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 126, 127, 0, 0, 81, 0, 0, 82, 0, 0, - 83, 0, 405, 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, 157, 158, 159, 0, 0, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, + 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, + 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 126, 127, 0, 0, 81, 0, + 0, 82, 0, 0, 83, 0, 405, 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, 157, 158, 159, 160, + 161, 162, 163, 0, 0, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 0, 0, 0, 0, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185 }; static const short int yycheck[] = { - 37, 125, 130, 130, 128, 282, 53, 4, 23, 305, - 306, 3, 111, 222, 131, 30, 53, 34, 0, 15, - 15, 29, 52, 53, 54, 234, 84, 325, 326, 159, - 239, 240, 32, 33, 164, 159, 55, 56, 162, 335, - 57, 71, 251, 167, 168, 169, 170, 171, 172, 41, - 10, 11, 12, 13, 14, 15, 16, 17, 116, 357, - 557, 57, 57, 61, 122, 189, 190, 9, 153, 576, - 23, 108, 109, 110, 155, 284, 193, 152, 163, 21, - 577, 588, 153, 164, 155, 294, 295, 296, 125, 20, - 61, 128, 163, 164, 86, 10, 11, 12, 13, 14, - 15, 16, 17, 153, 55, 56, 57, 405, 153, 159, - 41, 42, 43, 44, 45, 46, 47, 153, 163, 50, - 157, 158, 159, 160, 161, 162, 153, 163, 24, 153, - 167, 168, 169, 170, 171, 172, 163, 161, 161, 153, - 153, 164, 152, 45, 0, 47, 159, 161, 163, 186, - 187, 188, 189, 190, 162, 4, 365, 366, 367, 104, - 105, 457, 116, 152, 373, 162, 224, 225, 122, 25, - 228, 22, 152, 24, 152, 31, 152, 301, 387, 388, - 27, 28, 3, 4, 157, 41, 42, 43, 44, 45, - 46, 47, 155, 230, 3, 4, 3, 4, 4, 159, - 3, 4, 3, 4, 4, 252, 62, 77, 78, 155, - 24, 488, 24, 490, 4, 252, 64, 65, 66, 67, - 68, 69, 70, 432, 158, 434, 263, 24, 158, 438, - 155, 59, 4, 4, 4, 4, 4, 446, 447, 448, - 7, 7, 7, 280, 159, 161, 153, 156, 153, 153, - 153, 375, 299, 377, 378, 379, 157, 36, 153, 153, - 153, 385, 299, 300, 301, 10, 11, 12, 13, 14, - 15, 16, 17, 153, 483, 484, 153, 486, 487, 153, - 153, 153, 24, 24, 493, 153, 155, 63, 346, 155, - 155, 155, 155, 502, 155, 155, 155, 155, 397, 398, - 399, 400, 401, 155, 161, 155, 239, 240, 153, 153, - 156, 410, 411, 412, 413, 414, 153, 153, 251, 157, - 153, 153, 153, 153, 34, 24, 535, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 155, 375, 376, - 377, 378, 379, 380, 381, 21, 21, 405, 385, 386, - 342, 284, 4, 155, 153, 153, 24, 153, 153, 458, - 459, 294, 295, 296, 153, 574, 465, 153, 155, 4, - 153, 495, 496, 497, 36, 153, 153, 161, 153, 153, - 589, 161, 4, 57, 421, 24, 57, 596, 21, 153, - 153, 600, 601, 153, 153, 153, 153, 153, 435, 153, - 153, 156, 153, 21, 36, 157, 156, 156, 156, 533, - 509, 510, 511, 512, 153, 159, 453, 516, 517, 518, - 519, 27, 28, 153, 153, 156, 159, 153, 156, 557, - 557, 156, 365, 366, 367, 156, 156, 156, 156, 156, - 373, 156, 541, 542, 156, 21, 153, 21, 485, 577, - 577, 21, 96, 96, 387, 388, 96, 41, 495, 496, - 497, 25, 317, 422, 501, 318, 565, 96, 567, 568, - 96, 52, 421, 61, 3, 222, 19, 595, 435, 501, - -1, 460, -1, 520, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 533, -1, -1, 432, - -1, 434, -1, -1, -1, 438, -1, -1, -1, -1, - -1, -1, -1, 446, 447, 448, -1, -1, -1, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 5, 6, -1, -1, -1, -1, -1, -1, - 483, 484, -1, 486, 487, -1, -1, -1, -1, 22, - 493, 24, -1, 26, -1, -1, 20, -1, 22, 502, - 24, -1, -1, -1, -1, 38, 39, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, - 44, 45, 46, 47, -1, -1, 50, 51, -1, -1, - -1, -1, 535, -1, 58, -1, -1, -1, 62, -1, - -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, -1, -1, - -1, 574, -1, 106, -1, 108, 109, 110, 111, 112, - -1, 114, 115, 116, -1, -1, 589, -1, -1, -1, + 37, 125, 130, 130, 128, 282, 53, 4, 305, 306, + 29, 3, 111, 34, 23, 9, 53, 557, 325, 326, + 131, 30, 15, 222, 153, 15, 161, 21, 0, 164, + 159, 84, 52, 53, 54, 234, 57, 577, 335, 163, + 239, 240, 166, 167, 168, 169, 170, 171, 172, 41, + 357, 71, 251, 10, 11, 12, 13, 14, 15, 16, + 17, 0, 153, 116, 57, 189, 190, 57, 23, 122, + 161, 108, 109, 110, 10, 11, 12, 13, 14, 15, + 16, 17, 193, 153, 61, 284, 25, 576, 125, 20, + 153, 128, 31, 163, 86, 294, 295, 296, 405, 588, + 163, 152, 41, 42, 43, 44, 45, 46, 47, 155, + 41, 42, 43, 44, 45, 46, 47, 159, 164, 50, + 32, 33, 164, 62, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 153, 61, 155, 55, + 56, 57, 45, 162, 47, 153, 163, 164, 153, 186, + 187, 188, 189, 190, 163, 163, 116, 153, 163, 22, + 457, 24, 122, 159, 152, 162, 365, 366, 367, 27, + 28, 224, 225, 24, 373, 228, 4, 301, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 387, 388, + 153, 55, 56, 230, 108, 109, 27, 28, 161, 3, + 4, 152, 159, 3, 4, 252, 3, 4, 3, 4, + 152, 488, 152, 490, 152, 252, 64, 65, 66, 67, + 68, 69, 70, 159, 3, 4, 263, 77, 78, 157, + 155, 4, 4, 432, 155, 434, 24, 4, 24, 438, + 24, 158, 59, 280, 155, 158, 4, 446, 447, 448, + 4, 375, 299, 377, 378, 379, 4, 4, 7, 4, + 161, 385, 299, 300, 301, 7, 7, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 153, 156, 153, 483, 484, 153, 486, 487, 157, + 36, 153, 153, 346, 493, 24, 153, 153, 397, 398, + 399, 400, 401, 502, 153, 24, 239, 240, 153, 153, + 153, 410, 411, 412, 413, 414, 153, 153, 251, 10, + 11, 12, 13, 14, 15, 16, 17, 161, 155, 155, + 155, 155, 155, 155, 155, 155, 535, 155, 375, 376, + 377, 378, 379, 380, 381, 155, 153, 156, 385, 386, + 342, 284, 405, 63, 153, 153, 157, 153, 34, 458, + 459, 294, 295, 296, 153, 155, 465, 24, 153, 21, + 153, 495, 496, 497, 155, 574, 153, 21, 153, 155, + 4, 155, 153, 153, 421, 153, 24, 153, 153, 4, + 589, 153, 153, 153, 153, 36, 57, 596, 435, 4, + 153, 600, 601, 153, 161, 156, 161, 24, 57, 533, + 509, 510, 511, 512, 153, 153, 453, 516, 517, 518, + 519, 153, 153, 153, 157, 153, 153, 153, 153, 557, + 557, 153, 365, 366, 367, 156, 159, 153, 156, 156, + 373, 153, 541, 542, 21, 156, 36, 156, 485, 577, + 577, 156, 156, 156, 387, 388, 156, 159, 495, 496, + 497, 156, 21, 156, 501, 153, 565, 156, 567, 568, + 156, 21, 153, 21, 21, 96, 96, 96, 317, 41, + 318, 25, 96, 520, 96, 422, 222, 52, 61, 421, + 3, 19, 595, 460, 501, -1, 533, -1, 20, 432, + 22, 434, 24, -1, -1, 438, 435, -1, -1, 31, + 32, 33, -1, 446, 447, 448, -1, -1, -1, 41, + 42, 43, 44, 45, 46, 47, -1, -1, 50, 51, + -1, -1, -1, -1, -1, -1, 58, -1, 5, 6, + 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 483, 484, -1, 486, 487, 22, -1, 24, -1, 26, + 493, -1, -1, -1, -1, -1, -1, -1, -1, 502, + -1, 38, 39, -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, 535, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, -1, -1, + -1, 574, -1, 110, -1, 112, -1, 114, 115, 116, + -1, -1, -1, -1, -1, -1, 589, -1, -1, -1, -1, -1, -1, 596, -1, -1, -1, 600, 601, -1, - -1, -1, -1, -1, -1, -1, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, -1, - -1, -1, -1, -1, 157, -1, -1, 160, -1, 162, - 5, 6, 165, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, - 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, - -1, 5, 6, 48, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, - 24, 5, 6, 48, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, - 24, -1, -1, -1, 48, -1, 5, 6, -1, 8, + -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, -1, -1, -1, -1, -1, + 157, -1, -1, 160, -1, 162, 5, 6, 165, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, -1, 21, 22, 48, 24, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, + 19, -1, 21, 22, -1, 24, 5, 6, -1, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, -1, 21, 22, -1, 24, -1, 5, 6, 48, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, -1, 21, 22, -1, 24, 5, 6, 48, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, + 48, -1, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + 48, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 154, - -1, -1, 157, -1, -1, 160, -1, 162, 163, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 154, - -1, -1, 157, -1, -1, 160, -1, 162, 163, -1, + -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, + -1, 160, -1, 162, 163, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, + -1, 160, -1, 162, 163, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 154, -1, -1, 157, + -1, -1, 160, -1, 162, 163, -1, 3, 4, 5, + 6, 7, -1, -1, -1, -1, 154, -1, -1, 157, + -1, -1, 160, -1, 162, 163, 22, -1, 24, -1, + 26, 27, 28, -1, -1, -1, -1, -1, -1, -1, + -1, 154, 38, 39, 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, - -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, - 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, - 22, -1, 24, -1, 26, 27, 28, -1, -1, -1, - -1, -1, -1, -1, -1, 154, 38, 39, 157, -1, - -1, 160, -1, 162, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, + -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 3, - 4, -1, -1, 7, 106, -1, 108, 109, 110, 111, - 112, -1, 114, 115, 116, -1, -1, -1, -1, -1, - -1, -1, 26, 27, 28, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 38, 39, -1, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - -1, -1, -1, -1, -1, -1, -1, 61, 160, -1, + -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, + -1, -1, -1, -1, 110, -1, 112, -1, 114, 115, + 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, -1, -1, 7, -1, -1, + -1, -1, -1, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 26, 27, 28, -1, + -1, -1, -1, -1, 160, -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, -1, -1, -1, - -1, -1, 106, -1, 108, 109, 110, 111, 112, -1, - 114, 115, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, -1, -1, - -1, -1, -1, -1, 5, 6, 160, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, - -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, 5, 6, -1, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, -1, -1, -1, 48, -1, - -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, - -1, -1, -1, -1, -1, -1, 5, 6, 48, 8, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, -1, -1, -1, -1, -1, + 110, -1, 112, -1, 114, 115, 116, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, -1, -1, -1, -1, -1, -1, 5, 6, + 160, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 37, -1, -1, -1, -1, -1, -1, -1, -1, 5, + 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, -1, 21, 22, -1, 24, 5, + 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, + -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, + -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, + 5, 6, 48, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 48, -1, -1, -1, 154, -1, -1, + 157, -1, -1, 160, -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 154, -1, -1, 157, -1, 159, - 160, -1, 162, -1, -1, 48, -1, -1, -1, -1, - -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, - 160, -1, 162, 5, 6, -1, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, - -1, 160, -1, 162, 5, 6, 48, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 154, -1, + -1, 157, -1, 159, 160, -1, 162, -1, -1, 48, + -1, -1, -1, -1, -1, -1, -1, -1, 154, -1, + -1, 157, -1, -1, 160, -1, 162, 5, 6, -1, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 154, + -1, -1, 157, -1, -1, 160, -1, 162, 5, 6, + 48, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, -1, 21, 22, -1, 24, 5, 6, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, + -1, 48, -1, -1, -1, 154, -1, -1, 157, -1, + -1, 160, -1, 162, -1, -1, -1, -1, -1, 5, + 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, -1, -1, -1, -1, 35, -1, -1, -1, + -1, -1, 48, -1, -1, -1, 154, -1, -1, 157, + -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, 60, -1, -1, 154, -1, -1, 157, -1, -1, - 160, -1, 162, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, -1, -1, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 154, -1, -1, + 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 154, -1, -1, + 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, + 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 59, 60, -1, -1, 154, -1, + -1, 157, -1, -1, 160, -1, 162, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151 + -1, -1, -1, -1, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2947,7 +2946,7 @@ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 104, 105, 106, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 169, 170, 171, 174, 175, 233, 234, 240, 241, 243, 244, 24, 55, 56, @@ -2961,9 +2960,9 @@ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 173, 191, 191, 229, 191, 191, 237, 229, 229, 229, 229, 229, 229, 229, 191, 191, 191, 229, 229, 182, - 104, 105, 153, 159, 205, 206, 204, 27, 28, 3, - 4, 168, 4, 7, 26, 38, 39, 99, 100, 106, - 108, 114, 115, 116, 157, 160, 162, 165, 169, 170, + 108, 109, 153, 159, 205, 206, 204, 27, 28, 3, + 4, 168, 4, 7, 26, 38, 39, 103, 104, 110, + 112, 114, 115, 116, 157, 160, 162, 165, 169, 170, 171, 174, 175, 197, 227, 203, 193, 193, 161, 163, 193, 37, 191, 214, 215, 216, 153, 156, 3, 4, 7, 26, 27, 28, 38, 39, 61, 160, 197, 226, @@ -3661,7 +3660,7 @@ switch (yyn) { case 3: -#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1576 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3670,7 +3669,7 @@ break; case 5: -#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1585 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -3679,226 +3678,226 @@ break; case 26: -#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1607 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1607 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1608 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1608 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1609 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1609 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1610 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1610 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1615 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1615 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1616 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1616 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1618 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1618 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1620 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1620 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1627 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1622 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1628 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1623 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1657 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1662 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1668 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1663 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1669 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1664 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 1670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 1671 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1666 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 1672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1667 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 1673 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1668 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1674 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1669 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1678 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1673 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} break; case 92: -#line 1679 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1674 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} break; case 93: -#line 1680 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1675 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 1681 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1676 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 1682 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1677 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 1683 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 1684 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1679 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 1685 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1680 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -3907,12 +3906,12 @@ break; case 99: -#line 1695 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1690 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 1696 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3921,12 +3920,12 @@ break; case 101: -#line 1704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1699 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 1705 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1700 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3935,7 +3934,7 @@ break; case 103: -#line 1713 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1708 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -3945,27 +3944,27 @@ break; case 104: -#line 1722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1717 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 1723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1718 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 1730 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1725 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 107: -#line 1731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1726 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 108: -#line 1735 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3973,7 +3972,7 @@ break; case 109: -#line 1739 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -3983,7 +3982,7 @@ break; case 111: -#line 1756 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; @@ -3991,7 +3990,7 @@ break; case 113: -#line 1764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1759 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; @@ -3999,7 +3998,7 @@ break; case 114: -#line 1771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).T)->getDescription()); @@ -4008,7 +4007,7 @@ break; case 127: -#line 1785 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1780 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = (yyvsp[0].PrimType).S; @@ -4016,7 +4015,7 @@ break; case 128: -#line 1789 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1784 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).T = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S = Signless; @@ -4024,7 +4023,7 @@ break; case 129: -#line 1793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1788 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... const Type* tmp = getType((yyvsp[0].ValIDVal)); (yyval.TypeVal).T = new PATypeHolder(tmp); @@ -4033,7 +4032,7 @@ break; case 130: -#line 1798 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1793 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); @@ -4046,7 +4045,7 @@ break; case 131: -#line 1807 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1802 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? std::vector Params; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -4071,7 +4070,7 @@ break; case 132: -#line 1828 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1823 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).T->get(), (unsigned)(yyvsp[-3].UInt64Val)))); @@ -4081,7 +4080,7 @@ break; case 133: -#line 1834 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).T->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -4098,7 +4097,7 @@ break; case 134: -#line 1847 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1842 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -4111,7 +4110,7 @@ break; case 135: -#line 1856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).S = Signless; @@ -4119,7 +4118,7 @@ break; case 136: -#line 1860 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1855 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), @@ -4134,7 +4133,7 @@ break; case 137: -#line 1871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1866 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector(),true)); (yyval.TypeVal).S = Signless; @@ -4142,7 +4141,7 @@ break; case 138: -#line 1875 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).T->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); @@ -4153,7 +4152,7 @@ break; case 139: -#line 1888 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1883 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4161,14 +4160,14 @@ break; case 140: -#line 1892 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1887 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 1900 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1895 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; VoidTI.T = new PATypeHolder(Type::VoidTy); @@ -4178,7 +4177,7 @@ break; case 143: -#line 1906 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1901 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; @@ -4189,14 +4188,14 @@ break; case 144: -#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1908 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); ;} break; case 145: -#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1920 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (ATy == 0) @@ -4230,7 +4229,7 @@ break; case 146: -#line 1955 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1950 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (ATy == 0) @@ -4247,7 +4246,7 @@ break; case 147: -#line 1968 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1963 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (ATy == 0) @@ -4274,7 +4273,7 @@ break; case 148: -#line 1991 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1986 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (PTy == 0) @@ -4306,7 +4305,7 @@ break; case 149: -#line 2019 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2014 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).T->get()); if (STy == 0) @@ -4332,7 +4331,7 @@ break; case 150: -#line 2041 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2036 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).T->get()); if (STy == 0) @@ -4347,7 +4346,7 @@ break; case 151: -#line 2052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2047 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal).T->get()); if (STy == 0) @@ -4373,7 +4372,7 @@ break; case 152: -#line 2074 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2069 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-4].TypeVal).T->get()); if (STy == 0) @@ -4388,7 +4387,7 @@ break; case 153: -#line 2085 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2080 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (PTy == 0) @@ -4401,7 +4400,7 @@ break; case 154: -#line 2094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2089 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).T->get()); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; @@ -4410,7 +4409,7 @@ break; case 155: -#line 2099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2094 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (Ty == 0) @@ -4472,7 +4471,7 @@ break; case 156: -#line 2157 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).T->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); @@ -4483,7 +4482,7 @@ break; case 157: -#line 2164 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -4495,7 +4494,7 @@ break; case 158: -#line 2172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4506,7 +4505,7 @@ break; case 159: -#line 2179 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4517,7 +4516,7 @@ break; case 160: -#line 2186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S = Unsigned; @@ -4525,7 +4524,7 @@ break; case 161: -#line 2190 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S = Unsigned; @@ -4533,7 +4532,7 @@ break; case 162: -#line 2194 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4543,7 +4542,7 @@ break; case 163: -#line 2203 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); const Type* DstTy = (yyvsp[-1].TypeVal).T->get(); @@ -4562,7 +4561,7 @@ break; case 164: -#line 2218 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa(Ty)) @@ -4579,7 +4578,7 @@ break; case 165: -#line 2231 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4592,7 +4591,7 @@ break; case 166: -#line 2240 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2235 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4624,7 +4623,7 @@ break; case 167: -#line 2268 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2263 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4641,7 +4640,7 @@ break; case 168: -#line 2281 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2276 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4654,7 +4653,7 @@ break; case 169: -#line 2290 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2285 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4664,7 +4663,7 @@ break; case 170: -#line 2296 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2291 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4674,20 +4673,22 @@ break; case 171: -#line 2302 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) error("Shift count for shift constant must be unsigned byte"); + const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (!(yyvsp[-3].ConstVal).C->getType()->isInteger()) error("Shift constant expression requires integer operand"); - (yyval.ConstVal).C = ConstantExpr::get(getOtherOp((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal).S), (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C); + Constant *ShiftAmt = ConstantExpr::getZExt((yyvsp[-1].ConstVal).C, Ty); + (yyval.ConstVal).C = ConstantExpr::get(getBinaryOp((yyvsp[-5].BinaryOpVal), Ty, (yyvsp[-3].ConstVal).S), (yyvsp[-3].ConstVal).C, ShiftAmt); (yyval.ConstVal).S = (yyvsp[-3].ConstVal).S; ;} break; case 172: -#line 2311 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -4697,7 +4698,7 @@ break; case 173: -#line 2317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2314 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -4707,7 +4708,7 @@ break; case 174: -#line 2323 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2320 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -4717,12 +4718,12 @@ break; case 175: -#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2331 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -4730,17 +4731,17 @@ break; case 177: -#line 2344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2342 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2354 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -4748,27 +4749,27 @@ break; case 180: -#line 2366 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2364 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2365 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2366 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2367 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -4784,7 +4785,7 @@ break; case 185: -#line 2386 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2383 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -4808,19 +4809,19 @@ break; case 186: -#line 2406 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2403 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2408 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2405 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2410 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2407 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -4829,14 +4830,14 @@ break; case 189: -#line 2414 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2417 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2414 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0); @@ -4845,14 +4846,14 @@ break; case 191: -#line 2421 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2418 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2424 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0); @@ -4861,14 +4862,14 @@ break; case 193: -#line 2428 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2425 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2431 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2428 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); CurGV = @@ -4878,32 +4879,32 @@ break; case 195: -#line 2436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2433 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2439 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2441 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2438 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2443 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2440 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2448 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2445 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4918,24 +4919,24 @@ break; case 200: -#line 2462 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2459 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2463 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2460 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2467 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2464 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2470 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2467 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -4947,7 +4948,7 @@ break; case 204: -#line 2478 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2475 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4955,7 +4956,7 @@ break; case 205: -#line 2482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2479 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4963,7 +4964,7 @@ break; case 207: -#line 2493 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2490 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4971,7 +4972,7 @@ break; case 208: -#line 2497 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2494 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4979,17 +4980,17 @@ break; case 209: -#line 2501 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2498 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2514 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2511 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2518 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2515 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).T->get() == Type::VoidTy) error("void typed arguments are invalid"); @@ -4998,7 +4999,7 @@ break; case 215: -#line 2526 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2523 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5007,7 +5008,7 @@ break; case 216: -#line 2531 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2528 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5016,12 +5017,12 @@ break; case 217: -#line 2539 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2536 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2540 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; @@ -5032,7 +5033,7 @@ break; case 219: -#line 2547 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2544 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; @@ -5043,12 +5044,12 @@ break; case 220: -#line 2554 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2551 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2558 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2555 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -5164,7 +5165,7 @@ break; case 224: -#line 2677 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2674 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5175,29 +5176,29 @@ break; case 227: -#line 2691 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2688 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 229: -#line 2697 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2694 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} break; case 230: -#line 2698 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2695 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;} break; case 231: -#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2699 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 232: -#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2699 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5206,57 +5207,57 @@ break; case 233: -#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2711 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 234: -#line 2715 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2712 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 235: -#line 2720 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2717 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; case 236: -#line 2721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2718 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; case 237: -#line 2722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2719 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; case 238: -#line 2723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2720 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;} break; case 239: -#line 2724 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2721 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;} break; case 240: -#line 2725 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2722 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; case 241: -#line 2726 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2723 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; case 242: -#line 2727 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2724 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; case 243: -#line 2728 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2725 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5281,14 +5282,14 @@ break; case 244: -#line 2749 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2746 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); ;} break; case 245: -#line 2752 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2749 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5301,17 +5302,17 @@ break; case 246: -#line 2767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2764 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); ;} break; case 247: -#line 2768 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2765 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); ;} break; case 250: -#line 2781 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2778 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.ValueVal).S = (yyvsp[-1].TypeVal).S; @@ -5321,21 +5322,21 @@ break; case 251: -#line 2790 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2787 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 252: -#line 2793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2790 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 253: -#line 2802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2799 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); InsertValue((yyvsp[0].TermInstVal)); @@ -5346,7 +5347,7 @@ break; case 254: -#line 2812 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2809 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5355,7 +5356,7 @@ break; case 255: -#line 2817 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2814 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the @@ -5368,7 +5369,7 @@ break; case 256: -#line 2826 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2823 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5381,21 +5382,21 @@ break; case 259: -#line 2840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2837 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).V); ;} break; case 260: -#line 2843 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2840 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); ;} break; case 261: -#line 2846 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2843 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal) = new BranchInst(tmpBB); @@ -5403,7 +5404,7 @@ break; case 262: -#line 2850 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2847 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); @@ -5413,7 +5414,7 @@ break; case 263: -#line 2856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2853 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); @@ -5432,7 +5433,7 @@ break; case 264: -#line 2871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2868 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); @@ -5442,7 +5443,7 @@ break; case 265: -#line 2878 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2875 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -5501,21 +5502,21 @@ break; case 266: -#line 2933 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2930 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnwindInst(); ;} break; case 267: -#line 2936 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2933 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnreachableInst(); ;} break; case 268: -#line 2942 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2939 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5529,7 +5530,7 @@ break; case 269: -#line 2952 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2949 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5543,7 +5544,7 @@ break; case 270: -#line 2965 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2962 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -5575,7 +5576,7 @@ break; case 271: -#line 2994 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2991 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list >(); (yyval.PHIList).S = (yyvsp[-5].TypeVal).S; @@ -5587,7 +5588,7 @@ break; case 272: -#line 3002 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2999 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList).P->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -5597,7 +5598,7 @@ break; case 273: -#line 3010 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3007 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -5605,7 +5606,7 @@ break; case 274: -#line 3014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3011 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -5613,26 +5614,26 @@ break; case 276: -#line 3022 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3019 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; case 277: -#line 3026 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3023 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 278: -#line 3029 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3026 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 279: -#line 3035 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3032 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].TypeVal).T->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa(Ty)) @@ -5653,7 +5654,7 @@ break; case 280: -#line 3052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3049 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (!Ty->isInteger()) { @@ -5673,7 +5674,7 @@ break; case 281: -#line 3068 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3065 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].TypeVal).T->get(); if(isa(Ty)) @@ -5691,7 +5692,7 @@ break; case 282: -#line 3082 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3079 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (isa(Ty)) @@ -5707,7 +5708,7 @@ break; case 283: -#line 3094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3091 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].TypeVal).T->get(); if (isa(Ty)) @@ -5723,7 +5724,7 @@ break; case 284: -#line 3106 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -5738,20 +5739,29 @@ break; case 285: -#line 3117 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) error("Shift amount must be int8"); - if (!(yyvsp[-2].ValueVal).V->getType()->isInteger()) + const Type* Ty = (yyvsp[-2].ValueVal).V->getType(); + if (!Ty->isInteger()) error("Shift constant expression requires integer operand"); - (yyval.InstVal).I = new ShiftInst(getOtherOp((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal).S), (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V); + Value* ShiftAmt = 0; + if (cast(Ty)->getBitWidth() > Type::Int8Ty->getBitWidth()) + if (Constant *C = dyn_cast((yyvsp[0].ValueVal).V)) + ShiftAmt = ConstantExpr::getZExt(C, Ty); + else + ShiftAmt = new ZExtInst((yyvsp[0].ValueVal).V, Ty, makeNameUnique("shift"), CurBB); + else + ShiftAmt = (yyvsp[0].ValueVal).V; + (yyval.InstVal).I = BinaryOperator::create(getBinaryOp((yyvsp[-3].BinaryOpVal), Ty, (yyvsp[-2].ValueVal).S), (yyvsp[-2].ValueVal).V, ShiftAmt); (yyval.InstVal).S = (yyvsp[-2].ValueVal).S; ;} break; case 286: -#line 3126 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *DstTy = (yyvsp[0].TypeVal).T->get(); if (!DstTy->isFirstClassType()) @@ -5764,7 +5774,7 @@ break; case 287: -#line 3135 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -5777,7 +5787,7 @@ break; case 288: -#line 3144 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).T->get(); NewVarArgs = true; @@ -5788,7 +5798,7 @@ break; case 289: -#line 3151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).T->get(); @@ -5813,7 +5823,7 @@ break; case 290: -#line 3172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).T->get(); @@ -5841,7 +5851,7 @@ break; case 291: -#line 3196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -5851,7 +5861,7 @@ break; case 292: -#line 3202 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -5861,7 +5871,7 @@ break; case 293: -#line 3208 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -5871,7 +5881,7 @@ break; case 294: -#line 3214 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5891,7 +5901,7 @@ break; case 295: -#line 3230 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax @@ -5973,34 +5983,34 @@ break; case 296: -#line 3308 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3314 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; case 297: -#line 3316 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3322 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; case 298: -#line 3317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 299: -#line 3321 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3327 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 300: -#line 3322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3328 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 301: -#line 3326 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -6010,7 +6020,7 @@ break; case 302: -#line 3332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3338 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; @@ -6020,7 +6030,7 @@ break; case 303: -#line 3338 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3344 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -6030,7 +6040,7 @@ break; case 304: -#line 3344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3350 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; @@ -6040,7 +6050,7 @@ break; case 305: -#line 3350 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa(PTy)) @@ -6051,7 +6061,7 @@ break; case 306: -#line 3357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-1].TypeVal).T->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; @@ -6067,7 +6077,7 @@ break; case 307: -#line 3369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3375 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).T->get()); if (!PTy) @@ -6085,7 +6095,7 @@ break; case 308: -#line 3383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3389 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-2].TypeVal).T->get(); if (!isa(Ty)) @@ -6107,7 +6117,7 @@ } /* Line 1126 of yacc.c. */ -#line 6111 "UpgradeParser.tab.c" +#line 6121 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6375,7 +6385,7 @@ } -#line 3399 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3405 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.39 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.40 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.39 Mon Jan 29 13:08:46 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Thu Feb 1 20:16:23 2007 @@ -119,26 +119,26 @@ AND = 345, OR = 346, XOR = 347, - SETLE = 348, - SETGE = 349, - SETLT = 350, - SETGT = 351, - SETEQ = 352, - SETNE = 353, - ICMP = 354, - FCMP = 355, - MALLOC = 356, - ALLOCA = 357, - FREE = 358, - LOAD = 359, - STORE = 360, - GETELEMENTPTR = 361, - PHI_TOK = 362, - SELECT = 363, - SHL = 364, - SHR = 365, - ASHR = 366, - LSHR = 367, + SHL = 348, + SHR = 349, + ASHR = 350, + LSHR = 351, + SETLE = 352, + SETGE = 353, + SETLT = 354, + SETGT = 355, + SETEQ = 356, + SETNE = 357, + ICMP = 358, + FCMP = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + PHI_TOK = 366, + SELECT = 367, VAARG = 368, EXTRACTELEMENT = 369, INSERTELEMENT = 370, @@ -271,26 +271,26 @@ #define AND 345 #define OR 346 #define XOR 347 -#define SETLE 348 -#define SETGE 349 -#define SETLT 350 -#define SETGT 351 -#define SETEQ 352 -#define SETNE 353 -#define ICMP 354 -#define FCMP 355 -#define MALLOC 356 -#define ALLOCA 357 -#define FREE 358 -#define LOAD 359 -#define STORE 360 -#define GETELEMENTPTR 361 -#define PHI_TOK 362 -#define SELECT 363 -#define SHL 364 -#define SHR 365 -#define ASHR 366 -#define LSHR 367 +#define SHL 348 +#define SHR 349 +#define ASHR 350 +#define LSHR 351 +#define SETLE 352 +#define SETGE 353 +#define SETLT 354 +#define SETGT 355 +#define SETEQ 356 +#define SETNE 357 +#define ICMP 358 +#define FCMP 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define PHI_TOK 366 +#define SELECT 367 #define VAARG 368 #define EXTRACTELEMENT 369 #define INSERTELEMENT 370 @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1435 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.54 llvm/tools/llvm-upgrade/UpgradeParser.y:1.55 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.54 Tue Jan 30 14:08:39 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Thu Feb 1 20:16:23 2007 @@ -1008,6 +1008,13 @@ case URemOp : return Instruction::URem; case SRemOp : return Instruction::SRem; case FRemOp : return Instruction::FRem; + case LShrOp : return Instruction::LShr; + case AShrOp : return Instruction::AShr; + case ShlOp : return Instruction::Shl; + case ShrOp : + if (Sign == Signed) + return Instruction::AShr; + return Instruction::LShr; case AndOp : return Instruction::And; case OrOp : return Instruction::Or; case XorOp : return Instruction::Xor; @@ -1102,11 +1109,6 @@ default : assert(0 && "Invalid OldOtherOps"); case PHIOp : return Instruction::PHI; case CallOp : return Instruction::Call; - case ShlOp : return Instruction::Shl; - case ShrOp : - if (Sign == Signed) - return Instruction::AShr; - return Instruction::LShr; case SelectOp : return Instruction::Select; case UserOp1 : return Instruction::UserOp1; case UserOp2 : return Instruction::UserOp2; @@ -1116,8 +1118,6 @@ case ShuffleVectorOp : return Instruction::ShuffleVector; case ICmpOp : return Instruction::ICmp; case FCmpOp : return Instruction::FCmp; - case LShrOp : return Instruction::LShr; - case AShrOp : return Instruction::AShr; }; } @@ -1193,7 +1193,6 @@ error("Invalid prototype for " + Name + " prototype"); return new FCmpInst(FCmpInst::FCMP_UNO, Args[0], Args[1]); } else { - static unsigned upgradeCount = 1; const Type* PtrTy = PointerType::get(Type::Int8Ty); std::vector Params; if (Name == "llvm.va_start" || Name == "llvm.va_end") { @@ -1203,9 +1202,7 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName("va_upgrade"); - InstName += llvm::utostr(upgradeCount++); - Args[0] = new BitCastInst(Args[0], PtrTy, InstName, CurBB); + Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); return new CallInst(Func, Args); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) @@ -1215,10 +1212,8 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName0("va_upgrade"); - InstName0 += llvm::utostr(upgradeCount++); - std::string InstName1("va_upgrade"); - InstName1 += llvm::utostr(upgradeCount++); + std::string InstName0(makeNameUnique("va0")); + std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); return new CallInst(Func, Args); @@ -1263,7 +1258,7 @@ cast(Index), Type::Int64Ty); else Index = CastInst::create(Instruction::ZExt, Index, Type::Int64Ty, - makeNameUnique("gep_upgrade"), CurBB); + makeNameUnique("gep"), CurBB); VIndices[i] = Index; } } @@ -1546,8 +1541,9 @@ // Binary Operators %type ArithmeticOps LogicalOps SetCondOps // Binops Subcatagories +%type ShiftOps %token ADD SUB MUL DIV UDIV SDIV FDIV REM UREM SREM FREM -%token AND OR XOR +%token AND OR XOR SHL SHR ASHR LSHR %token SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators %token ICMP FCMP @@ -1555,8 +1551,7 @@ %token MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR // Other Operators -%type ShiftOps -%token PHI_TOK SELECT SHL SHR ASHR LSHR VAARG +%token PHI_TOK SELECT VAARG %token EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR %token VAARG_old VANEXT_old //OBSOLETE @@ -2303,9 +2298,11 @@ if (!$5.C->getType()->isInteger() || cast($5.C->getType())->getBitWidth() != 8) error("Shift count for shift constant must be unsigned byte"); + const Type* Ty = $3.C->getType(); if (!$3.C->getType()->isInteger()) error("Shift constant expression requires integer operand"); - $$.C = ConstantExpr::get(getOtherOp($1, $3.S), $3.C, $5.C); + Constant *ShiftAmt = ConstantExpr::getZExt($5.C, Ty); + $$.C = ConstantExpr::get(getBinaryOp($1, Ty, $3.S), $3.C, ShiftAmt); $$.S = $3.S; } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { @@ -3118,9 +3115,18 @@ if (!$4.V->getType()->isInteger() || cast($4.V->getType())->getBitWidth() != 8) error("Shift amount must be int8"); - if (!$2.V->getType()->isInteger()) + const Type* Ty = $2.V->getType(); + if (!Ty->isInteger()) error("Shift constant expression requires integer operand"); - $$.I = new ShiftInst(getOtherOp($1, $2.S), $2.V, $4.V); + Value* ShiftAmt = 0; + if (cast(Ty)->getBitWidth() > Type::Int8Ty->getBitWidth()) + if (Constant *C = dyn_cast($4.V)) + ShiftAmt = ConstantExpr::getZExt(C, Ty); + else + ShiftAmt = new ZExtInst($4.V, Ty, makeNameUnique("shift"), CurBB); + else + ShiftAmt = $4.V; + $$.I = BinaryOperator::create(getBinaryOp($1, Ty, $2.S), $2.V, ShiftAmt); $$.S = $2.S; } | CastOps ResolvedVal TO Types { Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.52 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.53 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.52 Tue Jan 30 14:08:39 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Thu Feb 1 20:16:23 2007 @@ -1008,6 +1008,13 @@ case URemOp : return Instruction::URem; case SRemOp : return Instruction::SRem; case FRemOp : return Instruction::FRem; + case LShrOp : return Instruction::LShr; + case AShrOp : return Instruction::AShr; + case ShlOp : return Instruction::Shl; + case ShrOp : + if (Sign == Signed) + return Instruction::AShr; + return Instruction::LShr; case AndOp : return Instruction::And; case OrOp : return Instruction::Or; case XorOp : return Instruction::Xor; @@ -1102,11 +1109,6 @@ default : assert(0 && "Invalid OldOtherOps"); case PHIOp : return Instruction::PHI; case CallOp : return Instruction::Call; - case ShlOp : return Instruction::Shl; - case ShrOp : - if (Sign == Signed) - return Instruction::AShr; - return Instruction::LShr; case SelectOp : return Instruction::Select; case UserOp1 : return Instruction::UserOp1; case UserOp2 : return Instruction::UserOp2; @@ -1116,8 +1118,6 @@ case ShuffleVectorOp : return Instruction::ShuffleVector; case ICmpOp : return Instruction::ICmp; case FCmpOp : return Instruction::FCmp; - case LShrOp : return Instruction::LShr; - case AShrOp : return Instruction::AShr; }; } @@ -1193,7 +1193,6 @@ error("Invalid prototype for " + Name + " prototype"); return new FCmpInst(FCmpInst::FCMP_UNO, Args[0], Args[1]); } else { - static unsigned upgradeCount = 1; const Type* PtrTy = PointerType::get(Type::Int8Ty); std::vector Params; if (Name == "llvm.va_start" || Name == "llvm.va_end") { @@ -1203,9 +1202,7 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName("va_upgrade"); - InstName += llvm::utostr(upgradeCount++); - Args[0] = new BitCastInst(Args[0], PtrTy, InstName, CurBB); + Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); return new CallInst(Func, Args); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) @@ -1215,10 +1212,8 @@ const FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); - std::string InstName0("va_upgrade"); - InstName0 += llvm::utostr(upgradeCount++); - std::string InstName1("va_upgrade"); - InstName1 += llvm::utostr(upgradeCount++); + std::string InstName0(makeNameUnique("va0")); + std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); return new CallInst(Func, Args); @@ -1263,7 +1258,7 @@ cast(Index), Type::Int64Ty); else Index = CastInst::create(Instruction::ZExt, Index, Type::Int64Ty, - makeNameUnique("gep_upgrade"), CurBB); + makeNameUnique("gep"), CurBB); VIndices[i] = Index; } } @@ -1546,8 +1541,9 @@ // Binary Operators %type ArithmeticOps LogicalOps SetCondOps // Binops Subcatagories +%type ShiftOps %token ADD SUB MUL DIV UDIV SDIV FDIV REM UREM SREM FREM -%token AND OR XOR +%token AND OR XOR SHL SHR ASHR LSHR %token SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators %token ICMP FCMP @@ -1555,8 +1551,7 @@ %token MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR // Other Operators -%type ShiftOps -%token PHI_TOK SELECT SHL SHR ASHR LSHR VAARG +%token PHI_TOK SELECT VAARG %token EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR %token VAARG_old VANEXT_old //OBSOLETE @@ -2303,9 +2298,11 @@ if (!$5.C->getType()->isInteger() || cast($5.C->getType())->getBitWidth() != 8) error("Shift count for shift constant must be unsigned byte"); + const Type* Ty = $3.C->getType(); if (!$3.C->getType()->isInteger()) error("Shift constant expression requires integer operand"); - $$.C = ConstantExpr::get(getOtherOp($1, $3.S), $3.C, $5.C); + Constant *ShiftAmt = ConstantExpr::getZExt($5.C, Ty); + $$.C = ConstantExpr::get(getBinaryOp($1, Ty, $3.S), $3.C, ShiftAmt); $$.S = $3.S; } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { @@ -3118,9 +3115,18 @@ if (!$4.V->getType()->isInteger() || cast($4.V->getType())->getBitWidth() != 8) error("Shift amount must be int8"); - if (!$2.V->getType()->isInteger()) + const Type* Ty = $2.V->getType(); + if (!Ty->isInteger()) error("Shift constant expression requires integer operand"); - $$.I = new ShiftInst(getOtherOp($1, $2.S), $2.V, $4.V); + Value* ShiftAmt = 0; + if (cast(Ty)->getBitWidth() > Type::Int8Ty->getBitWidth()) + if (Constant *C = dyn_cast($4.V)) + ShiftAmt = ConstantExpr::getZExt(C, Ty); + else + ShiftAmt = new ZExtInst($4.V, Ty, makeNameUnique("shift"), CurBB); + else + ShiftAmt = $4.V; + $$.I = BinaryOperator::create(getBinaryOp($1, Ty, $2.S), $2.V, ShiftAmt); $$.S = $2.S; } | CastOps ResolvedVal TO Types { From reid at x10sys.com Thu Feb 1 20:17:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:38 -0600 Subject: [llvm-commits] CVS: llvm/test/Transforms/Reassociate/shifttest.ll Message-ID: <200702020217.l122Hc2W020368@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/Reassociate: shifttest.ll updated: 1.3 -> 1.4 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+1 -1) shifttest.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/Reassociate/shifttest.ll diff -u llvm/test/Transforms/Reassociate/shifttest.ll:1.3 llvm/test/Transforms/Reassociate/shifttest.ll:1.4 --- llvm/test/Transforms/Reassociate/shifttest.ll:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/Reassociate/shifttest.ll Thu Feb 1 20:16:22 2007 @@ -1,6 +1,6 @@ ; With shl->mul reassociation, we can see that this is (shl A, 9) * A ; -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'shl .*, i8 9' +; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'shl .*, 9' int %test(int %A, int %B) { %X = shl int %A, ubyte 5 From reid at x10sys.com Thu Feb 1 20:17:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 1 Feb 2007 20:17:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l Lexer.l.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200702020217.l122HaTi020231@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.29 -> 1.30 Lexer.l updated: 1.97 -> 1.98 Lexer.l.cvs updated: 1.24 -> 1.25 llvmAsmParser.cpp.cvs updated: 1.61 -> 1.62 llvmAsmParser.h.cvs updated: 1.49 -> 1.50 llvmAsmParser.y updated: 1.316 -> 1.317 llvmAsmParser.y.cvs updated: 1.62 -> 1.63 --- Log message: Changes to support making the shift instructions be true BinaryOperators. This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. --- Diffs of the changes: (+5295 -4443) Lexer.cpp.cvs | 2169 +++++++-------- Lexer.l | 12 Lexer.l.cvs | 12 llvmAsmParser.cpp.cvs | 7015 ++++++++++++++++++++++++++++---------------------- llvmAsmParser.h.cvs | 439 ++- llvmAsmParser.y | 31 llvmAsmParser.y.cvs | 31 7 files changed, 5294 insertions(+), 4415 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.29 llvm/lib/AsmParser/Lexer.cpp.cvs:1.30 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.29 Sun Jan 28 07:37:39 2007 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Thu Feb 1 20:16:22 2007 @@ -1,94 +1,51 @@ -#line 2 "Lexer.cpp" +#define yy_create_buffer llvmAsm_create_buffer +#define yy_delete_buffer llvmAsm_delete_buffer +#define yy_scan_buffer llvmAsm_scan_buffer +#define yy_scan_string llvmAsm_scan_string +#define yy_scan_bytes llvmAsm_scan_bytes +#define yy_flex_debug llvmAsm_flex_debug +#define yy_init_buffer llvmAsm_init_buffer +#define yy_flush_buffer llvmAsm_flush_buffer +#define yy_load_buffer_state llvmAsm_load_buffer_state +#define yy_switch_to_buffer llvmAsm_switch_to_buffer +#define yyin llvmAsmin +#define yyleng llvmAsmleng +#define yylex llvmAsmlex +#define yyout llvmAsmout +#define yyrestart llvmAsmrestart +#define yytext llvmAsmtext +#define yylineno llvmAsmlineno -#line 4 "Lexer.cpp" +#line 20 "Lexer.cpp" +/* A lexical scanner generated by flex*/ -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ +/* Scanner skeleton version: + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.30 2007/02/02 02:16:22 reid Exp $ + */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ -/* begin standard C headers. */ #include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +#include -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus #endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ #ifdef __cplusplus +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -96,17 +53,34 @@ #if __STDC__ +#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -121,88 +95,80 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN (yy_start) = 1 + 2 * +#define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START (((yy_start) - 1) / 2) +#define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE llvmAsmrestart(llvmAsmin ) +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ -#ifndef YY_BUF_SIZE #define YY_BUF_SIZE (16384*64) -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int llvmAsmleng; -extern FILE *llvmAsmin, *llvmAsmout; +extern int yyleng; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE llvmAsmlex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-llvmAsmlineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < llvmAsmleng; ++yyl )\ - if ( llvmAsmtext[yyl] == '\n' )\ - --llvmAsmlineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + #define yyless(n) \ do \ { \ - /* Undo effects of setting up llvmAsmtext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */ \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define unput(c) yyunput( c, yytext_ptr ) + +/* Some routines like yy_flex_realloc() are emitted as static but are + not called by all lexers. This generates warnings in some compilers, + notably GCC. Arrange to suppress these. */ +#ifdef __GNUC__ +#define YY_MAY_BE_UNUSED __attribute__((unused)) +#else +#define YY_MAY_BE_UNUSED +#endif /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; -#endif -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE + struct yy_buffer_state { FILE *yy_input_file; @@ -239,16 +205,12 @@ */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; - #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -258,201 +220,197 @@ * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via llvmAsmrestart()), so that the user can continue scanning by - * just pointing llvmAsmin at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". - * - * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) +#define YY_CURRENT_BUFFER yy_current_buffer -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when llvmAsmtext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; + static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int llvmAsmleng; + + +int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ +static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow llvmAsmwrap()'s to do buffer switches - * instead of setting up a fresh llvmAsmin. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void llvmAsmrestart (FILE *input_file ); -void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE llvmAsm_create_buffer (FILE *file,int size ); -void llvmAsm_delete_buffer (YY_BUFFER_STATE b ); -void llvmAsm_flush_buffer (YY_BUFFER_STATE b ); -void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ); -void llvmAsmpop_buffer_state (void ); - -static void llvmAsmensure_buffer_stack (void ); -static void llvmAsm_load_buffer_state (void ); -static void llvmAsm_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER llvmAsm_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE llvmAsm_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE llvmAsm_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char *bytes,int len ); - -void *llvmAsmalloc (yy_size_t ); -void *llvmAsmrealloc (void *,yy_size_t ); -void llvmAsmfree (void * ); +void yyrestart YY_PROTO(( FILE *input_file )); -#define yy_new_buffer llvmAsm_create_buffer +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - llvmAsmensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - llvmAsmensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) -/* Begin user sect3 */ -#define llvmAsmwrap(n) 1 -#define YY_SKIP_YYWRAP +#define YY_USES_REJECT +#define yywrap() 1 +#define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; - -FILE *llvmAsmin = (FILE *) 0, *llvmAsmout = (FILE *) 0; - +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; - -extern int llvmAsmlineno; - -int llvmAsmlineno = 1; - -extern char *llvmAsmtext; -#define yytext_ptr llvmAsmtext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the - * corresponding action - sets up llvmAsmtext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - llvmAsmleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + yy_c_buf_p = yy_cp; #define YY_NUM_RULES 134 #define YY_END_OF_BUFFER 135 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[539] = +static yyconst short int yy_acclist[215] = + { 0, + 135, 133, 134, 132, 133, 134, 132, 134, 133, 134, + 133, 134, 133, 134, 133, 134, 133, 134, 133, 134, + 125, 133, 134, 125, 133, 134, 1, 133, 134, 133, + 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, + 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, + 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, + 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, + 134, 133, 134, 133, 134, 123, 121, 119, 128, 126, + 130, 125, 1, 120, 129, 105, 36, 68, 50, 69, + 64, 24, 123, 119, 130, 21, 130, 131, 124, 120, + + 51, 63, 34, 37, 3, 53, 78, 83, 81, 82, + 80, 79, 84, 88, 104, 73, 71, 60, 72, 70, + 52, 86, 77, 75, 76, 74, 87, 85, 65, 122, + 130, 130, 62, 89, 67, 56, 112, 59, 66, 113, + 61, 23, 127, 55, 92, 58, 43, 25, 4, 48, + 54, 57, 44, 12, 91, 130, 31, 2, 5, 45, + 94, 42, 47, 114, 90, 22, 111, 39, 7, 46, + 38, 98, 97, 8, 16, 107, 110, 33, 49, 102, + 96, 106, 26, 27, 95, 108, 103, 101, 6, 28, + 93, 32, 9, 18, 10, 99, 11, 100, 30, 13, + + 15, 14, 29, 35, 17, 109, 115, 117, 118, 40, + 116, 19, 41, 20 + } ; + +static yyconst short int yy_accept[540] = { 0, - 0, 0, 135, 133, 132, 132, 133, 133, 133, 133, - 133, 133, 125, 125, 1, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 0, 123, - 0, 121, 119, 128, 0, 126, 0, 130, 125, 0, - 1, 0, 120, 129, 0, 0, 0, 0, 0, 0, - 0, 105, 0, 36, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 59, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 123, 119, 130, 21, 130, 0, 131, 0, 124, - 120, 49, 0, 0, 58, 0, 0, 34, 0, 0, - 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 51, 0, 73, 78, 76, - 77, 75, 74, 0, 79, 83, 0, 104, 0, 0, - - 0, 0, 0, 68, 66, 100, 0, 0, 0, 67, - 65, 0, 0, 50, 0, 0, 0, 0, 0, 0, - 0, 81, 72, 70, 0, 71, 69, 0, 82, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, - 0, 122, 130, 0, 0, 0, 130, 0, 0, 0, - 102, 0, 0, 84, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 62, 54, 0, - 0, 0, 0, 112, 57, 0, 0, 0, 61, 0, - 0, 0, 0, 0, 0, 0, 0, 113, 101, 0, - 0, 23, 0, 0, 127, 53, 0, 0, 87, 0, - - 0, 0, 56, 89, 0, 0, 25, 0, 0, 4, - 0, 46, 52, 0, 0, 0, 0, 55, 0, 42, - 0, 12, 0, 0, 86, 130, 31, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5, 0, 43, 91, 0, 0, 0, 0, - 0, 0, 0, 88, 0, 0, 0, 0, 45, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, - 0, 0, 0, 85, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 111, 0, 0, 39, 0, 0, 0, - 7, 0, 0, 0, 44, 0, 0, 38, 95, 94, - - 0, 0, 8, 16, 0, 0, 0, 0, 107, 0, - 110, 33, 47, 0, 0, 99, 0, 0, 93, 106, - 26, 27, 92, 0, 108, 103, 0, 0, 0, 0, - 0, 98, 0, 0, 6, 28, 0, 0, 0, 0, - 0, 90, 0, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 10, 96, - 11, 97, 0, 0, 0, 30, 0, 0, 0, 13, - 0, 15, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, - - 0, 35, 0, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 115, 0, 117, 118, 0, - 40, 0, 116, 19, 41, 0, 20, 0 + 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, + 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 76, + 77, 77, 78, 79, 80, 80, 81, 81, 82, 83, + 83, 84, 84, 85, 86, 86, 86, 86, 86, 86, + 86, 86, 87, 87, 88, 88, 88, 88, 88, 88, + 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, + + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 94, 95, 96, 97, 98, 98, 99, 99, + 100, 101, 102, 102, 102, 103, 103, 103, 104, 104, + 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 107, 107, 108, 109, + 110, 111, 112, 113, 113, 114, 115, 115, 116, 116, + + 116, 116, 116, 116, 117, 118, 119, 119, 119, 119, + 120, 121, 121, 121, 122, 122, 122, 122, 122, 122, + 122, 122, 123, 124, 125, 125, 126, 127, 127, 128, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, + 130, 130, 131, 132, 132, 132, 132, 133, 133, 133, + 133, 134, 134, 134, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 136, 137, + 137, 137, 137, 137, 138, 139, 139, 139, 139, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 141, 142, + 142, 142, 143, 143, 143, 144, 145, 145, 145, 146, + + 146, 146, 146, 147, 148, 148, 148, 149, 149, 149, + 150, 150, 151, 152, 152, 152, 152, 152, 153, 153, + 154, 154, 155, 155, 155, 156, 157, 158, 158, 158, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 160, 160, 161, 162, 162, 162, 162, + 162, 162, 162, 162, 163, 163, 163, 163, 163, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 165, 165, 165, 165, 166, 166, 167, 167, 167, 167, + 167, 167, 167, 167, 168, 168, 168, 169, 169, 169, + 169, 170, 170, 170, 170, 171, 171, 171, 172, 173, + + 174, 174, 174, 175, 176, 176, 176, 176, 176, 177, + 177, 178, 179, 180, 180, 180, 181, 181, 181, 182, + 183, 184, 185, 186, 186, 187, 188, 188, 188, 188, + 188, 188, 189, 189, 189, 190, 191, 191, 191, 191, + 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, + 194, 194, 194, 194, 195, 195, 195, 195, 195, 196, + 197, 198, 199, 199, 199, 199, 200, 200, 200, 200, + 201, 201, 202, 203, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, + + 204, 204, 205, 205, 205, 205, 205, 206, 206, 206, + 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 208, 208, 209, 210, + 210, 211, 211, 212, 213, 214, 214, 215, 215 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -484,7 +442,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[45] = +static yyconst int yy_meta[45] = { 0, 1, 1, 2, 3, 4, 1, 1, 4, 4, 4, 4, 4, 4, 5, 1, 1, 4, 4, 4, 4, @@ -493,7 +451,7 @@ 4, 4, 4, 4 } ; -static yyconst flex_int16_t yy_base[547] = +static yyconst short int yy_base[547] = { 0, 0, 0, 1173, 1174, 1174, 1174, 1168, 1157, 35, 39, 43, 49, 55, 61, 0, 72, 64, 67, 66, 86, @@ -557,7 +515,7 @@ 254, 1054, 1057, 220, 1061, 167 } ; -static yyconst flex_int16_t yy_def[547] = +static yyconst short int yy_def[547] = { 0, 538, 1, 538, 538, 538, 538, 539, 540, 541, 538, 540, 540, 540, 540, 542, 543, 540, 540, 540, 540, @@ -621,7 +579,7 @@ 538, 538, 538, 538, 538, 538 } ; -static yyconst flex_int16_t yy_nxt[1219] = +static yyconst short int yy_nxt[1219] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 4, 15, 16, 8, 8, 8, 17, @@ -759,7 +717,7 @@ 538, 538, 538, 538, 538, 538, 538, 538 } ; -static yyconst flex_int16_t yy_chk[1219] = +static yyconst short int yy_chk[1219] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -897,32 +855,22 @@ 538, 538, 538, 538, 538, 538, 538, 538 } ; -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[135] = - { 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int llvmAsm_flex_debug; -int llvmAsm_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *llvmAsmtext; -#line 1 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +char *yytext; +#line 1 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // // The LLVM Compiler Infrastructure @@ -935,7 +883,8 @@ // This file implements the flex scanner for LLVM assembly languages files. // //===----------------------------------------------------------------------===*/ -#line 28 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#define YY_NEVER_INTERACTIVE 1 +#line 28 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -944,10 +893,10 @@ #include void set_scan_file(FILE * F){ - llvmAsm_switch_to_buffer(llvmAsm_create_buffer(F,YY_BUF_SIZE ) ); + yy_switch_to_buffer(yy_create_buffer( F, YY_BUF_SIZE ) ); } void set_scan_string (const char * str) { - llvmAsm_scan_string (str); + yy_scan_string (str); } // Construct a token value for a non-obsolete token @@ -1068,23 +1017,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1072 "Lexer.cpp" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); +#line 1021 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1092,30 +1025,65 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int llvmAsmwrap (void ); +extern "C" int yywrap YY_PROTO(( void )); #else -extern int llvmAsmwrap (void ); +extern int yywrap YY_PROTO(( void )); +#endif #endif + +#ifndef YY_NO_UNPUT +static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif - static inline void yyunput (int c,char *buf_ptr ); - #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + #else -static int input (void ); +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 #endif +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -1124,11 +1092,12 @@ #endif /* Copy whatever the last rule matched to the standard output. */ + #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( llvmAsmtext, llvmAsmleng, 1, llvmAsmout ) +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1136,35 +1105,21 @@ */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + if ( yy_current_buffer->yy_is_interactive ) \ { \ - int c = '*'; \ - size_t n; \ + int c = '*', n; \ for ( n = 0; n < max_size && \ - (c = getc( llvmAsmin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( llvmAsmin ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, llvmAsmin))==0 && ferror(llvmAsmin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(llvmAsmin); \ - } \ - }\ -\ - + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1185,20 +1140,14 @@ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int llvmAsmlex (void); - -#define YY_DECL int llvmAsmlex (void) -#endif /* !YY_DECL */ +#define YY_DECL int yylex YY_PROTO(( void )) +#endif -/* Code executed at the beginning of each rule, after llvmAsmtext and llvmAsmleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1213,67 +1162,60 @@ #define YY_RULE_SETUP \ YY_USER_ACTION -/** The main scanner function which does all the work. - */ YY_DECL -{ + { register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; + register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; - -#line 189 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" + +#line 189 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -#line 1228 "Lexer.cpp" +#line 1175 "Lexer.cpp" - if ( !(yy_init) ) + if ( yy_init ) { - (yy_init) = 1; + yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ - if ( ! llvmAsmin ) - llvmAsmin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! llvmAsmout ) - llvmAsmout = stdout; + if ( ! yyout ) + yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { - llvmAsmensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); - } + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); - llvmAsm_load_buffer_state( ); + yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = (yy_c_buf_p); + yy_cp = yy_c_buf_p; - /* Support of llvmAsmtext. */ - *yy_cp = (yy_hold_char); + /* Support of yytext. */ + *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -1281,707 +1223,711 @@ yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; ++yy_cp; } while ( yy_current_state != 538 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); yy_find_action: - yy_act = yy_accept[yy_current_state]; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } YY_DO_BEFORE_ACTION; - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + if ( yy_act != YY_END_OF_BUFFER ) { int yyl; - for ( yyl = 0; yyl < llvmAsmleng; ++yyl ) - if ( llvmAsmtext[yyl] == '\n' ) - - llvmAsmlineno++; -; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; } do_action: /* This label is used only to access EOF actions. */ + switch ( yy_act ) { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - case 1: YY_RULE_SETUP -#line 191 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 191 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 193 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 193 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 194 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 195 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 195 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 196 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 196 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 197 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 197 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 198 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 198 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DEFINE; } YY_BREAK case 8: YY_RULE_SETUP -#line 199 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 199 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 9: YY_RULE_SETUP -#line 200 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 200 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 10: YY_RULE_SETUP -#line 201 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 201 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 11: YY_RULE_SETUP -#line 202 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 202 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 12: YY_RULE_SETUP -#line 203 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 203 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 13: YY_RULE_SETUP -#line 204 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 204 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 14: YY_RULE_SETUP -#line 205 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 205 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLIMPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 206 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 206 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLEXPORT; } YY_BREAK case 16: YY_RULE_SETUP -#line 207 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 207 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return HIDDEN; } YY_BREAK case 17: YY_RULE_SETUP -#line 208 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 208 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERN_WEAK; } YY_BREAK case 18: YY_RULE_SETUP -#line 209 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 209 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 19: YY_RULE_SETUP -#line 210 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 210 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return IMPLEMENTATION; } YY_BREAK case 20: YY_RULE_SETUP -#line 211 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 211 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 21: YY_RULE_SETUP -#line 212 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 212 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 22: YY_RULE_SETUP -#line 213 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 213 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 23: YY_RULE_SETUP -#line 214 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 214 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 215 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 215 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 25: YY_RULE_SETUP -#line 216 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 216 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 26: YY_RULE_SETUP -#line 217 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 217 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 27: YY_RULE_SETUP -#line 218 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 218 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 28: YY_RULE_SETUP -#line 219 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 219 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 29: YY_RULE_SETUP -#line 220 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 220 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DATALAYOUT; } YY_BREAK case 30: YY_RULE_SETUP -#line 221 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 221 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 31: YY_RULE_SETUP -#line 222 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 222 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ALIGN; } YY_BREAK case 32: YY_RULE_SETUP -#line 223 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 223 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return SECTION; } YY_BREAK case 33: YY_RULE_SETUP -#line 224 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 224 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return MODULE; } YY_BREAK case 34: YY_RULE_SETUP -#line 225 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 225 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ASM_TOK; } YY_BREAK case 35: YY_RULE_SETUP -#line 226 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 226 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return SIDEEFFECT; } YY_BREAK case 36: YY_RULE_SETUP -#line 228 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 228 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CC_TOK; } YY_BREAK case 37: YY_RULE_SETUP -#line 229 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 229 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CCC_TOK; } YY_BREAK case 38: YY_RULE_SETUP -#line 230 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 230 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FASTCC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 231 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 231 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return COLDCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 232 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 232 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return X86_STDCALLCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 233 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 233 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return X86_FASTCALLCC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 235 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TY(Type::VoidTy, VOID); } +#line 235 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return INREG; } YY_BREAK case 43: YY_RULE_SETUP -#line 236 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TY(Type::FloatTy, FLOAT); } +#line 236 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SRET; } YY_BREAK case 44: YY_RULE_SETUP -#line 237 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TY(Type::DoubleTy,DOUBLE);} +#line 238 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::VoidTy, VOID); } YY_BREAK case 45: YY_RULE_SETUP -#line 238 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TY(Type::LabelTy, LABEL); } +#line 239 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::FloatTy, FLOAT); } YY_BREAK case 46: YY_RULE_SETUP -#line 239 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return TYPE; } +#line 240 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::DoubleTy,DOUBLE);} YY_BREAK case 47: YY_RULE_SETUP -#line 240 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OPAQUE; } +#line 241 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LabelTy, LABEL); } YY_BREAK case 48: YY_RULE_SETUP -#line 241 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ uint64_t NumBits = atoull(llvmAsmtext+1); - if (NumBits < IntegerType::MIN_INT_BITS || - NumBits > IntegerType::MAX_INT_BITS) - GenerateError("Bitwidth for integer type out of range!"); - const Type* Ty = IntegerType::get(NumBits); - RET_TY(Ty, INTTYPE); - } +#line 242 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TYPE; } YY_BREAK case 49: YY_RULE_SETUP -#line 249 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Add, ADD); } +#line 243 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OPAQUE; } YY_BREAK case 50: YY_RULE_SETUP -#line 250 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Sub, SUB); } +#line 244 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ uint64_t NumBits = atoull(yytext+1); + if (NumBits < IntegerType::MIN_INT_BITS || + NumBits > IntegerType::MAX_INT_BITS) + GenerateError("Bitwidth for integer type out of range!"); + const Type* Ty = IntegerType::get(NumBits); + RET_TY(Ty, INTTYPE); + } YY_BREAK case 51: YY_RULE_SETUP -#line 251 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Mul, MUL); } +#line 252 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 52: YY_RULE_SETUP -#line 252 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, UDiv, UDIV); } +#line 253 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 53: YY_RULE_SETUP -#line 253 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SDiv, SDIV); } +#line 254 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 54: YY_RULE_SETUP -#line 254 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, FDiv, FDIV); } +#line 255 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, UDiv, UDIV); } YY_BREAK case 55: YY_RULE_SETUP -#line 255 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, URem, UREM); } +#line 256 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SDiv, SDIV); } YY_BREAK case 56: YY_RULE_SETUP -#line 256 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SRem, SREM); } +#line 257 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, FDiv, FDIV); } YY_BREAK case 57: YY_RULE_SETUP -#line 257 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, FRem, FREM); } +#line 258 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, URem, UREM); } YY_BREAK case 58: YY_RULE_SETUP -#line 258 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, And, AND); } +#line 259 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SRem, SREM); } YY_BREAK case 59: YY_RULE_SETUP -#line 259 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Or , OR ); } +#line 260 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, FRem, FREM); } YY_BREAK case 60: YY_RULE_SETUP -#line 260 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Xor, XOR); } +#line 261 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Shl, SHL); } YY_BREAK case 61: YY_RULE_SETUP -#line 261 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, ICmp, ICMP); } +#line 262 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, LShr, LSHR); } YY_BREAK case 62: YY_RULE_SETUP -#line 262 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, FCmp, FCMP); } +#line 263 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, AShr, ASHR); } YY_BREAK case 63: YY_RULE_SETUP -#line 263 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return EQ; } +#line 264 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 64: YY_RULE_SETUP -#line 264 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return NE; } +#line 265 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 65: YY_RULE_SETUP -#line 265 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return SLT; } +#line 266 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 66: YY_RULE_SETUP -#line 266 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return SGT; } +#line 267 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, ICmp, ICMP); } YY_BREAK case 67: YY_RULE_SETUP -#line 267 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return SLE; } +#line 268 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, FCmp, FCMP); } YY_BREAK case 68: YY_RULE_SETUP -#line 268 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return SGE; } +#line 270 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return EQ; } YY_BREAK case 69: YY_RULE_SETUP -#line 269 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return ULT; } +#line 271 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return NE; } YY_BREAK case 70: YY_RULE_SETUP -#line 270 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return UGT; } +#line 272 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SLT; } YY_BREAK case 71: YY_RULE_SETUP -#line 271 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return ULE; } +#line 273 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SGT; } YY_BREAK case 72: YY_RULE_SETUP -#line 272 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return UGE; } +#line 274 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SLE; } YY_BREAK case 73: YY_RULE_SETUP -#line 273 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OEQ; } +#line 275 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SGE; } YY_BREAK case 74: YY_RULE_SETUP -#line 274 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return ONE; } +#line 276 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ULT; } YY_BREAK case 75: YY_RULE_SETUP -#line 275 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OLT; } +#line 277 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UGT; } YY_BREAK case 76: YY_RULE_SETUP -#line 276 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OGT; } +#line 278 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ULE; } YY_BREAK case 77: YY_RULE_SETUP -#line 277 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OLE; } +#line 279 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UGE; } YY_BREAK case 78: YY_RULE_SETUP -#line 278 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return OGE; } +#line 280 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OEQ; } YY_BREAK case 79: YY_RULE_SETUP -#line 279 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return ORD; } +#line 281 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ONE; } YY_BREAK case 80: YY_RULE_SETUP -#line 280 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return UNO; } +#line 282 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OLT; } YY_BREAK case 81: YY_RULE_SETUP -#line 281 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return UEQ; } +#line 283 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OGT; } YY_BREAK case 82: YY_RULE_SETUP -#line 282 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return UNE; } +#line 284 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OLE; } YY_BREAK case 83: YY_RULE_SETUP -#line 284 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } +#line 285 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OGE; } YY_BREAK case 84: YY_RULE_SETUP -#line 285 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Call, CALL); } +#line 286 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ORD; } YY_BREAK case 85: YY_RULE_SETUP -#line 286 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, Trunc, TRUNC); } +#line 287 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UNO; } YY_BREAK case 86: YY_RULE_SETUP -#line 287 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, ZExt, ZEXT); } +#line 288 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UEQ; } YY_BREAK case 87: YY_RULE_SETUP -#line 288 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, SExt, SEXT); } +#line 289 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UNE; } YY_BREAK case 88: YY_RULE_SETUP -#line 289 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return INREG; } +#line 291 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 89: YY_RULE_SETUP -#line 290 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return SRET; } +#line 292 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 90: YY_RULE_SETUP -#line 291 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } +#line 293 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, Trunc, TRUNC); } YY_BREAK case 91: YY_RULE_SETUP -#line 292 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPExt, FPEXT); } +#line 294 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, ZExt, ZEXT); } YY_BREAK case 92: YY_RULE_SETUP -#line 293 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, UIToFP, UITOFP); } +#line 295 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, SExt, SEXT); } YY_BREAK case 93: YY_RULE_SETUP -#line 294 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, SIToFP, SITOFP); } +#line 296 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } YY_BREAK case 94: YY_RULE_SETUP -#line 295 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPToUI, FPTOUI); } +#line 297 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPExt, FPEXT); } YY_BREAK case 95: YY_RULE_SETUP -#line 296 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPToSI, FPTOSI); } +#line 298 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, UIToFP, UITOFP); } YY_BREAK case 96: YY_RULE_SETUP -#line 297 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } +#line 299 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, SIToFP, SITOFP); } YY_BREAK case 97: YY_RULE_SETUP -#line 298 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } +#line 300 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPToUI, FPTOUI); } YY_BREAK case 98: YY_RULE_SETUP -#line 299 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, BitCast, BITCAST); } +#line 301 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPToSI, FPTOSI); } YY_BREAK case 99: YY_RULE_SETUP -#line 300 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Select, SELECT); } +#line 302 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } YY_BREAK case 100: YY_RULE_SETUP -#line 301 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Shl, SHL); } +#line 303 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } YY_BREAK case 101: YY_RULE_SETUP -#line 302 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, LShr, LSHR); } +#line 304 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, BitCast, BITCAST); } YY_BREAK case 102: YY_RULE_SETUP -#line 303 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, AShr, ASHR); } +#line 305 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 103: YY_RULE_SETUP -#line 304 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 306 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 104: YY_RULE_SETUP -#line 305 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 307 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 105: YY_RULE_SETUP -#line 306 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 308 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 106: YY_RULE_SETUP -#line 307 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 309 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 107: YY_RULE_SETUP -#line 308 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 310 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 108: YY_RULE_SETUP -#line 309 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 311 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 109: YY_RULE_SETUP -#line 310 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 312 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK case 110: YY_RULE_SETUP -#line 312 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 314 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK case 111: YY_RULE_SETUP -#line 313 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 315 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK case 112: YY_RULE_SETUP -#line 314 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 316 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK case 113: YY_RULE_SETUP -#line 315 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 317 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK case 114: YY_RULE_SETUP -#line 316 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 318 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK case 115: YY_RULE_SETUP -#line 317 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 319 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK case 116: YY_RULE_SETUP -#line 319 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 321 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK case 117: YY_RULE_SETUP -#line 320 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 322 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK case 118: YY_RULE_SETUP -#line 321 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 323 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK case 119: YY_RULE_SETUP -#line 324 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 326 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - UnEscapeLexed(llvmAsmtext+1); - llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Skip % + UnEscapeLexed(yytext+1); + llvmAsmlval.StrVal = strdup(yytext+1); // Skip % return LOCALVAR; } YY_BREAK case 120: YY_RULE_SETUP -#line 329 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 331 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - UnEscapeLexed(llvmAsmtext+1); - llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Skip @ + UnEscapeLexed(yytext+1); + llvmAsmlval.StrVal = strdup(yytext+1); // Skip @ return GLOBALVAR; } YY_BREAK case 121: YY_RULE_SETUP -#line 334 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 336 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke colon - UnEscapeLexed(llvmAsmtext); - llvmAsmlval.StrVal = strdup(llvmAsmtext); + yytext[strlen(yytext)-1] = 0; // nuke colon + UnEscapeLexed(yytext); + llvmAsmlval.StrVal = strdup(yytext); return LABELSTR; } YY_BREAK case 122: -/* rule 122 can match eol */ YY_RULE_SETUP -#line 340 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 342 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - llvmAsmtext[strlen(llvmAsmtext)-2] = 0; // nuke colon, end quote - UnEscapeLexed(llvmAsmtext+1); - llvmAsmlval.StrVal = strdup(llvmAsmtext+1); + yytext[strlen(yytext)-2] = 0; // nuke colon, end quote + UnEscapeLexed(yytext+1); + llvmAsmlval.StrVal = strdup(yytext+1); return LABELSTR; } YY_BREAK case 123: -/* rule 123 can match eol */ YY_RULE_SETUP -#line 347 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 349 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a // [sbyte] c"Hello World\00" constant, for example. // - llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke end quote - llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Nuke start quote + yytext[strlen(yytext)-1] = 0; // nuke end quote + llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote return STRINGCONSTANT; } YY_BREAK case 124: -/* rule 124 can match eol */ YY_RULE_SETUP -#line 356 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 358 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke end quote - llvmAsmlval.StrVal = strdup(llvmAsmtext+2); // Nuke @, quote + yytext[strlen(yytext)-1] = 0; // nuke end quote + llvmAsmlval.StrVal = strdup(yytext+2); // Nuke @, quote return ATSTRINGCONSTANT; } YY_BREAK case 125: YY_RULE_SETUP -#line 364 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ llvmAsmlval.UInt64Val = atoull(llvmAsmtext); return EUINT64VAL; } +#line 366 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK case 126: YY_RULE_SETUP -#line 365 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 367 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - uint64_t Val = atoull(llvmAsmtext+1); + uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range if (Val > (uint64_t)INT64_MAX+1) GenerateError("Constant too large for signed 64 bits!"); @@ -1991,17 +1937,17 @@ YY_BREAK case 127: YY_RULE_SETUP -#line 373 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 375 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - llvmAsmlval.UInt64Val = HexIntToVal(llvmAsmtext+3); - return llvmAsmtext[0] == 's' ? ESINT64VAL : EUINT64VAL; + llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); + return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; } YY_BREAK case 128: YY_RULE_SETUP -#line 378 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 380 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - uint64_t Val = atoull(llvmAsmtext+1); + uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); @@ -2010,9 +1956,9 @@ YY_BREAK case 129: YY_RULE_SETUP -#line 385 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 387 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { - uint64_t Val = atoull(llvmAsmtext+1); + uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); @@ -2021,65 +1967,64 @@ YY_BREAK case 130: YY_RULE_SETUP -#line 393 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ llvmAsmlval.FPVal = atof(llvmAsmtext); return FPVAL; } +#line 395 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 131: YY_RULE_SETUP -#line 394 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ llvmAsmlval.FPVal = HexToFP(llvmAsmtext); return FPVAL; } +#line 396 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 396 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! */ - llvmAsm_delete_buffer(YY_CURRENT_BUFFER); + yy_delete_buffer(YY_CURRENT_BUFFER); return EOF; } YY_BREAK case 132: -/* rule 132 can match eol */ YY_RULE_SETUP -#line 404 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 406 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK case 133: YY_RULE_SETUP -#line 405 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" -{ return llvmAsmtext[0]; } +#line 407 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return yytext[0]; } YY_BREAK case 134: YY_RULE_SETUP -#line 407 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" +#line 409 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2059 "Lexer.cpp" +#line 2004 "Lexer.cpp" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); + *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed llvmAsmin at a new source and called - * llvmAsmlex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = llvmAsmin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2089,13 +2034,13 @@ * end-of-buffer state). Contrast this with the test * in input(). */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2108,42 +2053,41 @@ yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); + yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + yy_cp = yy_c_buf_p; goto yy_find_action; } } - else switch ( yy_get_next_buffer( ) ) + else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { - (yy_did_buffer_switch_on_eof) = 0; + yy_did_buffer_switch_on_eof = 0; - if ( llvmAsmwrap( ) ) + if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * llvmAsmtext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2151,30 +2095,30 @@ else { - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2185,7 +2129,8 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of llvmAsmlex */ + } /* end of yylex */ + /* yy_get_next_buffer - try to read in a new buffer * @@ -2194,20 +2139,21 @@ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; register int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2227,30 +2173,34 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -2263,7 +2213,8 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - llvmAsmrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2273,35 +2224,35 @@ YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - +#endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + yy_current_buffer->yy_n_chars = yy_n_chars; } - if ( (yy_n_chars) == 0 ) + if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - llvmAsmrestart(llvmAsmin ); + yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2309,32 +2260,30 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; -} + } + /* yy_get_previous_state - get the state just before the EOB char was reached */ - static yy_state_type yy_get_previous_state (void) -{ +static yy_state_type yy_get_previous_state() + { register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = (yy_start); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -2342,27 +2291,29 @@ yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; } return yy_current_state; -} + } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -2371,79 +2322,87 @@ } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 538); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; -} + } - static inline void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - /* undo effects of setting up llvmAsmtext */ - *yy_cp = (yy_hold_char); +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static inline void yyunput( int c, register char *yy_bp ) +#else +static inline void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + &yy_current_buffer->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; - if ( c == '\n' ){ - --llvmAsmlineno; - } + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (void) +static int yyinput() #else - static int input (void) +static int input() #endif - -{ + { int c; - - *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; + *yy_c_buf_p = '\0'; else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; - switch ( yy_get_next_buffer( ) ) + switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2457,16 +2416,16 @@ */ /* Reset buffer status. */ - llvmAsmrestart(llvmAsmin ); + yyrestart( yyin ); - /*FALLTHROUGH*/ + /* fall through */ case EOB_ACT_END_OF_FILE: { - if ( llvmAsmwrap( ) ) + if ( yywrap() ) return EOF; - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2476,170 +2435,169 @@ } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; + yy_c_buf_p = yytext_ptr + offset; break; } } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve llvmAsmtext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; if ( c == '\n' ) - - llvmAsmlineno++; -; + ++yylineno; return c; -} -#endif /* ifndef YY_NO_INPUT */ + } +#endif /* YY_NO_INPUT */ -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void llvmAsmrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - llvmAsmensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); } - llvmAsm_init_buffer(YY_CURRENT_BUFFER,input_file ); - llvmAsm_load_buffer_state( ); -} -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * llvmAsmpop_buffer_state(); - * llvmAsmpush_buffer_state(new_buffer); - */ - llvmAsmensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) return; - if ( YY_CURRENT_BUFFER ) + if ( yy_current_buffer ) { /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; } - YY_CURRENT_BUFFER_LVALUE = new_buffer; - llvmAsm_load_buffer_state( ); + yy_current_buffer = new_buffer; + yy_load_buffer_state(); /* We don't actually know whether we did this switch during - * EOF (llvmAsmwrap()) processing, but the only time this flag - * is looked at is after llvmAsmwrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - (yy_did_buffer_switch_on_eof) = 1; -} + yy_did_buffer_switch_on_eof = 1; + } -static void llvmAsm_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - llvmAsmin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE llvmAsm_create_buffer (FILE * file, int size ) -{ +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) llvmAsmalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - llvmAsm_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; -} + } -/** Destroy the buffer. - * @param b a buffer created with llvmAsm_create_buffer() - * - */ - void llvmAsm_delete_buffer (YY_BUFFER_STATE b ) -{ - + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { if ( ! b ) return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - llvmAsmfree((void *) b->yy_ch_buf ); + yy_flex_free( (void *) b->yy_ch_buf ); - llvmAsmfree((void *) b ); -} + yy_flex_free( (void *) b ); + } -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a llvmAsmrestart() or at EOF. - */ - static void llvmAsm_init_buffer (YY_BUFFER_STATE b, FILE * file ) -{ - int oerrno = errno; - - llvmAsm_flush_buffer(b ); + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then llvmAsm_init_buffer was _probably_ - * called from llvmAsmrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } - b->yy_is_interactive = 0; - - errno = oerrno; -} -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void llvmAsm_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) return; b->yy_n_chars = 0; @@ -2656,123 +2614,31 @@ b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - llvmAsm_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - llvmAsmensure_buffer_stack(); - - /* This block is copied from llvmAsm_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from llvmAsm_switch_to_buffer. */ - llvmAsm_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void llvmAsmpop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - llvmAsm_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void llvmAsmensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; + if ( b == yy_current_buffer ) + yy_load_buffer_state(); } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE llvmAsm_scan_buffer (char * base, yy_size_t size ) -{ +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -2784,53 +2650,58 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - llvmAsm_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; -} + } +#endif -/** Setup the input buffer state to scan a string. The next call to llvmAsmlex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * llvmAsm_scan_bytes() instead. - */ -YY_BUFFER_STATE llvmAsm_scan_string (yyconst char * yystr ) -{ - - return llvmAsm_scan_bytes(yystr,strlen(yystr) ); -} -/** Setup the input buffer state to scan the given bytes. The next call to llvmAsmlex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) llvmAsmalloc(n ); + n = len + 2; + buf = (char *) yy_flex_alloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = llvmAsm_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in llvmAsm_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2838,199 +2709,148 @@ b->yy_is_our_buffer = 1; return b; -} + } +#endif -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; #endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); -/* Redefine yyless() so it works in section 3 code. */ + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up llvmAsmtext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - llvmAsmtext[llvmAsmleng] = (yy_hold_char); \ - (yy_c_buf_p) = llvmAsmtext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - llvmAsmleng = yyless_macro_arg; \ - } \ - while ( 0 ) + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); -/* Accessor methods (get/set functions) to struct members. */ + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } -/** Get the current line number. - * - */ -int llvmAsmget_lineno (void) -{ - - return llvmAsmlineno; -} + yy_start_stack[yy_start_stack_ptr++] = YY_START; -/** Get the input stream. - * - */ -FILE *llvmAsmget_in (void) -{ - return llvmAsmin; -} + BEGIN(new_state); + } +#endif -/** Get the output stream. - * - */ -FILE *llvmAsmget_out (void) -{ - return llvmAsmout; -} -/** Get the length of the current token. - * - */ -int llvmAsmget_leng (void) -{ - return llvmAsmleng; -} +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); -/** Get the current token. - * - */ + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif -char *llvmAsmget_text (void) -{ - return llvmAsmtext; -} -/** Set the current line number. - * @param line_number - * - */ -void llvmAsmset_lineno (int line_number ) -{ - - llvmAsmlineno = line_number; -} +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see llvmAsm_switch_to_buffer - */ -void llvmAsmset_in (FILE * in_str ) -{ - llvmAsmin = in_str ; -} +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif -void llvmAsmset_out (FILE * out_str ) -{ - llvmAsmout = out_str ; -} +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } -int llvmAsmget_debug (void) -{ - return llvmAsm_flex_debug; -} -void llvmAsmset_debug (int bdebug ) -{ - llvmAsm_flex_debug = bdebug ; -} -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from llvmAsmlex_destroy(), so don't allocate here. - */ - - /* We do not touch llvmAsmlineno unless the option is enabled. */ - llvmAsmlineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - llvmAsmin = stdin; - llvmAsmout = stdout; -#else - llvmAsmin = (FILE *) 0; - llvmAsmout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * llvmAsmlex_init() - */ - return 0; -} +/* Redefine yyless() so it works in section 3 code. */ -/* llvmAsmlex_destroy is for both reentrant and non-reentrant scanners. */ -int llvmAsmlex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - llvmAsmpop_buffer_state(); - } - - /* Destroy the stack itself. */ - llvmAsmfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * llvmAsmlex() is called, initialization will occur. */ - yy_init_globals( ); +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) - return 0; -} -/* - * Internal utility routines. - */ +/* Internal utility routines. */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; -} + } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { register int n; for ( n = 0; s[n]; ++n ) ; return n; -} + } #endif -void *llvmAsmalloc (yy_size_t size ) -{ + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { return (void *) malloc( size ); -} + } -void *llvmAsmrealloc (void * ptr, yy_size_t size ) -{ +#ifdef YY_USE_PROTOS +static inline void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static inline void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3039,16 +2859,24 @@ * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); -} - -void llvmAsmfree (void * ptr ) -{ - free( (char *) ptr ); /* see llvmAsmrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 407 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l" + } +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 409 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.97 llvm/lib/AsmParser/Lexer.l:1.98 --- llvm/lib/AsmParser/Lexer.l:1.97 Sun Jan 28 07:31:35 2007 +++ llvm/lib/AsmParser/Lexer.l Thu Feb 1 20:16:22 2007 @@ -232,6 +232,9 @@ x86_stdcallcc { return X86_STDCALLCC_TOK; } x86_fastcallcc { return X86_FASTCALLCC_TOK; } +inreg { return INREG; } +sret { return SRET; } + void { RET_TY(Type::VoidTy, VOID); } float { RET_TY(Type::FloatTy, FLOAT); } double { RET_TY(Type::DoubleTy,DOUBLE);} @@ -255,11 +258,15 @@ urem { RET_TOK(BinaryOpVal, URem, UREM); } srem { RET_TOK(BinaryOpVal, SRem, SREM); } frem { RET_TOK(BinaryOpVal, FRem, FREM); } +shl { RET_TOK(BinaryOpVal, Shl, SHL); } +lshr { RET_TOK(BinaryOpVal, LShr, LSHR); } +ashr { RET_TOK(BinaryOpVal, AShr, ASHR); } and { RET_TOK(BinaryOpVal, And, AND); } or { RET_TOK(BinaryOpVal, Or , OR ); } xor { RET_TOK(BinaryOpVal, Xor, XOR); } icmp { RET_TOK(OtherOpVal, ICmp, ICMP); } fcmp { RET_TOK(OtherOpVal, FCmp, FCMP); } + eq { return EQ; } ne { return NE; } slt { return SLT; } @@ -286,8 +293,6 @@ trunc { RET_TOK(CastOpVal, Trunc, TRUNC); } zext { RET_TOK(CastOpVal, ZExt, ZEXT); } sext { RET_TOK(CastOpVal, SExt, SEXT); } -inreg { return INREG; } -sret { return SRET; } fptrunc { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } fpext { RET_TOK(CastOpVal, FPExt, FPEXT); } uitofp { RET_TOK(CastOpVal, UIToFP, UITOFP); } @@ -298,9 +303,6 @@ ptrtoint { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } bitcast { RET_TOK(CastOpVal, BitCast, BITCAST); } select { RET_TOK(OtherOpVal, Select, SELECT); } -shl { RET_TOK(OtherOpVal, Shl, SHL); } -lshr { RET_TOK(OtherOpVal, LShr, LSHR); } -ashr { RET_TOK(OtherOpVal, AShr, ASHR); } va_arg { RET_TOK(OtherOpVal, VAArg , VAARG); } ret { RET_TOK(TermOpVal, Ret, RET); } br { RET_TOK(TermOpVal, Br, BR); } Index: llvm/lib/AsmParser/Lexer.l.cvs diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.24 llvm/lib/AsmParser/Lexer.l.cvs:1.25 --- llvm/lib/AsmParser/Lexer.l.cvs:1.24 Sun Jan 28 07:31:35 2007 +++ llvm/lib/AsmParser/Lexer.l.cvs Thu Feb 1 20:16:22 2007 @@ -232,6 +232,9 @@ x86_stdcallcc { return X86_STDCALLCC_TOK; } x86_fastcallcc { return X86_FASTCALLCC_TOK; } +inreg { return INREG; } +sret { return SRET; } + void { RET_TY(Type::VoidTy, VOID); } float { RET_TY(Type::FloatTy, FLOAT); } double { RET_TY(Type::DoubleTy,DOUBLE);} @@ -255,11 +258,15 @@ urem { RET_TOK(BinaryOpVal, URem, UREM); } srem { RET_TOK(BinaryOpVal, SRem, SREM); } frem { RET_TOK(BinaryOpVal, FRem, FREM); } +shl { RET_TOK(BinaryOpVal, Shl, SHL); } +lshr { RET_TOK(BinaryOpVal, LShr, LSHR); } +ashr { RET_TOK(BinaryOpVal, AShr, ASHR); } and { RET_TOK(BinaryOpVal, And, AND); } or { RET_TOK(BinaryOpVal, Or , OR ); } xor { RET_TOK(BinaryOpVal, Xor, XOR); } icmp { RET_TOK(OtherOpVal, ICmp, ICMP); } fcmp { RET_TOK(OtherOpVal, FCmp, FCMP); } + eq { return EQ; } ne { return NE; } slt { return SLT; } @@ -286,8 +293,6 @@ trunc { RET_TOK(CastOpVal, Trunc, TRUNC); } zext { RET_TOK(CastOpVal, ZExt, ZEXT); } sext { RET_TOK(CastOpVal, SExt, SEXT); } -inreg { return INREG; } -sret { return SRET; } fptrunc { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } fpext { RET_TOK(CastOpVal, FPExt, FPEXT); } uitofp { RET_TOK(CastOpVal, UIToFP, UITOFP); } @@ -298,9 +303,6 @@ ptrtoint { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } bitcast { RET_TOK(CastOpVal, BitCast, BITCAST); } select { RET_TOK(OtherOpVal, Select, SELECT); } -shl { RET_TOK(OtherOpVal, Shl, SHL); } -lshr { RET_TOK(OtherOpVal, LShr, LSHR); } -ashr { RET_TOK(OtherOpVal, AShr, ASHR); } va_arg { RET_TOK(OtherOpVal, VAArg , VAARG); } ret { RET_TOK(TermOpVal, Ret, RET); } br { RET_TOK(TermOpVal, Br, BR); } Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.61 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.62 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.61 Tue Jan 30 22:44:08 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Thu Feb 1 20:16:22 2007 @@ -1,147 +1,336 @@ +/* A Bison parser, made by GNU Bison 2.1. */ -/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -#define YYBISON 1 /* Identify Bison output. */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define LOCALVAL_ID 259 -#define GLOBALVAL_ID 260 -#define FPVAL 261 -#define VOID 262 -#define INTTYPE 263 -#define FLOAT 264 -#define DOUBLE 265 -#define LABEL 266 -#define TYPE 267 -#define LOCALVAR 268 -#define GLOBALVAR 269 -#define LABELSTR 270 -#define STRINGCONSTANT 271 -#define ATSTRINGCONSTANT 272 -#define IMPLEMENTATION 273 -#define ZEROINITIALIZER 274 -#define TRUETOK 275 -#define FALSETOK 276 -#define BEGINTOK 277 -#define ENDTOK 278 -#define DECLARE 279 -#define DEFINE 280 -#define GLOBAL 281 -#define CONSTANT 282 -#define SECTION 283 -#define VOLATILE 284 -#define TO 285 -#define DOTDOTDOT 286 -#define NULL_TOK 287 -#define UNDEF 288 -#define INTERNAL 289 -#define LINKONCE 290 -#define WEAK 291 -#define APPENDING 292 -#define DLLIMPORT 293 -#define DLLEXPORT 294 -#define EXTERN_WEAK 295 -#define OPAQUE 296 -#define EXTERNAL 297 -#define TARGET 298 -#define TRIPLE 299 -#define ALIGN 300 -#define DEPLIBS 301 -#define CALL 302 -#define TAIL 303 -#define ASM_TOK 304 -#define MODULE 305 -#define SIDEEFFECT 306 -#define CC_TOK 307 -#define CCC_TOK 308 -#define FASTCC_TOK 309 -#define COLDCC_TOK 310 -#define X86_STDCALLCC_TOK 311 -#define X86_FASTCALLCC_TOK 312 -#define DATALAYOUT 313 -#define RET 314 -#define BR 315 -#define SWITCH 316 -#define INVOKE 317 -#define UNWIND 318 -#define UNREACHABLE 319 -#define ADD 320 -#define SUB 321 -#define MUL 322 -#define UDIV 323 -#define SDIV 324 -#define FDIV 325 -#define UREM 326 -#define SREM 327 -#define FREM 328 -#define AND 329 -#define OR 330 -#define XOR 331 -#define ICMP 332 -#define FCMP 333 -#define EQ 334 -#define NE 335 -#define SLT 336 -#define SGT 337 -#define SLE 338 -#define SGE 339 -#define ULT 340 -#define UGT 341 -#define ULE 342 -#define UGE 343 -#define OEQ 344 -#define ONE 345 -#define OLT 346 -#define OGT 347 -#define OLE 348 -#define OGE 349 -#define ORD 350 -#define UNO 351 -#define UEQ 352 -#define UNE 353 -#define MALLOC 354 -#define ALLOCA 355 -#define FREE 356 -#define LOAD 357 -#define STORE 358 -#define GETELEMENTPTR 359 -#define TRUNC 360 -#define ZEXT 361 -#define SEXT 362 -#define FPTRUNC 363 -#define FPEXT 364 -#define BITCAST 365 -#define UITOFP 366 -#define SITOFP 367 -#define FPTOUI 368 -#define FPTOSI 369 -#define INTTOPTR 370 -#define PTRTOINT 371 -#define PHI_TOK 372 -#define SELECT 373 -#define SHL 374 -#define LSHR 375 -#define ASHR 376 -#define VAARG 377 -#define EXTRACTELEMENT 378 -#define INSERTELEMENT 379 -#define SHUFFLEVECTOR 380 -#define NORETURN 381 -#define INREG 382 -#define SRET 383 -#define DEFAULT 384 -#define HIDDEN 385 -#line 14 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + LOCALVAL_ID = 260, + GLOBALVAL_ID = 261, + FPVAL = 262, + VOID = 263, + INTTYPE = 264, + FLOAT = 265, + DOUBLE = 266, + LABEL = 267, + TYPE = 268, + LOCALVAR = 269, + GLOBALVAR = 270, + LABELSTR = 271, + STRINGCONSTANT = 272, + ATSTRINGCONSTANT = 273, + IMPLEMENTATION = 274, + ZEROINITIALIZER = 275, + TRUETOK = 276, + FALSETOK = 277, + BEGINTOK = 278, + ENDTOK = 279, + DECLARE = 280, + DEFINE = 281, + GLOBAL = 282, + CONSTANT = 283, + SECTION = 284, + VOLATILE = 285, + TO = 286, + DOTDOTDOT = 287, + NULL_TOK = 288, + UNDEF = 289, + INTERNAL = 290, + LINKONCE = 291, + WEAK = 292, + APPENDING = 293, + DLLIMPORT = 294, + DLLEXPORT = 295, + EXTERN_WEAK = 296, + OPAQUE = 297, + EXTERNAL = 298, + TARGET = 299, + TRIPLE = 300, + ALIGN = 301, + DEPLIBS = 302, + CALL = 303, + TAIL = 304, + ASM_TOK = 305, + MODULE = 306, + SIDEEFFECT = 307, + CC_TOK = 308, + CCC_TOK = 309, + FASTCC_TOK = 310, + COLDCC_TOK = 311, + X86_STDCALLCC_TOK = 312, + X86_FASTCALLCC_TOK = 313, + DATALAYOUT = 314, + RET = 315, + BR = 316, + SWITCH = 317, + INVOKE = 318, + UNWIND = 319, + UNREACHABLE = 320, + ADD = 321, + SUB = 322, + MUL = 323, + UDIV = 324, + SDIV = 325, + FDIV = 326, + UREM = 327, + SREM = 328, + FREM = 329, + AND = 330, + OR = 331, + XOR = 332, + SHL = 333, + LSHR = 334, + ASHR = 335, + ICMP = 336, + FCMP = 337, + EQ = 338, + NE = 339, + SLT = 340, + SGT = 341, + SLE = 342, + SGE = 343, + ULT = 344, + UGT = 345, + ULE = 346, + UGE = 347, + OEQ = 348, + ONE = 349, + OLT = 350, + OGT = 351, + OLE = 352, + OGE = 353, + ORD = 354, + UNO = 355, + UEQ = 356, + UNE = 357, + MALLOC = 358, + ALLOCA = 359, + FREE = 360, + LOAD = 361, + STORE = 362, + GETELEMENTPTR = 363, + TRUNC = 364, + ZEXT = 365, + SEXT = 366, + FPTRUNC = 367, + FPEXT = 368, + BITCAST = 369, + UITOFP = 370, + SITOFP = 371, + FPTOUI = 372, + FPTOSI = 373, + INTTOPTR = 374, + PTRTOINT = 375, + PHI_TOK = 376, + SELECT = 377, + VAARG = 378, + EXTRACTELEMENT = 379, + INSERTELEMENT = 380, + SHUFFLEVECTOR = 381, + NORETURN = 382, + INREG = 383, + SRET = 384, + DEFAULT = 385, + HIDDEN = 386 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define LOCALVAL_ID 260 +#define GLOBALVAL_ID 261 +#define FPVAL 262 +#define VOID 263 +#define INTTYPE 264 +#define FLOAT 265 +#define DOUBLE 266 +#define LABEL 267 +#define TYPE 268 +#define LOCALVAR 269 +#define GLOBALVAR 270 +#define LABELSTR 271 +#define STRINGCONSTANT 272 +#define ATSTRINGCONSTANT 273 +#define IMPLEMENTATION 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define TO 286 +#define DOTDOTDOT 287 +#define NULL_TOK 288 +#define UNDEF 289 +#define INTERNAL 290 +#define LINKONCE 291 +#define WEAK 292 +#define APPENDING 293 +#define DLLIMPORT 294 +#define DLLEXPORT 295 +#define EXTERN_WEAK 296 +#define OPAQUE 297 +#define EXTERNAL 298 +#define TARGET 299 +#define TRIPLE 300 +#define ALIGN 301 +#define DEPLIBS 302 +#define CALL 303 +#define TAIL 304 +#define ASM_TOK 305 +#define MODULE 306 +#define SIDEEFFECT 307 +#define CC_TOK 308 +#define CCC_TOK 309 +#define FASTCC_TOK 310 +#define COLDCC_TOK 311 +#define X86_STDCALLCC_TOK 312 +#define X86_FASTCALLCC_TOK 313 +#define DATALAYOUT 314 +#define RET 315 +#define BR 316 +#define SWITCH 317 +#define INVOKE 318 +#define UNWIND 319 +#define UNREACHABLE 320 +#define ADD 321 +#define SUB 322 +#define MUL 323 +#define UDIV 324 +#define SDIV 325 +#define FDIV 326 +#define UREM 327 +#define SREM 328 +#define FREM 329 +#define AND 330 +#define OR 331 +#define XOR 332 +#define SHL 333 +#define LSHR 334 +#define ASHR 335 +#define ICMP 336 +#define FCMP 337 +#define EQ 338 +#define NE 339 +#define SLT 340 +#define SGT 341 +#define SLE 342 +#define SGE 343 +#define ULT 344 +#define UGT 345 +#define ULE 346 +#define UGE 347 +#define OEQ 348 +#define ONE 349 +#define OLT 350 +#define OGT 351 +#define OLE 352 +#define OGE 353 +#define ORD 354 +#define UNO 355 +#define UEQ 356 +#define UNE 357 +#define MALLOC 358 +#define ALLOCA 359 +#define FREE 360 +#define LOAD 361 +#define STORE 362 +#define GETELEMENTPTR 363 +#define TRUNC 364 +#define ZEXT 365 +#define SEXT 366 +#define FPTRUNC 367 +#define FPEXT 368 +#define BITCAST 369 +#define UITOFP 370 +#define SITOFP 371 +#define FPTOUI 372 +#define FPTOSI 373 +#define INTTOPTR 374 +#define PTRTOINT 375 +#define PHI_TOK 376 +#define SELECT 377 +#define VAARG 378 +#define EXTRACTELEMENT 379 +#define INSERTELEMENT 380 +#define SHUFFLEVECTOR 381 +#define NORETURN 382 +#define INREG 383 +#define SRET 384 +#define DEFAULT 385 +#define HIDDEN 386 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1013,8 +1202,28 @@ } -#line 886 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 886 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1059,1062 +1268,1519 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -#include +/* Line 196 of yacc.c. */ +#line 1273 "llvmAsmParser.tab.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 1285 "llvmAsmParser.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; -#define YYFINAL 567 -#define YYFLAG -32768 -#define YYNTBASE 146 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 224) - -static const short yytranslate[] = { 0, - 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, 2, 2, 2, 2, 2, 136, - 137, 134, 2, 133, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, - 132, 142, 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, - 138, 135, 140, 2, 2, 2, 2, 2, 145, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, - 2, 2, 143, 2, 144, 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, 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, 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, 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, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 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, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131 -}; +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, - 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, - 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, - 195, 198, 199, 202, 203, 207, 210, 211, 213, 214, - 218, 220, 223, 225, 227, 229, 231, 233, 235, 238, - 240, 243, 249, 255, 261, 267, 271, 274, 280, 285, - 288, 290, 292, 294, 298, 300, 304, 306, 307, 309, - 313, 318, 322, 326, 331, 336, 340, 347, 353, 356, - 359, 362, 365, 368, 371, 374, 377, 380, 383, 390, - 396, 405, 412, 419, 427, 435, 442, 449, 458, 467, - 471, 473, 475, 477, 479, 480, 482, 485, 486, 490, - 491, 495, 499, 501, 505, 509, 510, 517, 518, 526, - 527, 535, 538, 542, 544, 548, 552, 556, 560, 562, - 563, 569, 573, 575, 579, 581, 582, 592, 594, 596, - 601, 603, 605, 608, 612, 613, 615, 617, 619, 621, - 623, 625, 627, 629, 631, 635, 637, 643, 645, 647, - 649, 651, 653, 655, 658, 661, 664, 668, 671, 672, - 674, 677, 680, 684, 694, 704, 713, 728, 730, 732, - 739, 745, 748, 755, 763, 767, 773, 774, 775, 779, - 782, 784, 790, 796, 803, 810, 815, 820, 827, 832, - 837, 844, 851, 854, 863, 865, 867, 868, 872, 879, - 883, 890, 893, 898, 905 -}; +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -static const short yyrhs[] = { 66, - 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, - 0, 72, 0, 73, 0, 74, 0, 75, 0, 76, - 0, 77, 0, 106, 0, 107, 0, 108, 0, 109, - 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 120, 0, 121, - 0, 122, 0, 80, 0, 81, 0, 82, 0, 83, - 0, 84, 0, 85, 0, 86, 0, 87, 0, 88, - 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, - 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, - 0, 99, 0, 86, 0, 87, 0, 88, 0, 89, - 0, 21, 0, 22, 0, 9, 0, 10, 0, 11, - 0, 14, 0, 17, 0, 154, 0, 0, 154, 132, - 0, 0, 15, 0, 18, 0, 157, 132, 0, 0, - 35, 0, 37, 0, 36, 0, 38, 0, 40, 0, - 39, 0, 41, 0, 43, 0, 0, 131, 0, 0, - 39, 0, 41, 0, 0, 35, 0, 36, 0, 37, - 0, 40, 0, 0, 54, 0, 55, 0, 56, 0, - 57, 0, 58, 0, 53, 4, 0, 107, 0, 108, - 0, 128, 0, 129, 0, 0, 166, 165, 0, 127, - 0, 165, 0, 0, 168, 167, 0, 0, 46, 4, - 0, 0, 133, 46, 4, 0, 29, 17, 0, 0, - 171, 0, 0, 133, 174, 173, 0, 171, 0, 46, - 4, 0, 9, 0, 10, 0, 11, 0, 12, 0, - 42, 0, 175, 0, 176, 134, 0, 208, 0, 135, - 4, 0, 176, 136, 180, 137, 168, 0, 8, 136, - 180, 137, 168, 0, 138, 4, 139, 176, 140, 0, - 141, 4, 139, 176, 142, 0, 143, 181, 144, 0, - 143, 144, 0, 141, 143, 181, 144, 142, 0, 141, - 143, 144, 142, 0, 176, 166, 0, 176, 0, 8, - 0, 177, 0, 179, 133, 177, 0, 179, 0, 179, - 133, 32, 0, 32, 0, 0, 176, 0, 181, 133, - 176, 0, 176, 138, 184, 140, 0, 176, 138, 140, - 0, 176, 145, 17, 0, 176, 141, 184, 142, 0, - 176, 143, 184, 144, 0, 176, 143, 144, 0, 176, - 141, 143, 184, 144, 142, 0, 176, 141, 143, 144, - 142, 0, 176, 33, 0, 176, 34, 0, 176, 208, - 0, 176, 183, 0, 176, 20, 0, 152, 3, 0, - 152, 4, 0, 9, 21, 0, 9, 22, 0, 153, - 7, 0, 148, 136, 182, 31, 176, 137, 0, 105, - 136, 182, 219, 137, 0, 119, 136, 182, 133, 182, - 133, 182, 137, 0, 146, 136, 182, 133, 182, 137, - 0, 147, 136, 182, 133, 182, 137, 0, 78, 150, - 136, 182, 133, 182, 137, 0, 79, 151, 136, 182, - 133, 182, 137, 0, 149, 136, 182, 133, 182, 137, - 0, 124, 136, 182, 133, 182, 137, 0, 125, 136, - 182, 133, 182, 133, 182, 137, 0, 126, 136, 182, - 133, 182, 133, 182, 137, 0, 184, 133, 182, 0, - 182, 0, 27, 0, 28, 0, 187, 0, 0, 188, - 0, 187, 188, 0, 0, 26, 189, 204, 0, 0, - 25, 190, 205, 0, 51, 50, 194, 0, 19, 0, - 156, 13, 176, 0, 156, 13, 8, 0, 0, 158, - 161, 185, 182, 191, 173, 0, 0, 158, 159, 161, - 185, 182, 192, 173, 0, 0, 158, 160, 161, 185, - 176, 193, 173, 0, 44, 195, 0, 47, 132, 196, - 0, 17, 0, 45, 132, 17, 0, 59, 132, 17, - 0, 138, 197, 140, 0, 197, 133, 17, 0, 17, - 0, 0, 198, 133, 176, 166, 155, 0, 176, 166, - 155, 0, 198, 0, 198, 133, 32, 0, 32, 0, - 0, 164, 178, 157, 136, 199, 137, 168, 172, 169, - 0, 23, 0, 143, 0, 163, 161, 200, 201, 0, - 24, 0, 144, 0, 211, 203, 0, 162, 161, 200, - 0, 0, 52, 0, 3, 0, 4, 0, 7, 0, - 21, 0, 22, 0, 33, 0, 34, 0, 20, 0, - 141, 184, 142, 0, 183, 0, 50, 206, 17, 133, - 17, 0, 5, 0, 6, 0, 154, 0, 157, 0, - 208, 0, 207, 0, 176, 209, 0, 211, 212, 0, - 202, 212, 0, 213, 156, 214, 0, 213, 216, 0, - 0, 16, 0, 60, 210, 0, 60, 8, 0, 61, - 12, 209, 0, 61, 9, 209, 133, 12, 209, 133, - 12, 209, 0, 62, 152, 209, 133, 12, 209, 138, - 215, 140, 0, 62, 152, 209, 133, 12, 209, 138, - 140, 0, 63, 164, 178, 209, 136, 218, 137, 168, - 31, 12, 209, 64, 12, 209, 0, 64, 0, 65, - 0, 215, 152, 207, 133, 12, 209, 0, 152, 207, - 133, 12, 209, 0, 156, 221, 0, 176, 138, 209, - 133, 209, 140, 0, 217, 133, 138, 209, 133, 209, - 140, 0, 176, 209, 166, 0, 218, 133, 176, 209, - 166, 0, 0, 0, 219, 133, 210, 0, 49, 48, - 0, 48, 0, 146, 176, 209, 133, 209, 0, 147, - 176, 209, 133, 209, 0, 78, 150, 176, 209, 133, - 209, 0, 79, 151, 176, 209, 133, 209, 0, 149, - 210, 133, 210, 0, 148, 210, 31, 176, 0, 119, - 210, 133, 210, 133, 210, 0, 123, 210, 133, 176, - 0, 124, 210, 133, 210, 0, 125, 210, 133, 210, - 133, 210, 0, 126, 210, 133, 210, 133, 210, 0, - 118, 217, 0, 220, 164, 178, 209, 136, 218, 137, - 168, 0, 223, 0, 30, 0, 0, 100, 176, 170, - 0, 100, 176, 133, 9, 209, 170, 0, 101, 176, - 170, 0, 101, 176, 133, 9, 209, 170, 0, 102, - 210, 0, 222, 103, 176, 209, 0, 222, 104, 210, - 133, 176, 209, 0, 105, 176, 209, 219, 0 -}; +#endif +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1033, - 1033, 1033, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1035, - 1035, 1035, 1035, 1035, 1036, 1036, 1036, 1038, 1038, 1039, - 1039, 1040, 1040, 1041, 1041, 1042, 1042, 1046, 1046, 1047, - 1047, 1048, 1048, 1049, 1049, 1050, 1050, 1051, 1051, 1052, - 1052, 1053, 1054, 1059, 1060, 1060, 1062, 1062, 1063, 1063, - 1067, 1071, 1076, 1076, 1078, 1082, 1088, 1089, 1090, 1091, - 1092, 1096, 1097, 1098, 1102, 1103, 1107, 1108, 1109, 1113, - 1114, 1115, 1116, 1117, 1120, 1120, 1121, 1122, 1123, 1124, - 1125, 1133, 1134, 1135, 1136, 1139, 1140, 1145, 1146, 1149, - 1150, 1157, 1157, 1164, 1164, 1173, 1181, 1181, 1187, 1187, - 1189, 1194, 1207, 1207, 1207, 1207, 1210, 1214, 1218, 1225, - 1230, 1238, 1256, 1274, 1279, 1291, 1301, 1305, 1315, 1322, - 1329, 1336, 1341, 1346, 1353, 1354, 1361, 1368, 1376, 1381, - 1392, 1420, 1436, 1465, 1493, 1518, 1537, 1562, 1581, 1593, - 1600, 1666, 1676, 1686, 1692, 1698, 1703, 1708, 1716, 1728, - 1749, 1757, 1763, 1774, 1779, 1784, 1793, 1799, 1805, 1814, - 1818, 1826, 1826, 1837, 1842, 1850, 1851, 1855, 1855, 1859, - 1859, 1862, 1865, 1877, 1901, 1912, 1919, 1922, 1927, 1930, - 1936, 1940, 1943, 1949, 1962, 1966, 1971, 1973, 1978, 1983, - 1992, 2002, 2013, 2017, 2026, 2035, 2040, 2146, 2146, 2148, - 2157, 2157, 2159, 2164, 2176, 2180, 2185, 2189, 2193, 2197, - 2201, 2205, 2209, 2213, 2217, 2242, 2246, 2260, 2264, 2268, - 2272, 2278, 2278, 2284, 2293, 2297, 2306, 2317, 2326, 2338, - 2351, 2355, 2359, 2364, 2374, 2393, 2402, 2469, 2473, 2480, - 2491, 2504, 2513, 2524, 2534, 2542, 2550, 2553, 2554, 2561, - 2565, 2570, 2591, 2608, 2621, 2634, 2643, 2655, 2663, 2670, - 2676, 2682, 2688, 2703, 2767, 2772, 2776, 2783, 2790, 2798, - 2805, 2813, 2821, 2835, 2852 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 40 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1439 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 146 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 78 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 284 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 557 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 386 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 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, 2, 2, 2, 2, 2, + 136, 137, 134, 2, 133, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 141, 132, 142, 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, 138, 135, 140, 2, 2, 2, 2, 2, 145, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 139, 2, 2, 143, 2, 144, 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, + 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, 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, 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, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 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, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131 }; -#endif +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short int yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, + 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, + 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, + 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, + 195, 197, 198, 201, 202, 205, 206, 210, 213, 214, + 216, 217, 221, 223, 226, 228, 230, 232, 234, 236, + 238, 241, 243, 246, 252, 258, 264, 270, 274, 277, + 283, 288, 291, 293, 295, 297, 301, 303, 307, 309, + 310, 312, 316, 321, 325, 329, 334, 339, 343, 350, + 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, + 386, 393, 399, 408, 415, 422, 430, 438, 445, 454, + 463, 467, 469, 471, 473, 475, 476, 478, 481, 482, + 486, 487, 491, 495, 497, 501, 505, 506, 513, 514, + 522, 523, 531, 534, 538, 540, 544, 548, 552, 556, + 558, 559, 565, 569, 571, 575, 577, 578, 588, 590, + 592, 597, 599, 601, 604, 608, 609, 611, 613, 615, + 617, 619, 621, 623, 625, 627, 631, 633, 639, 641, + 643, 645, 647, 649, 651, 654, 657, 660, 664, 667, + 668, 670, 673, 676, 680, 690, 700, 709, 724, 726, + 728, 735, 741, 744, 751, 759, 763, 769, 770, 771, + 775, 778, 780, 786, 792, 799, 806, 811, 818, 823, + 828, 835, 842, 845, 854, 856, 858, 859, 863, 870, + 874, 881, 884, 889, 896 +}; -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = +{ + 186, 0, -1, 66, -1, 67, -1, 68, -1, 69, + -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, + -1, 78, -1, 79, -1, 80, -1, 75, -1, 76, + -1, 77, -1, 109, -1, 110, -1, 111, -1, 112, + -1, 113, -1, 114, -1, 115, -1, 116, -1, 117, + -1, 118, -1, 119, -1, 120, -1, 83, -1, 84, + -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, + -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, + -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 102, -1, 89, -1, 90, + -1, 91, -1, 92, -1, 21, -1, 22, -1, 9, + -1, 10, -1, 11, -1, 14, -1, 17, -1, 154, + -1, -1, 154, 132, -1, -1, 15, -1, 18, -1, + 157, 132, -1, -1, 35, -1, 37, -1, 36, -1, + 38, -1, 40, -1, 39, -1, 41, -1, 43, -1, + -1, 131, -1, -1, 39, -1, 41, -1, -1, 35, + -1, 36, -1, 37, -1, 40, -1, -1, 54, -1, + 55, -1, 56, -1, 57, -1, 58, -1, 53, 4, + -1, 110, -1, 111, -1, 128, -1, 129, -1, -1, + 166, 165, -1, 127, -1, 165, -1, -1, 168, 167, + -1, -1, 46, 4, -1, -1, 133, 46, 4, -1, + 29, 17, -1, -1, 171, -1, -1, 133, 174, 173, + -1, 171, -1, 46, 4, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 42, -1, 175, -1, 176, 134, + -1, 208, -1, 135, 4, -1, 176, 136, 180, 137, + 168, -1, 8, 136, 180, 137, 168, -1, 138, 4, + 139, 176, 140, -1, 141, 4, 139, 176, 142, -1, + 143, 181, 144, -1, 143, 144, -1, 141, 143, 181, + 144, 142, -1, 141, 143, 144, 142, -1, 176, 166, + -1, 176, -1, 8, -1, 177, -1, 179, 133, 177, + -1, 179, -1, 179, 133, 32, -1, 32, -1, -1, + 176, -1, 181, 133, 176, -1, 176, 138, 184, 140, + -1, 176, 138, 140, -1, 176, 145, 17, -1, 176, + 141, 184, 142, -1, 176, 143, 184, 144, -1, 176, + 143, 144, -1, 176, 141, 143, 184, 144, 142, -1, + 176, 141, 143, 144, 142, -1, 176, 33, -1, 176, + 34, -1, 176, 208, -1, 176, 183, -1, 176, 20, + -1, 152, 3, -1, 152, 4, -1, 9, 21, -1, + 9, 22, -1, 153, 7, -1, 149, 136, 182, 31, + 176, 137, -1, 108, 136, 182, 219, 137, -1, 122, + 136, 182, 133, 182, 133, 182, 137, -1, 147, 136, + 182, 133, 182, 137, -1, 148, 136, 182, 133, 182, + 137, -1, 81, 150, 136, 182, 133, 182, 137, -1, + 82, 151, 136, 182, 133, 182, 137, -1, 124, 136, + 182, 133, 182, 137, -1, 125, 136, 182, 133, 182, + 133, 182, 137, -1, 126, 136, 182, 133, 182, 133, + 182, 137, -1, 184, 133, 182, -1, 182, -1, 27, + -1, 28, -1, 187, -1, -1, 188, -1, 187, 188, + -1, -1, 26, 189, 204, -1, -1, 25, 190, 205, + -1, 51, 50, 194, -1, 19, -1, 156, 13, 176, + -1, 156, 13, 8, -1, -1, 158, 161, 185, 182, + 191, 173, -1, -1, 158, 159, 161, 185, 182, 192, + 173, -1, -1, 158, 160, 161, 185, 176, 193, 173, + -1, 44, 195, -1, 47, 132, 196, -1, 17, -1, + 45, 132, 17, -1, 59, 132, 17, -1, 138, 197, + 140, -1, 197, 133, 17, -1, 17, -1, -1, 198, + 133, 176, 166, 155, -1, 176, 166, 155, -1, 198, + -1, 198, 133, 32, -1, 32, -1, -1, 164, 178, + 157, 136, 199, 137, 168, 172, 169, -1, 23, -1, + 143, -1, 163, 161, 200, 201, -1, 24, -1, 144, + -1, 211, 203, -1, 162, 161, 200, -1, -1, 52, + -1, 3, -1, 4, -1, 7, -1, 21, -1, 22, + -1, 33, -1, 34, -1, 20, -1, 141, 184, 142, + -1, 183, -1, 50, 206, 17, 133, 17, -1, 5, + -1, 6, -1, 154, -1, 157, -1, 208, -1, 207, + -1, 176, 209, -1, 211, 212, -1, 202, 212, -1, + 213, 156, 214, -1, 213, 216, -1, -1, 16, -1, + 60, 210, -1, 60, 8, -1, 61, 12, 209, -1, + 61, 9, 209, 133, 12, 209, 133, 12, 209, -1, + 62, 152, 209, 133, 12, 209, 138, 215, 140, -1, + 62, 152, 209, 133, 12, 209, 138, 140, -1, 63, + 164, 178, 209, 136, 218, 137, 168, 31, 12, 209, + 64, 12, 209, -1, 64, -1, 65, -1, 215, 152, + 207, 133, 12, 209, -1, 152, 207, 133, 12, 209, + -1, 156, 221, -1, 176, 138, 209, 133, 209, 140, + -1, 217, 133, 138, 209, 133, 209, 140, -1, 176, + 209, 166, -1, 218, 133, 176, 209, 166, -1, -1, + -1, 219, 133, 210, -1, 49, 48, -1, 48, -1, + 147, 176, 209, 133, 209, -1, 148, 176, 209, 133, + 209, -1, 81, 150, 176, 209, 133, 209, -1, 82, + 151, 176, 209, 133, 209, -1, 149, 210, 31, 176, + -1, 122, 210, 133, 210, 133, 210, -1, 123, 210, + 133, 176, -1, 124, 210, 133, 210, -1, 125, 210, + 133, 210, 133, 210, -1, 126, 210, 133, 210, 133, + 210, -1, 121, 217, -1, 220, 164, 178, 209, 136, + 218, 137, 168, -1, 223, -1, 30, -1, -1, 103, + 176, 170, -1, 103, 176, 133, 9, 209, 170, -1, + 104, 176, 170, -1, 104, 176, 133, 9, 209, 170, + -1, 105, 210, -1, 222, 106, 176, 209, -1, 222, + 107, 210, 133, 176, 209, -1, 108, 176, 209, 219, + -1 +}; -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL","VOID","INTTYPE","FLOAT","DOUBLE", -"LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT", -"IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK", -"DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO","DOTDOTDOT", -"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", -"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL", -"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK", -"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", -"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM", -"FREM","AND","OR","XOR","ICMP","FCMP","EQ","NE","SLT","SGT","SLE","SGE","ULT", -"UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE", -"MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC","ZEXT","SEXT", -"FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI","INTTOPTR","PTRTOINT", -"PHI_TOK","SELECT","SHL","LSHR","ASHR","VAARG","EXTRACTELEMENT","INSERTELEMENT", -"SHUFFLEVECTOR","NORETURN","INREG","SRET","DEFAULT","HIDDEN","'='","','","'*'", -"'\\\\'","'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", -"LogicalOps","CastOps","ShiftOps","IPredicates","FPredicates","IntType","FPType", -"LocalName","OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GVInternalLinkage", -"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", -"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign", -"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", -"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", -"ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList", -"Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", -"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", -"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", -"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", -"OptVolatile","MemoryInst", NULL +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, + 1035, 1035, 1035, 1036, 1036, 1036, 1036, 1036, 1036, 1039, + 1039, 1040, 1040, 1041, 1041, 1042, 1042, 1043, 1043, 1047, + 1047, 1048, 1048, 1049, 1049, 1050, 1050, 1051, 1051, 1052, + 1052, 1053, 1053, 1054, 1055, 1060, 1061, 1061, 1063, 1063, + 1064, 1064, 1068, 1072, 1077, 1077, 1079, 1083, 1089, 1090, + 1091, 1092, 1093, 1097, 1098, 1099, 1103, 1104, 1108, 1109, + 1110, 1114, 1115, 1116, 1117, 1118, 1121, 1122, 1123, 1124, + 1125, 1126, 1127, 1134, 1135, 1136, 1137, 1140, 1141, 1146, + 1147, 1150, 1151, 1158, 1159, 1165, 1166, 1174, 1182, 1183, + 1188, 1189, 1190, 1195, 1208, 1208, 1208, 1208, 1211, 1215, + 1219, 1226, 1231, 1239, 1257, 1275, 1280, 1292, 1302, 1306, + 1316, 1323, 1330, 1337, 1342, 1347, 1354, 1355, 1362, 1369, + 1377, 1382, 1393, 1421, 1437, 1466, 1494, 1519, 1538, 1563, + 1582, 1594, 1601, 1667, 1677, 1687, 1693, 1699, 1704, 1709, + 1717, 1729, 1750, 1758, 1764, 1775, 1780, 1785, 1791, 1797, + 1806, 1810, 1818, 1818, 1829, 1834, 1842, 1843, 1847, 1847, + 1851, 1851, 1854, 1857, 1869, 1893, 1904, 1904, 1914, 1914, + 1922, 1922, 1932, 1935, 1941, 1954, 1958, 1963, 1965, 1970, + 1975, 1984, 1994, 2005, 2009, 2018, 2027, 2032, 2138, 2138, + 2140, 2149, 2149, 2151, 2156, 2168, 2172, 2177, 2181, 2185, + 2189, 2193, 2197, 2201, 2205, 2209, 2234, 2238, 2252, 2256, + 2260, 2264, 2270, 2270, 2276, 2285, 2289, 2298, 2309, 2318, + 2330, 2343, 2347, 2351, 2356, 2366, 2385, 2394, 2461, 2465, + 2472, 2483, 2496, 2505, 2516, 2526, 2534, 2542, 2545, 2546, + 2553, 2557, 2562, 2583, 2600, 2613, 2626, 2638, 2646, 2653, + 2659, 2665, 2671, 2686, 2750, 2755, 2759, 2766, 2773, 2781, + 2788, 2796, 2804, 2818, 2835 }; #endif -static const short yyr1[] = { 0, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, - 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 149, 149, 149, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 152, 153, 153, 154, 154, 155, 155, - 156, 156, 157, 157, 158, 158, 159, 159, 159, 159, - 159, 160, 160, 160, 161, 161, 162, 162, 162, 163, - 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, - 164, 165, 165, 165, 165, 166, 166, 167, 167, 168, - 168, 169, 169, 170, 170, 171, 172, 172, 173, 173, - 174, 174, 175, 175, 175, 175, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, - 178, 178, 179, 179, 180, 180, 180, 180, 181, 181, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, - 184, 185, 185, 186, 186, 187, 187, 189, 188, 190, - 188, 188, 188, 188, 188, 191, 188, 192, 188, 193, - 188, 188, 188, 194, 195, 195, 196, 197, 197, 197, - 198, 198, 199, 199, 199, 199, 200, 201, 201, 202, - 203, 203, 204, 205, 206, 206, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, - 208, 209, 209, 210, 211, 211, 212, 213, 213, 213, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, - 215, 216, 217, 217, 218, 218, 218, 219, 219, 220, - 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, - 223, 223, 223, 223, 223 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", + "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", "FLOAT", + "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", + "STRINGCONSTANT", "ATSTRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", + "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", + "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", + "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", + "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", + "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", + "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", + "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", + "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", + "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", + "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", + "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", "DEFAULT", + "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", + "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", + "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", + "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", + "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", + "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", + "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", + "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "Module", + "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", + "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", + "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", + "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", + "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", + "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", + "OptVolatile", "MemoryInst", 0 }; +#endif -static const short yyr2[] = { 0, - 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, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, - 2, 0, 2, 0, 3, 2, 0, 1, 0, 3, - 1, 2, 1, 1, 1, 1, 1, 1, 2, 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, 6, 5, - 8, 6, 6, 7, 7, 6, 6, 8, 8, 3, - 1, 1, 1, 1, 0, 1, 2, 0, 3, 0, - 3, 3, 1, 3, 3, 0, 6, 0, 7, 0, - 7, 2, 3, 1, 3, 3, 3, 3, 1, 0, - 5, 3, 1, 3, 1, 0, 9, 1, 1, 4, - 1, 1, 2, 3, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 3, 2, 0, 1, - 2, 2, 3, 9, 9, 8, 14, 1, 1, 6, - 5, 2, 6, 7, 3, 5, 0, 0, 3, 2, - 1, 5, 5, 6, 6, 4, 4, 6, 4, 4, - 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, - 6, 2, 4, 6, 4 +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 61, 44, 42, 92, 40, 41, 91, 120, + 93, 60, 62, 123, 125, 99 }; +# endif -static const short yydefact[] = { 66, - 57, 63, 58, 64, 183, 180, 178, 0, 0, 0, - 0, 0, 0, 75, 66, 176, 77, 80, 0, 0, - 192, 0, 0, 61, 0, 65, 67, 69, 68, 70, - 72, 71, 73, 74, 76, 75, 75, 0, 177, 78, - 79, 75, 181, 81, 82, 83, 84, 75, 239, 179, - 239, 0, 0, 200, 193, 194, 182, 228, 229, 185, - 113, 114, 115, 116, 117, 0, 0, 0, 0, 230, - 231, 118, 184, 120, 0, 0, 172, 173, 0, 85, - 85, 240, 236, 62, 211, 212, 213, 235, 195, 196, - 199, 0, 138, 121, 0, 0, 0, 0, 127, 139, - 0, 119, 138, 0, 0, 113, 114, 115, 0, 0, - 0, 186, 0, 86, 87, 88, 89, 90, 0, 214, - 0, 277, 238, 0, 197, 137, 96, 133, 135, 0, - 0, 0, 0, 0, 0, 126, 0, 188, 190, 156, - 157, 154, 155, 158, 153, 149, 150, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, - 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 0, 25, 26, 27, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, - 151, 109, 91, 132, 131, 0, 208, 209, 210, 276, - 261, 0, 0, 0, 0, 85, 248, 249, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 237, 85, 252, 0, 275, 198, - 130, 0, 100, 0, 0, 129, 0, 140, 100, 109, - 109, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 0, 52, 53, 48, 49, 50, 51, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, - 0, 0, 0, 0, 142, 171, 0, 0, 0, 146, - 0, 143, 0, 0, 0, 0, 0, 187, 0, 260, - 242, 0, 241, 0, 0, 54, 0, 0, 0, 0, - 104, 104, 282, 0, 0, 273, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 92, 93, - 94, 95, 97, 136, 134, 123, 124, 125, 128, 122, - 189, 191, 0, 0, 258, 0, 0, 0, 0, 0, - 141, 127, 139, 0, 144, 145, 0, 0, 0, 0, - 0, 0, 111, 109, 206, 217, 218, 219, 224, 220, - 221, 222, 223, 215, 0, 226, 233, 232, 234, 0, - 243, 0, 0, 0, 0, 0, 278, 0, 280, 258, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 98, 99, 101, 0, 0, 0, - 0, 0, 0, 0, 170, 148, 0, 0, 0, 0, - 0, 106, 112, 110, 205, 96, 203, 0, 216, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, - 0, 0, 0, 269, 270, 0, 0, 0, 0, 267, - 266, 0, 283, 0, 0, 0, 0, 160, 0, 0, - 0, 0, 147, 0, 0, 0, 0, 60, 0, 100, - 0, 225, 0, 0, 257, 0, 0, 104, 105, 104, - 0, 0, 0, 0, 0, 262, 263, 257, 0, 0, - 0, 259, 0, 167, 0, 0, 162, 163, 159, 166, - 59, 202, 204, 96, 107, 0, 0, 0, 0, 0, - 264, 265, 0, 279, 281, 0, 0, 268, 271, 272, - 0, 284, 164, 165, 0, 0, 0, 60, 108, 102, - 227, 0, 0, 96, 0, 100, 253, 0, 100, 161, - 168, 169, 201, 0, 207, 0, 246, 0, 0, 255, - 0, 0, 254, 274, 103, 244, 0, 245, 0, 96, - 0, 0, 0, 256, 0, 0, 0, 0, 251, 0, - 0, 250, 0, 247, 0, 0, 0 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 148, 148, 148, 148, 148, 148, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 152, 153, 153, 154, 154, + 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, + 159, 159, 159, 160, 160, 160, 161, 161, 162, 162, + 162, 163, 163, 163, 163, 163, 164, 164, 164, 164, + 164, 164, 164, 165, 165, 165, 165, 166, 166, 167, + 167, 168, 168, 169, 169, 170, 170, 171, 172, 172, + 173, 173, 174, 174, 175, 175, 175, 175, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 177, 178, 178, 179, 179, 180, 180, 180, 180, + 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 184, 184, 185, 185, 186, 186, 187, 187, 189, 188, + 190, 188, 188, 188, 188, 188, 191, 188, 192, 188, + 193, 188, 188, 188, 194, 195, 195, 196, 197, 197, + 197, 198, 198, 199, 199, 199, 199, 200, 201, 201, + 202, 203, 203, 204, 205, 206, 206, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, + 208, 208, 209, 209, 210, 211, 211, 212, 213, 213, + 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 215, 215, 216, 217, 217, 218, 218, 218, 219, 219, + 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, + 223, 223, 223, 223, 223 }; -static const short yydefgoto[] = { 186, - 187, 188, 189, 252, 269, 109, 110, 70, 492, 12, - 71, 14, 36, 37, 38, 42, 48, 119, 323, 231, - 397, 326, 535, 377, 353, 520, 288, 354, 72, 111, - 128, 196, 129, 130, 101, 276, 366, 277, 79, 565, - 15, 16, 18, 17, 192, 240, 241, 57, 21, 55, - 92, 417, 418, 120, 199, 49, 87, 50, 43, 420, - 367, 74, 369, 293, 51, 83, 84, 225, 539, 123, - 306, 500, 400, 226, 227, 228, 229 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 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, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, + 1, 0, 2, 0, 2, 0, 3, 2, 0, 1, + 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, + 2, 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, + 6, 5, 8, 6, 6, 7, 7, 6, 8, 8, + 3, 1, 1, 1, 1, 0, 1, 2, 0, 3, + 0, 3, 3, 1, 3, 3, 0, 6, 0, 7, + 0, 7, 2, 3, 1, 3, 3, 3, 3, 1, + 0, 5, 3, 1, 3, 1, 0, 9, 1, 1, + 4, 1, 1, 2, 3, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 3, 2, 0, + 1, 2, 2, 3, 9, 9, 8, 14, 1, 1, + 6, 5, 2, 6, 7, 3, 5, 0, 0, 3, + 2, 1, 5, 5, 6, 6, 4, 6, 4, 4, + 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, + 6, 2, 4, 6, 4 }; -static const short yypact[] = { 356, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 4, -115, -2, - -52, 93, -4, 51, 593,-32768, 195, 140, 41, 99, --32768, 87, 141,-32768, 125,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 128, 128, 47,-32768,-32768, --32768, 128,-32768,-32768,-32768,-32768,-32768, 128, 251,-32768, - 17, 262, 264, 269,-32768,-32768,-32768,-32768,-32768, 151, --32768,-32768,-32768,-32768,-32768, 287, 292, 3, 13,-32768, --32768,-32768, 113,-32768, 47, 47,-32768,-32768, 840, 290, - 290,-32768,-32768, 88,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -90, 1094,-32768, 158, 164, 107, 151,-32768, 113, - -91,-32768, 1094, 840, 1054, 79, 295, 297, 208, 298, - 616,-32768, 302,-32768,-32768,-32768,-32768,-32768, 1197,-32768, - -14, 1319,-32768, 291,-32768,-32768, 113,-32768, 179, 176, - 1054, 1054, 175, -82, 1054,-32768, 200,-32768, 113,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 241, - 474, 202,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 205,-32768,-32768,-32768, 213, 214, - 215, 802, 1213, 460, 335, 218, 221, 232, 236,-32768, --32768, 245,-32768, 151, 113, 163,-32768,-32768,-32768,-32768, --32768, 331, 1235, 210, 371, 290,-32768,-32768, 241, 474, - 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, - 1054, 1054, 1054, 1054,-32768, 290,-32768, 181,-32768,-32768, - -61, 1133,-32768, 26, -64,-32768, 242, 113,-32768, 245, - 245,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 247,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 249, 840, - 840, 840, 840, 840,-32768,-32768, -30, 517, -10,-32768, - -40,-32768, 840, 840, 840, 840, 10,-32768, 252,-32768, - 151, 759,-32768, 884, 884,-32768, 884, 1197, 1054, 1054, - 19, 144,-32768, 759, 119, 254, 258, 261, 263, 265, - 266, 759, 759, 364, 268, 1197, 1054, 1054,-32768,-32768, --32768,-32768,-32768,-32768,-32768, -31,-32768,-32768,-32768, -31, --32768,-32768, 840, 840,-32768, 271, 273, 275, 276, 840, --32768, 260, 616, -6,-32768,-32768, 277, 278, 387, 286, - 404, 420,-32768, 245, 1149,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 374, 840,-32768,-32768,-32768,-32768, 294, --32768, 296, 884, 759, 759, 20,-32768, 25,-32768,-32768, - 884, 299, 1054, 1054, 1054, 1054, 1054, 301, 303, 1054, - 1054, 884, 759, 305,-32768,-32768,-32768, 306, 307, 32, - 840, 840, 840, 840,-32768,-32768, 300, 840, 840, 1054, - 840,-32768,-32768,-32768,-32768, 113, 310, 308,-32768, 411, - 8, 432, 434, 311, 315, 319, 884, 428, 884, 320, - 322, 884, 323, 113,-32768, 324, 326, 884, 884, 113, --32768, 325,-32768, 1054, 840, 840, 1054,-32768, 327, 336, - 330, 343,-32768, 342, 346, 136, 347, 154, 1168,-32768, - 352,-32768, 884, 884, 1054, 884, 884, 354,-32768, 354, - 884, 355, 1054, 1054, 1054,-32768,-32768, 1054, 759, 353, - 357,-32768, 840,-32768, 840, 840,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 113, 56, 447, 365, 359, 759, 73, --32768,-32768, 454,-32768,-32768, 340, 884,-32768,-32768,-32768, - 100,-32768,-32768,-32768, 366, 367, 368, 154,-32768, 461, --32768, 494, 5,-32768, 1054,-32768,-32768, 369,-32768,-32768, --32768,-32768,-32768, 504,-32768, 884,-32768, 1008, 7, -61, - 759, 182,-32768, -31,-32768,-32768, 379,-32768, 1008,-32768, - 501, 502, 382, -61, 884, 884, 505, 452,-32768, 884, - 507,-32768, 884,-32768, 520, 521,-32768 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned short int yydefact[] = +{ + 67, 58, 64, 59, 65, 183, 180, 178, 0, 0, + 0, 0, 0, 0, 76, 0, 67, 176, 78, 81, + 0, 0, 192, 0, 0, 62, 0, 66, 68, 70, + 69, 71, 73, 72, 74, 75, 77, 76, 76, 0, + 1, 177, 79, 80, 76, 181, 82, 83, 84, 85, + 76, 239, 179, 239, 0, 0, 200, 193, 194, 182, + 228, 229, 185, 114, 115, 116, 117, 118, 0, 0, + 0, 0, 230, 231, 119, 184, 121, 0, 0, 172, + 173, 0, 86, 86, 240, 236, 63, 211, 212, 213, + 235, 195, 196, 199, 0, 139, 122, 0, 0, 0, + 0, 128, 140, 0, 120, 139, 0, 0, 114, 115, + 116, 0, 0, 0, 186, 0, 87, 88, 89, 90, + 91, 0, 214, 0, 276, 238, 0, 197, 138, 97, + 134, 136, 0, 0, 0, 0, 0, 0, 127, 0, + 188, 190, 157, 158, 155, 156, 159, 154, 150, 151, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, + 15, 16, 11, 12, 13, 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, 153, 152, 110, 92, 133, 132, 0, 208, 209, + 210, 275, 261, 0, 0, 0, 0, 86, 248, 249, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 237, 86, 252, 0, 274, + 198, 131, 0, 101, 0, 0, 130, 0, 141, 101, + 110, 110, 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, 0, 0, 0, 143, 171, 0, 0, 0, + 147, 0, 144, 0, 0, 0, 0, 187, 0, 260, + 242, 0, 241, 0, 0, 55, 0, 0, 0, 0, + 105, 105, 281, 0, 0, 272, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 93, 94, 95, + 96, 98, 137, 135, 124, 125, 126, 129, 123, 189, + 191, 0, 0, 258, 0, 0, 0, 0, 0, 142, + 128, 140, 0, 145, 146, 0, 0, 0, 0, 0, + 112, 110, 206, 217, 218, 219, 224, 220, 221, 222, + 223, 215, 0, 226, 233, 232, 234, 0, 243, 0, + 0, 0, 0, 0, 277, 0, 279, 258, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 99, 100, 102, 0, 0, 0, 0, 0, 0, + 0, 170, 149, 0, 0, 0, 0, 107, 113, 111, + 205, 97, 203, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 284, 0, 0, 0, 268, + 269, 0, 0, 0, 0, 266, 0, 282, 0, 0, + 0, 0, 161, 0, 0, 0, 0, 148, 0, 0, + 0, 61, 0, 101, 0, 225, 0, 0, 257, 0, + 0, 105, 106, 105, 0, 0, 0, 0, 0, 262, + 263, 257, 0, 0, 0, 259, 0, 167, 0, 0, + 163, 164, 160, 60, 202, 204, 97, 108, 0, 0, + 0, 0, 0, 264, 265, 0, 278, 280, 0, 0, + 267, 270, 271, 0, 283, 165, 166, 0, 0, 0, + 61, 109, 103, 227, 0, 0, 97, 0, 101, 253, + 0, 101, 162, 168, 169, 201, 0, 207, 0, 246, + 0, 0, 255, 0, 0, 254, 273, 104, 244, 0, + 245, 0, 97, 0, 0, 0, 256, 0, 0, 0, + 0, 251, 0, 0, 250, 0, 247 }; -static const short yypgoto[] = { 402, - 408, 414, 415, 329, 332, -203,-32768, 0, 15, 455, - 11,-32768,-32768,-32768, 204,-32768,-32768, -174, -286, -380, --32768, -231,-32768, -296, 45,-32768, -228,-32768,-32768, -24, - 309, -278,-32768, 440, 449, -69, -108, -179, 168,-32768, --32768, 529,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 467,-32768,-32768,-32768,-32768,-32768,-32768, - -429, -74, 118, -159,-32768, 498,-32768,-32768,-32768,-32768, --32768, 74, 171,-32768,-32768,-32768,-32768 +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = +{ + -1, 188, 189, 190, 252, 269, 111, 112, 72, 484, + 12, 73, 14, 37, 38, 39, 44, 50, 121, 321, + 231, 393, 324, 527, 374, 350, 512, 287, 351, 74, + 113, 130, 197, 131, 132, 103, 276, 363, 277, 81, + 15, 16, 17, 19, 18, 193, 240, 241, 59, 22, + 57, 94, 412, 413, 122, 200, 51, 89, 52, 45, + 415, 364, 76, 366, 292, 53, 85, 86, 225, 531, + 125, 305, 492, 396, 226, 227, 228, 229 }; - -#define YYLAST 1445 - - -static const short yytable[] = { 11, - 73, 297, 190, 279, 281, 379, 96, 330, 197, 112, - 13, 331, 332, 296, 11, 296, 22, 58, 59, 373, - 98, 61, 62, 63, 64, 13, 1, 2, 427, 3, - 4, 298, 82, 429, 138, 458, 191, 392, 351, 396, - 85, 135, 124, 396, 100, 319, 320, 23, 19, 125, - 135, 316, 136, 303, 65, 352, 307, 308, 309, 310, - 311, 237, 20, 314, 315, 428, 321, 322, 127, 102, - 428, 103, 100, 77, 78, 319, 320, 328, 127, 24, - 139, -54, -54, 11, 351, 27, 28, 29, 30, 31, - 32, 33, 340, 34, 195, 395, 321, 322, 344, 140, - 141, 1, 340, 346, 3, 25, 234, 235, 547, 341, - 238, 58, 59, 518, 98, 61, 62, 63, 64, 553, - 1, 2, 340, 3, 4, 414, 340, 26, 198, 58, - 59, 345, 60, 61, 62, 63, 64, 407, 1, 2, - 340, 3, 4, 540, 537, 97, 548, 66, 65, 462, - 67, 376, 102, 68, 103, 69, 99, 56, 394, 102, - 86, 103, 319, 320, 447, 327, 65, 1, 448, 554, - 3, 504, 52, 505, 44, 45, 46, 2, 292, 47, - 4, 35, 395, 321, 322, 421, 301, 302, 292, 304, - 305, 292, 292, 292, 292, 292, 312, 313, 292, 292, - 335, 336, 337, 338, 339, 525, 289, 127, 396, 526, - 142, 143, 551, 347, 348, 349, 350, 368, 294, 368, - 368, 295, 368, 433, 54, 435, 436, 437, 495, 368, - 53, 441, 525, 40, 190, 41, 529, 368, 368, 75, - 76, 66, 104, 105, 67, 80, 102, 68, 103, 69, - 133, 81, 102, 343, 103, 396, 381, 396, 35, 66, - 319, 320, 67, 398, 399, 68, 82, 69, 191, 102, - 405, 103, 489, 195, 374, 375, 378, 102, 89, 103, - 90, 321, 322, 317, 318, 91, 93, 482, 319, 320, - 94, 195, 393, 292, 542, 95, 131, 544, 368, 368, - 368, -55, 132, -56, 144, 193, 368, 230, 395, 321, - 322, 232, 233, 508, 509, 510, 236, 368, 368, 538, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 416, 449, 450, 451, 452, 549, 239, 270, 454, 455, - 271, 457, 113, 114, 115, 116, 117, 118, 272, 273, - 274, 282, 368, 283, 368, -175, 284, 368, 292, 434, - 292, 292, 292, 368, 368, 440, 292, 285, -62, 1, - 2, 286, 3, 4, 5, 480, 481, 287, 290, 296, - 6, 7, 333, 329, 334, 456, 382, 355, 368, 368, - 383, 368, 368, 384, 390, 385, 368, 386, 387, 8, - 391, 406, 9, 401, 368, 402, 10, 403, 404, 408, - 409, 370, 371, 515, 372, 516, 517, 410, 411, 479, - 412, 380, 292, 413, 368, 419, 422, 461, 423, 388, - 389, 469, 368, 438, 494, 439, 432, 444, 445, 446, - 499, 453, 459, 463, 460, 464, 465, 466, 292, 292, - 292, 467, 447, 499, 471, 473, 474, 491, 475, 483, - 478, 368, 485, 521, 58, 59, 368, 98, 106, 107, - 108, 64, 484, 1, 2, 486, 3, 4, 487, 527, - 368, 368, 488, 490, 496, 368, 503, 507, 368, 513, - 424, 425, 426, 514, 253, 254, 523, 522, 431, 428, - 541, 65, 530, 531, 532, 536, 534, 545, 543, 442, - 443, 552, 555, 556, 557, 561, 560, 491, 563, 566, - 567, 58, 59, 221, 98, 106, 107, 108, 64, 222, - 1, 2, 533, 3, 4, 223, 224, 299, 122, 519, - 325, 300, 137, 39, 468, 134, 470, 121, 88, 472, - 430, 511, 0, 0, 0, 476, 477, 0, 65, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 0, 0, 0, 0, 0, 0, 0, - 497, 498, 0, 501, 502, 0, 0, 0, 506, 0, - 0, 0, -174, 0, 66, 0, 512, 67, 0, 0, - 68, 0, 69, 280, 0, -62, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 524, 6, 7, 0, - 58, 59, 0, 0, 528, 0, 0, 0, 0, 1, - 2, 0, 3, 4, 0, 145, 8, 0, 0, 9, - 0, 0, 0, 10, 0, 0, 0, 0, 146, 147, - 0, 66, 0, 546, 67, 0, 0, 68, 550, 69, - 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 558, 559, 0, 0, 0, 562, 0, 0, - 564, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 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, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 0, 175, 176, 177, 178, 0, 179, - 180, 181, 0, 0, 0, 0, 0, 0, 0, 102, - 0, 103, 0, 182, 0, 0, 183, 0, 184, 0, - 185, 356, 357, 58, 59, 358, 0, 0, 0, 0, - 0, 0, 1, 2, 0, 3, 4, 0, 359, 360, - 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 362, 363, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 58, 59, 364, 98, - 106, 107, 108, 64, 0, 1, 2, 0, 3, 4, - 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, - 0, 0, 0, 65, 58, 59, 0, 98, 106, 107, - 108, 64, 0, 1, 2, 0, 3, 4, 0, 0, - 0, 0, 0, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 0, 175, 176, 177, - 178, 65, 179, 180, 181, 0, 356, 357, 58, 59, - 358, 0, 102, 0, 103, 0, 0, 1, 2, 365, - 3, 4, 0, 359, 360, 361, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 362, 363, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 364, 0, 0, 66, 0, 0, 67, - 0, 275, 68, 0, 69, 0, 0, 0, 0, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 66, 0, 0, 67, 0, 0, - 68, 0, 69, 0, 0, 0, 0, 0, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 0, 175, 176, 177, 178, 0, 179, 180, 181, - 356, 357, 0, 0, 358, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 365, 0, 0, 359, 360, 361, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 364, 58, 59, - 0, 98, 61, 62, 63, 64, 0, 1, 2, 0, - 3, 4, 0, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 0, 0, 58, 59, - 0, 98, 61, 62, 63, 64, 0, 1, 2, 0, - 3, 4, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 126, 175, 176, 177, 178, - 0, 179, 180, 181, 0, 65, 0, 58, 59, 0, - 98, 61, 62, 63, 64, 0, 1, 2, 365, 3, - 4, 0, 0, 58, 59, 0, 98, 61, 62, 63, - 64, 0, 1, 2, 324, 3, 4, 0, 0, 0, - 0, 0, 58, 59, 65, 98, 61, 62, 63, 64, - 415, 1, 2, 0, 3, 4, 0, 0, 66, 0, - 65, 67, 0, 0, 68, 0, 69, 0, 0, 493, - 0, 58, 59, 0, 194, 61, 62, 63, 64, 65, - 1, 2, 0, 3, 4, 0, 0, 58, 59, 0, - 98, 106, 107, 108, 64, 0, 1, 2, 66, 3, - 4, 67, 0, 0, 68, 0, 69, 0, 65, 58, - 59, 0, 291, 61, 62, 63, 64, 0, 1, 2, - 0, 3, 4, 0, 65, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, - 67, 0, 0, 68, 0, 69, 65, 0, 0, 0, - 0, 0, 0, 66, 0, 0, 67, 0, 0, 68, - 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 66, 0, 0, 67, 0, 0, 68, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 67, 0, 0, 68, 0, 69, - 0, 0, 0, 0, 0, 0, 0, 66, 200, 0, - 67, 0, 0, 68, 0, 278, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 201, 202, 0, 66, - 0, 0, 67, 0, 0, 68, 0, 69, 203, 204, - 205, 206, 207, 208, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 209, 210, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, - 213, 0, 0, 214, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 215, 216, 176, 177, - 178, 217, 218, 219, 220 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -399 +static const short int yypact[] = +{ + 406, -399, -399, -399, -399, -399, -399, -399, -26, -114, + -16, -53, 92, -11, 54, 136, 526, -399, 247, 173, + 43, 49, -399, 62, 194, -399, 814, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, 134, 134, 99, + -399, -399, -399, -399, 134, -399, -399, -399, -399, -399, + 134, 212, -399, -1, 219, 225, 253, -399, -399, -399, + -399, -399, 135, -399, -399, -399, -399, -399, 271, 275, + 3, 33, -399, -399, -399, 160, -399, 99, 99, -399, + -399, 1029, 287, 287, -399, -399, 220, -399, -399, -399, + -399, -399, -399, -399, 20, 1071, -399, 141, 148, 105, + 135, -399, 160, -75, -399, 1071, 1029, 1174, 32, 286, + 293, 151, 294, 590, -399, 298, -399, -399, -399, -399, + -399, 1190, -399, -13, 1313, -399, 289, -399, -399, 160, + -399, 170, 167, 1174, 1174, 165, -68, 1174, -399, 174, + -399, 160, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, 495, 591, 176, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + 177, 178, 182, 183, 776, 1212, 123, 305, 187, 188, + 189, -399, -399, 193, -399, 135, 160, 266, -399, -399, + -399, -399, -399, 284, 1229, 283, 325, 287, -399, -399, + 495, 591, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, + 1174, 1174, 1174, 1174, 1174, -399, 287, -399, 144, -399, + -399, -4, 1110, -399, -63, -110, -399, 204, 160, -399, + 193, 193, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, 211, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, 214, + 1029, 1029, 1029, 1029, 1029, -399, -399, 79, 494, -111, + -399, -66, -399, 1029, 1029, 1029, 39, -399, 216, -399, + 135, 733, -399, 858, 858, -399, 858, 1190, 1174, 1174, + 50, 111, -399, 733, 97, 215, 230, 231, 232, 233, + 234, 733, 733, 322, 1190, 1174, 1174, -399, -399, -399, + -399, -399, -399, -399, -27, -399, -399, -399, -27, -399, + -399, 1029, 1029, -399, 235, 236, 239, 240, 1029, -399, + 237, 590, 26, -399, -399, 241, 242, 345, 360, 374, + -399, 193, 1126, -399, -399, -399, -399, -399, -399, -399, + -399, 328, 1029, -399, -399, -399, -399, 249, -399, 252, + 858, 733, 733, 11, -399, 18, -399, -399, 858, 250, + 1174, 1174, 1174, 1174, 1174, 256, 257, 1174, 858, 733, + 259, -399, -399, -399, 262, 264, -34, 1029, 1029, 1029, + 1029, -399, -399, 258, 1029, 1029, 1174, -399, -399, -399, + -399, 160, 265, 267, -399, 384, -61, 390, 393, 272, + 281, 282, 858, 413, 858, 295, 296, 858, 297, 160, + -399, 301, 302, 858, 858, 160, 300, -399, 1174, 1029, + 1029, 1174, -399, 304, 285, 306, 307, -399, 308, 310, + 118, 38, 1145, -399, 311, -399, 858, 858, 1174, 858, + 858, 315, -399, 315, 858, 316, 1174, 1174, 1174, -399, + -399, 1174, 733, 317, 319, -399, 1029, -399, 1029, 1029, + -399, -399, -399, -399, -399, -399, 160, 149, 421, 326, + 314, 733, 19, -399, -399, 412, -399, -399, 321, 858, + -399, -399, -399, 36, -399, -399, -399, 327, 329, 330, + 38, -399, 416, -399, 451, 2, -399, 1174, -399, -399, + 333, -399, -399, -399, -399, -399, 461, -399, 858, -399, + 982, 5, -4, 733, 210, -399, -27, -399, -399, 335, + -399, 982, -399, 457, 464, 344, -4, 858, 858, 468, + 417, -399, 858, 471, -399, 858, -399 }; -static const short yycheck[] = { 0, - 25, 205, 111, 183, 184, 302, 4, 239, 23, 79, - 0, 240, 241, 9, 15, 9, 132, 5, 6, 298, - 8, 9, 10, 11, 12, 15, 14, 15, 9, 17, - 18, 206, 16, 9, 104, 416, 111, 316, 29, 326, - 24, 133, 133, 330, 69, 107, 108, 50, 45, 140, - 133, 226, 144, 213, 42, 46, 216, 217, 218, 219, - 220, 144, 59, 223, 224, 46, 128, 129, 93, 134, - 46, 136, 97, 27, 28, 107, 108, 142, 103, 132, - 105, 3, 4, 84, 29, 35, 36, 37, 38, 39, - 40, 41, 133, 43, 119, 127, 128, 129, 278, 21, - 22, 14, 133, 144, 17, 13, 131, 132, 538, 140, - 135, 5, 6, 494, 8, 9, 10, 11, 12, 549, - 14, 15, 133, 17, 18, 354, 133, 132, 143, 5, - 6, 142, 8, 9, 10, 11, 12, 144, 14, 15, - 133, 17, 18, 524, 140, 143, 140, 135, 42, 142, - 138, 133, 134, 141, 136, 143, 144, 17, 318, 134, - 144, 136, 107, 108, 133, 140, 42, 14, 137, 550, - 17, 468, 132, 470, 35, 36, 37, 15, 203, 40, - 18, 131, 127, 128, 129, 365, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 270, 271, 272, 273, 274, 133, 196, 232, 495, 137, - 3, 4, 31, 283, 284, 285, 286, 292, 9, 294, - 295, 12, 297, 383, 138, 385, 386, 387, 460, 304, - 132, 391, 133, 39, 343, 41, 137, 312, 313, 36, - 37, 135, 75, 76, 138, 42, 134, 141, 136, 143, - 144, 48, 134, 278, 136, 542, 138, 544, 131, 135, - 107, 108, 138, 333, 334, 141, 16, 143, 343, 134, - 340, 136, 137, 298, 299, 300, 133, 134, 17, 136, - 17, 128, 129, 103, 104, 17, 136, 447, 107, 108, - 4, 316, 317, 318, 526, 4, 139, 529, 373, 374, - 375, 7, 139, 7, 7, 4, 381, 17, 127, 128, - 129, 133, 137, 473, 474, 475, 142, 392, 393, 523, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 355, 401, 402, 403, 404, 539, 137, 136, 408, 409, - 136, 411, 53, 54, 55, 56, 57, 58, 136, 136, - 136, 17, 427, 136, 429, 0, 136, 432, 383, 384, - 385, 386, 387, 438, 439, 390, 391, 136, 13, 14, - 15, 136, 17, 18, 19, 445, 446, 133, 48, 9, - 25, 26, 136, 142, 136, 410, 133, 136, 463, 464, - 133, 466, 467, 133, 31, 133, 471, 133, 133, 44, - 133, 142, 47, 133, 479, 133, 51, 133, 133, 133, - 133, 294, 295, 483, 297, 485, 486, 31, 133, 444, - 17, 304, 447, 4, 499, 52, 133, 17, 133, 312, - 313, 4, 507, 133, 459, 133, 138, 133, 133, 133, - 465, 142, 133, 12, 137, 12, 136, 133, 473, 474, - 475, 133, 133, 478, 133, 133, 133, 458, 133, 133, - 136, 536, 133, 17, 5, 6, 541, 8, 9, 10, - 11, 12, 137, 14, 15, 133, 17, 18, 137, 140, - 555, 556, 137, 137, 133, 560, 133, 133, 563, 137, - 373, 374, 375, 137, 21, 22, 138, 133, 381, 46, - 525, 42, 137, 137, 137, 12, 46, 4, 140, 392, - 393, 133, 12, 12, 133, 64, 12, 518, 12, 0, - 0, 5, 6, 122, 8, 9, 10, 11, 12, 122, - 14, 15, 518, 17, 18, 122, 122, 209, 84, 495, - 232, 210, 103, 15, 427, 97, 429, 81, 51, 432, - 380, 478, -1, -1, -1, 438, 439, -1, 42, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, -1, -1, -1, -1, -1, -1, -1, - 463, 464, -1, 466, 467, -1, -1, -1, 471, -1, - -1, -1, 0, -1, 135, -1, 479, 138, -1, -1, - 141, -1, 143, 144, -1, 13, 14, 15, -1, 17, - 18, 19, -1, -1, -1, -1, 499, 25, 26, -1, - 5, 6, -1, -1, 507, -1, -1, -1, -1, 14, - 15, -1, 17, 18, -1, 20, 44, -1, -1, 47, - -1, -1, -1, 51, -1, -1, -1, -1, 33, 34, - -1, 135, -1, 536, 138, -1, -1, 141, 541, 143, - 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 555, 556, -1, -1, -1, 560, -1, -1, - 563, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, -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, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, -1, 119, 120, 121, 122, -1, 124, - 125, 126, -1, -1, -1, -1, -1, -1, -1, 134, - -1, 136, -1, 138, -1, -1, 141, -1, 143, -1, - 145, 3, 4, 5, 6, 7, -1, -1, -1, -1, - -1, -1, 14, 15, -1, 17, 18, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 5, 6, 50, 8, - 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, - -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, - -1, -1, -1, 42, 5, 6, -1, 8, 9, 10, - 11, 12, -1, 14, 15, -1, 17, 18, -1, -1, - -1, -1, -1, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, -1, 119, 120, 121, - 122, 42, 124, 125, 126, -1, 3, 4, 5, 6, - 7, -1, 134, -1, 136, -1, -1, 14, 15, 141, - 17, 18, -1, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 50, -1, -1, 135, -1, -1, 138, - -1, 140, 141, -1, 143, -1, -1, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 135, -1, -1, 138, -1, -1, - 141, -1, 143, -1, -1, -1, -1, -1, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, -1, 119, 120, 121, 122, -1, 124, 125, 126, - 3, 4, -1, -1, 7, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 141, -1, -1, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 33, 34, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 50, 5, 6, - -1, 8, 9, 10, 11, 12, -1, 14, 15, -1, - 17, 18, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, -1, -1, -1, - -1, -1, -1, -1, -1, 42, -1, -1, 5, 6, - -1, 8, 9, 10, 11, 12, -1, 14, 15, -1, - 17, 18, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 32, 119, 120, 121, 122, - -1, 124, 125, 126, -1, 42, -1, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, 141, 17, - 18, -1, -1, 5, 6, -1, 8, 9, 10, 11, - 12, -1, 14, 15, 32, 17, 18, -1, -1, -1, - -1, -1, 5, 6, 42, 8, 9, 10, 11, 12, - 32, 14, 15, -1, 17, 18, -1, -1, 135, -1, - 42, 138, -1, -1, 141, -1, 143, -1, -1, 32, - -1, 5, 6, -1, 8, 9, 10, 11, 12, 42, - 14, 15, -1, 17, 18, -1, -1, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, 135, 17, - 18, 138, -1, -1, 141, -1, 143, -1, 42, 5, - 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, - -1, 17, 18, -1, 42, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, - 138, -1, -1, 141, -1, 143, 42, -1, -1, -1, - -1, -1, -1, 135, -1, -1, 138, -1, -1, 141, - -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 135, -1, -1, 138, -1, -1, 141, -1, - 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, - -1, -1, -1, -1, -1, -1, -1, 135, 30, -1, - 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 48, 49, -1, 135, - -1, -1, 138, -1, -1, 141, -1, 143, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 100, 101, - 102, -1, -1, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126 +/* YYPGOTO[NTERM-NUM]. */ +static const short int yypgoto[] = +{ + -399, 361, 362, 363, 274, 279, -198, -399, 0, -19, + 407, 9, -399, -399, -399, 113, -399, -399, -177, -307, + -398, -399, -236, -399, -299, 7, -399, -212, -399, -399, + -25, 263, -210, -399, 391, 398, -69, -109, -180, 179, + -399, -399, 482, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, 418, -399, -399, -399, -399, -399, + -399, -369, -73, 100, -158, -399, 454, -399, -399, -399, + -399, -399, 42, 137, -399, -399, -399, -399 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* 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 -176 +static const short int yytable[] = +{ + 11, 75, 376, 328, 191, 279, 281, 98, 296, 13, + 198, 295, 114, 451, 295, 84, 11, 392, 23, 20, + 422, 392, 338, 87, 104, 13, 105, 424, 329, 330, + 297, 343, 326, 21, 24, -55, -55, 140, 60, 61, + 192, 100, 63, 64, 65, 66, 102, 1, 2, 314, + 3, 4, 1, 142, 143, 3, 302, 423, 137, 306, + 307, 308, 309, 310, 423, 137, 313, 338, 348, 138, + 129, 104, 338, 105, 102, 67, 237, 325, 344, 25, + 129, 455, 141, 317, 318, 349, 11, 370, 510, 28, + 29, 30, 31, 32, 33, 34, 196, 35, 342, 441, + 391, 319, 320, 442, 388, 26, 317, 318, 234, 235, + 60, 61, 238, 100, 63, 64, 65, 66, 532, 1, + 2, 27, 3, 4, 319, 320, 79, 80, 60, 61, + 199, 100, 108, 109, 110, 66, 40, 1, 2, 409, + 3, 4, 529, 88, 546, 540, 99, 67, 317, 318, + 77, 78, 517, 126, 144, 145, 518, 82, 390, 338, + 127, 539, 496, 83, 497, 67, 319, 320, 68, 517, + 403, 69, 545, 521, 70, 54, 71, 101, 348, 291, + 392, 55, 416, 373, 104, 36, 105, 300, 301, 291, + 303, 304, 291, 291, 291, 291, 291, 311, 312, 291, + 56, 333, 334, 335, 336, 337, 288, 129, 46, 47, + 48, 58, 338, 49, 345, 346, 347, 487, 365, 339, + 365, 365, 428, 365, 430, 431, 432, 392, 84, 392, + 365, 104, 191, 105, 1, 378, 91, 3, 365, 365, + 68, 543, 92, 69, 375, 104, 70, 105, 71, 135, + 315, 316, 104, 341, 105, 482, 106, 107, 68, 317, + 318, 69, 394, 395, 70, 36, 71, 280, 192, 401, + 93, 95, 196, 371, 372, 96, 391, 319, 320, 97, + 133, 2, 534, 475, 4, 536, 42, 134, 43, 196, + 389, 291, 293, -56, 104, 294, 105, 365, 365, 365, + -57, 146, 194, 232, 233, 365, 230, 236, 500, 501, + 502, 239, 270, 271, 272, 365, 365, 530, 273, 274, + 317, 318, 282, 283, 284, 285, 286, 411, 443, 444, + 445, 446, 289, 541, 295, 448, 449, 391, 319, 320, + 115, 116, 117, 118, 119, 120, 327, 331, 379, 365, + 332, 365, 352, 387, 365, 291, 429, 291, 291, 291, + 365, 365, 435, 380, 381, 382, 383, 384, 397, 398, + 473, 474, 399, 400, 404, 405, 406, 407, 408, 402, + 414, 450, 417, 365, 365, 418, 365, 365, 427, 433, + 434, 365, 438, 367, 368, 439, 369, 440, 452, 365, + 447, 454, 456, 377, 453, 457, -175, 507, 458, 508, + 509, 385, 386, 472, 459, 460, 291, 462, 365, -63, + 1, 2, 477, 3, 4, 5, 365, 486, 441, 464, + 466, 6, 7, 491, 467, 468, 471, 476, 513, 478, + 479, 291, 291, 291, 488, 480, 491, 481, 495, 499, + 8, 483, 515, 9, 505, 365, 506, 10, 423, 514, + 365, 519, 526, 528, 522, 537, 523, 524, 544, 547, + 419, 420, 421, 535, 365, 365, 548, 549, 426, 365, + 552, 553, 365, 555, 298, 222, 223, 224, 436, 437, + 299, 525, 533, 124, 511, 323, 139, 136, 41, 60, + 61, 123, 100, 108, 109, 110, 66, 90, 1, 2, + 483, 3, 4, 503, 425, 0, 0, 0, 0, 0, + 0, 0, 461, 0, 463, 0, -174, 465, 0, 0, + 0, 0, 0, 469, 470, 0, 67, 0, 0, -63, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 6, 7, 0, 0, 0, 489, 490, 0, 493, + 494, 0, 0, 0, 498, 0, 0, 0, 0, 0, + 8, 0, 504, 9, 0, 0, 0, 10, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 0, 0, + 0, 516, 0, 0, 0, 60, 61, 0, 0, 520, + 0, 0, 0, 0, 1, 2, 0, 3, 4, 0, + 147, 0, 253, 254, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 149, 0, 0, 0, 538, 68, + 0, 0, 69, 542, 0, 70, 0, 71, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 550, 551, 0, + 0, 0, 554, 0, 0, 556, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 0, 0, 0, 0, 0, 0, 0, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 0, 0, 0, 0, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 0, 180, 0, 181, 182, 183, 0, 0, 0, + 0, 0, 0, 0, 104, 0, 105, 0, 184, 0, + 0, 185, 0, 186, 0, 187, 353, 354, 60, 61, + 355, 0, 0, 0, 0, 0, 0, 1, 2, 0, + 3, 4, 0, 356, 357, 358, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 359, 360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 60, 61, 361, 100, 108, 109, 110, 66, 0, + 1, 2, 0, 3, 4, 0, 0, 0, 0, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 0, 0, 67, 60, + 61, 0, 62, 63, 64, 65, 66, 0, 1, 2, + 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 0, 180, 67, 181, 182, 183, + 0, 353, 354, 60, 61, 355, 0, 104, 0, 105, + 0, 0, 1, 2, 362, 3, 4, 0, 356, 357, + 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 359, 360, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, + 0, 68, 0, 0, 69, 0, 275, 70, 0, 71, + 0, 0, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, + 0, 0, 0, 0, 0, 0, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 180, 0, 181, 182, 183, 353, 354, 0, 0, 355, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, + 0, 0, 356, 357, 358, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 359, 360, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 361, 0, 60, 61, 0, 100, 108, 109, + 110, 66, 0, 1, 2, 0, 3, 4, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 0, 0, 60, 61, 0, 100, + 63, 64, 65, 66, 0, 1, 2, 0, 3, 4, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 128, 180, 0, 181, 182, 183, 0, + 0, 0, 0, 67, 0, 60, 61, 0, 100, 63, + 64, 65, 66, 362, 1, 2, 0, 3, 4, 0, + 0, 60, 61, 0, 100, 63, 64, 65, 66, 0, + 1, 2, 322, 3, 4, 0, 0, 0, 0, 0, + 60, 61, 67, 100, 63, 64, 65, 66, 410, 1, + 2, 0, 3, 4, 68, 0, 0, 69, 67, 0, + 70, 0, 71, 0, 0, 0, 0, 485, 0, 60, + 61, 0, 100, 63, 64, 65, 66, 67, 1, 2, + 0, 3, 4, 0, 0, 60, 61, 0, 195, 63, + 64, 65, 66, 0, 1, 2, 68, 3, 4, 69, + 0, 0, 70, 0, 71, 0, 67, 60, 61, 0, + 100, 108, 109, 110, 66, 0, 1, 2, 0, 3, + 4, 0, 67, 0, 60, 61, 0, 290, 63, 64, + 65, 66, 0, 1, 2, 68, 3, 4, 69, 0, + 0, 70, 0, 71, 67, 0, 0, 0, 0, 0, + 0, 68, 0, 0, 69, 0, 0, 70, 0, 71, + 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 69, 0, 0, 70, 0, 71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, + 0, 0, 0, 0, 0, 68, 0, 0, 69, 0, + 0, 70, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 201, 0, 0, 0, 68, 0, 0, + 69, 0, 0, 70, 0, 278, 0, 0, 0, 0, + 0, 202, 203, 0, 68, 0, 0, 69, 0, 0, + 70, 0, 71, 204, 205, 206, 207, 208, 209, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 210, 211, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, + 0, 215, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 216, 217, 218, 219, 220, 221 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const short int yycheck[] = +{ + 0, 26, 301, 239, 113, 185, 186, 4, 206, 0, + 23, 9, 81, 411, 9, 16, 16, 324, 132, 45, + 9, 328, 133, 24, 134, 16, 136, 9, 240, 241, + 207, 142, 142, 59, 50, 3, 4, 106, 5, 6, + 113, 8, 9, 10, 11, 12, 71, 14, 15, 226, + 17, 18, 14, 21, 22, 17, 214, 46, 133, 217, + 218, 219, 220, 221, 46, 133, 224, 133, 29, 144, + 95, 134, 133, 136, 99, 42, 144, 140, 144, 132, + 105, 142, 107, 110, 111, 46, 86, 297, 486, 35, + 36, 37, 38, 39, 40, 41, 121, 43, 278, 133, + 127, 128, 129, 137, 314, 13, 110, 111, 133, 134, + 5, 6, 137, 8, 9, 10, 11, 12, 516, 14, + 15, 132, 17, 18, 128, 129, 27, 28, 5, 6, + 143, 8, 9, 10, 11, 12, 0, 14, 15, 351, + 17, 18, 140, 144, 542, 140, 143, 42, 110, 111, + 37, 38, 133, 133, 3, 4, 137, 44, 316, 133, + 140, 530, 461, 50, 463, 42, 128, 129, 135, 133, + 144, 138, 541, 137, 141, 132, 143, 144, 29, 204, + 487, 132, 362, 133, 134, 131, 136, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 138, 270, 271, 272, 273, 274, 197, 232, 35, 36, + 37, 17, 133, 40, 283, 284, 285, 453, 291, 140, + 293, 294, 380, 296, 382, 383, 384, 534, 16, 536, + 303, 134, 341, 136, 14, 138, 17, 17, 311, 312, + 135, 31, 17, 138, 133, 134, 141, 136, 143, 144, + 106, 107, 134, 278, 136, 137, 77, 78, 135, 110, + 111, 138, 331, 332, 141, 131, 143, 144, 341, 338, + 17, 136, 297, 298, 299, 4, 127, 128, 129, 4, + 139, 15, 518, 441, 18, 521, 39, 139, 41, 314, + 315, 316, 9, 7, 134, 12, 136, 370, 371, 372, + 7, 7, 4, 133, 137, 378, 17, 142, 466, 467, + 468, 137, 136, 136, 136, 388, 389, 515, 136, 136, + 110, 111, 17, 136, 136, 136, 133, 352, 397, 398, + 399, 400, 48, 531, 9, 404, 405, 127, 128, 129, + 53, 54, 55, 56, 57, 58, 142, 136, 133, 422, + 136, 424, 136, 31, 427, 380, 381, 382, 383, 384, + 433, 434, 387, 133, 133, 133, 133, 133, 133, 133, + 439, 440, 133, 133, 133, 133, 31, 17, 4, 142, + 52, 406, 133, 456, 457, 133, 459, 460, 138, 133, + 133, 464, 133, 293, 294, 133, 296, 133, 133, 472, + 142, 17, 12, 303, 137, 12, 0, 476, 136, 478, + 479, 311, 312, 438, 133, 133, 441, 4, 491, 13, + 14, 15, 137, 17, 18, 19, 499, 452, 133, 133, + 133, 25, 26, 458, 133, 133, 136, 133, 17, 133, + 133, 466, 467, 468, 133, 137, 471, 137, 133, 133, + 44, 451, 138, 47, 137, 528, 137, 51, 46, 133, + 533, 140, 46, 12, 137, 4, 137, 137, 133, 12, + 370, 371, 372, 140, 547, 548, 12, 133, 378, 552, + 12, 64, 555, 12, 210, 124, 124, 124, 388, 389, + 211, 510, 517, 86, 487, 232, 105, 99, 16, 5, + 6, 83, 8, 9, 10, 11, 12, 53, 14, 15, + 510, 17, 18, 471, 377, -1, -1, -1, -1, -1, + -1, -1, 422, -1, 424, -1, 0, 427, -1, -1, + -1, -1, -1, 433, 434, -1, 42, -1, -1, 13, + 14, 15, -1, 17, 18, 19, -1, -1, -1, -1, + -1, 25, 26, -1, -1, -1, 456, 457, -1, 459, + 460, -1, -1, -1, 464, -1, -1, -1, -1, -1, + 44, -1, 472, 47, -1, -1, -1, 51, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, -1, + -1, 491, -1, -1, -1, 5, 6, -1, -1, 499, + -1, -1, -1, -1, 14, 15, -1, 17, 18, -1, + 20, -1, 21, 22, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, -1, -1, -1, 528, 135, + -1, -1, 138, 533, -1, 141, -1, 143, 144, -1, + -1, -1, -1, -1, -1, -1, -1, 547, 548, -1, + -1, -1, 552, -1, -1, 555, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, -1, -1, -1, -1, -1, -1, -1, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, -1, -1, -1, -1, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, -1, 122, -1, 124, 125, 126, -1, -1, -1, + -1, -1, -1, -1, 134, -1, 136, -1, 138, -1, + -1, 141, -1, 143, -1, 145, 3, 4, 5, 6, + 7, -1, -1, -1, -1, -1, -1, 14, 15, -1, + 17, 18, -1, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 5, 6, 50, 8, 9, 10, 11, 12, -1, + 14, 15, -1, 17, 18, -1, -1, -1, -1, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, -1, -1, 42, 5, + 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, + -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, + -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, -1, 122, 42, 124, 125, 126, + -1, 3, 4, 5, 6, 7, -1, 134, -1, 136, + -1, -1, 14, 15, 141, 17, 18, -1, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, + -1, 135, -1, -1, 138, -1, 140, 141, -1, 143, + -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, -1, -1, -1, -1, -1, -1, -1, -1, 135, + -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, + -1, -1, -1, -1, -1, -1, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, + 122, -1, 124, 125, 126, 3, 4, -1, -1, 7, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, + -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 34, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 50, -1, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, -1, 17, 18, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, + -1, 42, -1, -1, -1, -1, 5, 6, -1, 8, + 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 32, 122, -1, 124, 125, 126, -1, + -1, -1, -1, 42, -1, 5, 6, -1, 8, 9, + 10, 11, 12, 141, 14, 15, -1, 17, 18, -1, + -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, + 14, 15, 32, 17, 18, -1, -1, -1, -1, -1, + 5, 6, 42, 8, 9, 10, 11, 12, 32, 14, + 15, -1, 17, 18, 135, -1, -1, 138, 42, -1, + 141, -1, 143, -1, -1, -1, -1, 32, -1, 5, + 6, -1, 8, 9, 10, 11, 12, 42, 14, 15, + -1, 17, 18, -1, -1, 5, 6, -1, 8, 9, + 10, 11, 12, -1, 14, 15, 135, 17, 18, 138, + -1, -1, 141, -1, 143, -1, 42, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, + 18, -1, 42, -1, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, 135, 17, 18, 138, -1, + -1, 141, -1, 143, 42, -1, -1, -1, -1, -1, + -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, + -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, + 135, -1, -1, 138, -1, -1, 141, -1, 143, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, + -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, + -1, -1, -1, -1, -1, 135, -1, -1, 138, -1, + -1, 141, -1, 143, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 30, -1, -1, -1, 135, -1, -1, + 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, + -1, 48, 49, -1, 135, -1, -1, 138, -1, -1, + 141, -1, 143, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 103, 104, 105, -1, + -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 +}; -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 14, 15, 17, 18, 19, 25, 26, 44, 47, + 51, 154, 156, 157, 158, 186, 187, 188, 190, 189, + 45, 59, 195, 132, 50, 132, 13, 132, 35, 36, + 37, 38, 39, 40, 41, 43, 131, 159, 160, 161, + 0, 188, 39, 41, 162, 205, 35, 36, 37, 40, + 163, 202, 204, 211, 132, 132, 138, 196, 17, 194, + 5, 6, 8, 9, 10, 11, 12, 42, 135, 138, + 141, 143, 154, 157, 175, 176, 208, 161, 161, 27, + 28, 185, 161, 161, 16, 212, 213, 24, 144, 203, + 212, 17, 17, 17, 197, 136, 4, 4, 4, 143, + 8, 144, 176, 181, 134, 136, 185, 185, 9, 10, + 11, 152, 153, 176, 182, 53, 54, 55, 56, 57, + 58, 164, 200, 200, 156, 216, 133, 140, 32, 176, + 177, 179, 180, 139, 139, 144, 181, 133, 144, 180, + 182, 176, 21, 22, 3, 4, 7, 20, 33, 34, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 122, 124, 125, 126, 138, 141, 143, 145, 147, 148, + 149, 183, 208, 191, 4, 8, 176, 178, 23, 143, + 201, 30, 48, 49, 60, 61, 62, 63, 64, 65, + 81, 82, 103, 104, 105, 108, 121, 122, 123, 124, + 125, 126, 147, 148, 149, 214, 220, 221, 222, 223, + 17, 166, 133, 137, 176, 176, 142, 144, 176, 137, + 192, 193, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 150, 21, 22, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 151, + 136, 136, 136, 136, 136, 140, 182, 184, 143, 184, + 144, 184, 17, 136, 136, 136, 133, 173, 157, 48, + 8, 176, 210, 9, 12, 9, 152, 164, 150, 151, + 176, 176, 210, 176, 176, 217, 210, 210, 210, 210, + 210, 176, 176, 210, 164, 106, 107, 110, 111, 128, + 129, 165, 32, 177, 168, 140, 142, 142, 168, 173, + 173, 136, 136, 182, 182, 182, 182, 182, 133, 140, + 144, 176, 184, 142, 144, 182, 182, 182, 29, 46, + 171, 174, 136, 3, 4, 7, 20, 21, 22, 33, + 34, 50, 141, 183, 207, 208, 209, 209, 209, 209, + 178, 176, 176, 133, 170, 133, 170, 209, 138, 133, + 133, 133, 133, 133, 133, 209, 209, 31, 178, 176, + 210, 127, 165, 167, 182, 182, 219, 133, 133, 133, + 133, 182, 142, 144, 133, 133, 31, 17, 4, 173, + 32, 176, 198, 199, 52, 206, 184, 133, 133, 209, + 209, 209, 9, 46, 9, 219, 209, 138, 210, 176, + 210, 210, 210, 133, 133, 176, 209, 209, 133, 133, + 133, 133, 137, 182, 182, 182, 182, 142, 182, 182, + 176, 166, 133, 137, 17, 142, 12, 12, 136, 133, + 133, 209, 4, 209, 133, 209, 133, 133, 133, 209, + 209, 136, 176, 182, 182, 210, 133, 137, 133, 133, + 137, 137, 137, 154, 155, 32, 176, 168, 133, 209, + 209, 176, 218, 209, 209, 133, 170, 170, 209, 133, + 210, 210, 210, 218, 209, 137, 137, 182, 182, 182, + 166, 171, 172, 17, 133, 138, 209, 133, 137, 140, + 209, 137, 137, 137, 137, 155, 46, 169, 12, 140, + 152, 215, 166, 176, 168, 140, 168, 4, 209, 207, + 140, 152, 209, 31, 133, 207, 166, 12, 12, 133, + 209, 209, 12, 64, 209, 12, 209 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ + +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ while (0) + #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif -#else /* not YYLSP_NEEDED */ + + +/* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) +# define YYLEX yylex (YYLEX_PARAM) #else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ +# define YYLEX yylex () #endif -/* If nonreentrant, generate the variables here */ +/* Enable debugging if requested. */ +#if YYDEBUG -#ifndef YYPURE +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; #endif +{ + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); +} -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif { - register char *f = from; - register char *t = to; - register int i = count; + const char *yys = yystr; + + while (*yys++ != '\0') + continue; - while (i-- > 0) - *t++ = *f++; + return yys - yystr - 1; } +# endif +# endif -#else /* __cplusplus */ +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + char *yyd = yydest; + const char *yys = yysrc; -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) { - register char *t = to; - register char *f = from; - register int i = count; + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; - while (i-- > 0) - *t++ = *f++; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; } +# endif + +#endif /* YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; #endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} -#line 217 "/usr/share/bison.simple" -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ #ifdef YYPARSE_PARAM -int yyparse (void *); +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) #else -int yyparse (void); +int +yyparse () + #endif #endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL { - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else #define YYPOPSTACK (yyvsp--, yyssp--) -#endif - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; + YYSIZE_T yystacksize = YYINITDEPTH; -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ int yylen; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2126,644 +2792,675 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - if (yyssp >= yyss + yystacksize - 1) + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* Not known => get a look-ahead token if don't already have one. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; + -/* Do a reduction. yyn is the number of a rule to reduce with. */ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int i; + case 29: +#line 1039 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + case 30: +#line 1039 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} + break; - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif + case 31: +#line 1040 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} + break; + case 32: +#line 1040 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} + break; - switch (yyn) { + case 33: +#line 1041 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} + break; -case 28: -#line 1038 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; - break;} -case 29: -#line 1038 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_NE; ; - break;} -case 30: -#line 1039 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; - break;} -case 31: -#line 1039 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; - break;} -case 32: -#line 1040 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; - break;} -case 33: -#line 1040 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; - break;} -case 34: -#line 1041 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; - break;} -case 35: -#line 1041 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; - break;} -case 36: -#line 1042 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; - break;} -case 37: -#line 1042 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; - break;} -case 38: -#line 1046 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; - break;} -case 39: -#line 1046 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; - break;} -case 40: -#line 1047 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; - break;} -case 41: -#line 1047 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; - break;} -case 42: -#line 1048 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; - break;} -case 43: -#line 1048 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; - break;} -case 44: -#line 1049 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; - break;} -case 45: -#line 1049 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; - break;} -case 46: -#line 1050 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; - break;} -case 47: -#line 1050 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; - break;} -case 48: -#line 1051 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; - break;} -case 49: -#line 1051 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; - break;} -case 50: -#line 1052 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; - break;} -case 51: -#line 1052 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; - break;} -case 52: -#line 1053 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; - break;} -case 53: -#line 1054 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; - break;} -case 60: -#line 1063 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 61: -#line 1067 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 62: -#line 1071 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; - CHECK_FOR_ERROR - ; - break;} -case 65: -#line 1078 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 66: -#line 1082 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; - CHECK_FOR_ERROR - ; - break;} -case 67: -#line 1088 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 68: -#line 1089 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 69: -#line 1090 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 70: -#line 1091 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 71: -#line 1092 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 72: -#line 1096 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 73: -#line 1097 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 74: -#line 1098 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 75: -#line 1102 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 76: -#line 1103 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::HiddenVisibility; ; - break;} -case 77: -#line 1107 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 78: -#line 1108 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 79: -#line 1109 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 80: -#line 1113 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 81: -#line 1114 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 82: -#line 1115 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 83: -#line 1116 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 84: -#line 1117 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 85: -#line 1120 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 86: -#line 1121 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 87: -#line 1122 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 88: -#line 1123 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 89: -#line 1124 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_StdCall; ; - break;} -case 90: -#line 1125 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_FastCall; ; - break;} -case 91: -#line 1126 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) - GEN_ERROR("Calling conv too large!"); - yyval.UIntVal = yyvsp[0].UInt64Val; - CHECK_FOR_ERROR - ; - break;} -case 92: -#line 1133 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::ZExtAttribute; ; - break;} -case 93: -#line 1134 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::SExtAttribute; ; - break;} -case 94: -#line 1135 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::InRegAttribute; ; - break;} -case 95: -#line 1136 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::StructRetAttribute; ; - break;} -case 96: -#line 1139 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; - break;} -case 97: -#line 1140 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); - ; - break;}