From isanbard at gmail.com Mon Nov 27 04:09:26 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 04:09:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Linker.cpp Message-ID: <200611271009.kARA9Qpc000458@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.118 -> 1.119 Linker.cpp updated: 1.11 -> 1.12 --- Log message: Removed #include and replaced with llvm_* streams. --- Diffs of the changes: (+16 -20) LinkModules.cpp | 18 +++++++++--------- Linker.cpp | 18 +++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.118 llvm/lib/Linker/LinkModules.cpp:1.119 --- llvm/lib/Linker/LinkModules.cpp:1.118 Wed Nov 8 23:18:12 2006 +++ llvm/lib/Linker/LinkModules.cpp Mon Nov 27 04:09:12 2006 @@ -23,8 +23,8 @@ #include "llvm/SymbolTable.h" #include "llvm/Instructions.h" #include "llvm/Assembly/Writer.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Path.h" -#include #include using namespace llvm; @@ -251,11 +251,11 @@ static void PrintMap(const std::map &M) { for (std::map::const_iterator I = M.begin(), E =M.end(); I != E; ++I) { - std::cerr << " Fr: " << (void*)I->first << " "; + llvm_cerr << " Fr: " << (void*)I->first << " "; I->first->dump(); - std::cerr << " To: " << (void*)I->second << " "; + llvm_cerr << " To: " << (void*)I->second << " "; I->second->dump(); - std::cerr << "\n"; + llvm_cerr << "\n"; } } @@ -313,10 +313,10 @@ } - std::cerr << "LinkModules ValueMap: \n"; + llvm_cerr << "LinkModules ValueMap: \n"; PrintMap(ValueMap); - std::cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n"; + llvm_cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n"; assert(0 && "Couldn't remap value!"); return 0; } @@ -832,13 +832,13 @@ if (Src->getEndianness() != Module::AnyEndianness && Dest->getEndianness() != Src->getEndianness()) - std::cerr << "WARNING: Linking two modules of different endianness!\n"; + llvm_cerr << "WARNING: Linking two modules of different endianness!\n"; if (Src->getPointerSize() != Module::AnyPointerSize && Dest->getPointerSize() != Src->getPointerSize()) - std::cerr << "WARNING: Linking two modules of different pointer size!\n"; + llvm_cerr << "WARNING: Linking two modules of different pointer size!\n"; if (!Src->getTargetTriple().empty() && Dest->getTargetTriple() != Src->getTargetTriple()) - std::cerr << "WARNING: Linking two modules of different target triples!\n"; + llvm_cerr << "WARNING: Linking two modules of different target triples!\n"; if (!Src->getModuleInlineAsm().empty()) { if (Dest->getModuleInlineAsm().empty()) Index: llvm/lib/Linker/Linker.cpp diff -u llvm/lib/Linker/Linker.cpp:1.11 llvm/lib/Linker/Linker.cpp:1.12 --- llvm/lib/Linker/Linker.cpp:1.11 Fri Jul 28 17:52:11 2006 +++ llvm/lib/Linker/Linker.cpp Mon Nov 27 04:09:12 2006 @@ -15,8 +15,7 @@ #include "llvm/Module.h" #include "llvm/Bytecode/Reader.h" #include "llvm/Config/config.h" -#include - +#include "llvm/Support/Streams.h" using namespace llvm; Linker::Linker(const std::string& progname, const std::string& modname, unsigned flags) @@ -45,26 +44,23 @@ bool Linker::error(const std::string& message) { Error = message; - if (!(Flags&QuietErrors)) { - std::cerr << ProgramName << ": error: " << message << "\n"; - } + if (!(Flags&QuietErrors)) + llvm_cerr << ProgramName << ": error: " << message << "\n"; return true; } bool Linker::warning(const std::string& message) { Error = message; - if (!(Flags&QuietErrors)) { - std::cerr << ProgramName << ": warning: " << message << "\n"; - } + if (!(Flags&QuietErrors)) + llvm_cerr << ProgramName << ": warning: " << message << "\n"; return false; } void Linker::verbose(const std::string& message) { - if (Flags&Verbose) { - std::cerr << " " << message << "\n"; - } + if (Flags&Verbose) + llvm_cerr << " " << message << "\n"; } void From isanbard at gmail.com Mon Nov 27 04:46:04 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 04:46:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Streams.h Message-ID: <200611271046.kARAk4ZO001017@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Streams.h updated: 1.2 -> 1.3 --- Log message: Protect against null streams. --- Diffs of the changes: (+1 -1) Streams.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Support/Streams.h diff -u llvm/include/llvm/Support/Streams.h:1.2 llvm/include/llvm/Support/Streams.h:1.3 --- llvm/include/llvm/Support/Streams.h:1.2 Sun Nov 26 04:51:51 2006 +++ llvm/include/llvm/Support/Streams.h Mon Nov 27 04:45:49 2006 @@ -32,7 +32,7 @@ std::ostream* stream() const { return Stream; } inline llvm_ostream &operator << (std::ostream& (*Func)(std::ostream&)) { - *Stream << Func; + if (Stream) *Stream << Func; return *this; } From jlaskey at apple.com Mon Nov 27 07:54:27 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 27 Nov 2006 09:54:27 -0400 Subject: [llvm-commits] [llvm-gcc] CAST Patch for llvm-gcc (Please Commit!) In-Reply-To: <1164591050.2817.138.camel@bashful.x10sys.com> References: <1164591050.2817.138.camel@bashful.x10sys.com> Message-ID: <5A63BCA6-BC7C-454D-B280-FF0906E6237E@apple.com> Reid, Your ConvertInst changes are not in the llvm tree as yet, so this fails to build on PowerPC. Won't make today's llvm-gcc mirror. Cheers, -- Jim On Nov 26, 2006, at 9:30 PM, Reid Spencer wrote: > The LLVM Cast patch has been committed. Please commit this patch to > llvm-gcc as soon as possible so nightly tests don't break for too > long. > > If you're maintaining your own llvm-gcc source, please apply this > to SVN > revision 210 if you update LLVM. > > Thanks, > > Reid. > > -------------- 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/20061127/eabad44e/attachment.bin From rspencer at reidspencer.com Mon Nov 27 10:08:44 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 27 Nov 2006 08:08:44 -0800 Subject: [llvm-commits] [llvm-gcc] CAST Patch for llvm-gcc (Please Commit!) In-Reply-To: <5A63BCA6-BC7C-454D-B280-FF0906E6237E@apple.com> References: <1164591050.2817.138.camel@bashful.x10sys.com> <5A63BCA6-BC7C-454D-B280-FF0906E6237E@apple.com> Message-ID: <1164643724.2837.19.camel@bashful.x10sys.com> On Mon, 2006-11-27 at 09:54 -0400, Jim Laskey wrote: > Reid, > > Your ConvertInst changes are not in the llvm tree as yet, Oops. Please apply the attached patch for rs6000.h. Thanks, Reid. > so this > fails to build on PowerPC. Won't make today's llvm-gcc mirror. Hmm .. you mean config/ > > Cheers, > > -- Jim > > > On Nov 26, 2006, at 9:30 PM, Reid Spencer wrote: > > > The LLVM Cast patch has been committed. Please commit this patch to > > llvm-gcc as soon as possible so nightly tests don't break for too > > long. > > > > If you're maintaining your own llvm-gcc source, please apply this > > to SVN > > revision 210 if you update LLVM. > > > > Thanks, > > > > Reid. > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: CAST-rs6000.patch Type: text/x-patch Size: 2946 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061127/9dbc99f5/attachment.bin From rspencer at reidspencer.com Mon Nov 27 10:50:55 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 27 Nov 2006 08:50:55 -0800 Subject: [llvm-commits] [llvm-gcc] CAST Patch, Take 2 Message-ID: <1164646255.2837.23.camel@bashful.x10sys.com> All, The first CAST patch I sent should work fine on X86 systems. However, there was a PPC problem. The attached patch fixes that. So, if you're on Darwin, use this one instead of the original. Jim, please try this out. I have no way to compile it here. Thanks. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: CAST-llvmgcc-ppc.patch Type: text/x-patch Size: 29944 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061127/b4fa2afa/attachment.bin From jlaskey at apple.com Mon Nov 27 11:07:27 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 27 Nov 2006 13:07:27 -0400 Subject: [llvm-commits] [llvm-gcc] CAST Patch, Take 2 In-Reply-To: <1164646255.2837.23.camel@bashful.x10sys.com> References: <1164646255.2837.23.camel@bashful.x10sys.com> Message-ID: <2D2A7587-841F-4214-B54B-AF3C96D8F223@apple.com> All set. Will be in tomorrow's mirror. -- Jim On Nov 27, 2006, at 12:50 PM, Reid Spencer wrote: > All, > > The first CAST patch I sent should work fine on X86 systems. However, > there was a PPC problem. The attached patch fixes that. So, if > you're on > Darwin, use this one instead of the original. > > Jim, please try this out. I have no way to compile it here. Thanks. > > Reid. > -------------- 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/20061127/3ac6e146/attachment.bin From brukman at cs.uiuc.edu Mon Nov 27 10:07:53 2006 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 27 Nov 2006 10:07:53 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/index.html Message-ID: <200611271607.kARG7rDm006555@zion.cs.uiuc.edu> Changes in directory llvm-www/releases: index.html updated: 1.33 -> 1.34 --- Log message: * Added link to v1.9 docs * Wrapped HTML at 80 cols; removed extra blank lines --- Diffs of the changes: (+3 -7) index.html | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) Index: llvm-www/releases/index.html diff -u llvm-www/releases/index.html:1.33 llvm-www/releases/index.html:1.34 --- llvm-www/releases/index.html:1.33 Mon Nov 20 01:34:43 2006 +++ llvm-www/releases/index.html Mon Nov 27 10:07:38 2006 @@ -39,29 +39,24 @@ @@ -77,6 +72,7 @@
  • Current LLVM documentation
  • +
  • Documentation for LLVM 1.9
  • Documentation for LLVM 1.8
  • Documentation for LLVM 1.7
  • Documentation for LLVM 1.6
  • From reid at x10sys.com Mon Nov 27 12:51:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Nov 2006 12:51:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611271851.kARIpL00009612@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.283 -> 1.284 --- Log message: When truncating to bool, it is necessary to & with 1 for all casts that can result in a bool. Previously PtrToInt, FPToUI and FPToSI were missing this operation. --- Diffs of the changes: (+10 -3) Writer.cpp | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.283 llvm/lib/Target/CBackend/Writer.cpp:1.284 --- llvm/lib/Target/CBackend/Writer.cpp:1.283 Sun Nov 26 19:05:10 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Nov 27 12:51:06 2006 @@ -626,8 +626,11 @@ Out << "0-"; } printConstant(CE->getOperand(0)); - if (CE->getOpcode() == Instruction::Trunc && - CE->getType() == Type::BoolTy) { + if (CE->getType() == Type::BoolTy && + (CE->getOpcode() == Instruction::Trunc || + CE->getOpcode() == Instruction::FPToUI || + CE->getOpcode() == Instruction::FPToSI || + CE->getOpcode() == Instruction::PtrToInt)) { // Make sure we really truncate to bool here by anding with 1 Out << "&1u"; } @@ -1960,7 +1963,11 @@ Out << "0-"; } writeOperand(I.getOperand(0)); - if (I.getOpcode() == Instruction::Trunc && DstTy == Type::BoolTy) { + if (DstTy == Type::BoolTy && + (I.getOpcode() == Instruction::Trunc || + I.getOpcode() == Instruction::FPToUI || + I.getOpcode() == Instruction::FPToSI || + I.getOpcode() == Instruction::PtrToInt)) { // Make sure we really get a trunc to bool by anding the operand with 1 Out << "&1u"; } From sabre at nondot.org Mon Nov 27 13:47:37 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 13:47:37 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-11-27-XorBug.ll Message-ID: <200611271947.kARJlbkh010827@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2006-11-27-XorBug.ll added (r1.1) --- Log message: testcase for PR1014: http://llvm.org/PR1014 --- Diffs of the changes: (+11 -0) 2006-11-27-XorBug.ll | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/2006-11-27-XorBug.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-11-27-XorBug.ll:1.1 *** /dev/null Mon Nov 27 13:47:32 2006 --- llvm/test/Regression/Transforms/InstCombine/2006-11-27-XorBug.ll Mon Nov 27 13:47:22 2006 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'and.*32' && + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'or.*153' + ; PR1014 + + int %test(int %tmp1) { + %ovm = and int %tmp1, 32 ; [#uses=1] + %ov3 = add int %ovm, 145 ; [#uses=2] + %ov110 = xor int %ov3, 153 + ret int %ov110 + } + From reid at x10sys.com Mon Nov 27 13:54:38 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Nov 2006 13:54:38 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll Message-ID: <200611271954.kARJscB5011012@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: trunc-to-bool.ll updated: 1.2 -> 1.3 --- Log message: Add 3 more test cases for ptrtoint, fptoui and fptosi --- Diffs of the changes: (+28 -1) trunc-to-bool.ll | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll diff -u llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.2 llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.3 --- llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.2 Sun Nov 26 23:08:03 2006 +++ llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll Mon Nov 27 13:54:23 2006 @@ -2,7 +2,7 @@ ; sure only the LSBit survives. Test that this is the case both for a returned ; value and as the operand of a branch. ; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 3 +; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 6 bool %test1(int %X) { %Y = trunc int %X to bool ret bool %Y @@ -30,3 +30,30 @@ cond_false: ret int 42 } + +int %test4(sbyte* %ptr) { + %tmp = ptrtoint sbyte* %ptr to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} + +int %test5(float %f) { + %tmp = fptoui float %f to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} + +int %test6(double %d) { + %tmp = fptosi double %d to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} From sabre at nondot.org Mon Nov 27 13:55:22 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 13:55:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611271955.kARJtMvF011085@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.548 -> 1.549 --- Log message: Fix PR1014: http://llvm.org/PR1014 and InstCombine/2006-11-27-XorBug.ll. --- Diffs of the changes: (+8 -10) InstructionCombining.cpp | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.548 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.549 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.548 Sun Nov 26 19:05:10 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Nov 27 13:55:07 2006 @@ -939,17 +939,15 @@ // Output known-1 are known to be set if set in only one of the LHS, RHS. uint64_t KnownOneOut = (KnownZero & KnownOne2) | (KnownOne & KnownZero2); - // If all of the unknown bits are known to be zero on one side or the other - // (but not both) turn this into an *inclusive* or. + // If all of the demanded bits are known to be zero on one side or the + // other, turn this into an *inclusive* or. // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 - if (uint64_t UnknownBits = DemandedMask & ~(KnownZeroOut|KnownOneOut)) { - if ((UnknownBits & (KnownZero|KnownZero2)) == UnknownBits) { - Instruction *Or = - BinaryOperator::createOr(I->getOperand(0), I->getOperand(1), - I->getName()); - InsertNewInstBefore(Or, *I); - return UpdateValueUsesWith(I, Or); - } + if ((DemandedMask & ~KnownZero & ~KnownZero2) == 0) { + Instruction *Or = + BinaryOperator::createOr(I->getOperand(0), I->getOperand(1), + I->getName()); + InsertNewInstBefore(Or, *I); + return UpdateValueUsesWith(I, Or); } // If all of the demanded bits on one side are known, and all of the set From sabre at nondot.org Mon Nov 27 14:02:03 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 14:02:03 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll Message-ID: <200611272002.kARK23aK011240@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast-and-cast.ll updated: 1.1 -> 1.2 --- Log message: this doesn't pass with CVS HEAD. --- Diffs of the changes: (+5 -0) cast-and-cast.ll | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.1 llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.2 --- llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.1 Sun Nov 26 23:06:58 2006 +++ llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll Mon Nov 27 14:01:48 2006 @@ -1,4 +1,9 @@ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast + +;; This requires Reid to remove the instcombine hack that turns trunc to bool into setne. +; XFAIL: * + + bool %test1(uint %val) { %t1 = bitcast uint %val to int %t2 = and int %t1, 1 From sabre at nondot.org Mon Nov 27 15:50:16 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 15:50:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200611272150.kARLoG9g013911@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.80 -> 1.81 --- Log message: Fix the dag combiner bug corresponding to PR1014: http://llvm.org/PR1014 . --- Diffs of the changes: (+8 -8) TargetLowering.cpp | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.80 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.81 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.80 Thu Nov 9 12:56:43 2006 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Nov 27 15:50:02 2006 @@ -363,20 +363,20 @@ return TLO.CombineTo(Op, Op.getOperand(0)); if ((DemandedMask & KnownZero2) == DemandedMask) return TLO.CombineTo(Op, Op.getOperand(1)); + + // If all of the unknown bits are known to be zero on one side or the other + // (but not both) turn this into an *inclusive* or. + // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 + if ((DemandedMask & ~KnownZero & ~KnownZero2) == 0) + return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, Op.getValueType(), + Op.getOperand(0), + Op.getOperand(1))); // Output known-0 bits are known if clear or set in both the LHS & RHS. KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2); // Output known-1 are known to be set if set in only one of the LHS, RHS. KnownOneOut = (KnownZero & KnownOne2) | (KnownOne & KnownZero2); - // If all of the unknown bits are known to be zero on one side or the other - // (but not both) turn this into an *inclusive* or. - // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 - if (uint64_t UnknownBits = DemandedMask & ~(KnownZeroOut|KnownOneOut)) - if ((UnknownBits & (KnownZero|KnownZero2)) == UnknownBits) - return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, Op.getValueType(), - Op.getOperand(0), - Op.getOperand(1))); // If all of the demanded bits on one side are known, and all of the set // bits on that side are also known to be set on the other side, turn this // into an AND, as we know the bits will be cleared. From sabre at nondot.org Mon Nov 27 15:53:43 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 15:53:43 -0600 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200611272153.kARLrhqk014058@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.173 -> 1.174 --- Log message: remove dead tag --- Diffs of the changes: (+1 -2) LangRef.html | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.173 llvm/docs/LangRef.html:1.174 --- llvm/docs/LangRef.html:1.173 Sat Nov 18 21:00:14 2006 +++ llvm/docs/LangRef.html Mon Nov 27 15:53:28 2006 @@ -95,7 +95,6 @@
  • 'ashr' Instruction
  • -
  • Vector Operations
    1. 'extractelement' Instruction
    2. @@ -4427,7 +4426,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/11/19 03:00:14 $ + Last modified: $Date: 2006/11/27 21:53:28 $ From clattner at apple.com Mon Nov 27 16:22:24 2006 From: clattner at apple.com (Chris Lattner) Date: Mon, 27 Nov 2006 14:22:24 -0800 Subject: [llvm-commits] External weak linkage patches for review In-Reply-To: <1164505483.11512.4.camel@asl.dorms.spbu.ru> References: <1164505483.11512.4.camel@asl.dorms.spbu.ru> Message-ID: On Nov 25, 2006, at 5:44 PM, Anton Korobeynikov wrote: > Hello, Everyone. > > Please find patches for LLVM & llvm-gcc4 which enables external weak > linkage. This is just first "draft". The patch looks good. Please change these asserts: + case GlobalValue::ExternalWeakLinkage: + if (Subtarget->isTargetDarwin()) { + assert(0 && "FIXME"); + } else if (Subtarget->isTargetCygwin()) { + assert(0 && "FIXME"); + } else { + O << "\t.weak " << name << "\n"; + break; + } to be more descriptive (e.g. "FIXME: extern weak not supported yet" or something). > Know issues: > > 1. There is some "FIXME" in the llvm-backend.cpp connected with > external > weak linkage. It seems to be somehow "old". Don't know, what should be > done with it. This code: #if 0 // FIXME: When we support external weak globals, this is where we do it. x = gen_rtx_SYMBOL_REF(Pmode, name); SYMBOL_REF_WEAK(x) = DECL_WEAK(decl); #endif ... should just be removed. > 2. FIXME's in backend code: Darwin & Mingw32 codegens should be > implemented This can be implemented after the first part goes in. > 3. Linker & ExecutionEngine wasn't touched. TBD later. The linker part at least should be implemented before this goes in. > 4. Fixed somehow ELFWriter.cpp. It should be finished. The same > applies > to MachOWriter.cpp. Unfortunately, I don't know this code well to > finish > it. Don't worry about either of these, they are both unfinished in many other respects. Also, I believe there is a mention in the llvm-gcc/README.LLVM that talks about disabling threads on linux to work around this problem. Please check to see that it is not needed anymore and remove it if so. Once the linker part is implemented, go ahead and commit, thanks! -Chris From clattner at apple.com Mon Nov 27 16:28:02 2006 From: clattner at apple.com (Chris Lattner) Date: Mon, 27 Nov 2006 14:28:02 -0800 Subject: [llvm-commits] CAST patch committed In-Reply-To: <1164589934.2817.124.camel@bashful.x10sys.com> References: <1164589934.2817.124.camel@bashful.x10sys.com> Message-ID: > 2. Although I tried for two weeks, I was unsuccessful in making LLVM > code generation emit the right code for "cast to bool". Currently, the > instcombine pass is turning these into "setne X, 0" as is the current > HEAD functionality. When the backend can handle a cast to bool > properly > (including promotion from MVT:i1 to MVT:i8), then we can remove these. > For now, they stay or many tests will break. This should be fixed, please let me know if not. > > I also ran the SPEC CINT2000 test suite. Several tests failed but I > don't think they are due to the cast patch. Here's the analysis of > those > failures: > > TEST-FAIL: llc /External/SPEC/CINT2000/175.vpr/175.vpr > TEST-FAIL: jit /External/SPEC/CINT2000/175.vpr/175.vpr > TEST-FAIL: cbe /External/SPEC/CINT2000/175.vpr/175.vpr > These all fail because of a small difference in floating point > computation and the > Makefile doesn't define an FP tolerance. > 3,4c3,4 > < Cost recomputed from scratch is 256.837830. > < Final Placement cost: 256.837 > --- >> Cost recomputed from scratch is 255.033325. >> Final Placement cost: 255.041 Spec specifies (benchspec/CINT2000/175.vpr/Spec/object.pm) that this test should have a relative tolerance of 0.1, please add it to the makefile. FWIW, this passes for me on PPC (which doesn't have the X86 FP issues). > TEST-FAIL: cbe /External/SPEC/CINT2000/176.gcc/176.gcc > There are significant differences in the assembly output, but this > test has been > failing similarly on recent (HEAD) nightly tests as well. This fails for me because the CBE doesn't implement the stacksave/ restore builtins right. If someone was interested in doing this, it should be possible to use GCC extensions to implement this. > TEST-FAIL: jit /External/SPEC/CINT2000/186.crafty/186.crafty > Crash in the X86 code emitter due to inline asm: > lli: X86CodeEmitter.cpp:625: > void::Emitter::emitInstruction(const > llvm::MachineInstr&): Assertion `0 && "JIT does not support > inline > asm!\n"' failed. > These are coming from FD_ZERO, FD_SET and FD_ISSET macros used in > utility.c and > defined as inline ASM in /usr/include/bits/select.h on my machine. > > TEST-FAIL: cbe /External/SPEC/CINT2000/186.crafty/186.crafty > I'm assuming the CBE didn't like inline ASM either. It produced no > output. Ok, right. Can you send me the inline asm used, or just the entire .bc file? > > TEST-FAIL: compile /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > TEST-FAIL: llc /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > TEST-FAIL: jit /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > TEST-FAIL: cbe /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > This test doesn't compile on my machine. Note that neither gcc > 4.0.3 > nor llvm-gcc > compile this test correctly. They both produce the same errors, > starting with: > nt_perlmain.c:89: error: 'MAX_PATH' undeclared (first use in this > function) > > I noted this: > win32.c:13:19: error: tchar.h: No such file or directory > > which would seem to indicate that there's something wrong with the > configuration as > a win32 file probably shouldn't be compiled on this platform. Ok, this is strange. > All the other SPEC CINT2000 tests pass. Unfortunately, I can't test > CFP2000 because there are build problems related to f95 which I don't > have. There are 4 C programs in CFP2000. Thanks Reid, -Chris From reid at x10sys.com Mon Nov 27 16:39:53 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Nov 2006 16:39:53 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/obsequi/obsequi.c Message-ID: <200611272239.kARMdrra015455@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/obsequi: obsequi.c updated: 1.4 -> 1.5 --- Log message: Implement a poor-mans version of getline that hopefully works for this program on most platforms. --- Diffs of the changes: (+16 -3) obsequi.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) Index: llvm-test/MultiSource/Applications/obsequi/obsequi.c diff -u llvm-test/MultiSource/Applications/obsequi/obsequi.c:1.4 llvm-test/MultiSource/Applications/obsequi/obsequi.c:1.5 --- llvm-test/MultiSource/Applications/obsequi/obsequi.c:1.4 Sat Nov 25 02:25:55 2006 +++ llvm-test/MultiSource/Applications/obsequi/obsequi.c Mon Nov 27 16:39:39 2006 @@ -34,14 +34,27 @@ #include "cppflags.h" #include "interface.h" -#ifndef __linux__ // LLVM: define our own getline for portability #define getline getline_llvm +// Crude approximation of gnu getline ssize_t getline(char **lineptr, size_t *n, FILE *stream) { - return getstr (lineptr, n, stream, '\n', 0, 0); + char buffer[4096]; + bzero(buffer,4096); + ssize_t result = 0; + if (NULL == fgets(buffer, 4095, stream)) + result = -1; + else + result = strlen(buffer); + if (result >= 0) { + if (*lineptr == 0 ) + *lineptr = malloc(result+1); + else + *lineptr = realloc(*lineptr, result+1); + memcpy(*lineptr, buffer, result+1); + } + return result; } -#endif //######################################################## // Function templates. From rspencer at reidspencer.com Mon Nov 27 16:53:30 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 27 Nov 2006 14:53:30 -0800 Subject: [llvm-commits] CAST patch committed In-Reply-To: References: <1164589934.2817.124.camel@bashful.x10sys.com> Message-ID: <1164668010.2837.63.camel@bashful.x10sys.com> On Mon, 2006-11-27 at 14:28 -0800, Chris Lattner wrote: > > 2. Although I tried for two weeks, I was unsuccessful in making LLVM > > code generation emit the right code for "cast to bool". Currently, the > > instcombine pass is turning these into "setne X, 0" as is the current > > HEAD functionality. When the backend can handle a cast to bool > > properly > > (including promotion from MVT:i1 to MVT:i8), then we can remove these. > > For now, they stay or many tests will break. > > This should be fixed, please let me know if not. Seems to be mostly working but I have a regression on 176.gcc now. I don't know the cause. The test is too large to manually reduce. bugpoint could take a few days to reduce a test case from this and is likely to turn up nothing anyway (it hasn't identified a single bug for me in the last few weeks unless I tell it the specific passes that are in error). > > > > I also ran the SPEC CINT2000 test suite. Several tests failed but I > > don't think they are due to the cast patch. Here's the analysis of > > those > > failures: > > > > TEST-FAIL: llc /External/SPEC/CINT2000/175.vpr/175.vpr > > TEST-FAIL: jit /External/SPEC/CINT2000/175.vpr/175.vpr > > TEST-FAIL: cbe /External/SPEC/CINT2000/175.vpr/175.vpr > > These all fail because of a small difference in floating point > > computation and the > > Makefile doesn't define an FP tolerance. > > 3,4c3,4 > > < Cost recomputed from scratch is 256.837830. > > < Final Placement cost: 256.837 > > --- > >> Cost recomputed from scratch is 255.033325. > >> Final Placement cost: 255.041 > > Spec specifies (benchspec/CINT2000/175.vpr/Spec/object.pm) that this > test should have a relative tolerance of 0.1, please add it to the > makefile. FWIW, this passes for me on PPC (which doesn't have the > X86 FP issues). Okay. > > > > TEST-FAIL: cbe /External/SPEC/CINT2000/176.gcc/176.gcc > > There are significant differences in the assembly output, but this > > test has been > > failing similarly on recent (HEAD) nightly tests as well. > > This fails for me because the CBE doesn't implement the stacksave/ > restore builtins right. If someone was interested in doing this, it > should be possible to use GCC extensions to implement this. Is there a PR open for this? > > > TEST-FAIL: jit /External/SPEC/CINT2000/186.crafty/186.crafty > > Crash in the X86 code emitter due to inline asm: > > lli: X86CodeEmitter.cpp:625: > > void::Emitter::emitInstruction(const > > llvm::MachineInstr&): Assertion `0 && "JIT does not support > > inline > > asm!\n"' failed. > > These are coming from FD_ZERO, FD_SET and FD_ISSET macros used in > > utility.c and > > defined as inline ASM in /usr/include/bits/select.h on my machine. > > > > TEST-FAIL: cbe /External/SPEC/CINT2000/186.crafty/186.crafty > > I'm assuming the CBE didn't like inline ASM either. It produced no > > output. > > Ok, right. Can you send me the inline asm used, or just the > entire .bc file? I attached the /usr/include/bits/select.h file from Linux. This is mostly asm but I thought I'd give you the extra context since there are compiler differences for it. The raw bytecode for 186.crafty is also attached. > > > > > TEST-FAIL: compile /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > > TEST-FAIL: llc /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > > TEST-FAIL: jit /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > > TEST-FAIL: cbe /External/SPEC/CINT2000/253.perlbmk/253.perlbmk > > This test doesn't compile on my machine. Note that neither gcc > > 4.0.3 > > nor llvm-gcc > > compile this test correctly. They both produce the same errors, > > starting with: > > nt_perlmain.c:89: error: 'MAX_PATH' undeclared (first use in this > > function) > > > > I noted this: > > win32.c:13:19: error: tchar.h: No such file or directory > > > > which would seem to indicate that there's something wrong with the > > configuration as > > a win32 file probably shouldn't be compiled on this platform. > > Ok, this is strange. Yeah. I haven't found a workaround yet. The docs in the SPEC stuff is scanty at best. I believe I'm setting the configuration right on the command line, but for some reason it still is defining the SPEC_CPU2000_NTOS symbol which causes all the win32 related madness. > > > All the other SPEC CINT2000 tests pass. Unfortunately, I can't test > > CFP2000 because there are build problems related to f95 which I don't > > have. > > There are 4 C programs in CFP2000. Yes, I'll hack the makefiles to get results for those too. > > Thanks Reid, Thank you! Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: select.h Type: text/x-chdr Size: 2753 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061127/9ab90a3a/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 186.crafty.linked.rbc Type: application/octet-stream Size: 304703 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061127/9ab90a3a/attachment.obj From sabre at nondot.org Mon Nov 27 17:19:29 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 17:19:29 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/FloatPrecision.c Message-ID: <200611272319.kARNJTw5009352@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: FloatPrecision.c updated: 1.2 -> 1.3 --- Log message: do not depend on undefined behavior --- Diffs of the changes: (+1 -1) FloatPrecision.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/FloatPrecision.c diff -u llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.2 llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.3 --- llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.2 Thu Feb 17 13:05:22 2005 +++ llvm-test/SingleSource/UnitTests/FloatPrecision.c Mon Nov 27 17:19:14 2006 @@ -2,7 +2,7 @@ void print(float X) { printf("%f\n", X*2147483647); - printf("%x\n", (unsigned)(X*2147483647)); + printf("%x\n", (int)(unsigned long long)(X*2147483647)); } int main() { From evan.cheng at apple.com Mon Nov 27 17:33:47 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:33:47 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h MachineInstrBuilder.h Message-ID: <200611272333.kARNXlFQ009654@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.200 -> 1.201 MachineInstrBuilder.h updated: 1.40 -> 1.41 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+30 -38) MachineInstr.h | 16 +++++++-------- MachineInstrBuilder.h | 52 +++++++++++++++++++++----------------------------- 2 files changed, 30 insertions(+), 38 deletions(-) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.200 llvm/include/llvm/CodeGen/MachineInstr.h:1.201 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.200 Mon Nov 20 11:57:22 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.h Mon Nov 27 17:33:29 2006 @@ -27,7 +27,6 @@ class Value; class Function; class MachineBasicBlock; -class TargetInstrInfo; class TargetInstrDescriptor; class TargetMachine; class GlobalValue; @@ -296,7 +295,7 @@ /// class MachineInstr { short Opcode; // the opcode - short NumImplicitOps; // Number of implicit operands (which + unsigned short NumImplicitOps; // Number of implicit operands (which // are determined at construction time). std::vector Operands; // the operands @@ -314,19 +313,20 @@ friend struct ilist_traits; public: - /// MachineInstr ctor - This constructor reserves space for numOperand - /// operands. - MachineInstr(short Opcode, unsigned numOperands); + /// MachineInstr ctor - This constructor creates a dummy MachineInstr with + /// opcode 0 and no operands. + MachineInstr(); /// MachineInstr ctor - This constructor create a MachineInstr and add the - /// implicit operands. It reserves space for numOperand operands. - MachineInstr(const TargetInstrInfo &TII, short Opcode, unsigned numOperands); + /// implicit operands. It reserves space for number of operands specified by + /// TargetInstrDescriptor. + MachineInstr(const TargetInstrDescriptor &TID); /// MachineInstr ctor - Work exactly the same as the ctor above, except that /// the MachineInstr is created and added to the end of the specified basic /// block. /// - MachineInstr(MachineBasicBlock *MBB, short Opcode, unsigned numOps); + MachineInstr(MachineBasicBlock *MBB, const TargetInstrDescriptor &TID); ~MachineInstr(); Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.40 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.41 --- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.40 Mon Nov 13 17:32:33 2006 +++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Mon Nov 27 17:33:29 2006 @@ -19,10 +19,11 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunction.h" -#include "llvm/Target/TargetMachine.h" namespace llvm { +class TargetInstrDescriptor; + class MachineInstrBuilder { MachineInstr *MI; public: @@ -83,36 +84,29 @@ }; /// BuildMI - Builder interface. Specify how to create the initial instruction -/// itself. NumOperands is the number of operands to the machine instruction to -/// allow for memory efficient representation of machine instructions. +/// itself. /// -inline MachineInstrBuilder BuildMI(const TargetInstrInfo &TII, int Opcode, - unsigned NumOperands) { - return MachineInstrBuilder(new MachineInstr(TII, Opcode, NumOperands)); +inline MachineInstrBuilder BuildMI(const TargetInstrDescriptor &TID) { + return MachineInstrBuilder(new MachineInstr(TID)); } /// BuildMI - This version of the builder sets up the first operand as a -/// destination virtual register. NumOperands is the number of additional add* -/// calls that are expected, not including the destination register. +/// destination virtual register. /// -inline MachineInstrBuilder BuildMI(const TargetInstrInfo &TII, int Opcode, - unsigned NumOperands, unsigned DestReg) { - return MachineInstrBuilder(new MachineInstr(TII, Opcode, NumOperands+1)) - .addReg(DestReg, true); + inline MachineInstrBuilder BuildMI(const TargetInstrDescriptor &TID, + unsigned DestReg) { + return MachineInstrBuilder(new MachineInstr(TID)).addReg(DestReg, true); } /// BuildMI - This version of the builder inserts the newly-built /// instruction before the given position in the given MachineBasicBlock, and /// sets up the first operand as a destination virtual register. -/// NumOperands is the number of additional add* calls that are expected, -/// not including the destination register. /// inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB, MachineBasicBlock::iterator I, - int Opcode, unsigned NumOperands, + const TargetInstrDescriptor &TID, unsigned DestReg) { - MachineInstr *MI = new MachineInstr(*BB.getParent()->getTarget(). - getInstrInfo(), Opcode, NumOperands+1); + MachineInstr *MI = new MachineInstr(TID); BB.insert(I, MI); return MachineInstrBuilder(MI).addReg(DestReg, true); } @@ -123,9 +117,8 @@ /// inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB, MachineBasicBlock::iterator I, - int Opcode, unsigned NumOperands) { - MachineInstr *MI = new MachineInstr(*BB.getParent()->getTarget(). - getInstrInfo(), Opcode, NumOperands); + const TargetInstrDescriptor &TID) { + MachineInstr *MI = new MachineInstr(TID); BB.insert(I, MI); return MachineInstrBuilder(MI); } @@ -134,20 +127,19 @@ /// instruction at the end of the given MachineBasicBlock, and does NOT take a /// destination register. /// -inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, int Opcode, - unsigned NumOperands) { - return BuildMI(*BB, BB->end(), Opcode, NumOperands); +inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, + const TargetInstrDescriptor &TID) { + return BuildMI(*BB, BB->end(), TID); } /// BuildMI - This version of the builder inserts the newly-built /// instruction at the end of the given MachineBasicBlock, and sets up the first -/// operand as a destination virtual register. NumOperands is the number of -/// additional add* calls that are expected, not including the destination -/// register. -/// -inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, int Opcode, - unsigned NumOperands, unsigned DestReg) { - return BuildMI(*BB, BB->end(), Opcode, NumOperands, DestReg); +/// operand as a destination virtual register. +/// +inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, + const TargetInstrDescriptor &TID, + unsigned DestReg) { + return BuildMI(*BB, BB->end(), TID, DestReg); } } // End llvm namespace From evan.cheng at apple.com Mon Nov 27 17:36:26 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:36:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineBasicBlock.cpp MachineInstr.cpp Message-ID: <200611272336.kARNaQ5L009746@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineBasicBlock.cpp updated: 1.34 -> 1.35 MachineInstr.cpp updated: 1.132 -> 1.133 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+15 -21) MachineBasicBlock.cpp | 2 +- MachineInstr.cpp | 34 ++++++++++++++-------------------- 2 files changed, 15 insertions(+), 21 deletions(-) Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.34 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.35 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.34 Sat Nov 18 15:47:36 2006 +++ llvm/lib/CodeGen/MachineBasicBlock.cpp Mon Nov 27 17:36:08 2006 @@ -52,7 +52,7 @@ MachineInstr* ilist_traits::createSentinel() { - MachineInstr* dummy = new MachineInstr(0, 0); + MachineInstr* dummy = new MachineInstr(); LeakDetector::removeGarbageObject(dummy); return dummy; } Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.132 llvm/lib/CodeGen/MachineInstr.cpp:1.133 --- llvm/lib/CodeGen/MachineInstr.cpp:1.132 Mon Nov 20 11:57:22 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Mon Nov 27 17:36:08 2006 @@ -32,14 +32,10 @@ extern const TargetInstrDescriptor *TargetInstrDescriptors; } -/// MachineInstr ctor - This constructor only does a _reserve_ of the operands, -/// not a resize for them. It is expected that if you use this that you call -/// add* methods below to fill up the operands, instead of the Set methods. -/// Eventually, the "resizing" ctors will be phased out. -/// -MachineInstr::MachineInstr(short opcode, unsigned numOperands) - : Opcode(opcode), NumImplicitOps(0), parent(0) { - Operands.reserve(numOperands); +/// MachineInstr ctor - This constructor creates a dummy MachineInstr with +/// opcode 0 and no operands. +MachineInstr::MachineInstr() + : Opcode(0), NumImplicitOps(0), parent(0) { // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); } @@ -72,18 +68,18 @@ } /// MachineInstr ctor - This constructor create a MachineInstr and add the -/// implicit operands. It reserves space for numOperand operands. -MachineInstr::MachineInstr(const TargetInstrInfo &TII, short opcode, - unsigned numOperands) - : Opcode(opcode), NumImplicitOps(0), parent(0) { - const TargetInstrDescriptor &TID = TII.get(opcode); +/// implicit operands. It reserves space for number of operands specified by +/// TargetInstrDescriptor or the numOperands if it is not zero. (for +/// instructions with variable number of operands). +MachineInstr::MachineInstr(const TargetInstrDescriptor &TID) + : Opcode(TID.Opcode), NumImplicitOps(0), parent(0) { if (TID.ImplicitDefs) for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) NumImplicitOps++; if (TID.ImplicitUses) for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) NumImplicitOps++; - Operands.reserve(NumImplicitOps + numOperands); + Operands.reserve(NumImplicitOps + TID.numOperands); addImplicitDefUseOperands(TID); // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); @@ -92,19 +88,17 @@ /// MachineInstr ctor - Work exactly the same as the ctor above, except that the /// MachineInstr is created and added to the end of the specified basic block. /// -MachineInstr::MachineInstr(MachineBasicBlock *MBB, short opcode, - unsigned numOperands) - : Opcode(opcode), NumImplicitOps(0), parent(0) { +MachineInstr::MachineInstr(MachineBasicBlock *MBB, + const TargetInstrDescriptor &TID) + : Opcode(TID.Opcode), NumImplicitOps(0), parent(0) { assert(MBB && "Cannot use inserting ctor with null basic block!"); - const TargetInstrDescriptor &TID = MBB->getParent()->getTarget(). - getInstrInfo()->get(opcode); if (TID.ImplicitDefs) for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) NumImplicitOps++; if (TID.ImplicitUses) for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) NumImplicitOps++; - Operands.reserve(NumImplicitOps + numOperands); + Operands.reserve(NumImplicitOps + TID.numOperands); addImplicitDefUseOperands(TID); // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); From evan.cheng at apple.com Mon Nov 27 17:36:25 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:36:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp SelectionDAGISel.cpp Message-ID: <200611272336.kARNaPrQ009738@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp updated: 1.109 -> 1.110 SelectionDAGISel.cpp updated: 1.320 -> 1.321 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+4 -3) ScheduleDAG.cpp | 4 ++-- SelectionDAGISel.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.109 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.110 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.109 Mon Nov 13 17:35:00 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Mon Nov 27 17:36:08 2006 @@ -395,7 +395,7 @@ #endif // Create the new machine instruction. - MachineInstr *MI = new MachineInstr(*TII, Opc, NumMIOperands); + MachineInstr *MI = new MachineInstr(II); // Add result register values for things that are defined by this // instruction. @@ -518,7 +518,7 @@ // Create the inline asm machine instruction. MachineInstr *MI = - new MachineInstr(BB, TargetInstrInfo::INLINEASM, (NumOps-2)/2+1); + new MachineInstr(BB, TII->get(TargetInstrInfo::INLINEASM)); // Add the asm string as an external symbol operand. const char *AsmStr = Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.320 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.321 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.320 Sun Nov 26 19:05:09 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Nov 27 17:36:08 2006 @@ -294,8 +294,9 @@ } unsigned PHIReg = ValueMap[PN]; assert(PHIReg && "PHI node does not have an assigned virtual register!"); + const TargetInstrInfo *TII = TLI.getTargetMachine().getInstrInfo(); for (unsigned i = 0; i != NumElements; ++i) - BuildMI(MBB, TargetInstrInfo::PHI, PN->getNumOperands(), PHIReg+i); + BuildMI(MBB, TII->get(TargetInstrInfo::PHI), PHIReg+i); } } } From evan.cheng at apple.com Mon Nov 27 17:37:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64Bundling.cpp IA64ISelLowering.cpp IA64InstrInfo.cpp IA64RegisterInfo.cpp IA64RegisterInfo.h Message-ID: <200611272337.kARNbem3009808@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64Bundling.cpp updated: 1.3 -> 1.4 IA64ISelLowering.cpp updated: 1.49 -> 1.50 IA64InstrInfo.cpp updated: 1.6 -> 1.7 IA64RegisterInfo.cpp updated: 1.23 -> 1.24 IA64RegisterInfo.h updated: 1.8 -> 1.9 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+48 -41) IA64Bundling.cpp | 5 +++ IA64ISelLowering.cpp | 9 +++---- IA64InstrInfo.cpp | 5 ++- IA64RegisterInfo.cpp | 64 ++++++++++++++++++++++++--------------------------- IA64RegisterInfo.h | 6 +++- 5 files changed, 48 insertions(+), 41 deletions(-) Index: llvm/lib/Target/IA64/IA64Bundling.cpp diff -u llvm/lib/Target/IA64/IA64Bundling.cpp:1.3 llvm/lib/Target/IA64/IA64Bundling.cpp:1.4 --- llvm/lib/Target/IA64/IA64Bundling.cpp:1.3 Mon Mar 13 17:20:37 2006 +++ llvm/lib/Target/IA64/IA64Bundling.cpp Mon Nov 27 17:37:22 2006 @@ -21,6 +21,8 @@ //===----------------------------------------------------------------------===// #include "IA64.h" +#include "IA64InstrInfo.h" +#include "IA64TargetMachine.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/ADT/SetOperations.h" @@ -99,7 +101,8 @@ if(! (CurrentReads.empty() && CurrentWrites.empty()) ) { // there is a conflict, insert a stop and reset PendingRegWrites - CurrentInsn = BuildMI(MBB, CurrentInsn, IA64::STOP, 0); + CurrentInsn = BuildMI(MBB, CurrentInsn, + TM.getInstrInfo()->get(IA64::STOP), 0); PendingRegWrites=OrigWrites; // carry over current writes to next insn Changed=true; StopBitsAdded++; // update stats } else { // otherwise, track additional pending writes Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.49 llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.50 --- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.49 Thu Nov 2 19:19:31 2006 +++ llvm/lib/Target/IA64/IA64ISelLowering.cpp Mon Nov 27 17:37:22 2006 @@ -139,6 +139,7 @@ // MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); GP = MF.getSSARegMap()->createVirtualRegister(getRegClassFor(MVT::i64)); SP = MF.getSSARegMap()->createVirtualRegister(getRegClassFor(MVT::i64)); @@ -225,7 +226,7 @@ // Create a vreg to hold the output of (what will become) // the "alloc" instruction VirtGPR = MF.getSSARegMap()->createVirtualRegister(getRegClassFor(MVT::i64)); - BuildMI(&BB, IA64::PSEUDO_ALLOC, 0, VirtGPR); + BuildMI(&BB, TII->get(IA64::PSEUDO_ALLOC), VirtGPR); // we create a PSEUDO_ALLOC (pseudo)instruction for now /* BuildMI(&BB, IA64::IDEF, 0, IA64::r1); @@ -255,14 +256,14 @@ // here we actually do the moving of args, and store them to the stack // too if this is a varargs function: for (int i = 0; i < count && i < 8; ++i) { - BuildMI(&BB, argOpc[i], 1, argVreg[i]).addReg(argPreg[i]); + BuildMI(&BB, TII->get(argOpc[i]), argVreg[i]).addReg(argPreg[i]); if(F.isVarArg()) { // if this is a varargs function, we copy the input registers to the stack int FI = MFI->CreateFixedObject(8, tempOffset); tempOffset+=8; //XXX: is it safe to use r22 like this? - BuildMI(&BB, IA64::MOV, 1, IA64::r22).addFrameIndex(FI); + BuildMI(&BB, TII->get(IA64::MOV), IA64::r22).addFrameIndex(FI); // FIXME: we should use st8.spill here, one day - BuildMI(&BB, IA64::ST8, 1, IA64::r22).addReg(argPreg[i]); + BuildMI(&BB, TII->get(IA64::ST8), IA64::r22).addReg(argPreg[i]); } } Index: llvm/lib/Target/IA64/IA64InstrInfo.cpp diff -u llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.6 llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.7 --- llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.6 Tue Oct 24 12:07:11 2006 +++ llvm/lib/Target/IA64/IA64InstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -19,7 +19,8 @@ using namespace llvm; IA64InstrInfo::IA64InstrInfo() - : TargetInstrInfo(IA64Insts, sizeof(IA64Insts)/sizeof(IA64Insts[0])) { + : TargetInstrInfo(IA64Insts, sizeof(IA64Insts)/sizeof(IA64Insts[0])), + RI(*this) { } @@ -51,5 +52,5 @@ const std::vector &Cond)const { // Can only insert uncond branches so far. assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!"); - BuildMI(&MBB, IA64::BRL_NOTCALL, 1).addMBB(TBB); + BuildMI(&MBB, get(IA64::BRL_NOTCALL)).addMBB(TBB); } Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.23 llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.24 --- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.23 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -26,14 +26,16 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/ADT/STLExtras.h" #include using namespace llvm; -IA64RegisterInfo::IA64RegisterInfo() - : IA64GenRegisterInfo(IA64::ADJUSTCALLSTACKDOWN, IA64::ADJUSTCALLSTACKUP) {} +IA64RegisterInfo::IA64RegisterInfo(const TargetInstrInfo &tii) + : IA64GenRegisterInfo(IA64::ADJUSTCALLSTACKDOWN, IA64::ADJUSTCALLSTACKUP), + TII(tii) {} void IA64RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, @@ -41,19 +43,19 @@ const TargetRegisterClass *RC) const{ if (RC == IA64::FPRegisterClass) { - BuildMI(MBB, MI, IA64::STF_SPILL, 2).addFrameIndex(FrameIdx).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(IA64::STF_SPILL)).addFrameIndex(FrameIdx).addReg(SrcReg); } else if (RC == IA64::GRRegisterClass) { - BuildMI(MBB, MI, IA64::ST8, 2).addFrameIndex(FrameIdx).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(IA64::ST8)).addFrameIndex(FrameIdx).addReg(SrcReg); } else if (RC == IA64::PRRegisterClass) { /* we use IA64::r2 as a temporary register for doing this hackery. */ // first we load 0: - BuildMI(MBB, MI, IA64::MOV, 1, IA64::r2).addReg(IA64::r0); + BuildMI(MBB, MI, TII.get(IA64::MOV), IA64::r2).addReg(IA64::r0); // then conditionally add 1: - BuildMI(MBB, MI, IA64::CADDIMM22, 3, IA64::r2).addReg(IA64::r2) + BuildMI(MBB, MI, TII.get(IA64::CADDIMM22), IA64::r2).addReg(IA64::r2) .addImm(1).addReg(SrcReg); // and then store it to the stack - BuildMI(MBB, MI, IA64::ST8, 2).addFrameIndex(FrameIdx).addReg(IA64::r2); + BuildMI(MBB, MI, TII.get(IA64::ST8)).addFrameIndex(FrameIdx).addReg(IA64::r2); } else assert(0 && "sorry, I don't know how to store this sort of reg in the stack\n"); } @@ -64,16 +66,16 @@ const TargetRegisterClass *RC)const{ if (RC == IA64::FPRegisterClass) { - BuildMI(MBB, MI, IA64::LDF_FILL, 1, DestReg).addFrameIndex(FrameIdx); + BuildMI(MBB, MI, TII.get(IA64::LDF_FILL), DestReg).addFrameIndex(FrameIdx); } else if (RC == IA64::GRRegisterClass) { - BuildMI(MBB, MI, IA64::LD8, 1, DestReg).addFrameIndex(FrameIdx); + BuildMI(MBB, MI, TII.get(IA64::LD8), DestReg).addFrameIndex(FrameIdx); } else if (RC == IA64::PRRegisterClass) { // first we load a byte from the stack into r2, our 'predicate hackery' // scratch reg - BuildMI(MBB, MI, IA64::LD8, 1, IA64::r2).addFrameIndex(FrameIdx); + BuildMI(MBB, MI, TII.get(IA64::LD8), IA64::r2).addFrameIndex(FrameIdx); // then we compare it to zero. If it _is_ zero, compare-not-equal to // r0 gives us 0, which is what we want, so that's nice. - BuildMI(MBB, MI, IA64::CMPNE, 2, DestReg).addReg(IA64::r2).addReg(IA64::r0); + BuildMI(MBB, MI, TII.get(IA64::CMPNE), DestReg).addReg(IA64::r2).addReg(IA64::r0); } else assert(0 && "sorry, I don't know how to load this sort of reg from the stack\n"); } @@ -85,10 +87,10 @@ if(RC == IA64::PRRegisterClass ) // if a bool, we use pseudocode // (SrcReg) DestReg = cmp.eq.unc(r0, r0) - BuildMI(MBB, MI, IA64::PCMPEQUNC, 3, DestReg) + BuildMI(MBB, MI, TII.get(IA64::PCMPEQUNC), DestReg) .addReg(IA64::r0).addReg(IA64::r0).addReg(SrcReg); else // otherwise, MOV works (for both gen. regs and FP regs) - BuildMI(MBB, MI, IA64::MOV, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(IA64::MOV), DestReg).addReg(SrcReg); } const unsigned* IA64RegisterInfo::getCalleeSaveRegs() const { @@ -121,7 +123,6 @@ void IA64RegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { - const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); if (hasFP(MF)) { // If we have a frame pointer, turn the adjcallstackup instruction into a // 'sub SP, ' and the adjcallstackdown instruction into 'add SP, @@ -137,11 +138,11 @@ MachineInstr *New; if (Old->getOpcode() == IA64::ADJUSTCALLSTACKDOWN) { - New=BuildMI(TII, IA64::ADDIMM22, 2, IA64::r12).addReg(IA64::r12) + New=BuildMI(TII.get(IA64::ADDIMM22), IA64::r12).addReg(IA64::r12) .addImm(-Amount); } else { assert(Old->getOpcode() == IA64::ADJUSTCALLSTACKUP); - New=BuildMI(TII, IA64::ADDIMM22, 2, IA64::r12).addReg(IA64::r12) + New=BuildMI(TII.get(IA64::ADDIMM22), IA64::r12).addReg(IA64::r12) .addImm(Amount); } @@ -158,7 +159,6 @@ MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); MachineFunction &MF = *MBB.getParent(); - const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); bool FP = hasFP(MF); @@ -187,16 +187,16 @@ // Fix up the old: MI.getOperand(i).ChangeToRegister(IA64::r22, false); //insert the new - MachineInstr* nMI=BuildMI(TII, IA64::ADDIMM22, 2, IA64::r22) + MachineInstr* nMI=BuildMI(TII.get(IA64::ADDIMM22), IA64::r22) .addReg(BaseRegister).addImm(Offset); MBB.insert(II, nMI); } else { // it's big //fix up the old: MI.getOperand(i).ChangeToRegister(IA64::r22, false); MachineInstr* nMI; - nMI=BuildMI(TII, IA64::MOVLIMM64, 1, IA64::r22).addImm(Offset); + nMI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(Offset); MBB.insert(II, nMI); - nMI=BuildMI(TII, IA64::ADD, 2, IA64::r22).addReg(BaseRegister) + nMI=BuildMI(TII.get(IA64::ADD), IA64::r22).addReg(BaseRegister) .addReg(IA64::r22); MBB.insert(II, nMI); } @@ -207,7 +207,6 @@ MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB MachineBasicBlock::iterator MBBI = MBB.begin(); MachineFrameInfo *MFI = MF.getFrameInfo(); - const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); MachineInstr *MI; bool FP = hasFP(MF); @@ -252,7 +251,7 @@ } } - MI=BuildMI(TII, IA64::ALLOC,5).addReg(dstRegOfPseudoAlloc).addImm(0). \ + MI=BuildMI(TII.get(IA64::ALLOC)).addReg(dstRegOfPseudoAlloc).addImm(0). \ addImm(numStackedGPRsUsed).addImm(numOutRegsUsed).addImm(0); MBB.insert(MBBI, MI); @@ -284,23 +283,23 @@ // adjust stack pointer: r12 -= numbytes if (NumBytes <= 8191) { - MI=BuildMI(TII, IA64::ADDIMM22,2,IA64::r12).addReg(IA64::r12). + MI=BuildMI(TII.get(IA64::ADDIMM22),IA64::r12).addReg(IA64::r12). addImm(-NumBytes); MBB.insert(MBBI, MI); } else { // we use r22 as a scratch register here - MI=BuildMI(TII, IA64::MOVLIMM64, 1, IA64::r22).addImm(-NumBytes); + MI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(-NumBytes); // FIXME: MOVLSI32 expects a _u_32imm MBB.insert(MBBI, MI); // first load the decrement into r22 - MI=BuildMI(TII,IA64::ADD, 2, IA64::r12).addReg(IA64::r12).addReg(IA64::r22); + MI=BuildMI(TII.get(IA64::ADD), IA64::r12).addReg(IA64::r12).addReg(IA64::r22); MBB.insert(MBBI, MI); // then add (subtract) it to r12 (stack ptr) } // now if we need to, save the old FP and set the new if (FP) { - MI = BuildMI(TII, IA64::ST8, 2).addReg(IA64::r12).addReg(IA64::r5); + MI = BuildMI(TII.get(IA64::ST8)).addReg(IA64::r12).addReg(IA64::r5); MBB.insert(MBBI, MI); // this must be the last instr in the prolog ? (XXX: why??) - MI = BuildMI(TII, IA64::MOV, 1, IA64::r5).addReg(IA64::r12); + MI = BuildMI(TII.get(IA64::MOV), IA64::r5).addReg(IA64::r12); MBB.insert(MBBI, MI); } @@ -309,7 +308,6 @@ void IA64RegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); - const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); MachineBasicBlock::iterator MBBI = prior(MBB.end()); MachineInstr *MI; assert(MBBI->getOpcode() == IA64::RET && @@ -324,23 +322,23 @@ if (FP) { //copy the FP into the SP (discards allocas) - MI=BuildMI(TII, IA64::MOV, 1, IA64::r12).addReg(IA64::r5); + MI=BuildMI(TII.get(IA64::MOV), IA64::r12).addReg(IA64::r5); MBB.insert(MBBI, MI); //restore the FP - MI=BuildMI(TII, IA64::LD8, 1, IA64::r5).addReg(IA64::r5); + MI=BuildMI(TII.get(IA64::LD8), IA64::r5).addReg(IA64::r5); MBB.insert(MBBI, MI); } if (NumBytes != 0) { if (NumBytes <= 8191) { - MI=BuildMI(TII, IA64::ADDIMM22,2,IA64::r12).addReg(IA64::r12). + MI=BuildMI(TII.get(IA64::ADDIMM22),IA64::r12).addReg(IA64::r12). addImm(NumBytes); MBB.insert(MBBI, MI); } else { - MI=BuildMI(TII, IA64::MOVLIMM64, 1, IA64::r22).addImm(NumBytes); + MI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(NumBytes); MBB.insert(MBBI, MI); - MI=BuildMI(TII, IA64::ADD, 2, IA64::r12).addReg(IA64::r12). + MI=BuildMI(TII.get(IA64::ADD), IA64::r12).addReg(IA64::r12). addReg(IA64::r22); MBB.insert(MBBI, MI); } Index: llvm/lib/Target/IA64/IA64RegisterInfo.h diff -u llvm/lib/Target/IA64/IA64RegisterInfo.h:1.8 llvm/lib/Target/IA64/IA64RegisterInfo.h:1.9 --- llvm/lib/Target/IA64/IA64RegisterInfo.h:1.8 Wed May 17 19:12:11 2006 +++ llvm/lib/Target/IA64/IA64RegisterInfo.h Mon Nov 27 17:37:22 2006 @@ -21,8 +21,12 @@ namespace llvm { +class TargetInstrInfo; + struct IA64RegisterInfo : public IA64GenRegisterInfo { - IA64RegisterInfo(); + const TargetInstrInfo &TII; + + IA64RegisterInfo(const TargetInstrInfo &tii); /// Code Generation virtual methods... void storeRegToStackSlot(MachineBasicBlock &MBB, From evan.cheng at apple.com Mon Nov 27 17:37:45 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMMul.cpp ARMRegisterInfo.cpp ARMRegisterInfo.h Message-ID: <200611272337.kARNbjht009870@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.cpp updated: 1.9 -> 1.10 ARMMul.cpp updated: 1.3 -> 1.4 ARMRegisterInfo.cpp updated: 1.26 -> 1.27 ARMRegisterInfo.h updated: 1.2 -> 1.3 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+28 -21) ARMInstrInfo.cpp | 5 +++-- ARMMul.cpp | 6 ++++-- ARMRegisterInfo.cpp | 34 ++++++++++++++++++---------------- ARMRegisterInfo.h | 4 +++- 4 files changed, 28 insertions(+), 21 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.9 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.10 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.9 Tue Oct 24 12:07:11 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -19,7 +19,8 @@ using namespace llvm; ARMInstrInfo::ARMInstrInfo() - : TargetInstrInfo(ARMInsts, sizeof(ARMInsts)/sizeof(ARMInsts[0])) { + : TargetInstrInfo(ARMInsts, sizeof(ARMInsts)/sizeof(ARMInsts[0])), + RI(*this) { } const TargetRegisterClass *ARMInstrInfo::getPointerRegClass() const { @@ -54,5 +55,5 @@ const std::vector &Cond)const{ // Can only insert uncond branches so far. assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!"); - BuildMI(&MBB, ARM::b, 1).addMBB(TBB); + BuildMI(&MBB, get(ARM::b)).addMBB(TBB); } Index: llvm/lib/Target/ARM/ARMMul.cpp diff -u llvm/lib/Target/ARM/ARMMul.cpp:1.3 llvm/lib/Target/ARM/ARMMul.cpp:1.4 --- llvm/lib/Target/ARM/ARMMul.cpp:1.3 Mon Oct 16 11:33:29 2006 +++ llvm/lib/Target/ARM/ARMMul.cpp Mon Nov 27 17:37:22 2006 @@ -16,6 +16,8 @@ #include "ARM.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Compiler.h" using namespace llvm; @@ -60,8 +62,8 @@ RsOp.setReg(Rm); } else { unsigned scratch = Op == ARM::MUL ? ARM::R12 : ARM::R0; - BuildMI(MBB, I, ARM::MOV, 3, scratch).addReg(Rm).addImm(0) - .addImm(ARMShift::LSL); + BuildMI(MBB, I, MF.getTarget().getInstrInfo()->get(ARM::MOV), + scratch).addReg(Rm).addImm(0).addImm(ARMShift::LSL); RmOp.setReg(scratch); } } Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.26 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.27 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.26 Thu Nov 9 07:58:55 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -22,6 +22,7 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/STLExtras.h" #include using namespace llvm; @@ -35,8 +36,9 @@ return NoFramePointerElim || MFI->hasVarSizedObjects(); } -ARMRegisterInfo::ARMRegisterInfo() - : ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP) { +ARMRegisterInfo::ARMRegisterInfo(const TargetInstrInfo &tii) + : ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP), + TII(tii) { } void ARMRegisterInfo:: @@ -44,7 +46,7 @@ unsigned SrcReg, int FI, const TargetRegisterClass *RC) const { assert (RC == ARM::IntRegsRegisterClass); - BuildMI(MBB, I, ARM::STR, 3).addReg(SrcReg).addFrameIndex(FI).addImm(0); + BuildMI(MBB, I, TII.get(ARM::STR)).addReg(SrcReg).addFrameIndex(FI).addImm(0); } void ARMRegisterInfo:: @@ -52,7 +54,7 @@ unsigned DestReg, int FI, const TargetRegisterClass *RC) const { assert (RC == ARM::IntRegsRegisterClass); - BuildMI(MBB, I, ARM::LDR, 2, DestReg).addFrameIndex(FI).addImm(0); + BuildMI(MBB, I, TII.get(ARM::LDR), DestReg).addFrameIndex(FI).addImm(0); } void ARMRegisterInfo::copyRegToReg(MachineBasicBlock &MBB, @@ -64,12 +66,12 @@ RC == ARM::DFPRegsRegisterClass); if (RC == ARM::IntRegsRegisterClass) - BuildMI(MBB, I, ARM::MOV, 3, DestReg).addReg(SrcReg).addImm(0) + BuildMI(MBB, I, TII.get(ARM::MOV), DestReg).addReg(SrcReg).addImm(0) .addImm(ARMShift::LSL); else if (RC == ARM::FPRegsRegisterClass) - BuildMI(MBB, I, ARM::FCPYS, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, I, TII.get(ARM::FCPYS), DestReg).addReg(SrcReg); else - BuildMI(MBB, I, ARM::FCPYD, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, I, TII.get(ARM::FCPYD), DestReg).addReg(SrcReg); } MachineInstr *ARMRegisterInfo::foldMemoryOperand(MachineInstr* MI, @@ -109,12 +111,12 @@ if (Old->getOpcode() == ARM::ADJCALLSTACKDOWN) { // sub sp, sp, amount - BuildMI(MBB, I, ARM::SUB, 2, ARM::R13).addReg(ARM::R13).addImm(Amount) + BuildMI(MBB, I, TII.get(ARM::SUB), ARM::R13).addReg(ARM::R13).addImm(Amount) .addImm(0).addImm(ARMShift::LSL); } else { // add sp, sp, amount assert(Old->getOpcode() == ARM::ADJCALLSTACKUP); - BuildMI(MBB, I, ARM::ADD, 2, ARM::R13).addReg(ARM::R13).addImm(Amount) + BuildMI(MBB, I, TII.get(ARM::ADD), ARM::R13).addReg(ARM::R13).addImm(Amount) .addImm(0).addImm(ARMShift::LSL); } } @@ -155,7 +157,7 @@ // Insert a set of r12 with the full address // r12 = r13 + offset MachineBasicBlock *MBB2 = MI.getParent(); - BuildMI(*MBB2, II, ARM::ADD, 4, ARM::R12).addReg(BaseRegister) + BuildMI(*MBB2, II, TII.get(ARM::ADD), ARM::R12).addReg(BaseRegister) .addImm(Offset).addImm(0).addImm(ARMShift::LSL); // Replace the FrameIndex with r12 @@ -191,13 +193,13 @@ MFI->setStackSize(NumBytes); //sub sp, sp, #NumBytes - BuildMI(MBB, MBBI, ARM::SUB, 4, ARM::R13).addReg(ARM::R13).addImm(NumBytes) + BuildMI(MBB, MBBI, TII.get(ARM::SUB), ARM::R13).addReg(ARM::R13).addImm(NumBytes) .addImm(0).addImm(ARMShift::LSL); if (HasFP) { - BuildMI(MBB, MBBI, ARM::STR, 3) + BuildMI(MBB, MBBI, TII.get(ARM::STR)) .addReg(ARM::R11).addReg(ARM::R13).addImm(0); - BuildMI(MBB, MBBI, ARM::MOV, 3, ARM::R11).addReg(ARM::R13).addImm(0). + BuildMI(MBB, MBBI, TII.get(ARM::MOV), ARM::R11).addReg(ARM::R13).addImm(0). addImm(ARMShift::LSL); } } @@ -212,13 +214,13 @@ int NumBytes = (int) MFI->getStackSize(); if (hasFP(MF)) { - BuildMI(MBB, MBBI, ARM::MOV, 3, ARM::R13).addReg(ARM::R11).addImm(0). + BuildMI(MBB, MBBI, TII.get(ARM::MOV), ARM::R13).addReg(ARM::R11).addImm(0). addImm(ARMShift::LSL); - BuildMI(MBB, MBBI, ARM::LDR, 2, ARM::R11).addReg(ARM::R13).addImm(0); + BuildMI(MBB, MBBI, TII.get(ARM::LDR), ARM::R11).addReg(ARM::R13).addImm(0); } //add sp, sp, #NumBytes - BuildMI(MBB, MBBI, ARM::ADD, 4, ARM::R13).addReg(ARM::R13).addImm(NumBytes) + BuildMI(MBB, MBBI, TII.get(ARM::ADD), ARM::R13).addReg(ARM::R13).addImm(NumBytes) .addImm(0).addImm(ARMShift::LSL); } Index: llvm/lib/Target/ARM/ARMRegisterInfo.h diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.2 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.3 --- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.2 Wed May 17 19:11:26 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.h Mon Nov 27 17:37:22 2006 @@ -21,10 +21,12 @@ namespace llvm { class Type; +class TargetInstrInfo; struct ARMRegisterInfo : public ARMGenRegisterInfo { + const TargetInstrInfo &TII; - ARMRegisterInfo(); + ARMRegisterInfo(const TargetInstrInfo &tii); /// Code Generation virtual methods... void storeRegToStackSlot(MachineBasicBlock &MBB, From evan.cheng at apple.com Mon Nov 27 17:37:45 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86FloatingPoint.cpp X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86InstrInfo.cpp X86RegisterInfo.cpp Message-ID: <200611272337.kARNbjRi009853@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86FloatingPoint.cpp updated: 1.60 -> 1.61 X86ISelDAGToDAG.cpp updated: 1.129 -> 1.130 X86ISelLowering.cpp updated: 1.294 -> 1.295 X86InstrInfo.cpp updated: 1.74 -> 1.75 X86RegisterInfo.cpp updated: 1.180 -> 1.181 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+75 -61) X86FloatingPoint.cpp | 19 ++++++++++++++----- X86ISelDAGToDAG.cpp | 19 ++++++++++--------- X86ISelLowering.cpp | 22 +++++++++++++--------- X86InstrInfo.cpp | 30 +++++++++++++++--------------- X86RegisterInfo.cpp | 46 +++++++++++++++++++++++----------------------- 5 files changed, 75 insertions(+), 61 deletions(-) Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.60 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.61 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.60 Wed Nov 15 14:56:39 2006 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Mon Nov 27 17:37:22 2006 @@ -107,6 +107,9 @@ bool isAtTop(unsigned RegNo) const { return getSlot(RegNo) == StackTop-1; } void moveToTop(unsigned RegNo, MachineBasicBlock::iterator &I) { if (!isAtTop(RegNo)) { + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); + unsigned STReg = getSTReg(RegNo); unsigned RegOnTop = getStackEntry(0); @@ -118,16 +121,18 @@ std::swap(Stack[RegMap[RegOnTop]], Stack[StackTop-1]); // Emit an fxch to update the runtime processors version of the state - BuildMI(*MBB, I, X86::FXCH, 1).addReg(STReg); + BuildMI(*MBB, I, TII.get(X86::FXCH)).addReg(STReg); NumFXCH++; } } void duplicateToTop(unsigned RegNo, unsigned AsReg, MachineInstr *I) { + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); unsigned STReg = getSTReg(RegNo); pushReg(AsReg); // New register on top of stack - BuildMI(*MBB, I, X86::FLDrr, 1).addReg(STReg); + BuildMI(*MBB, I, TII.get(X86::FLDrr)).addReg(STReg); } // popStackAfter - Pop the current value off of the top of the FP stack @@ -435,7 +440,9 @@ I->RemoveOperand(0); } else { // Insert an explicit pop - I = BuildMI(*MBB, ++I, X86::FSTPrr, 1).addReg(X86::ST0); + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); + I = BuildMI(*MBB, ++I, TII.get(X86::FSTPrr)).addReg(X86::ST0); } } @@ -459,7 +466,9 @@ RegMap[TopReg] = OldSlot; RegMap[FPRegNo] = ~0; Stack[--StackTop] = ~0; - I = BuildMI(*MBB, ++I, X86::FSTPrr, 1).addReg(STReg); + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); + I = BuildMI(*MBB, ++I, TII.get(X86::FSTPrr)).addReg(STReg); } @@ -697,7 +706,7 @@ // Replace the old instruction with a new instruction MBB->remove(I++); - I = BuildMI(*MBB, I, Opcode, 1).addReg(getSTReg(NotTOS)); + I = BuildMI(*MBB, I, TII.get(Opcode)).addReg(getSTReg(NotTOS)); // If both operands are killed, pop one off of the stack in addition to // overwriting the other one. Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.129 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.130 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.129 Fri Nov 17 16:10:14 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Nov 27 17:37:22 2006 @@ -525,7 +525,8 @@ // Finally, if we found any FP code, emit the FP_REG_KILL instruction. if (ContainsFPCode) { - BuildMI(*BB, BB->getFirstTerminator(), X86::FP_REG_KILL, 0); + BuildMI(*BB, BB->getFirstTerminator(), + TM.getInstrInfo()->get(X86::FP_REG_KILL)); ++NumFPKill; } } @@ -535,19 +536,20 @@ /// the main function. void X86DAGToDAGISel::EmitSpecialCodeForMain(MachineBasicBlock *BB, MachineFrameInfo *MFI) { + const TargetInstrInfo *TII = TM.getInstrInfo(); if (Subtarget->isTargetCygwin()) - BuildMI(BB, X86::CALLpcrel32, 1).addExternalSymbol("__main"); + BuildMI(BB, TII->get(X86::CALLpcrel32)).addExternalSymbol("__main"); // Switch the FPU to 64-bit precision mode for better compatibility and speed. int CWFrameIdx = MFI->CreateStackObject(2, 2); - addFrameReference(BuildMI(BB, X86::FNSTCW16m, 4), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::FNSTCW16m)), CWFrameIdx); // Set the high part to be 64-bit precision. - addFrameReference(BuildMI(BB, X86::MOV8mi, 5), + addFrameReference(BuildMI(BB, TII->get(X86::MOV8mi)), CWFrameIdx, 1).addImm(2); // Reload the modified control word now. - addFrameReference(BuildMI(BB, X86::FLDCW16m, 4), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::FLDCW16m)), CWFrameIdx); } void X86DAGToDAGISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) { @@ -943,11 +945,10 @@ MachineBasicBlock &FirstMBB = BB->getParent()->front(); MachineBasicBlock::iterator MBBI = FirstMBB.begin(); SSARegMap *RegMap = BB->getParent()->getSSARegMap(); - // FIXME: when we get to LP64, we will need to create the appropriate - // type of register here. GlobalBaseReg = RegMap->createVirtualRegister(X86::GR32RegisterClass); - BuildMI(FirstMBB, MBBI, X86::MovePCtoStack, 0); - BuildMI(FirstMBB, MBBI, X86::POP32r, 1, GlobalBaseReg); + const TargetInstrInfo *TII = TM.getInstrInfo(); + BuildMI(FirstMBB, MBBI, TII->get(X86::MovePCtoStack)); + BuildMI(FirstMBB, MBBI, TII->get(X86::POP32r), GlobalBaseReg); } return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).Val; } Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.294 llvm/lib/Target/X86/X86ISelLowering.cpp:1.295 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.294 Mon Nov 20 18:01:06 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Nov 27 17:37:22 2006 @@ -5036,6 +5036,7 @@ MachineBasicBlock * X86TargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, MachineBasicBlock *BB) { + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); switch (MI->getOpcode()) { default: assert(false && "Unexpected instr type to insert"); case X86::CMOV_FR32: @@ -5062,7 +5063,7 @@ MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB); unsigned Opc = X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); - BuildMI(BB, Opc, 1).addMBB(sinkMBB); + BuildMI(BB, TII->get(Opc)).addMBB(sinkMBB); MachineFunction *F = BB->getParent(); F->getBasicBlockList().insert(It, copy0MBB); F->getBasicBlockList().insert(It, sinkMBB); @@ -5090,7 +5091,7 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, X86::PHI, 4, MI->getOperand(0).getReg()) + BuildMI(BB, TII->get(X86::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); @@ -5105,21 +5106,23 @@ // mode when truncating to an integer value. MachineFunction *F = BB->getParent(); int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2); - addFrameReference(BuildMI(BB, X86::FNSTCW16m, 4), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::FNSTCW16m)), CWFrameIdx); // Load the old value of the high byte of the control word... unsigned OldCW = F->getSSARegMap()->createVirtualRegister(X86::GR16RegisterClass); - addFrameReference(BuildMI(BB, X86::MOV16rm, 4, OldCW), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::MOV16rm), OldCW), CWFrameIdx); // Set the high part to be round to zero... - addFrameReference(BuildMI(BB, X86::MOV16mi, 5), CWFrameIdx).addImm(0xC7F); + addFrameReference(BuildMI(BB, TII->get(X86::MOV16mi)), CWFrameIdx) + .addImm(0xC7F); // Reload the modified control word now... - addFrameReference(BuildMI(BB, X86::FLDCW16m, 4), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::FLDCW16m)), CWFrameIdx); // Restore the memory image of control word to original value - addFrameReference(BuildMI(BB, X86::MOV16mr, 5), CWFrameIdx).addReg(OldCW); + addFrameReference(BuildMI(BB, TII->get(X86::MOV16mr)), CWFrameIdx) + .addReg(OldCW); // Get the X86 opcode to use. unsigned Opc; @@ -5151,10 +5154,11 @@ } else { AM.Disp = Op.getImm(); } - addFullAddress(BuildMI(BB, Opc, 5), AM).addReg(MI->getOperand(4).getReg()); + addFullAddress(BuildMI(BB, TII->get(Opc)), AM) + .addReg(MI->getOperand(4).getReg()); // Reload the original control word now. - addFrameReference(BuildMI(BB, X86::FLDCW16m, 4), CWFrameIdx); + addFrameReference(BuildMI(BB, TII->get(X86::FLDCW16m)), CWFrameIdx); delete MI; // The pseudo instruction is gone now. return BB; Index: llvm/lib/Target/X86/X86InstrInfo.cpp diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.74 llvm/lib/Target/X86/X86InstrInfo.cpp:1.75 --- llvm/lib/Target/X86/X86InstrInfo.cpp:1.74 Thu Nov 16 17:22:26 2006 +++ llvm/lib/Target/X86/X86InstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -139,7 +139,7 @@ unsigned C = MI->getOperand(2).getReg(); unsigned M = MI->getOperand(3).getImmedValue(); if (!Subtarget->hasSSE2() || B != C) return 0; - NewMI = BuildMI(*this, X86::PSHUFDri, 2, A).addReg(B).addImm(M); + NewMI = BuildMI(get(X86::PSHUFDri), A).addReg(B).addImm(M); NewMI->copyKillDeadInfo(MI); return NewMI; } @@ -158,41 +158,41 @@ case X86::INC32r: case X86::INC64_32r: assert(MI->getNumOperands() == 2 && "Unknown inc instruction!"); - NewMI = addRegOffset(BuildMI(*this, X86::LEA32r, 5, Dest), Src, 1); + NewMI = addRegOffset(BuildMI(get(X86::LEA32r), Dest), Src, 1); break; case X86::INC16r: case X86::INC64_16r: if (DisableLEA16) return 0; assert(MI->getNumOperands() == 2 && "Unknown inc instruction!"); - NewMI = addRegOffset(BuildMI(*this, X86::LEA16r, 5, Dest), Src, 1); + NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src, 1); break; case X86::DEC32r: case X86::DEC64_32r: assert(MI->getNumOperands() == 2 && "Unknown dec instruction!"); - NewMI = addRegOffset(BuildMI(*this, X86::LEA32r, 5, Dest), Src, -1); + NewMI = addRegOffset(BuildMI(get(X86::LEA32r), Dest), Src, -1); break; case X86::DEC16r: case X86::DEC64_16r: if (DisableLEA16) return 0; assert(MI->getNumOperands() == 2 && "Unknown dec instruction!"); - NewMI = addRegOffset(BuildMI(*this, X86::LEA16r, 5, Dest), Src, -1); + NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src, -1); break; case X86::ADD32rr: assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); - NewMI = addRegReg(BuildMI(*this, X86::LEA32r, 5, Dest), Src, + NewMI = addRegReg(BuildMI(get(X86::LEA32r), Dest), Src, MI->getOperand(2).getReg()); break; case X86::ADD16rr: if (DisableLEA16) return 0; assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); - NewMI = addRegReg(BuildMI(*this, X86::LEA16r, 5, Dest), Src, + NewMI = addRegReg(BuildMI(get(X86::LEA16r), Dest), Src, MI->getOperand(2).getReg()); break; case X86::ADD32ri: case X86::ADD32ri8: assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); if (MI->getOperand(2).isImmediate()) - NewMI = addRegOffset(BuildMI(*this, X86::LEA32r, 5, Dest), Src, + NewMI = addRegOffset(BuildMI(get(X86::LEA32r), Dest), Src, MI->getOperand(2).getImmedValue()); break; case X86::ADD16ri: @@ -200,7 +200,7 @@ if (DisableLEA16) return 0; assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); if (MI->getOperand(2).isImmediate()) - NewMI = addRegOffset(BuildMI(*this, X86::LEA16r, 5, Dest), Src, + NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src, MI->getOperand(2).getImmedValue()); break; case X86::SHL16ri: @@ -214,7 +214,7 @@ AM.Scale = 1 << ShAmt; AM.IndexReg = Src; unsigned Opc = MI->getOpcode() == X86::SHL32ri ? X86::LEA32r :X86::LEA16r; - NewMI = addFullAddress(BuildMI(*this, Opc, 5, Dest), AM); + NewMI = addFullAddress(BuildMI(get(Opc), Dest), AM); } break; } @@ -249,7 +249,7 @@ unsigned C = MI->getOperand(2).getReg(); bool BisKill = MI->getOperand(1).isKill(); bool CisKill = MI->getOperand(2).isKill(); - return BuildMI(*this, Opc, 3, A).addReg(C, false, false, CisKill) + return BuildMI(get(Opc), A).addReg(C, false, false, CisKill) .addReg(B, false, false, BisKill).addImm(Size-Amt); } default: @@ -416,19 +416,19 @@ if (FBB == 0) { // One way branch. if (Cond.empty()) { // Unconditional branch? - BuildMI(&MBB, X86::JMP, 1).addMBB(TBB); + BuildMI(&MBB, get(X86::JMP)).addMBB(TBB); } else { // Conditional branch. unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm()); - BuildMI(&MBB, Opc, 1).addMBB(TBB); + BuildMI(&MBB, get(Opc)).addMBB(TBB); } return; } // Two-way Conditional branch. unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm()); - BuildMI(&MBB, Opc, 1).addMBB(TBB); - BuildMI(&MBB, X86::JMP, 1).addMBB(FBB); + BuildMI(&MBB, get(Opc)).addMBB(TBB); + BuildMI(&MBB, get(X86::JMP)).addMBB(FBB); } bool X86InstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const { Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.180 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.181 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.180 Fri Nov 17 15:19:15 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -93,7 +93,7 @@ assert(0 && "Unknown regclass"); abort(); } - addFrameReference(BuildMI(MBB, MI, Opc, 5), FrameIdx).addReg(SrcReg); + addFrameReference(BuildMI(MBB, MI, TII.get(Opc)), FrameIdx).addReg(SrcReg); } void X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, @@ -125,7 +125,7 @@ assert(0 && "Unknown regclass"); abort(); } - addFrameReference(BuildMI(MBB, MI, Opc, 4, DestReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(Opc), DestReg), FrameIdx); } void X86RegisterInfo::copyRegToReg(MachineBasicBlock &MBB, @@ -157,7 +157,7 @@ assert(0 && "Unknown regclass"); abort(); } - BuildMI(MBB, MI, Opc, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(Opc), DestReg).addReg(SrcReg); } static MachineInstr *FuseTwoAddrInst(unsigned Opcode, unsigned FrameIndex, @@ -165,7 +165,7 @@ const TargetInstrInfo &TII) { unsigned NumOps = TII.getNumOperands(MI->getOpcode())-2; // Create the base instruction with the memory operand as the first part. - MachineInstrBuilder MIB = addFrameReference(BuildMI(TII, Opcode, 4+NumOps), + MachineInstrBuilder MIB = addFrameReference(BuildMI(TII.get(Opcode)), FrameIndex); // Loop over the rest of the ri operands, converting them over. @@ -188,7 +188,7 @@ static MachineInstr *FuseInst(unsigned Opcode, unsigned OpNo, unsigned FrameIndex, MachineInstr *MI, const TargetInstrInfo &TII) { - MachineInstrBuilder MIB = BuildMI(TII, Opcode, MI->getNumOperands()+3); + MachineInstrBuilder MIB = BuildMI(TII.get(Opcode)); for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { MachineOperand &MO = MI->getOperand(i); @@ -212,7 +212,7 @@ static MachineInstr *MakeM0Inst(const TargetInstrInfo &TII, unsigned Opcode, unsigned FrameIndex, MachineInstr *MI) { - return addFrameReference(BuildMI(TII, Opcode, 5), FrameIndex).addImm(0); + return addFrameReference(BuildMI(TII.get(Opcode)), FrameIndex).addImm(0); } @@ -908,7 +908,7 @@ MachineInstr *New = 0; if (Old->getOpcode() == X86::ADJCALLSTACKDOWN) { - New=BuildMI(TII, Is64Bit ? X86::SUB64ri32 : X86::SUB32ri, 1, StackPtr) + New=BuildMI(TII.get(Is64Bit ? X86::SUB64ri32 : X86::SUB32ri), StackPtr) .addReg(StackPtr).addImm(Amount); } else { assert(Old->getOpcode() == X86::ADJCALLSTACKUP); @@ -919,7 +919,7 @@ unsigned Opc = (Amount < 128) ? (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) : (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri); - New = BuildMI(TII, Opc, 1, StackPtr).addReg(StackPtr).addImm(Amount); + New = BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(Amount); } } @@ -935,7 +935,7 @@ (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) : (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri); MachineInstr *New = - BuildMI(TII, Opc, 1, StackPtr).addReg(StackPtr).addImm(CalleeAmt); + BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(CalleeAmt); MBB.insert(I, New); } } @@ -1012,15 +1012,15 @@ // more than 4k bytes in one go. Touching the stack at 4K increments is // necessary to ensure that the guard pages used by the OS virtual memory // manager are allocated in correct sequence. - MI = BuildMI(TII, X86::MOV32ri, 2, X86::EAX).addImm(NumBytes); + MI = BuildMI(TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes); MBB.insert(MBBI, MI); - MI = BuildMI(TII, X86::CALLpcrel32, 1).addExternalSymbol("_alloca"); + MI = BuildMI(TII.get(X86::CALLpcrel32)).addExternalSymbol("_alloca"); MBB.insert(MBBI, MI); } else { unsigned Opc = (NumBytes < 128) ? (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) : (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri); - MI= BuildMI(TII, Opc, 1, StackPtr).addReg(StackPtr).addImm(NumBytes); + MI= BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(NumBytes); MBB.insert(MBBI, MI); } } @@ -1034,17 +1034,17 @@ // Save EBP into the appropriate stack slot... // mov [ESP-], EBP - MI = addRegOffset(BuildMI(TII, Is64Bit ? X86::MOV64mr : X86::MOV32mr, 5), + MI = addRegOffset(BuildMI(TII.get(Is64Bit ? X86::MOV64mr : X86::MOV32mr)), StackPtr, EBPOffset+NumBytes).addReg(FramePtr); MBB.insert(MBBI, MI); // Update EBP with the new base value... if (NumBytes == SlotSize) // mov EBP, ESP - MI = BuildMI(TII, Is64Bit ? X86::MOV64rr : X86::MOV32rr, 2, FramePtr). + MI = BuildMI(TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), FramePtr). addReg(StackPtr); else // lea EBP, [ESP+StackSize] - MI = addRegOffset(BuildMI(TII, Is64Bit ? X86::LEA64r : X86::LEA32r, - 5, FramePtr), StackPtr, NumBytes-SlotSize); + MI = addRegOffset(BuildMI(TII.get(Is64Bit ? X86::LEA64r : X86::LEA32r), + FramePtr), StackPtr, NumBytes-SlotSize); MBB.insert(MBBI, MI); } @@ -1052,13 +1052,13 @@ // If it's main() on Cygwin\Mingw32 we should align stack as well if (Fn->hasExternalLinkage() && Fn->getName() == "main" && Subtarget->isTargetCygwin()) { - MI= BuildMI(TII, X86::AND32ri, 2, X86::ESP).addReg(X86::ESP).addImm(-Align); + MI= BuildMI(TII.get(X86::AND32ri), X86::ESP).addReg(X86::ESP).addImm(-Align); MBB.insert(MBBI, MI); // Probe the stack - MI = BuildMI(TII, X86::MOV32ri, 2, X86::EAX).addImm(Align); + MI = BuildMI(TII.get(X86::MOV32ri), X86::EAX).addImm(Align); MBB.insert(MBBI, MI); - MI = BuildMI(TII, X86::CALLpcrel32, 1).addExternalSymbol("_alloca"); + MI = BuildMI(TII.get(X86::CALLpcrel32)).addExternalSymbol("_alloca"); MBB.insert(MBBI, MI); } } @@ -1080,11 +1080,11 @@ if (hasFP(MF)) { // mov ESP, EBP - BuildMI(MBB, MBBI, Is64Bit ? X86::MOV64rr : X86::MOV32rr, 1, StackPtr). + BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr). addReg(FramePtr); // pop EBP - BuildMI(MBB, MBBI, Is64Bit ? X86::POP64r : X86::POP32r, 0, FramePtr); + BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::POP64r : X86::POP32r), FramePtr); } else { // Get the number of bytes allocated from the FrameInfo... unsigned NumBytes = MFI->getStackSize(); @@ -1112,12 +1112,12 @@ unsigned Opc = (NumBytes < 128) ? (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) : (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri); - BuildMI(MBB, MBBI, Opc, 2, StackPtr).addReg(StackPtr).addImm(NumBytes); + BuildMI(MBB, MBBI, TII.get(Opc), StackPtr).addReg(StackPtr).addImm(NumBytes); } else if ((int)NumBytes < 0) { unsigned Opc = (-NumBytes < 128) ? (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) : (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri); - BuildMI(MBB, MBBI, Opc, 2, StackPtr).addReg(StackPtr).addImm(-NumBytes); + BuildMI(MBB, MBBI, TII.get(Opc), StackPtr).addReg(StackPtr).addImm(-NumBytes); } } } From evan.cheng at apple.com Mon Nov 27 17:37:44 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/DelaySlotFiller.cpp FPMover.cpp SparcISelDAGToDAG.cpp SparcInstrInfo.cpp SparcRegisterInfo.cpp SparcRegisterInfo.h Message-ID: <200611272337.kARNbiS5009836@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: DelaySlotFiller.cpp updated: 1.10 -> 1.11 FPMover.cpp updated: 1.13 -> 1.14 SparcISelDAGToDAG.cpp updated: 1.114 -> 1.115 SparcInstrInfo.cpp updated: 1.16 -> 1.17 SparcRegisterInfo.cpp updated: 1.47 -> 1.48 SparcRegisterInfo.h updated: 1.14 -> 1.15 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+38 -29) DelaySlotFiller.cpp | 2 - FPMover.cpp | 4 ++- SparcISelDAGToDAG.cpp | 5 ++-- SparcInstrInfo.cpp | 2 - SparcRegisterInfo.cpp | 53 +++++++++++++++++++++++++++----------------------- SparcRegisterInfo.h | 1 6 files changed, 38 insertions(+), 29 deletions(-) Index: llvm/lib/Target/Sparc/DelaySlotFiller.cpp diff -u llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.10 llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.11 --- llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.10 Sat Feb 4 23:50:24 2006 +++ llvm/lib/Target/Sparc/DelaySlotFiller.cpp Mon Nov 27 17:37:22 2006 @@ -64,7 +64,7 @@ if (TII->hasDelaySlot(I->getOpcode())) { MachineBasicBlock::iterator J = I; ++J; - BuildMI(MBB, J, SP::NOP, 0); + BuildMI(MBB, J, TII->get(SP::NOP)); ++FilledSlots; Changed = true; } Index: llvm/lib/Target/Sparc/FPMover.cpp diff -u llvm/lib/Target/Sparc/FPMover.cpp:1.13 llvm/lib/Target/Sparc/FPMover.cpp:1.14 --- llvm/lib/Target/Sparc/FPMover.cpp:1.13 Thu May 4 12:52:23 2006 +++ llvm/lib/Target/Sparc/FPMover.cpp Mon Nov 27 17:37:22 2006 @@ -16,6 +16,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" #include @@ -109,7 +110,8 @@ DEBUG(std::cerr << "FPMover: the modified instr is: " << *MI); // Insert copy for the other half of the double. if (DestDReg != SrcDReg) { - MI = BuildMI(MBB, I, SP::FMOVS, 1, OddDestReg).addReg(OddSrcReg); + MI = BuildMI(MBB, I, TM.getInstrInfo()->get(SP::FMOVS), OddDestReg) + .addReg(OddSrcReg); DEBUG(std::cerr << "FPMover: the inserted instr is: " << *MI); } ++NumFpDs; Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.114 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.115 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.114 Wed Nov 8 14:33:40 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Mon Nov 27 17:37:22 2006 @@ -873,6 +873,7 @@ MachineBasicBlock * SparcTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, MachineBasicBlock *BB) { + const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo(); unsigned BROpcode; unsigned CC; // Figure out the conditional branch opcode to use for this select_cc. @@ -908,7 +909,7 @@ MachineBasicBlock *thisMBB = BB; MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB); - BuildMI(BB, BROpcode, 2).addMBB(sinkMBB).addImm(CC); + BuildMI(BB, TII.get(BROpcode)).addMBB(sinkMBB).addImm(CC); MachineFunction *F = BB->getParent(); F->getBasicBlockList().insert(It, copy0MBB); F->getBasicBlockList().insert(It, sinkMBB); @@ -936,7 +937,7 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, SP::PHI, 4, MI->getOperand(0).getReg()) + BuildMI(BB, TII.get(SP::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); Index: llvm/lib/Target/Sparc/SparcInstrInfo.cpp diff -u llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.16 llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.17 --- llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.16 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/Sparc/SparcInstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -102,5 +102,5 @@ const std::vector &Cond)const{ // Can only insert uncond branches so far. assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!"); - BuildMI(&MBB, SP::BA, 1).addMBB(TBB); + BuildMI(&MBB, get(SP::BA)).addMBB(TBB); } Index: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.47 llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.48 --- llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.47 Wed Nov 15 14:58:11 2006 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -18,6 +18,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineLocation.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Type.h" #include "llvm/ADT/STLExtras.h" #include @@ -35,11 +36,14 @@ const TargetRegisterClass *RC) const { // On the order of operands here: think "[FrameIdx + 0] = SrcReg". if (RC == SP::IntRegsRegisterClass) - BuildMI(MBB, I, SP::STri, 3).addFrameIndex(FI).addImm(0).addReg(SrcReg); + BuildMI(MBB, I, TII.get(SP::STri)).addFrameIndex(FI).addImm(0) + .addReg(SrcReg); else if (RC == SP::FPRegsRegisterClass) - BuildMI(MBB, I, SP::STFri, 3).addFrameIndex(FI).addImm(0).addReg(SrcReg); + BuildMI(MBB, I, TII.get(SP::STFri)).addFrameIndex(FI).addImm(0) + .addReg(SrcReg); else if (RC == SP::DFPRegsRegisterClass) - BuildMI(MBB, I, SP::STDFri, 3).addFrameIndex(FI).addImm(0).addReg(SrcReg); + BuildMI(MBB, I, TII.get(SP::STDFri)).addFrameIndex(FI).addImm(0) + .addReg(SrcReg); else assert(0 && "Can't store this register to stack slot"); } @@ -49,11 +53,11 @@ unsigned DestReg, int FI, const TargetRegisterClass *RC) const { if (RC == SP::IntRegsRegisterClass) - BuildMI(MBB, I, SP::LDri, 2, DestReg).addFrameIndex(FI).addImm(0); + BuildMI(MBB, I, TII.get(SP::LDri), DestReg).addFrameIndex(FI).addImm(0); else if (RC == SP::FPRegsRegisterClass) - BuildMI(MBB, I, SP::LDFri, 2, DestReg).addFrameIndex(FI).addImm (0); + BuildMI(MBB, I, TII.get(SP::LDFri), DestReg).addFrameIndex(FI).addImm(0); else if (RC == SP::DFPRegsRegisterClass) - BuildMI(MBB, I, SP::LDDFri, 2, DestReg).addFrameIndex(FI).addImm(0); + BuildMI(MBB, I, TII.get(SP::LDDFri), DestReg).addFrameIndex(FI).addImm(0); else assert(0 && "Can't load this register from stack slot"); } @@ -63,12 +67,12 @@ unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const { if (RC == SP::IntRegsRegisterClass) - BuildMI(MBB, I, SP::ORrr, 2, DestReg).addReg(SP::G0).addReg(SrcReg); + BuildMI(MBB, I, TII.get(SP::ORrr), DestReg).addReg(SP::G0).addReg(SrcReg); else if (RC == SP::FPRegsRegisterClass) - BuildMI(MBB, I, SP::FMOVS, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, I, TII.get(SP::FMOVS), DestReg).addReg(SrcReg); else if (RC == SP::DFPRegsRegisterClass) - BuildMI(MBB, I, Subtarget.isV9() ? SP::FMOVD : SP::FpMOVD, - 1, DestReg).addReg(SrcReg); + BuildMI(MBB, I, TII.get(Subtarget.isV9() ? SP::FMOVD : SP::FpMOVD),DestReg) + .addReg(SrcReg); else assert (0 && "Can't copy this register"); } @@ -83,10 +87,10 @@ if (MI->getOperand(1).isRegister() && MI->getOperand(1).getReg() == SP::G0&& MI->getOperand(0).isRegister() && MI->getOperand(2).isRegister()) { if (OpNum == 0) // COPY -> STORE - NewMI = BuildMI(TII, SP::STri, 3).addFrameIndex(FI).addImm(0) + NewMI = BuildMI(TII.get(SP::STri)).addFrameIndex(FI).addImm(0) .addReg(MI->getOperand(2).getReg()); else // COPY -> LOAD - NewMI = BuildMI(TII, SP::LDri, 2, MI->getOperand(0).getReg()) + NewMI = BuildMI(TII.get(SP::LDri), MI->getOperand(0).getReg()) .addFrameIndex(FI).addImm(0); } break; @@ -95,10 +99,10 @@ // FALLTHROUGH case SP::FMOVD: if (OpNum == 0) // COPY -> STORE - NewMI = BuildMI(TII, isFloat ? SP::STFri : SP::STDFri, 3) + NewMI = BuildMI(TII.get(isFloat ? SP::STFri : SP::STDFri)) .addFrameIndex(FI).addImm(0).addReg(MI->getOperand(1).getReg()); else // COPY -> LOAD - NewMI = BuildMI(TII, isFloat ? SP::LDFri : SP::LDDFri, 2, + NewMI = BuildMI(TII.get(isFloat ? SP::LDFri : SP::LDDFri), MI->getOperand(0).getReg()).addFrameIndex(FI).addImm(0); break; } @@ -128,7 +132,7 @@ if (MI.getOpcode() == SP::ADJCALLSTACKDOWN) Size = -Size; if (Size) - BuildMI(MBB, I, SP::ADDri, 2, SP::O6).addReg(SP::O6).addImm(Size); + BuildMI(MBB, I, TII.get(SP::ADDri), SP::O6).addReg(SP::O6).addImm(Size); MBB.erase(I); } @@ -158,10 +162,10 @@ // Otherwise, emit a G1 = SETHI %hi(offset). FIXME: it would be better to // scavenge a register here instead of reserving G1 all of the time. unsigned OffHi = (unsigned)Offset >> 10U; - BuildMI(*MI.getParent(), II, SP::SETHIi, 1, SP::G1).addImm(OffHi); + BuildMI(*MI.getParent(), II, TII.get(SP::SETHIi), SP::G1).addImm(OffHi); // Emit G1 = G1 + I6 - BuildMI(*MI.getParent(), II, SP::ADDrr, 2, - SP::G1).addReg(SP::G1).addReg(SP::I6); + BuildMI(*MI.getParent(), II, TII.get(SP::ADDrr), SP::G1).addReg(SP::G1) + .addReg(SP::I6); // Insert: G1+%lo(offset) into the user. MI.getOperand(i).ChangeToRegister(SP::G1, false); MI.getOperand(i+1).ChangeToImmediate(Offset & ((1 << 10)-1)); @@ -192,19 +196,19 @@ NumBytes = -NumBytes; if (NumBytes >= -4096) { - BuildMI(MBB, MBB.begin(), SP::SAVEri, 2, + BuildMI(MBB, MBB.begin(), TII.get(SP::SAVEri), SP::O6).addImm(NumBytes).addReg(SP::O6); } else { MachineBasicBlock::iterator InsertPt = MBB.begin(); // Emit this the hard way. This clobbers G1 which we always know is // available here. unsigned OffHi = (unsigned)NumBytes >> 10U; - BuildMI(MBB, InsertPt, SP::SETHIi, 1, SP::G1).addImm(OffHi); + BuildMI(MBB, InsertPt, TII.get(SP::SETHIi), SP::G1).addImm(OffHi); // Emit G1 = G1 + I6 - BuildMI(MBB, InsertPt, SP::ORri, 2, SP::G1) + BuildMI(MBB, InsertPt, TII.get(SP::ORri), SP::G1) .addReg(SP::G1).addImm(NumBytes & ((1 << 10)-1)); - BuildMI(MBB, InsertPt, SP::SAVErr, 2, - SP::O6).addReg(SP::O6).addReg(SP::G1); + BuildMI(MBB, InsertPt, TII.get(SP::SAVErr), SP::O6) + .addReg(SP::O6).addReg(SP::G1); } } @@ -213,7 +217,8 @@ MachineBasicBlock::iterator MBBI = prior(MBB.end()); assert(MBBI->getOpcode() == SP::RETL && "Can only put epilog before 'retl' instruction!"); - BuildMI(MBB, MBBI, SP::RESTORErr, 2, SP::G0).addReg(SP::G0).addReg(SP::G0); + BuildMI(MBB, MBBI, TII.get(SP::RESTORErr), SP::G0).addReg(SP::G0) + .addReg(SP::G0); } unsigned SparcRegisterInfo::getRARegister() const { Index: llvm/lib/Target/Sparc/SparcRegisterInfo.h diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.14 llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.15 --- llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.14 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.h Mon Nov 27 17:37:22 2006 @@ -20,6 +20,7 @@ namespace llvm { class SparcSubtarget; +class TargetInstrInfo; class Type; struct SparcRegisterInfo : public SparcGenRegisterInfo { From evan.cheng at apple.com Mon Nov 27 17:37:43 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.cpp AlphaLLRP.cpp AlphaRegisterInfo.cpp AlphaRegisterInfo.h Message-ID: <200611272337.kARNbhrA009821@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.cpp updated: 1.14 -> 1.15 AlphaLLRP.cpp updated: 1.3 -> 1.4 AlphaRegisterInfo.cpp updated: 1.52 -> 1.53 AlphaRegisterInfo.h updated: 1.14 -> 1.15 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+46 -41) AlphaInstrInfo.cpp | 14 ++++++------ AlphaLLRP.cpp | 17 +++++++++------ AlphaRegisterInfo.cpp | 55 +++++++++++++++++++++++++------------------------- AlphaRegisterInfo.h | 1 4 files changed, 46 insertions(+), 41 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.14 llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.15 --- llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.14 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -110,25 +110,25 @@ // One-way branch. if (FBB == 0) { if (Cond.empty()) // Unconditional branch - BuildMI(&MBB, Alpha::BR, 1).addMBB(TBB); + BuildMI(&MBB, get(Alpha::BR)).addMBB(TBB); else // Conditional branch if (isAlphaIntCondCode(Cond[0].getImm())) - BuildMI(&MBB, Alpha::COND_BRANCH_I, 3) + BuildMI(&MBB, get(Alpha::COND_BRANCH_I)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); else - BuildMI(&MBB, Alpha::COND_BRANCH_F, 3) + BuildMI(&MBB, get(Alpha::COND_BRANCH_F)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); return; } // Two-way Conditional Branch. if (isAlphaIntCondCode(Cond[0].getImm())) - BuildMI(&MBB, Alpha::COND_BRANCH_I, 3) + BuildMI(&MBB, get(Alpha::COND_BRANCH_I)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); else - BuildMI(&MBB, Alpha::COND_BRANCH_F, 3) + BuildMI(&MBB, get(Alpha::COND_BRANCH_F)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); - BuildMI(&MBB, Alpha::BR, 1).addMBB(FBB); + BuildMI(&MBB, get(Alpha::BR)).addMBB(FBB); } static unsigned AlphaRevCondCode(unsigned Opcode) { @@ -230,7 +230,7 @@ void AlphaInstrInfo::insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const { - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); } Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.3 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.4 --- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.3 Tue Oct 31 17:46:56 2006 +++ llvm/lib/Target/Alpha/AlphaLLRP.cpp Mon Nov 27 17:37:22 2006 @@ -15,6 +15,8 @@ #include "Alpha.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CommandLine.h" @@ -42,6 +44,7 @@ } bool runOnMachineFunction(MachineFunction &F) { + const TargetInstrInfo *TII = F.getTarget().getInstrInfo(); bool Changed = false; MachineInstr* prev[3] = {0,0,0}; unsigned count = 0; @@ -70,7 +73,7 @@ prev[0] = prev[1]; prev[1] = prev[2]; prev[2] = 0; - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); Changed = true; nopintro += 1; count += 1; @@ -81,9 +84,9 @@ MI->getOperand(1).getImmedValue()) { prev[0] = prev[2]; prev[1] = prev[2] = 0; - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); Changed = true; nopintro += 2; count += 2; @@ -93,11 +96,11 @@ && prev[2]->getOperand(1).getImmedValue() == MI->getOperand(1).getImmedValue()) { prev[0] = prev[1] = prev[2] = 0; - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); - BuildMI(MBB, MI, Alpha::BISr, 2, Alpha::R31).addReg(Alpha::R31) + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) .addReg(Alpha::R31); Changed = true; nopintro += 3; count += 3; @@ -130,7 +133,7 @@ if (ub || AlignAll) { //we can align stuff for free at this point while (count % 4) { - BuildMI(MBB, MBB.end(), Alpha::BISr, 2, Alpha::R31) + BuildMI(MBB, MBB.end(), TII->get(Alpha::BISr), Alpha::R31) .addReg(Alpha::R31).addReg(Alpha::R31); ++count; ++nopalign; Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.52 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.53 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.52 Wed Nov 15 14:58:11 2006 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -25,6 +25,7 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/STLExtras.h" @@ -66,13 +67,13 @@ //<< FrameIdx << "\n"; //BuildMI(MBB, MI, Alpha::WTF, 0).addReg(SrcReg); if (RC == Alpha::F4RCRegisterClass) - BuildMI(MBB, MI, Alpha::STS, 3) + BuildMI(MBB, MI, TII.get(Alpha::STS)) .addReg(SrcReg).addFrameIndex(FrameIdx).addReg(Alpha::F31); else if (RC == Alpha::F8RCRegisterClass) - BuildMI(MBB, MI, Alpha::STT, 3) + BuildMI(MBB, MI, TII.get(Alpha::STT)) .addReg(SrcReg).addFrameIndex(FrameIdx).addReg(Alpha::F31); else if (RC == Alpha::GPRCRegisterClass) - BuildMI(MBB, MI, Alpha::STQ, 3) + BuildMI(MBB, MI, TII.get(Alpha::STQ)) .addReg(SrcReg).addFrameIndex(FrameIdx).addReg(Alpha::F31); else abort(); @@ -86,13 +87,13 @@ //std::cerr << "Trying to load " << getPrettyName(DestReg) << " to " //<< FrameIdx << "\n"; if (RC == Alpha::F4RCRegisterClass) - BuildMI(MBB, MI, Alpha::LDS, 2, DestReg) + BuildMI(MBB, MI, TII.get(Alpha::LDS), DestReg) .addFrameIndex(FrameIdx).addReg(Alpha::F31); else if (RC == Alpha::F8RCRegisterClass) - BuildMI(MBB, MI, Alpha::LDT, 2, DestReg) + BuildMI(MBB, MI, TII.get(Alpha::LDT), DestReg) .addFrameIndex(FrameIdx).addReg(Alpha::F31); else if (RC == Alpha::GPRCRegisterClass) - BuildMI(MBB, MI, Alpha::LDQ, 2, DestReg) + BuildMI(MBB, MI, TII.get(Alpha::LDQ), DestReg) .addFrameIndex(FrameIdx).addReg(Alpha::F31); else abort(); @@ -116,13 +117,13 @@ unsigned InReg = MI->getOperand(1).getReg(); Opc = (Opc == Alpha::BISr) ? Alpha::STQ : ((Opc == Alpha::CPYSS) ? Alpha::STS : Alpha::STT); - NewMI = BuildMI(TII, Opc, 3).addReg(InReg).addFrameIndex(FrameIndex) + NewMI = BuildMI(TII.get(Opc)).addReg(InReg).addFrameIndex(FrameIndex) .addReg(Alpha::F31); } else { // load -> move unsigned OutReg = MI->getOperand(0).getReg(); Opc = (Opc == Alpha::BISr) ? Alpha::LDQ : ((Opc == Alpha::CPYSS) ? Alpha::LDS : Alpha::LDT); - NewMI = BuildMI(TII, Opc, 2, OutReg).addFrameIndex(FrameIndex) + NewMI = BuildMI(TII.get(Opc), OutReg).addFrameIndex(FrameIndex) .addReg(Alpha::F31); } } @@ -140,11 +141,11 @@ const TargetRegisterClass *RC) const { // std::cerr << "copyRegToReg " << DestReg << " <- " << SrcReg << "\n"; if (RC == Alpha::GPRCRegisterClass) { - BuildMI(MBB, MI, Alpha::BISr, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(Alpha::BISr), DestReg).addReg(SrcReg).addReg(SrcReg); } else if (RC == Alpha::F4RCRegisterClass) { - BuildMI(MBB, MI, Alpha::CPYSS, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(Alpha::CPYSS), DestReg).addReg(SrcReg).addReg(SrcReg); } else if (RC == Alpha::F8RCRegisterClass) { - BuildMI(MBB, MI, Alpha::CPYST, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(Alpha::CPYST), DestReg).addReg(SrcReg).addReg(SrcReg); } else { std::cerr << "Attempt to copy register that is not GPR or FPR"; abort(); @@ -209,11 +210,11 @@ MachineInstr *New; if (Old->getOpcode() == Alpha::ADJUSTSTACKDOWN) { - New=BuildMI(TII, Alpha::LDA, 2, Alpha::R30) + New=BuildMI(TII.get(Alpha::LDA), Alpha::R30) .addImm(-Amount).addReg(Alpha::R30); } else { assert(Old->getOpcode() == Alpha::ADJUSTSTACKUP); - New=BuildMI(TII, Alpha::LDA, 2, Alpha::R30) + New=BuildMI(TII.get(Alpha::LDA), Alpha::R30) .addImm(Amount).addReg(Alpha::R30); } @@ -270,7 +271,7 @@ MI.getOperand(i + 1).ChangeToRegister(Alpha::R28, false); MI.getOperand(i).ChangeToImmediate(getLower16(Offset)); //insert the new - MachineInstr* nMI=BuildMI(TII, Alpha::LDAH, 2, Alpha::R28) + MachineInstr* nMI=BuildMI(TII.get(Alpha::LDAH), Alpha::R28) .addImm(getUpper16(Offset)).addReg(FP ? Alpha::R15 : Alpha::R30); MBB.insert(II, nMI); } else { @@ -288,15 +289,15 @@ static int curgpdist = 0; //handle GOP offset - BuildMI(MBB, MBBI, Alpha::LDAHg, 3, Alpha::R29) + BuildMI(MBB, MBBI, TII.get(Alpha::LDAHg), Alpha::R29) .addGlobalAddress(const_cast(MF.getFunction())) .addReg(Alpha::R27).addImm(++curgpdist); - BuildMI(MBB, MBBI, Alpha::LDAg, 3, Alpha::R29) + BuildMI(MBB, MBBI, TII.get(Alpha::LDAg), Alpha::R29) .addGlobalAddress(const_cast(MF.getFunction())) .addReg(Alpha::R29).addImm(curgpdist); //evil const_cast until MO stuff setup to handle const - BuildMI(MBB, MBBI, Alpha::ALTENT, 1) + BuildMI(MBB, MBBI, TII.get(Alpha::ALTENT)) .addGlobalAddress(const_cast(MF.getFunction())); // Get the number of bytes to allocate from the FrameInfo @@ -327,12 +328,12 @@ // adjust stack pointer: r30 -= numbytes NumBytes = -NumBytes; if (NumBytes >= IMM_LOW) { - BuildMI(MBB, MBBI, Alpha::LDA, 2, Alpha::R30).addImm(NumBytes) + BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes) .addReg(Alpha::R30); } else if (getUpper16(NumBytes) >= IMM_LOW) { - BuildMI(MBB, MBBI, Alpha::LDAH, 2, Alpha::R30).addImm(getUpper16(NumBytes)) + BuildMI(MBB, MBBI, TII.get(Alpha::LDAH), Alpha::R30).addImm(getUpper16(NumBytes)) .addReg(Alpha::R30); - BuildMI(MBB, MBBI, Alpha::LDA, 2, Alpha::R30).addImm(getLower16(NumBytes)) + BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(getLower16(NumBytes)) .addReg(Alpha::R30); } else { std::cerr << "Too big a stack frame at " << NumBytes << "\n"; @@ -342,10 +343,10 @@ //now if we need to, save the old FP and set the new if (FP) { - BuildMI(MBB, MBBI, Alpha::STQ, 3) + BuildMI(MBB, MBBI, TII.get(Alpha::STQ)) .addReg(Alpha::R15).addImm(0).addReg(Alpha::R30); //this must be the last instr in the prolog - BuildMI(MBB, MBBI, Alpha::BISr, 2, Alpha::R15) + BuildMI(MBB, MBBI, TII.get(Alpha::BISr), Alpha::R15) .addReg(Alpha::R30).addReg(Alpha::R30); } @@ -368,21 +369,21 @@ if (FP) { //copy the FP into the SP (discards allocas) - BuildMI(MBB, MBBI, Alpha::BISr, 2, Alpha::R30).addReg(Alpha::R15) + BuildMI(MBB, MBBI, TII.get(Alpha::BISr), Alpha::R30).addReg(Alpha::R15) .addReg(Alpha::R15); //restore the FP - BuildMI(MBB, MBBI, Alpha::LDQ, 2, Alpha::R15).addImm(0).addReg(Alpha::R15); + BuildMI(MBB, MBBI, TII.get(Alpha::LDQ), Alpha::R15).addImm(0).addReg(Alpha::R15); } if (NumBytes != 0) { if (NumBytes <= IMM_HIGH) { - BuildMI(MBB, MBBI, Alpha::LDA, 2, Alpha::R30).addImm(NumBytes) + BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes) .addReg(Alpha::R30); } else if (getUpper16(NumBytes) <= IMM_HIGH) { - BuildMI(MBB, MBBI, Alpha::LDAH, 2, Alpha::R30) + BuildMI(MBB, MBBI, TII.get(Alpha::LDAH), Alpha::R30) .addImm(getUpper16(NumBytes)).addReg(Alpha::R30); - BuildMI(MBB, MBBI, Alpha::LDA, 2, Alpha::R30) + BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30) .addImm(getLower16(NumBytes)).addReg(Alpha::R30); } else { std::cerr << "Too big a stack frame at " << NumBytes << "\n"; Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.h diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.14 llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.15 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.14 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.h Mon Nov 27 17:37:22 2006 @@ -19,6 +19,7 @@ namespace llvm { +class TargetInstrInfo; class Type; struct AlphaRegisterInfo : public AlphaGenRegisterInfo { From evan.cheng at apple.com Mon Nov 27 17:37:45 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 17:37:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp PPCISelDAGToDAG.cpp PPCISelLowering.cpp PPCInstrInfo.cpp PPCRegisterInfo.cpp PPCRegisterInfo.h Message-ID: <200611272337.kARNbjO9009867@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.38 -> 1.39 PPCISelDAGToDAG.cpp updated: 1.224 -> 1.225 PPCISelLowering.cpp updated: 1.232 -> 1.233 PPCInstrInfo.cpp updated: 1.34 -> 1.35 PPCRegisterInfo.cpp updated: 1.89 -> 1.90 PPCRegisterInfo.h updated: 1.18 -> 1.19 --- Log message: Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead of opcode and number of operands. --- Diffs of the changes: (+117 -102) PPCBranchSelector.cpp | 5 - PPCISelDAGToDAG.cpp | 19 ++--- PPCISelLowering.cpp | 5 - PPCInstrInfo.cpp | 10 +- PPCRegisterInfo.cpp | 179 ++++++++++++++++++++++++++------------------------ PPCRegisterInfo.h | 1 6 files changed, 117 insertions(+), 102 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.38 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.39 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.38 Fri Nov 17 18:32:03 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Mon Nov 27 17:37:22 2006 @@ -73,6 +73,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) { + const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo(); // Give the blocks of the function a dense, in-order, numbering. Fn.RenumberBlocks(); BlockSizes.resize(Fn.getNumBlockIDs()); @@ -165,11 +166,11 @@ MachineInstr *OldBranch = I; // Jump over the uncond branch inst (i.e. $PC+8) on opposite condition. - BuildMI(MBB, I, PPC::BCC, 3) + BuildMI(MBB, I, TII->get(PPC::BCC)) .addImm(PPC::InvertPredicate(Pred)).addReg(CRReg).addImm(2); // Uncond branch to the real destination. - I = BuildMI(MBB, I, PPC::B, 1).addMBB(Dest); + I = BuildMI(MBB, I, TII->get(PPC::B)).addMBB(Dest); // Remove the old branch from the function. OldBranch->eraseFromParent(); Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.224 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.225 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.224 Fri Nov 17 16:37:34 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Nov 27 17:37:22 2006 @@ -250,18 +250,18 @@ unsigned InVRSAVE = RegMap->createVirtualRegister(&PPC::GPRCRegClass); unsigned UpdatedVRSAVE = RegMap->createVirtualRegister(&PPC::GPRCRegClass); + const TargetInstrInfo &TII = *TM.getInstrInfo(); MachineBasicBlock &EntryBB = *Fn.begin(); // Emit the following code into the entry block: // InVRSAVE = MFVRSAVE // UpdatedVRSAVE = UPDATE_VRSAVE InVRSAVE // MTVRSAVE UpdatedVRSAVE MachineBasicBlock::iterator IP = EntryBB.begin(); // Insert Point - BuildMI(EntryBB, IP, PPC::MFVRSAVE, 0, InVRSAVE); - BuildMI(EntryBB, IP, PPC::UPDATE_VRSAVE, 1, UpdatedVRSAVE).addReg(InVRSAVE); - BuildMI(EntryBB, IP, PPC::MTVRSAVE, 1).addReg(UpdatedVRSAVE); + BuildMI(EntryBB, IP, TII.get(PPC::MFVRSAVE), InVRSAVE); + BuildMI(EntryBB, IP, TII.get(PPC::UPDATE_VRSAVE), UpdatedVRSAVE).addReg(InVRSAVE); + BuildMI(EntryBB, IP, TII.get(PPC::MTVRSAVE)).addReg(UpdatedVRSAVE); // Find all return blocks, outputting a restore in each epilog. - const TargetInstrInfo &TII = *TM.getInstrInfo(); for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { if (!BB->empty() && TII.isReturn(BB->back().getOpcode())) { IP = BB->end(); --IP; @@ -273,7 +273,7 @@ IP = I2; // Emit: MTVRSAVE InVRSave - BuildMI(*BB, IP, PPC::MTVRSAVE, 1).addReg(InVRSAVE); + BuildMI(*BB, IP, TII.get(PPC::MTVRSAVE)).addReg(InVRSAVE); } } } @@ -284,6 +284,7 @@ /// SDNode *PPCDAGToDAGISel::getGlobalBaseReg() { if (!GlobalBaseReg) { + const TargetInstrInfo &TII = *TM.getInstrInfo(); // Insert the set of GlobalBaseReg into the first MBB of the function MachineBasicBlock &FirstMBB = BB->getParent()->front(); MachineBasicBlock::iterator MBBI = FirstMBB.begin(); @@ -291,12 +292,12 @@ if (PPCLowering.getPointerTy() == MVT::i32) { GlobalBaseReg = RegMap->createVirtualRegister(PPC::GPRCRegisterClass); - BuildMI(FirstMBB, MBBI, PPC::MovePCtoLR, 0, PPC::LR); - BuildMI(FirstMBB, MBBI, PPC::MFLR, 1, GlobalBaseReg); + BuildMI(FirstMBB, MBBI, TII.get(PPC::MovePCtoLR), PPC::LR); + BuildMI(FirstMBB, MBBI, TII.get(PPC::MFLR), GlobalBaseReg); } else { GlobalBaseReg = RegMap->createVirtualRegister(PPC::G8RCRegisterClass); - BuildMI(FirstMBB, MBBI, PPC::MovePCtoLR8, 0, PPC::LR8); - BuildMI(FirstMBB, MBBI, PPC::MFLR8, 1, GlobalBaseReg); + BuildMI(FirstMBB, MBBI, TII.get(PPC::MovePCtoLR8), PPC::LR8); + BuildMI(FirstMBB, MBBI, TII.get(PPC::MFLR8), GlobalBaseReg); } } return CurDAG->getRegister(GlobalBaseReg, PPCLowering.getPointerTy()).Val; Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.232 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.233 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.232 Fri Nov 17 19:57:19 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Nov 27 17:37:22 2006 @@ -2593,6 +2593,7 @@ MachineBasicBlock * PPCTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, MachineBasicBlock *BB) { + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); assert((MI->getOpcode() == PPC::SELECT_CC_I4 || MI->getOpcode() == PPC::SELECT_CC_I8 || MI->getOpcode() == PPC::SELECT_CC_F4 || @@ -2618,7 +2619,7 @@ MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB); unsigned SelectPred = MI->getOperand(4).getImm(); - BuildMI(BB, PPC::BCC, 3) + BuildMI(BB, TII->get(PPC::BCC)) .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); MachineFunction *F = BB->getParent(); F->getBasicBlockList().insert(It, copy0MBB); @@ -2647,7 +2648,7 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, PPC::PHI, 4, MI->getOperand(0).getReg()) + BuildMI(BB, TII->get(PPC::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.34 llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.35 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.34 Fri Nov 17 16:37:34 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Mon Nov 27 17:37:22 2006 @@ -171,7 +171,7 @@ void PPCInstrInfo::insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const { - BuildMI(MBB, MI, PPC::NOP, 0); + BuildMI(MBB, MI, get(PPC::NOP)); } @@ -257,17 +257,17 @@ // One-way branch. if (FBB == 0) { if (Cond.empty()) // Unconditional branch - BuildMI(&MBB, PPC::B, 1).addMBB(TBB); + BuildMI(&MBB, get(PPC::B)).addMBB(TBB); else // Conditional branch - BuildMI(&MBB, PPC::BCC, 3) + BuildMI(&MBB, get(PPC::BCC)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); return; } // Two-way Conditional Branch. - BuildMI(&MBB, PPC::BCC, 3) + BuildMI(&MBB, get(PPC::BCC)) .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB); - BuildMI(&MBB, PPC::B, 1).addMBB(FBB); + BuildMI(&MBB, get(PPC::B)).addMBB(FBB); } bool PPCInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const { Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.89 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.90 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.89 Mon Nov 20 13:33:51 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Nov 27 17:37:22 2006 @@ -103,54 +103,60 @@ const TargetRegisterClass *RC) const { if (RC == PPC::GPRCRegisterClass) { if (SrcReg != PPC::LR) { - addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(SrcReg),FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STW)).addReg(SrcReg), + FrameIdx); } else { // FIXME: this spills LR immediately to memory in one step. To do this, // we use R11, which we know cannot be used in the prolog/epilog. This is // a hack. - BuildMI(MBB, MI, PPC::MFLR, 1, PPC::R11); - addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(PPC::R11), + BuildMI(MBB, MI, TII.get(PPC::MFLR), PPC::R11); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STW)).addReg(PPC::R11), FrameIdx); } } else if (RC == PPC::G8RCRegisterClass) { if (SrcReg != PPC::LR8) { - addFrameReference(BuildMI(MBB, MI, PPC::STD, 3).addReg(SrcReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STD)).addReg(SrcReg), + FrameIdx); } else { // FIXME: this spills LR immediately to memory in one step. To do this, // we use R11, which we know cannot be used in the prolog/epilog. This is // a hack. - BuildMI(MBB, MI, PPC::MFLR8, 1, PPC::X11); - addFrameReference(BuildMI(MBB, MI, PPC::STD, 3).addReg(PPC::X11), + BuildMI(MBB, MI, TII.get(PPC::MFLR8), PPC::X11); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STD)).addReg(PPC::X11), FrameIdx); } } else if (RC == PPC::F8RCRegisterClass) { - addFrameReference(BuildMI(MBB, MI, PPC::STFD, 3).addReg(SrcReg),FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STFD)).addReg(SrcReg), + FrameIdx); } else if (RC == PPC::F4RCRegisterClass) { - addFrameReference(BuildMI(MBB, MI, PPC::STFS, 3).addReg(SrcReg),FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STFS)).addReg(SrcReg), + FrameIdx); } else if (RC == PPC::CRRCRegisterClass) { // FIXME: We use R0 here, because it isn't available for RA. // We need to store the CR in the low 4-bits of the saved value. First, // issue a MFCR to save all of the CRBits. - BuildMI(MBB, MI, PPC::MFCR, 0, PPC::R0); + BuildMI(MBB, MI, TII.get(PPC::MFCR), PPC::R0); // If the saved register wasn't CR0, shift the bits left so that they are in // CR0's slot. if (SrcReg != PPC::CR0) { unsigned ShiftBits = PPCRegisterInfo::getRegisterNumbering(SrcReg)*4; // rlwinm r0, r0, ShiftBits, 0, 31. - BuildMI(MBB, MI, PPC::RLWINM, 4, PPC::R0) + BuildMI(MBB, MI, TII.get(PPC::RLWINM), PPC::R0) .addReg(PPC::R0).addImm(ShiftBits).addImm(0).addImm(31); } - addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(PPC::R0), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::STW)).addReg(PPC::R0), + FrameIdx); } else if (RC == PPC::VRRCRegisterClass) { // We don't have indexed addressing for vector loads. Emit: // R11 = ADDI FI# // Dest = LVX R0, R11 // // FIXME: We use R0 here, because it isn't available for RA. - addFrameReference(BuildMI(MBB, MI, PPC::ADDI, 1, PPC::R0), FrameIdx, 0, 0); - BuildMI(MBB, MI, PPC::STVX, 3) + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::ADDI), PPC::R0), + FrameIdx, 0, 0); + BuildMI(MBB, MI, TII.get(PPC::STVX)) .addReg(SrcReg).addReg(PPC::R0).addReg(PPC::R0); } else { assert(0 && "Unknown regclass!"); @@ -165,44 +171,45 @@ const TargetRegisterClass *RC) const { if (RC == PPC::GPRCRegisterClass) { if (DestReg != PPC::LR) { - addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, DestReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LWZ), DestReg), FrameIdx); } else { - addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, PPC::R11), FrameIdx); - BuildMI(MBB, MI, PPC::MTLR, 1).addReg(PPC::R11); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LWZ), PPC::R11),FrameIdx); + BuildMI(MBB, MI, TII.get(PPC::MTLR)).addReg(PPC::R11); } } else if (RC == PPC::G8RCRegisterClass) { if (DestReg != PPC::LR8) { - addFrameReference(BuildMI(MBB, MI, PPC::LD, 2, DestReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LD), DestReg), FrameIdx); } else { - addFrameReference(BuildMI(MBB, MI, PPC::LD, 2, PPC::R11), FrameIdx); - BuildMI(MBB, MI, PPC::MTLR8, 1).addReg(PPC::R11); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LD), PPC::R11), FrameIdx); + BuildMI(MBB, MI, TII.get(PPC::MTLR8)).addReg(PPC::R11); } } else if (RC == PPC::F8RCRegisterClass) { - addFrameReference(BuildMI(MBB, MI, PPC::LFD, 2, DestReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LFD), DestReg), FrameIdx); } else if (RC == PPC::F4RCRegisterClass) { - addFrameReference(BuildMI(MBB, MI, PPC::LFS, 2, DestReg), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LFS), DestReg), FrameIdx); } else if (RC == PPC::CRRCRegisterClass) { // FIXME: We use R0 here, because it isn't available for RA. - addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, PPC::R0), FrameIdx); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::LWZ), PPC::R0), FrameIdx); // If the reloaded register isn't CR0, shift the bits right so that they are // in the right CR's slot. if (DestReg != PPC::CR0) { unsigned ShiftBits = PPCRegisterInfo::getRegisterNumbering(DestReg)*4; // rlwinm r11, r11, 32-ShiftBits, 0, 31. - BuildMI(MBB, MI, PPC::RLWINM, 4, PPC::R0) + BuildMI(MBB, MI, TII.get(PPC::RLWINM), PPC::R0) .addReg(PPC::R0).addImm(32-ShiftBits).addImm(0).addImm(31); } - BuildMI(MBB, MI, PPC::MTCRF, 1, DestReg).addReg(PPC::R0); + BuildMI(MBB, MI, TII.get(PPC::MTCRF), DestReg).addReg(PPC::R0); } else if (RC == PPC::VRRCRegisterClass) { // We don't have indexed addressing for vector loads. Emit: // R11 = ADDI FI# // Dest = LVX R0, R11 // // FIXME: We use R0 here, because it isn't available for RA. - addFrameReference(BuildMI(MBB, MI, PPC::ADDI, 1, PPC::R0), FrameIdx, 0, 0); - BuildMI(MBB, MI, PPC::LVX, 2, DestReg).addReg(PPC::R0).addReg(PPC::R0); + addFrameReference(BuildMI(MBB, MI, TII.get(PPC::ADDI), PPC::R0), + FrameIdx, 0, 0); + BuildMI(MBB, MI, TII.get(PPC::LVX),DestReg).addReg(PPC::R0).addReg(PPC::R0); } else { assert(0 && "Unknown regclass!"); abort(); @@ -214,17 +221,17 @@ unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const { if (RC == PPC::GPRCRegisterClass) { - BuildMI(MBB, MI, PPC::OR, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::OR), DestReg).addReg(SrcReg).addReg(SrcReg); } else if (RC == PPC::G8RCRegisterClass) { - BuildMI(MBB, MI, PPC::OR8, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::OR8), DestReg).addReg(SrcReg).addReg(SrcReg); } else if (RC == PPC::F4RCRegisterClass) { - BuildMI(MBB, MI, PPC::FMRS, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::FMRS), DestReg).addReg(SrcReg); } else if (RC == PPC::F8RCRegisterClass) { - BuildMI(MBB, MI, PPC::FMRD, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::FMRD), DestReg).addReg(SrcReg); } else if (RC == PPC::CRRCRegisterClass) { - BuildMI(MBB, MI, PPC::MCRF, 1, DestReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::MCRF), DestReg).addReg(SrcReg); } else if (RC == PPC::VRRCRegisterClass) { - BuildMI(MBB, MI, PPC::VOR, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + BuildMI(MBB, MI, TII.get(PPC::VOR), DestReg).addReg(SrcReg).addReg(SrcReg); } else { std::cerr << "Attempt to copy register that is not GPR or FPR"; abort(); @@ -345,39 +352,40 @@ MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::STW, - 3).addReg(InReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::STW)).addReg(InReg), + FrameIndex); } else { // move -> load unsigned OutReg = MI->getOperand(0).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::LWZ, 2, OutReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::LWZ), OutReg), + FrameIndex); } } else if ((Opc == PPC::OR8 && MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::STD, - 3).addReg(InReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::STD)).addReg(InReg), + FrameIndex); } else { // move -> load unsigned OutReg = MI->getOperand(0).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::LD, 2, OutReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::LD), OutReg), FrameIndex); } } else if (Opc == PPC::FMRD) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::STFD, - 3).addReg(InReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::STFD)).addReg(InReg), + FrameIndex); } else { // move -> load unsigned OutReg = MI->getOperand(0).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::LFD, 2, OutReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::LFD), OutReg), FrameIndex); } } else if (Opc == PPC::FMRS) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::STFS, - 3).addReg(InReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::STFS)).addReg(InReg), + FrameIndex); } else { // move -> load unsigned OutReg = MI->getOperand(0).getReg(); - NewMI = addFrameReference(BuildMI(TII, PPC::LFS, 2, OutReg), FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(PPC::LFS), OutReg), FrameIndex); } } @@ -455,15 +463,15 @@ // Constructing the constant and adding would take 3 instructions. // Fortunately, a frame greater than 32K is rare. if (MaxAlign < TargetAlign && isInt16(FrameSize)) { - BuildMI(MBB, II, PPC::ADDI, 2, PPC::R0) + BuildMI(MBB, II, TII.get(PPC::ADDI), PPC::R0) .addReg(PPC::R31) .addImm(FrameSize); } else if (LP64) { - BuildMI(MBB, II, PPC::LD, 2, PPC::X0) + BuildMI(MBB, II, TII.get(PPC::LD), PPC::X0) .addImm(0) .addReg(PPC::X1); } else { - BuildMI(MBB, II, PPC::LWZ, 2, PPC::R0) + BuildMI(MBB, II, TII.get(PPC::LWZ), PPC::R0) .addImm(0) .addReg(PPC::R1); } @@ -471,19 +479,19 @@ // Grow the stack and update the stack pointer link, then // determine the address of new allocated space. if (LP64) { - BuildMI(MBB, II, PPC::STDUX, 3) + BuildMI(MBB, II, TII.get(PPC::STDUX)) .addReg(PPC::X0) .addReg(PPC::X1) .addReg(MI.getOperand(1).getReg()); - BuildMI(MBB, II, PPC::ADDI8, 2, MI.getOperand(0).getReg()) + BuildMI(MBB, II, TII.get(PPC::ADDI8), MI.getOperand(0).getReg()) .addReg(PPC::X1) .addImm(maxCallFrameSize); } else { - BuildMI(MBB, II, PPC::STWUX, 3) + BuildMI(MBB, II, TII.get(PPC::STWUX)) .addReg(PPC::R0) .addReg(PPC::R1) .addReg(MI.getOperand(1).getReg()); - BuildMI(MBB, II, PPC::ADDI, 2, MI.getOperand(0).getReg()) + BuildMI(MBB, II, TII.get(PPC::ADDI), MI.getOperand(0).getReg()) .addReg(PPC::R1) .addImm(maxCallFrameSize); } @@ -559,8 +567,8 @@ if (!isInt16(Offset)) { // Insert a set of r0 with the full offset value before the ld, st, or add - BuildMI(MBB, II, PPC::LIS, 1, PPC::R0).addImm(Offset >> 16); - BuildMI(MBB, II, PPC::ORI, 2, PPC::R0).addReg(PPC::R0).addImm(Offset); + BuildMI(MBB, II, TII.get(PPC::LIS), PPC::R0).addImm(Offset >> 16); + BuildMI(MBB, II, TII.get(PPC::ORI), PPC::R0).addReg(PPC::R0).addImm(Offset); // convert into indexed form of the instruction // sth 0:rA, 1:imm 2:(rB) ==> sthx 0:rA, 2:rB, 1:r0 @@ -640,7 +648,8 @@ // HandleVRSaveUpdate - MI is the UPDATE_VRSAVE instruction introduced by the // instruction selector. Based on the vector registers that have been used, // transform this into the appropriate ORI instruction. -static void HandleVRSaveUpdate(MachineInstr *MI, const bool *UsedRegs) { +static void HandleVRSaveUpdate(MachineInstr *MI, const bool *UsedRegs, + const TargetInstrInfo &TII) { unsigned UsedRegMask = 0; for (unsigned i = 0; i != 32; ++i) if (UsedRegs[VRRegNo[i]]) @@ -670,15 +679,15 @@ RemoveVRSaveCode(MI); return; } else if ((UsedRegMask & 0xFFFF) == UsedRegMask) { - BuildMI(*MI->getParent(), MI, PPC::ORI, 2, DstReg) + BuildMI(*MI->getParent(), MI, TII.get(PPC::ORI), DstReg) .addReg(SrcReg).addImm(UsedRegMask); } else if ((UsedRegMask & 0xFFFF0000) == UsedRegMask) { - BuildMI(*MI->getParent(), MI, PPC::ORIS, 2, DstReg) + BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg) .addReg(SrcReg).addImm(UsedRegMask >> 16); } else { - BuildMI(*MI->getParent(), MI, PPC::ORIS, 2, DstReg) + BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg) .addReg(SrcReg).addImm(UsedRegMask >> 16); - BuildMI(*MI->getParent(), MI, PPC::ORI, 2, DstReg) + BuildMI(*MI->getParent(), MI, TII.get(PPC::ORI), DstReg) .addReg(DstReg).addImm(UsedRegMask & 0xFFFF); } @@ -750,7 +759,7 @@ // process it. for (unsigned i = 0; MBBI != MBB.end(); ++i, ++MBBI) { if (MBBI->getOpcode() == PPC::UPDATE_VRSAVE) { - HandleVRSaveUpdate(MBBI, MF.getUsedPhysregs()); + HandleVRSaveUpdate(MBBI, MF.getUsedPhysregs(), TII); break; } } @@ -775,10 +784,10 @@ int Offset = PPCFrameInfo::getFramePointerSaveOffset(Subtarget.isPPC64()); if (!Subtarget.isPPC64()) { - BuildMI(MBB, MBBI, PPC::STW, 3) + BuildMI(MBB, MBBI, TII.get(PPC::STW)) .addReg(PPC::R31).addImm(Offset).addReg(PPC::R1); } else { - BuildMI(MBB, MBBI, PPC::STD, 3) + BuildMI(MBB, MBBI, TII.get(PPC::STD)) .addReg(PPC::X31).addImm(Offset/4).addReg(PPC::X1); } } @@ -794,40 +803,40 @@ if (MaxAlign > TargetAlign) { assert(isPowerOf2_32(MaxAlign)&&isInt16(MaxAlign)&&"Invalid alignment!"); assert(isInt16(NegFrameSize) && "Unhandled stack size and alignment!"); - BuildMI(MBB, MBBI, PPC::RLWINM, 4, PPC::R0) + BuildMI(MBB, MBBI, TII.get(PPC::RLWINM), PPC::R0) .addReg(PPC::R1).addImm(0).addImm(32-Log2_32(MaxAlign)).addImm(31); - BuildMI(MBB, MBBI, PPC::SUBFIC,2,PPC::R0).addReg(PPC::R0) + BuildMI(MBB, MBBI, TII.get(PPC::SUBFIC) ,PPC::R0).addReg(PPC::R0) .addImm(NegFrameSize); - BuildMI(MBB, MBBI, PPC::STWUX, 3) + BuildMI(MBB, MBBI, TII.get(PPC::STWUX)) .addReg(PPC::R1).addReg(PPC::R1).addReg(PPC::R0); } else if (isInt16(NegFrameSize)) { - BuildMI(MBB, MBBI, PPC::STWU, 3, + BuildMI(MBB, MBBI, TII.get(PPC::STWU), PPC::R1).addReg(PPC::R1).addImm(NegFrameSize).addReg(PPC::R1); } else { - BuildMI(MBB, MBBI, PPC::LIS, 1, PPC::R0).addImm(NegFrameSize >> 16); - BuildMI(MBB, MBBI, PPC::ORI, 2, PPC::R0).addReg(PPC::R0) + BuildMI(MBB, MBBI, TII.get(PPC::LIS), PPC::R0).addImm(NegFrameSize >> 16); + BuildMI(MBB, MBBI, TII.get(PPC::ORI), PPC::R0).addReg(PPC::R0) .addImm(NegFrameSize & 0xFFFF); - BuildMI(MBB, MBBI, PPC::STWUX, 3).addReg(PPC::R1).addReg(PPC::R1) + BuildMI(MBB, MBBI, TII.get(PPC::STWUX)).addReg(PPC::R1).addReg(PPC::R1) .addReg(PPC::R0); } } else { // PPC64. if (MaxAlign > TargetAlign) { assert(isPowerOf2_32(MaxAlign)&&isInt16(MaxAlign)&&"Invalid alignment!"); assert(isInt16(NegFrameSize) && "Unhandled stack size and alignment!"); - BuildMI(MBB, MBBI, PPC::RLDICL, 3, PPC::X0) + BuildMI(MBB, MBBI, TII.get(PPC::RLDICL), PPC::X0) .addReg(PPC::X1).addImm(0).addImm(64-Log2_32(MaxAlign)); - BuildMI(MBB, MBBI, PPC::SUBFIC8, 2, PPC::X0).addReg(PPC::X0) + BuildMI(MBB, MBBI, TII.get(PPC::SUBFIC8), PPC::X0).addReg(PPC::X0) .addImm(NegFrameSize); - BuildMI(MBB, MBBI, PPC::STDUX, 3) + BuildMI(MBB, MBBI, TII.get(PPC::STDUX)) .addReg(PPC::X1).addReg(PPC::X1).addReg(PPC::X0); } else if (isInt16(NegFrameSize)) { - BuildMI(MBB, MBBI, PPC::STDU, 3, PPC::X1) + BuildMI(MBB, MBBI, TII.get(PPC::STDU), PPC::X1) .addReg(PPC::X1).addImm(NegFrameSize/4).addReg(PPC::X1); } else { - BuildMI(MBB, MBBI, PPC::LIS8, 1, PPC::X0).addImm(NegFrameSize >> 16); - BuildMI(MBB, MBBI, PPC::ORI8, 2, PPC::X0).addReg(PPC::X0) + BuildMI(MBB, MBBI, TII.get(PPC::LIS8), PPC::X0).addImm(NegFrameSize >>16); + BuildMI(MBB, MBBI, TII.get(PPC::ORI8), PPC::X0).addReg(PPC::X0) .addImm(NegFrameSize & 0xFFFF); - BuildMI(MBB, MBBI, PPC::STDUX, 3).addReg(PPC::X1).addReg(PPC::X1) + BuildMI(MBB, MBBI, TII.get(PPC::STDUX)).addReg(PPC::X1).addReg(PPC::X1) .addReg(PPC::X0); } } @@ -837,7 +846,7 @@ unsigned LabelID = DebugInfo->NextLabelID(); // Mark effective beginning of when frame pointer becomes valid. - BuildMI(MBB, MBBI, PPC::DWARF_LABEL, 1).addImm(LabelID); + BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(LabelID); // Show update of SP. MachineLocation SPDst(MachineLocation::VirtualFP); @@ -857,9 +866,11 @@ // If there is a frame pointer, copy R1 into R31 if (HasFP) { if (!Subtarget.isPPC64()) { - BuildMI(MBB, MBBI, PPC::OR, 2, PPC::R31).addReg(PPC::R1).addReg(PPC::R1); + BuildMI(MBB, MBBI, TII.get(PPC::OR), PPC::R31).addReg(PPC::R1) + .addReg(PPC::R1); } else { - BuildMI(MBB, MBBI, PPC::OR8, 2, PPC::X31).addReg(PPC::X1).addReg(PPC::X1); + BuildMI(MBB, MBBI, TII.get(PPC::OR8), PPC::X31).addReg(PPC::X1) + .addReg(PPC::X1); } } } @@ -884,18 +895,18 @@ if (!Subtarget.isPPC64()) { if (isInt16(FrameSize) && TargetAlign >= MaxAlign && !MFI->hasVarSizedObjects()) { - BuildMI(MBB, MBBI, PPC::ADDI, 2, PPC::R1) + BuildMI(MBB, MBBI, TII.get(PPC::ADDI), PPC::R1) .addReg(PPC::R1).addImm(FrameSize); } else { - BuildMI(MBB, MBBI, PPC::LWZ, 2, PPC::R1).addImm(0).addReg(PPC::R1); + BuildMI(MBB, MBBI, TII.get(PPC::LWZ),PPC::R1).addImm(0).addReg(PPC::R1); } } else { if (isInt16(FrameSize) && TargetAlign >= MaxAlign && !MFI->hasVarSizedObjects()) { - BuildMI(MBB, MBBI, PPC::ADDI8, 2, PPC::X1) + BuildMI(MBB, MBBI, TII.get(PPC::ADDI8), PPC::X1) .addReg(PPC::X1).addImm(FrameSize); } else { - BuildMI(MBB, MBBI, PPC::LD, 2, PPC::X1).addImm(0).addReg(PPC::X1); + BuildMI(MBB, MBBI, TII.get(PPC::LD), PPC::X1).addImm(0).addReg(PPC::X1); } } @@ -905,10 +916,10 @@ int Offset = PPCFrameInfo::getFramePointerSaveOffset(Subtarget.isPPC64()); if (!Subtarget.isPPC64()) { - BuildMI(MBB, MBBI, PPC::LWZ, 2, PPC::R31) + BuildMI(MBB, MBBI, TII.get(PPC::LWZ), PPC::R31) .addImm(Offset).addReg(PPC::R1); } else { - BuildMI(MBB, MBBI, PPC::LD, 2, PPC::X31) + BuildMI(MBB, MBBI, TII.get(PPC::LD), PPC::X31) .addImm(Offset/4).addReg(PPC::X1); } } Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.18 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.19 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.18 Thu Nov 16 16:43:37 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Mon Nov 27 17:37:22 2006 @@ -20,6 +20,7 @@ namespace llvm { class PPCSubtarget; +class TargetInstrInfo; class Type; class PPCRegisterInfo : public PPCGenRegisterInfo { From alenhar2 at cs.uiuc.edu Mon Nov 27 17:51:16 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 27 Nov 2006 17:51:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611272351.kARNpG8G031433@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.284 -> 1.285 --- Log message: Preliminary support for inline asm in the cbe. The target specific ugliness is still in Writer, but issolated to a single function. This might be split into something in each target directory. This is sufficient to get through archie and an strcpy impl on linux-x86. Module level asm is not handled. --- Diffs of the changes: (+164 -2) Writer.cpp | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 164 insertions(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.284 llvm/lib/Target/CBackend/Writer.cpp:1.285 --- llvm/lib/Target/CBackend/Writer.cpp:1.284 Mon Nov 27 12:51:06 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Nov 27 17:50:49 2006 @@ -23,6 +23,7 @@ #include "llvm/SymbolTable.h" #include "llvm/Intrinsics.h" #include "llvm/IntrinsicInst.h" +#include "llvm/InlineAsm.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Analysis/LoopInfo.h" @@ -120,6 +121,7 @@ const PointerType *Ty); void writeOperand(Value *Operand); + void writeOperandRaw(Value *Operand); void writeOperandInternal(Value *Operand); void writeOperandWithCast(Value* Operand, unsigned Opcode); bool writeInstructionCast(const Instruction &I); @@ -162,6 +164,9 @@ // Don't inline a load across a store or other bad things! return false; + // Must not be used in inline asm + if (I.hasOneUse() && isInlineAsm(*I.use_back())) return false; + // Only inline instruction it it's use is in the same BB as the inst. return I.getParent() == cast(I.use_back())->getParent(); } @@ -179,7 +184,14 @@ return 0; return AI; } - + + // isInlineAsm - Check if the instruction is a call to an inline asm chunk + static bool isInlineAsm(const Instruction& I) { + if (isa(&I) && isa(I.getOperand(0))) + return true; + return false; + } + // Instruction visitation functions friend class InstVisitor; @@ -201,6 +213,7 @@ void visitCastInst (CastInst &I); void visitSelectInst(SelectInst &I); void visitCallInst (CallInst &I); + void visitInlineAsm(CallInst &I); void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); } void visitMallocInst(MallocInst &I); @@ -999,6 +1012,15 @@ } } +void CWriter::writeOperandRaw(Value *Operand) { + Constant* CPV = dyn_cast(Operand); + if (CPV && !isa(CPV)) { + printConstant(CPV); + } else { + Out << Mang->getValueName(Operand); + } +} + void CWriter::writeOperand(Value *Operand) { if (isa(Operand) || isDirectAlloca(Operand)) Out << "(&"; // Global variables are referenced as their addresses by llvm @@ -1727,7 +1749,7 @@ for (BasicBlock::iterator II = BB->begin(), E = --BB->end(); II != E; ++II) { if (!isInlinableInst(*II) && !isDirectAlloca(II)) { - if (II->getType() != Type::VoidTy) + if (II->getType() != Type::VoidTy && !isInlineAsm(*II)) outputLValue(II); else Out << " "; @@ -2033,6 +2055,12 @@ void CWriter::visitCallInst(CallInst &I) { + //check if we have inline asm + if (isInlineAsm(I)) { + visitInlineAsm(I); + return; + } + bool WroteCallee = false; // Handle intrinsic function calls first... @@ -2224,6 +2252,140 @@ Out << ')'; } + +//This converts the llvm constraint string to something gcc is expecting. +//This could be broken into a bunch of peices and spread accross the +//targets, but this information is only useful here. +//TODO: work out platform independent constraints and factor those out +static std::string InterpretConstraint(const std::string& target, + InlineAsm::ConstraintInfo& c) { + + assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); + + //catch numeric constraints + if (c.Codes[0].find_first_not_of("0123456789") >= c.Codes[0].size()) + return c.Codes[0]; + + static const char* x86_table[] = {"{si}", "S", + "{di}", "D", + "{ax}", "a", + "{cx}", "c", + "q", "q", + "r", "r", + "m", "m", + "{memory}", "memory", + "{flags}", "", + "{dirflag}", "", + "{fpsr}", "", + "{cc}", "cc" + }; + + const char** table = 0; + int tbl_len = 0; + if (target == "i686-pc-linux-gnu") { + table = x86_table; + tbl_len = sizeof(x86_table) / sizeof(char*); + } + for (int i = 0; i < tbl_len && table; i += 2) + if (c.Codes[0] == table[i]) + return table[i+1]; + + std::cerr << target << "\n"; + std::cerr << c.Codes[0] << "\n"; + assert(0 && "Unknown Asm Constraint"); + return ""; +} + +//TODO: import logic from AsmPrinter.cpp +static std::string gccifyAsm(const std::string& target, std::string asmstr) { + for (std::string::size_type i = 0; i != asmstr.size(); ++i) + if (asmstr[i] == '\n') + asmstr.replace(i, 1, "\\n"); + else if (asmstr[i] == '\t') + asmstr.replace(i, 1, "\\t"); + else if (asmstr[i] == '$') { + if (asmstr[i + 1] == '{') { + std::string::size_type a = asmstr.find_first_of(':', i + 1); + std::string::size_type b = asmstr.find_first_of('}', i + 1); + std::string n = "%" + + asmstr.substr(a + 1, b - a - 1) + + asmstr.substr(i + 2, a - i - 2); + asmstr.replace(i, b - i + 1, n); + i += n.size() - 1; + } else + asmstr.replace(i, 1, "%"); + } + else if (asmstr[i] == '%')//grr + { asmstr.replace(i, 1, "%%"); ++i;} + + return asmstr; +} + +void CWriter::visitInlineAsm(CallInst &CI) { + InlineAsm* as = cast(CI.getOperand(0)); + const std::string& target = TheModule->getTargetTriple(); + std::vector Constraints = as->ParseConstraints(); + std::vector > Input; + std::vector > Output; + std::string Clobber; + int count = CI.getType() == Type::VoidTy ? 1 : 0; + for (std::vector::iterator I = Constraints.begin(), + E = Constraints.end(); I != E; ++I) { + assert(I->Codes.size() == 1 && "Too many asm constraint codes to handle"); + std::string c = + InterpretConstraint(target, *I); + switch(I->Type) { + default: + assert(0 && "Unknown asm constraint"); + break; + case InlineAsm::isInput: { + if (c.size()) { + Input.push_back(std::make_pair(c, count ? CI.getOperand(count) : &CI)); + ++count; //consume arg + } + break; + } + case InlineAsm::isOutput: { + if (c.size()) { + Output.push_back(std::make_pair("="+((I->isEarlyClobber ? "&" : "")+c), + count ? CI.getOperand(count) : &CI)); + ++count; //consume arg + } + break; + } + case InlineAsm::isClobber: { + if (c.size()) + Clobber += ",\"" + c + "\""; + break; + } + } + } + + //fix up the asm string for gcc + std::string asmstr = gccifyAsm(target, as->getAsmString()); + + Out << "__asm__ volatile (\"" << asmstr << "\"\n"; + Out << " :"; + for (std::vector >::iterator I = Output.begin(), + E = Output.end(); I != E; ++I) { + Out << "\"" << I->first << "\"("; + writeOperandRaw(I->second); + Out << ")"; + if (I + 1 != E) + Out << ","; + } + Out << "\n :"; + for (std::vector >::iterator I = Input.begin(), + E = Input.end(); I != E; ++I) { + Out << "\"" << I->first << "\"("; + writeOperandRaw(I->second); + Out << ")"; + if (I + 1 != E) + Out << ","; + } + Out << "\n :" << Clobber.substr(1) << ")\n"; +} + void CWriter::visitMallocInst(MallocInst &I) { assert(0 && "lowerallocations pass didn't work!"); } From isanbard at gmail.com Mon Nov 27 17:55:06 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 17:55:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200611272355.kARNt6HM010181@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.88 -> 1.89 --- Log message: Removed #include and replaced streams with llvm streams. --- Diffs of the changes: (+11 -12) ExecutionEngine.cpp | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.88 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.89 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.88 Sun Nov 26 19:05:10 2006 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Mon Nov 27 17:54:50 2006 @@ -24,7 +24,6 @@ #include "llvm/Support/MutexGuard.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/Target/TargetData.h" -#include using namespace llvm; namespace { @@ -159,13 +158,13 @@ unsigned PtrSize = EE->getTargetData()->getPointerSize(); char *Result = new char[(InputArgv.size()+1)*PtrSize]; - DEBUG(std::cerr << "ARGV = " << (void*)Result << "\n"); + DOUT << "ARGV = " << (void*)Result << "\n"; const Type *SBytePtr = PointerType::get(Type::SByteTy); for (unsigned i = 0; i != InputArgv.size(); ++i) { unsigned Size = InputArgv[i].size()+1; char *Dest = new char[Size]; - DEBUG(std::cerr << "ARGV[" << i << "] = " << (void*)Dest << "\n"); + DOUT << "ARGV[" << i << "] = " << (void*)Dest << "\n"; std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest); Dest[Size-1] = 0; @@ -403,7 +402,7 @@ default: break; } - std::cerr << "ConstantExpr not handled as global var init: " << *CE << "\n"; + llvm_cerr << "ConstantExpr not handled as global var init: " << *CE << "\n"; abort(); } @@ -433,7 +432,7 @@ assert(0 && "Unknown constant pointer type!"); break; default: - std::cout << "ERROR: Constant unimp for type: " << *C->getType() << "\n"; + llvm_cerr << "ERROR: Constant unimp for type: " << *C->getType() << "\n"; abort(); } return Result; @@ -478,7 +477,7 @@ Ptr->Untyped[7] = (unsigned char)(Val.ULongVal >> 56); break; default: - std::cout << "Cannot store value of type " << *Ty << "!\n"; + llvm_cerr << "Cannot store value of type " << *Ty << "!\n"; } } else { switch (Ty->getTypeID()) { @@ -512,7 +511,7 @@ Ptr->Untyped[0] = (unsigned char)(Val.ULongVal >> 56); break; default: - std::cout << "Cannot store value of type " << *Ty << "!\n"; + llvm_cerr << "Cannot store value of type " << *Ty << "!\n"; } } } @@ -553,7 +552,7 @@ ((uint64_t)Ptr->Untyped[7] << 56); break; default: - std::cout << "Cannot load value of type " << *Ty << "!\n"; + llvm_cerr << "Cannot load value of type " << *Ty << "!\n"; abort(); } } else { @@ -587,7 +586,7 @@ ((uint64_t)Ptr->Untyped[0] << 56); break; default: - std::cout << "Cannot load value of type " << *Ty << "!\n"; + llvm_cerr << "Cannot load value of type " << *Ty << "!\n"; abort(); } } @@ -635,7 +634,7 @@ } default: - std::cerr << "Bad Type: " << *Init->getType() << "\n"; + llvm_cerr << "Bad Type: " << *Init->getType() << "\n"; assert(0 && "Unknown constant type to initialize memory with!"); } } @@ -719,7 +718,7 @@ sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str())) addGlobalMapping(I, SymAddr); else { - std::cerr << "Could not resolve external global address: " + llvm_cerr << "Could not resolve external global address: " << I->getName() << "\n"; abort(); } @@ -761,7 +760,7 @@ // already in the map. void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) { void *GA = getPointerToGlobalIfAvailable(GV); - DEBUG(std::cerr << "Global '" << GV->getName() << "' -> " << GA << "\n"); + DOUT << "Global '" << GV->getName() << "' -> " << GA << "\n"; const Type *ElTy = GV->getType()->getElementType(); size_t GVSize = (size_t)getTargetData()->getTypeSize(ElTy); From isanbard at gmail.com Mon Nov 27 17:55:07 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 17:55:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp ExternalFunctions.cpp Message-ID: <200611272355.kARNt7FA010188@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.148 -> 1.149 ExternalFunctions.cpp updated: 1.89 -> 1.90 --- Log message: Removed #include and replaced streams with llvm streams. --- Diffs of the changes: (+36 -35) Execution.cpp | 58 +++++++++++++++++++++++++------------------------- ExternalFunctions.cpp | 13 ++++++----- 2 files changed, 36 insertions(+), 35 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.148 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.149 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.148 Sun Nov 26 19:05:10 2006 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Mon Nov 27 17:54:50 2006 @@ -187,7 +187,7 @@ getOperandValue(CE->getOperand(1), SF), getOperandValue(CE->getOperand(2), SF)); default: - std::cerr << "Unhandled ConstantExpr: " << *CE << "\n"; + llvm_cerr << "Unhandled ConstantExpr: " << *CE << "\n"; abort(); return GenericValue(); } @@ -235,7 +235,7 @@ IMPLEMENT_BINARY_OPERATOR(+, Float); IMPLEMENT_BINARY_OPERATOR(+, Double); default: - std::cout << "Unhandled type for Add instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Add instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -256,7 +256,7 @@ IMPLEMENT_BINARY_OPERATOR(-, Float); IMPLEMENT_BINARY_OPERATOR(-, Double); default: - std::cout << "Unhandled type for Sub instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Sub instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -277,7 +277,7 @@ IMPLEMENT_BINARY_OPERATOR(*, Float); IMPLEMENT_BINARY_OPERATOR(*, Double); default: - std::cout << "Unhandled type for Mul instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Mul instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -295,7 +295,7 @@ IMPLEMENT_SIGNLESS_BINOP(/, UInt, Int); IMPLEMENT_SIGNLESS_BINOP(/, ULong, Long); default: - std::cout << "Unhandled type for UDiv instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for UDiv instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -310,7 +310,7 @@ IMPLEMENT_SIGNLESS_BINOP(/, Int, UInt); IMPLEMENT_SIGNLESS_BINOP(/, Long, ULong); default: - std::cout << "Unhandled type for SDiv instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SDiv instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -323,7 +323,7 @@ IMPLEMENT_BINARY_OPERATOR(/, Float); IMPLEMENT_BINARY_OPERATOR(/, Double); default: - std::cout << "Unhandled type for Div instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Div instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -338,7 +338,7 @@ IMPLEMENT_SIGNLESS_BINOP(%, UInt, Int); IMPLEMENT_SIGNLESS_BINOP(%, ULong, Long); default: - std::cout << "Unhandled type for URem instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for URem instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -353,7 +353,7 @@ IMPLEMENT_SIGNLESS_BINOP(%, Int, UInt); IMPLEMENT_SIGNLESS_BINOP(%, Long, ULong); default: - std::cout << "Unhandled type for Rem instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Rem instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -370,7 +370,7 @@ Dest.DoubleVal = fmod(Src1.DoubleVal, Src2.DoubleVal); break; default: - std::cout << "Unhandled type for Rem instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Rem instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -390,7 +390,7 @@ IMPLEMENT_BINARY_OPERATOR(&, ULong); IMPLEMENT_BINARY_OPERATOR(&, Long); default: - std::cout << "Unhandled type for And instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for And instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -410,7 +410,7 @@ IMPLEMENT_BINARY_OPERATOR(|, ULong); IMPLEMENT_BINARY_OPERATOR(|, Long); default: - std::cout << "Unhandled type for Or instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Or instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -430,7 +430,7 @@ IMPLEMENT_BINARY_OPERATOR(^, ULong); IMPLEMENT_BINARY_OPERATOR(^, Long); default: - std::cout << "Unhandled type for Xor instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Xor instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -464,7 +464,7 @@ IMPLEMENT_SETCC(==, Double); IMPLEMENT_POINTERSETCC(==); default: - std::cout << "Unhandled type for SetEQ instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetEQ instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -487,7 +487,7 @@ IMPLEMENT_POINTERSETCC(!=); default: - std::cout << "Unhandled type for SetNE instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetNE instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -509,7 +509,7 @@ IMPLEMENT_SETCC(<=, Double); IMPLEMENT_POINTERSETCC(<=); default: - std::cout << "Unhandled type for SetLE instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetLE instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -531,7 +531,7 @@ IMPLEMENT_SETCC(>=, Double); IMPLEMENT_POINTERSETCC(>=); default: - std::cout << "Unhandled type for SetGE instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetGE instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -553,7 +553,7 @@ IMPLEMENT_SETCC(<, Double); IMPLEMENT_POINTERSETCC(<); default: - std::cout << "Unhandled type for SetLT instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetLT instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -575,7 +575,7 @@ IMPLEMENT_SETCC(>, Double); IMPLEMENT_POINTERSETCC(>); default: - std::cout << "Unhandled type for SetGT instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for SetGT instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -608,7 +608,7 @@ case Instruction::SetLT: R = executeSetLTInst(Src1, Src2, Ty); break; case Instruction::SetGT: R = executeSetGTInst(Src1, Src2, Ty); break; default: - std::cout << "Don't know how to handle this binary operator!\n-->" << I; + llvm_cerr << "Don't know how to handle this binary operator!\n-->" << I; abort(); } @@ -709,7 +709,7 @@ } void Interpreter::visitUnreachableInst(UnreachableInst &I) { - std::cerr << "ERROR: Program executed an 'unreachable' instruction!\n"; + llvm_cerr << "ERROR: Program executed an 'unreachable' instruction!\n"; abort(); } @@ -977,7 +977,7 @@ IMPLEMENT_SHIFT(<<, ULong); IMPLEMENT_SHIFT(<<, Long); default: - std::cout << "Unhandled type for Shl instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for Shl instruction: " << *Ty << "\n"; } return Dest; } @@ -991,7 +991,7 @@ IMPLEMENT_SIGNLESS_SHIFT(>>, UInt, Int); IMPLEMENT_SIGNLESS_SHIFT(>>, ULong, Long); default: - std::cout << "Unhandled type for LShr instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for LShr instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -1006,7 +1006,7 @@ IMPLEMENT_SIGNLESS_SHIFT(>>, Int, UInt); IMPLEMENT_SIGNLESS_SHIFT(>>, Long, ULong); default: - std::cout << "Unhandled type for AShr instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled type for AShr instruction: " << *Ty << "\n"; abort(); } return Dest; @@ -1064,14 +1064,14 @@ IMPLEMENT_CAST(DESTTY, DESTCTY, Float); \ IMPLEMENT_CAST(DESTTY, DESTCTY, Double) \ default: \ - std::cout << "Unhandled cast: " \ + llvm_cerr << "Unhandled cast: " \ << *SrcTy << " to " << *DstTy << "\n"; \ abort(); \ } \ break #define IMPLEMENT_CAST_END \ - default: std::cout \ + default: llvm_cerr \ << "Unhandled dest type for cast instruction: " \ << *DstTy << "\n"; \ abort(); \ @@ -1225,7 +1225,7 @@ IMPLEMENT_CAST_END break; default: - std::cout + llvm_cerr << "Invalid cast opcode for cast instruction: " << opcode << "\n"; abort(); } @@ -1265,7 +1265,7 @@ IMPLEMENT_VAARG(Double); IMPLEMENT_VAARG(Bool); default: - std::cout << "Unhandled dest type for vaarg instruction: " << *Ty << "\n"; + llvm_cerr << "Unhandled dest type for vaarg instruction: " << *Ty << "\n"; abort(); } @@ -1328,7 +1328,7 @@ // Track the number of dynamic instructions executed. ++NumDynamicInsts; - DEBUG(std::cerr << "About to interpret: " << I); + DOUT << "About to interpret: " << I; visit(I); // Dispatch to one of the visit* methods... } } Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.89 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.90 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.89 Wed Nov 8 13:16:44 2006 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Mon Nov 27 17:54:50 2006 @@ -22,6 +22,7 @@ #include "Interpreter.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" +#include "llvm/Support/Streams.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/Target/TargetData.h" #include @@ -91,7 +92,7 @@ std::map::iterator FI = Functions.find(F); ExFunc Fn = (FI == Functions.end()) ? lookupFunction(F) : FI->second; if (Fn == 0) { - std::cout << "Tried to execute an unknown external function: " + llvm_cerr << "Tried to execute an unknown external function: " << F->getType()->getDescription() << " " << F->getName() << "\n"; if (F->getName() == "__main") return GenericValue(); @@ -112,19 +113,19 @@ // void putchar(sbyte) GenericValue lle_Vb_putchar(FunctionType *M, const vector &Args) { - std::cout << Args[0].SByteVal; + llvm_cout << Args[0].SByteVal; return GenericValue(); } // int putchar(int) GenericValue lle_ii_putchar(FunctionType *M, const vector &Args) { - std::cout << ((char)Args[0].IntVal) << std::flush; + llvm_cout << ((char)Args[0].IntVal) << std::flush; return Args[0]; } // void putchar(ubyte) GenericValue lle_VB_putchar(FunctionType *M, const vector &Args) { - std::cout << Args[0].SByteVal << std::flush; + llvm_cout << Args[0].SByteVal << std::flush; return Args[0]; } @@ -330,7 +331,7 @@ sprintf(Buffer, FmtBuf, (void*)GVTOP(Args[ArgNo++])); break; case 's': sprintf(Buffer, FmtBuf, (char*)GVTOP(Args[ArgNo++])); break; - default: std::cout << ""; + default: llvm_cerr << ""; ArgNo++; break; } strcpy(OutputBuffer, Buffer); @@ -348,7 +349,7 @@ NewArgs.push_back(PTOGV(Buffer)); NewArgs.insert(NewArgs.end(), Args.begin(), Args.end()); GenericValue GV = lle_X_sprintf(M, NewArgs); - std::cout << Buffer; + llvm_cout << Buffer; return GV; } From sabre at nondot.org Mon Nov 27 19:03:44 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 19:03:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200611280103.kAS13iov011503@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.418 -> 1.419 --- Log message: Fix PR1016: http://llvm.org/PR1016 --- Diffs of the changes: (+4 -5) LegalizeDAG.cpp | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.418 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.419 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.418 Sun Nov 26 22:39:56 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 27 19:03:30 2006 @@ -1862,6 +1862,10 @@ break; case Promote: Tmp1 = PromoteOp(Node->getOperand(0)); // Promote the condition. + // Make sure the condition is either zero or one. + if (!TLI.MaskedValueIsZero(Tmp1, + MVT::getIntVTBitMask(Tmp1.getValueType())^1)) + Tmp1 = DAG.getZeroExtendInReg(Tmp1, MVT::i1); break; } Tmp2 = LegalizeOp(Node->getOperand(1)); // TrueVal @@ -1883,11 +1887,6 @@ Tmp2, Tmp3, cast(Tmp1.getOperand(2))->get()); } else { - // Make sure the condition is either zero or one. It may have been - // promoted from something else. - unsigned NumBits = MVT::getSizeInBits(Tmp1.getValueType()); - if (!TLI.MaskedValueIsZero(Tmp1, (~0ULL >> (64-NumBits))^1)) - Tmp1 = DAG.getZeroExtendInReg(Tmp1, MVT::i1); Result = DAG.getSelectCC(Tmp1, DAG.getConstant(0, Tmp1.getValueType()), Tmp2, Tmp3, ISD::SETNE); From sabre at nondot.org Mon Nov 27 19:26:51 2006 From: sabre at nondot.org (Chris Lattner) Date: Mon, 27 Nov 2006 19:26:51 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-11-27-SelectLegalize.ll Message-ID: <200611280126.kAS1Qpd1012046@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-11-27-SelectLegalize.ll added (r1.1) --- Log message: testcase for pr1016: http://llvm.org/PR1016 --- Diffs of the changes: (+8 -0) 2006-11-27-SelectLegalize.ll | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-11-27-SelectLegalize.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2006-11-27-SelectLegalize.ll:1.1 *** /dev/null Mon Nov 27 19:26:47 2006 --- llvm/test/Regression/CodeGen/X86/2006-11-27-SelectLegalize.ll Mon Nov 27 19:26:37 2006 *************** *** 0 **** --- 1,8 ---- + ; RUN: llvm-as < %s | llc -march=x86 | grep test.*1 + ; PR1016 + + int %test(int %A, int %B, int %C) { + %a = trunc int %A to bool + %D = select bool %a, int %B, int %C + ret int %D + } From evan.cheng at apple.com Mon Nov 27 19:28:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 19:28:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrX86-64.td Message-ID: <200611280128.kAS1SELh012094@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrX86-64.td updated: 1.7 -> 1.8 --- Log message: Fix JIT encoding bugs for shift / rotate by one ops. --- Diffs of the changes: (+5 -5) X86InstrX86-64.td | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Target/X86/X86InstrX86-64.td diff -u llvm/lib/Target/X86/X86InstrX86-64.td:1.7 llvm/lib/Target/X86/X86InstrX86-64.td:1.8 --- llvm/lib/Target/X86/X86InstrX86-64.td:1.7 Thu Nov 16 17:33:25 2006 +++ llvm/lib/Target/X86/X86InstrX86-64.td Mon Nov 27 19:28:00 2006 @@ -466,7 +466,7 @@ def SHL64mi : RIi8<0xC1, MRM4m, (ops i64mem:$dst, i8imm:$src), "shl{q} {$src, $dst|$dst, $src}", [(store (shl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>; -def SHL64m1 : RI<0xC1, MRM4m, (ops i64mem:$dst), +def SHL64m1 : RI<0xD1, MRM4m, (ops i64mem:$dst), "shl{q} $dst", [(store (shl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>; @@ -490,7 +490,7 @@ def SHR64mi : RIi8<0xC1, MRM5m, (ops i64mem:$dst, i8imm:$src), "shr{q} {$src, $dst|$dst, $src}", [(store (srl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>; -def SHR64m1 : RI<0xC1, MRM5m, (ops i64mem:$dst), +def SHR64m1 : RI<0xD1, MRM5m, (ops i64mem:$dst), "shr{q} $dst", [(store (srl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>; @@ -513,7 +513,7 @@ def SAR64mi : RIi8<0xC1, MRM7m, (ops i64mem:$dst, i8imm:$src), "sar{q} {$src, $dst|$dst, $src}", [(store (sra (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>; -def SAR64m1 : RI<0xC1, MRM7m, (ops i64mem:$dst), +def SAR64m1 : RI<0xD1, MRM7m, (ops i64mem:$dst), "sar{q} $dst", [(store (sra (loadi64 addr:$dst), (i8 1)), addr:$dst)]>; @@ -525,7 +525,7 @@ def ROL64ri : RIi8<0xC1, MRM0r, (ops GR64:$dst, GR64:$src1, i8imm:$src2), "rol{q} {$src2, $dst|$dst, $src2}", [(set GR64:$dst, (rotl GR64:$src1, (i8 imm:$src2)))]>; -def ROL64r1 : RI<0xC1, MRM0r, (ops GR64:$dst, GR64:$src1), +def ROL64r1 : RI<0xD1, MRM0r, (ops GR64:$dst, GR64:$src1), "rol{q} $dst", [(set GR64:$dst, (rotl GR64:$src1, (i8 1)))]>; } // isTwoAddress @@ -548,7 +548,7 @@ def ROR64ri : RIi8<0xC1, MRM1r, (ops GR64:$dst, GR64:$src1, i8imm:$src2), "ror{q} {$src2, $dst|$dst, $src2}", [(set GR64:$dst, (rotr GR64:$src1, (i8 imm:$src2)))]>; -def ROR64r1 : RI<0xC1, MRM1r, (ops GR64:$dst, GR64:$src1), +def ROR64r1 : RI<0xD1, MRM1r, (ops GR64:$dst, GR64:$src1), "ror{q} $dst", [(set GR64:$dst, (rotr GR64:$src1, (i8 1)))]>; } // isTwoAddress From isanbard at gmail.com Mon Nov 27 20:07:44 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 20:07:44 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200611280207.kAS27iSh012735@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.26 -> 1.27 --- Log message: Added helper function to transition to using llvm streams. --- Diffs of the changes: (+13 -2) LiveInterval.h | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.26 llvm/include/llvm/CodeGen/LiveInterval.h:1.27 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.26 Wed Nov 15 20:43:32 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Mon Nov 27 20:07:29 2006 @@ -22,6 +22,7 @@ #define LLVM_CODEGEN_LIVEINTERVAL_H #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Streams.h" #include #include #include @@ -252,7 +253,11 @@ return beginNumber() < other.beginNumber(); } - void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const; + void print(llvm_ostream &OS, const MRegisterInfo *MRI = 0) const; + void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const { + llvm_ostream L(OS); + L << MRI; + } void dump() const; private: @@ -262,10 +267,16 @@ LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT }; - inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) { + inline llvm_ostream &operator<<(llvm_ostream &OS, const LiveInterval &LI) { LI.print(OS); return OS; } + + inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) { + llvm_ostream L(OS); + L << LI; + return OS; + } } #endif From isanbard at gmail.com Mon Nov 27 20:08:31 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 20:08:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp LiveInterval.cpp Message-ID: <200611280208.kAS28VMT012782@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.47 -> 1.48 LiveInterval.cpp updated: 1.36 -> 1.37 --- Log message: Changed to using llvm streams. --- Diffs of the changes: (+14 -15) IntrinsicLowering.cpp | 19 +++++++++---------- LiveInterval.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 15 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.47 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.48 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.47 Sun Nov 26 19:05:09 2006 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon Nov 27 20:08:17 2006 @@ -11,14 +11,13 @@ // //===----------------------------------------------------------------------===// -#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/Instructions.h" #include "llvm/Type.h" -#include - +#include "llvm/CodeGen/IntrinsicLowering.h" +#include "llvm/Support/Streams.h" using namespace llvm; template @@ -275,11 +274,11 @@ switch (Callee->getIntrinsicID()) { case Intrinsic::not_intrinsic: - std::cerr << "Cannot lower a call to a non-intrinsic function '" + llvm_cerr << "Cannot lower a call to a non-intrinsic function '" << Callee->getName() << "'!\n"; abort(); default: - std::cerr << "Error: Code generator does not support intrinsic function '" + llvm_cerr << "Error: Code generator does not support intrinsic function '" << Callee->getName() << "'!\n"; abort(); @@ -357,9 +356,9 @@ case Intrinsic::stackrestore: { static bool Warned = false; if (!Warned) - std::cerr << "WARNING: this target does not support the llvm.stack" - << (Callee->getIntrinsicID() == Intrinsic::stacksave ? - "save" : "restore") << " intrinsic.\n"; + llvm_cerr << "WARNING: this target does not support the llvm.stack" + << (Callee->getIntrinsicID() == Intrinsic::stacksave ? + "save" : "restore") << " intrinsic.\n"; Warned = true; if (Callee->getIntrinsicID() == Intrinsic::stacksave) CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); @@ -368,7 +367,7 @@ case Intrinsic::returnaddress: case Intrinsic::frameaddress: - std::cerr << "WARNING: this target does not support the llvm." + llvm_cerr << "WARNING: this target does not support the llvm." << (Callee->getIntrinsicID() == Intrinsic::returnaddress ? "return" : "frame") << "address intrinsic.\n"; CI->replaceAllUsesWith(ConstantPointerNull::get( @@ -381,7 +380,7 @@ case Intrinsic::pcmarker: break; // Simply strip out pcmarker on unsupported architectures case Intrinsic::readcyclecounter: { - std::cerr << "WARNING: this target does not support the llvm.readcyclecoun" + llvm_cerr << "WARNING: this target does not support the llvm.readcyclecoun" << "ter intrinsic. It is being lowered to a constant 0\n"; CI->replaceAllUsesWith(ConstantInt::get(Type::ULongTy, 0)); break; Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.36 llvm/lib/CodeGen/LiveInterval.cpp:1.37 --- llvm/lib/CodeGen/LiveInterval.cpp:1.36 Thu Nov 2 14:25:49 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Mon Nov 27 20:08:17 2006 @@ -18,8 +18,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/CodeGen/LiveInterval.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/CodeGen/LiveInterval.h" +#include "llvm/Support/Streams.h" #include "llvm/Target/MRegisterInfo.h" #include #include @@ -466,16 +467,15 @@ } } - std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) { return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")"; } void LiveRange::dump() const { - std::cerr << *this << "\n"; + llvm_cerr << *this << "\n"; } -void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const { +void LiveInterval::print(llvm_ostream &OS, const MRegisterInfo *MRI) const { if (MRI && MRegisterInfo::isPhysicalRegister(reg)) OS << MRI->getName(reg); else @@ -508,5 +508,5 @@ } void LiveInterval::dump() const { - std::cerr << *this << "\n"; + llvm_cerr << *this << "\n"; } From isanbard at gmail.com Mon Nov 27 20:09:18 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 20:09:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp AutoUpgrade.cpp LeakDetector.cpp PassManager.cpp TypeSymbolTable.cpp Verifier.cpp Message-ID: <200611280209.kAS29IWp012826@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.213 -> 1.214 AutoUpgrade.cpp updated: 1.21 -> 1.22 LeakDetector.cpp updated: 1.15 -> 1.16 PassManager.cpp updated: 1.32 -> 1.33 TypeSymbolTable.cpp updated: 1.3 -> 1.4 Verifier.cpp updated: 1.167 -> 1.168 --- Log message: Changed to using LLVM streams. --- Diffs of the changes: (+34 -35) AsmWriter.cpp | 13 +++++++------ AutoUpgrade.cpp | 4 ++-- LeakDetector.cpp | 20 ++++++++++---------- PassManager.cpp | 5 ++--- TypeSymbolTable.cpp | 21 ++++++++++----------- Verifier.cpp | 6 +++--- 6 files changed, 34 insertions(+), 35 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.213 llvm/lib/VMCore/AsmWriter.cpp:1.214 --- llvm/lib/VMCore/AsmWriter.cpp:1.213 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Nov 27 20:09:03 2006 @@ -26,10 +26,11 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" -#include "llvm/Support/CFG.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/CFG.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include using namespace llvm; @@ -866,7 +867,7 @@ case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break; case GlobalValue::ExternalLinkage: break; case GlobalValue::GhostLinkage: - std::cerr << "GhostLinkage not allowed in AsmWriter!\n"; + llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n"; abort(); } @@ -965,7 +966,7 @@ case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break; case GlobalValue::ExternalLinkage: break; case GlobalValue::GhostLinkage: - std::cerr << "GhostLinkage not allowed in AsmWriter!\n"; + llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n"; abort(); } @@ -1358,11 +1359,11 @@ // Value::dump - allow easy printing of Values from the debugger. // Located here because so much of the needed functionality is here. -void Value::dump() const { print(std::cerr); std::cerr << '\n'; } +void Value::dump() const { print(std::cerr); llvm_cerr << '\n'; } // Type::dump - allow easy printing of Values from the debugger. // Located here because so much of the needed functionality is here. -void Type::dump() const { print(std::cerr); std::cerr << '\n'; } +void Type::dump() const { print(std::cerr); llvm_cerr << '\n'; } //===----------------------------------------------------------------------===// // CachedWriter Class Implementation @@ -1413,7 +1414,7 @@ //===----------------------------------------------------------------------===// #if 0 -#define SC_DEBUG(X) std::cerr << X +#define SC_DEBUG(X) llvm_cerr << X #else #define SC_DEBUG(X) #endif Index: llvm/lib/VMCore/AutoUpgrade.cpp diff -u llvm/lib/VMCore/AutoUpgrade.cpp:1.21 llvm/lib/VMCore/AutoUpgrade.cpp:1.22 --- llvm/lib/VMCore/AutoUpgrade.cpp:1.21 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/AutoUpgrade.cpp Mon Nov 27 20:09:03 2006 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Assembly/AutoUpgrade.h" +#include "llvm/Support/Streams.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" @@ -19,7 +20,6 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/SymbolTable.h" -#include using namespace llvm; static Function *getUpgradedUnaryFn(Function *F) { @@ -193,7 +193,7 @@ // See if its one of the name's we're interested in. if (Function *R = getUpgradedIntrinsic(F)) { if (R->getName() != F->getName()) - std::cerr << "WARNING: change " << F->getName() << " to " + llvm_cerr << "WARNING: change " << F->getName() << " to " << R->getName() << "\n"; return R; } Index: llvm/lib/VMCore/LeakDetector.cpp diff -u llvm/lib/VMCore/LeakDetector.cpp:1.15 llvm/lib/VMCore/LeakDetector.cpp:1.16 --- llvm/lib/VMCore/LeakDetector.cpp:1.15 Sun Aug 27 07:54:02 2006 +++ llvm/lib/VMCore/LeakDetector.cpp Mon Nov 27 20:09:03 2006 @@ -11,22 +11,22 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/LeakDetector.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/LeakDetector.h" +#include "llvm/Support/Streams.h" #include "llvm/Value.h" -#include #include using namespace llvm; namespace { template struct VISIBILITY_HIDDEN PrinterTrait { - static void print(const T* P) { std::cerr << P; } + static void print(const T* P) { llvm_cerr << P; } }; template<> struct VISIBILITY_HIDDEN PrinterTrait { - static void print(const Value* P) { std::cerr << *P; } + static void print(const Value* P) { llvm_cerr << *P; } }; template @@ -59,15 +59,15 @@ assert(Cache == 0 && "No value should be cached anymore!"); if (!Ts.empty()) { - std::cerr + llvm_cerr << "Leaked " << Name << " objects found: " << Message << ":\n"; for (typename std::set::iterator I = Ts.begin(), E = Ts.end(); I != E; ++I) { - std::cerr << "\t"; + llvm_cerr << "\t"; PrinterTrait::print(*I); - std::cerr << "\n"; + llvm_cerr << "\n"; } - std::cerr << '\n'; + llvm_cerr << '\n'; return true; } @@ -123,8 +123,8 @@ // use non-short-circuit version so that both checks are performed if (getObjects().hasGarbage(Message) | getLLVMObjects().hasGarbage(Message)) - std::cerr << "\nThis is probably because you removed an object, but didn't " - "delete it. Please check your code for memory leaks.\n"; + llvm_cerr << "\nThis is probably because you removed an object, but didn't " + << "delete it. Please check your code for memory leaks.\n"; // Clear out results so we don't get duplicate warnings on // next call... Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.32 llvm/lib/VMCore/PassManager.cpp:1.33 --- llvm/lib/VMCore/PassManager.cpp:1.32 Wed Nov 15 13:39:54 2006 +++ llvm/lib/VMCore/PassManager.cpp Mon Nov 27 20:09:03 2006 @@ -15,10 +15,9 @@ #include "llvm/PassManager.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" +#include "llvm/Support/Streams.h" #include #include -#include - using namespace llvm; namespace llvm { @@ -443,7 +442,7 @@ bool FunctionPassManager_New::run(Function &F) { std::string errstr; if (MP->materializeFunction(&F, &errstr)) { - std::cerr << "Error reading bytecode file: " << errstr << "\n"; + llvm_cerr << "Error reading bytecode file: " << errstr << "\n"; abort(); } return FPM->runOnFunction(F); Index: llvm/lib/VMCore/TypeSymbolTable.cpp diff -u llvm/lib/VMCore/TypeSymbolTable.cpp:1.3 llvm/lib/VMCore/TypeSymbolTable.cpp:1.4 --- llvm/lib/VMCore/TypeSymbolTable.cpp:1.3 Wed Jan 11 10:21:23 2006 +++ llvm/lib/VMCore/TypeSymbolTable.cpp Mon Nov 27 20:09:03 2006 @@ -14,9 +14,8 @@ #include "llvm/TypeSymbolTable.h" #include "llvm/DerivedTypes.h" #include "llvm/ADT/StringExtras.h" -#include +#include "llvm/Support/Streams.h" #include - using namespace llvm; #define DEBUG_SYMBOL_TABLE 0 @@ -67,7 +66,7 @@ #if DEBUG_SYMBOL_TABLE dump(); - std::cerr << " Removing Value: " << Result->getName() << "\n"; + llvm_cerr << " Removing Value: " << Result->getName() << "\n"; #endif tmap.erase(Entry); @@ -76,7 +75,7 @@ // list... if (Result->isAbstract()) { #if DEBUG_ABSTYPE - std::cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n"; + llvm_cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n"; #endif cast(Result)->removeAbstractTypeUser(this); } @@ -96,7 +95,7 @@ #if DEBUG_SYMBOL_TABLE dump(); - std::cerr << " Inserting type: " << UniqueName << ": " + llvm_cerr << " Inserting type: " << UniqueName << ": " << T->getDescription() << "\n"; #endif @@ -107,7 +106,7 @@ if (T->isAbstract()) { cast(T)->addAbstractTypeUser(this); #if DEBUG_ABSTYPE - std::cerr << "Added abstract type to ST: " << T->getDescription() << "\n"; + llvm_cerr << "Added abstract type to ST: " << T->getDescription() << "\n"; #endif } } @@ -153,14 +152,14 @@ for (iterator I = begin(), E = end(); I != E; ++I) { if (I->second == (Type*)OldType) { // FIXME when Types aren't const. #if DEBUG_ABSTYPE - std::cerr << "Removing type " << OldType->getDescription() << "\n"; + llvm_cerr << "Removing type " << OldType->getDescription() << "\n"; #endif OldType->removeAbstractTypeUser(this); I->second = (Type*)NewType; // TODO FIXME when types aren't const if (NewType->isAbstract()) { #if DEBUG_ABSTYPE - std::cerr << "Added type " << NewType->getDescription() << "\n"; + llvm_cerr << "Added type " << NewType->getDescription() << "\n"; #endif cast(NewType)->addAbstractTypeUser(this); } @@ -180,13 +179,13 @@ } static void DumpTypes(const std::pair& T ) { - std::cerr << " '" << T.first << "' = "; + llvm_cerr << " '" << T.first << "' = "; T.second->dump(); - std::cerr << "\n"; + llvm_cerr << "\n"; } void TypeSymbolTable::dump() const { - std::cerr << "TypeSymbolPlane: "; + llvm_cerr << "TypeSymbolPlane: "; for_each(tmap.begin(), tmap.end(), DumpTypes); } Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.167 llvm/lib/VMCore/Verifier.cpp:1.168 --- llvm/lib/VMCore/Verifier.cpp:1.167 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/Verifier.cpp Mon Nov 27 20:09:03 2006 @@ -55,11 +55,11 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" #include -#include #include #include using namespace llvm; @@ -156,11 +156,11 @@ switch (action) { case AbortProcessAction: msgs << "compilation aborted!\n"; - std::cerr << msgs.str(); + llvm_cerr << msgs.str(); abort(); case PrintMessageAction: msgs << "verification continues.\n"; - std::cerr << msgs.str(); + llvm_cerr << msgs.str(); return false; case ReturnStatusAction: msgs << "compilation terminated.\n"; From evan.cheng at apple.com Mon Nov 27 20:23:06 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 20:23:06 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstrBuilder.h Message-ID: <200611280223.kAS2N6fA013058@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstrBuilder.h updated: 1.41 -> 1.42 --- Log message: Fix indentation. --- Diffs of the changes: (+2 -2) MachineInstrBuilder.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.41 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.42 --- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.41 Mon Nov 27 17:33:29 2006 +++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Mon Nov 27 20:22:51 2006 @@ -93,8 +93,8 @@ /// BuildMI - This version of the builder sets up the first operand as a /// destination virtual register. /// - inline MachineInstrBuilder BuildMI(const TargetInstrDescriptor &TID, - unsigned DestReg) { +inline MachineInstrBuilder BuildMI(const TargetInstrDescriptor &TID, + unsigned DestReg) { return MachineInstrBuilder(new MachineInstr(TID)).addReg(DestReg, true); } From evan.cheng at apple.com Mon Nov 27 20:25:48 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 27 Nov 2006 20:25:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp Message-ID: <200611280225.kAS2Pmwi013113@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.133 -> 1.134 --- Log message: Clean up. --- Diffs of the changes: (+2 -2) MachineInstr.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.133 llvm/lib/CodeGen/MachineInstr.cpp:1.134 --- llvm/lib/CodeGen/MachineInstr.cpp:1.133 Mon Nov 27 17:36:08 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Mon Nov 27 20:25:34 2006 @@ -139,9 +139,9 @@ /// OperandComplete - Return true if it's illegal to add a new operand /// bool MachineInstr::OperandsComplete() const { - int NumOperands = TargetInstrDescriptors[Opcode].numOperands; + unsigned short NumOperands = TargetInstrDescriptors[Opcode].numOperands; if ((TargetInstrDescriptors[Opcode].Flags & M_VARIABLE_OPS) == 0 && - getNumOperands()-NumImplicitOps >= (unsigned)NumOperands) + getNumOperands()-NumImplicitOps >= NumOperands) return true; // Broken: we have all the operands of this instruction! return false; } From jlaskey at apple.com Mon Nov 27 21:14:51 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 27 Nov 2006 23:14:51 -0400 Subject: [llvm-commits] [llvm-gcc4] svn:Changes for ARM bootstrap. Message-ID: Changes for ARM bootstrap - prepared by Rafael Espindola. Index: configure =================================================================== --- configure (revision 120625) +++ configure (working copy) @@ -1269,6 +1269,10 @@ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) noconfigdirs="$noconfigdirs target-libffi target-qthreads" ;; + arm*-*-linux-gnueabi) + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + noconfigdirs="$noconfigdirs target-libjava target-libobjc" + ;; arm*-*-symbianelf*) noconfigdirs="$noconfigdirs ${libgcj} target-libiberty" ;; @@ -1812,7 +1816,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1816: checking for $ac_word" >&5 +echo "configure:1820: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1842,7 +1846,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1846: checking for $ac_word" >&5 +echo "configure:1850: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1893,7 +1897,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1897: checking for $ac_word" >&5 +echo "configure:1901: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1925,7 +1929,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1929: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1933: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1936,12 +1940,12 @@ cat > conftest.$ac_ext << EOF -#line 1940 "configure" +#line 1944 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1967,12 +1971,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1971: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1975: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1976: checking whether we are using GNU C" >&5 +echo "configure:1980: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1981,7 +1985,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2000,7 +2004,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2004: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2008: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2067,7 +2071,7 @@ # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2071: checking for $ac_word" >&5 +echo "configure:2075: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2099,7 +2103,7 @@ # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2103: checking for $ac_word" >&5 +echo "configure:2107: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2132,7 +2136,7 @@ fi echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2136: checking whether compiler driver understands Ada" >&5 +echo "configure:2140: checking whether compiler driver understands Ada" >&5 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2164,7 +2168,7 @@ fi echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2168: checking how to compare bootstrapped objects" >&5 +echo "configure:2172: checking how to compare bootstrapped objects" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2262,9 +2266,9 @@ CFLAGS="$CFLAGS $gmpinc" # Check GMP actually works echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2266: checking for correct version of gmp.h" >&5 +echo "configure:2270: checking for correct version of gmp.h" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2288,12 +2292,12 @@ if test x"$have_gmp" = xyes; then echo $ac_n "checking for MPFR""... $ac_c" 1>&6 -echo "configure:2292: checking for MPFR" >&5 +echo "configure:2296: checking for MPFR" >&5 saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" cat > conftest.$ac_ext < #include @@ -2301,7 +2305,7 @@ mpfr_t n; mpfr_init(n); ; return 0; } EOF -if { (eval echo configure:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2788,7 +2792,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2792: checking for $ac_word" >&5 +echo "configure:2796: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2823,7 +2827,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2827: checking for $ac_word" >&5 +echo "configure:2831: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2858,7 +2862,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2862: checking for $ac_word" >&5 +echo "configure:2866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2893,7 +2897,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2897: checking for $ac_word" >&5 +echo "configure:2901: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2928,7 +2932,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2932: checking for $ac_word" >&5 +echo "configure:2936: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2963,7 +2967,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2967: checking for $ac_word" >&5 +echo "configure:2971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3610,7 +3614,7 @@ # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3614: checking for $ac_word" >&5 +echo "configure:3618: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3643,7 +3647,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3647: checking for $ac_word" >&5 +echo "configure:3651: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3682,7 +3686,7 @@ # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3686: checking for $ac_word" >&5 +echo "configure:3690: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3715,7 +3719,7 @@ # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3719: checking for $ac_word" >&5 +echo "configure:3723: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3754,7 +3758,7 @@ # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3758: checking for $ac_word" >&5 +echo "configure:3762: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3787,7 +3791,7 @@ # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3791: checking for $ac_word" >&5 +echo "configure:3795: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3826,7 +3830,7 @@ # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3830: checking for $ac_word" >&5 +echo "configure:3834: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3859,7 +3863,7 @@ # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3863: checking for $ac_word" >&5 +echo "configure:3867: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3898,7 +3902,7 @@ # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3902: checking for $ac_word" >&5 +echo "configure:3906: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3931,7 +3935,7 @@ # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3935: checking for $ac_word" >&5 +echo "configure:3939: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3970,7 +3974,7 @@ # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3974: checking for $ac_word" >&5 +echo "configure:3978: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4003,7 +4007,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4007: checking for $ac_word" >&5 +echo "configure:4011: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4042,7 +4046,7 @@ # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4046: checking for $ac_word" >&5 +echo "configure:4050: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4075,7 +4079,7 @@ # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4079: checking for $ac_word" >&5 +echo "configure:4083: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4114,7 +4118,7 @@ # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4118: checking for $ac_word" >&5 +echo "configure:4122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4147,7 +4151,7 @@ # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4151: checking for $ac_word" >&5 +echo "configure:4155: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4186,7 +4190,7 @@ # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4190: checking for $ac_word" >&5 +echo "configure:4194: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4219,7 +4223,7 @@ # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4223: checking for $ac_word" >&5 +echo "configure:4227: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4265,7 +4269,7 @@ # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4269: checking for $ac_word" >&5 +echo "configure:4273: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4298,7 +4302,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4302: checking for $ac_word" >&5 +echo "configure:4306: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4337,7 +4341,7 @@ # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4341: checking for $ac_word" >&5 +echo "configure:4345: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4370,7 +4374,7 @@ # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4374: checking for $ac_word" >&5 +echo "configure:4378: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4409,7 +4413,7 @@ # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4413: checking for $ac_word" >&5 +echo "configure:4417: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4442,7 +4446,7 @@ # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4446: checking for $ac_word" >&5 +echo "configure:4450: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4481,7 +4485,7 @@ # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4485: checking for $ac_word" >&5 +echo "configure:4489: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4514,7 +4518,7 @@ # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4518: checking for $ac_word" >&5 +echo "configure:4522: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4553,7 +4557,7 @@ # Extract the first word of "${ncn_target_tool_prefix}lipo", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}lipo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4557: checking for $ac_word" >&5 +echo "configure:4561: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LIPO_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4586,7 +4590,7 @@ # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4590: checking for $ac_word" >&5 +echo "configure:4594: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LIPO_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4625,7 +4629,7 @@ # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4629: checking for $ac_word" >&5 +echo "configure:4633: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4658,7 +4662,7 @@ # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4662: checking for $ac_word" >&5 +echo "configure:4666: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4697,7 +4701,7 @@ # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4701: checking for $ac_word" >&5 +echo "configure:4705: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4730,7 +4734,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4734: checking for $ac_word" >&5 +echo "configure:4738: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4769,7 +4773,7 @@ # Extract the first word of "${ncn_target_tool_prefix}strip", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4773: checking for $ac_word" >&5 +echo "configure:4777: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_STRIP_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4802,7 +4806,7 @@ # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4806: checking for $ac_word" >&5 +echo "configure:4810: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_STRIP_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4841,7 +4845,7 @@ # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4845: checking for $ac_word" >&5 +echo "configure:4849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4874,7 +4878,7 @@ # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4878: checking for $ac_word" >&5 +echo "configure:4882: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4965,7 +4969,7 @@ NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4969: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4973: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -5012,7 +5016,7 @@ # gcc for stageN-gcc and stagePREV-gcc for stage(N-1). In case this is not # possible, however, we can resort to mv. echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6 -echo "configure:5016: checking if symbolic links between directories work" >&5 +echo "configure:5020: checking if symbolic links between directories work" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else Index: gcc/dwarf2asm.c =================================================================== --- gcc/dwarf2asm.c (revision 120625) +++ gcc/dwarf2asm.c (working copy) @@ -135,7 +135,10 @@ special relocations for this that we must use. */ void -dw2_asm_output_offset (int size, const char *label, const char * base, +/* APPLE LOCAL begin LLVM */ +dw2_asm_output_offset (int size, const char *label, + const char * base ATTRIBUTE_UNUSED, +/* APPLE LOCAL end LLVM */ const char *comment, ...) /* APPLE LOCAL end mainline 2006-03-16 dwarf 4383509 */ { Index: gcc/c-common.c =================================================================== --- gcc/c-common.c (revision 120625) +++ gcc/c-common.c (working copy) @@ -6478,7 +6478,9 @@ /* Default value of the constraint table. */ /* ??? This should be in defaults.h or a CW asm specific header. */ #ifndef TARGET_IASM_OP_CONSTRAINT -#define TARGET_IASM_OP_CONSTRAINT {} +/* APPLE LOCAL begin LLVM */ +#define TARGET_IASM_OP_CONSTRAINT +/* APPLE LOCAL end LLVM */ #endif /* Comparison function for bsearch to find an opcode/argument number @@ -6558,6 +6560,9 @@ /* This table must be sorted. */ const struct iasm_op_constraint db[] = { TARGET_IASM_OP_CONSTRAINT + /* APPLE LOCAL begin LLVM */ + { "", 0, "" } + /* APPLE LOCAL end LLVM */ }; struct iasm_op_constraint key; struct iasm_op_constraint *r; @@ -6569,7 +6574,9 @@ { size_t i; once = 1; - for (i=0; i < sizeof (db) / sizeof(db[0]) - 1; ++i) + /* APPLE LOCAL begin LLVM */ + for (i=0; i < sizeof (db) / sizeof(db[0]) - 2; ++i) + /* APPLE LOCAL end LLVM */ gcc_assert (iasm_op_comp (&db[i+1], &db[i]) >= 0); } #endif @@ -6579,7 +6586,9 @@ TARGET_IASM_REORDER_ARG(opcode, key.argnum, num_args, argnum); - r = bsearch (&key, db, sizeof (db) / sizeof (db[0]), sizeof (db [0]), iasm_op_comp); + /* APPLE LOCAL begin LLVM */ + r = bsearch (&key, db, sizeof (db) / sizeof (db[0]) - 1, sizeof (db [0]), iasm_op_comp); + /* APPLE LOCAL end LLVM */ IASM_SYNTH_CONSTRAINTS(r, argnum, num_args, db); @@ -6635,9 +6644,13 @@ tree *outputsp, tree *inputsp, tree *uses, unsigned num_args, iasm_md_extra_info *e) { - const char *s; + /* APPLE LOCAL begin LLVM */ + const char *s = NULL; + /* APPLE LOCAL end LLVM */ bool was_output = true; - tree str, one; + /* APPLE LOCAL begin LLVM */ + tree str = NULL, one; + /* APPLE LOCAL end LLVM */ tree var = e->dat[op_num].var; unsigned argnum = e->dat[op_num].argnum; /* must_be_reg is true, iff we know the operand must be a register. */ Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 120625) +++ gcc/config.gcc (working copy) @@ -677,10 +677,30 @@ use_collect2=yes ;; arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/ linux-elf.h arm/aout.h arm/arm.h" - tmake_file="${tmake_file} arm/t-arm arm/t-linux" + # APPLE LOCAL begin LLVM + tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/ linux-elf.h" + tmake_file="${tmake_file} t-linux arm/t-arm" + # APPLE LOCAL end LLVM extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" gnu_ld=yes + # APPLE LOCAL begin LLVM + case ${target} in + arm*-*-linux-gnueabi) + tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" + tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux- eabi" + # The BPABI long long divmod functions return a 128-bit value in + # registers r0-r3. Correctly modeling that requires the use of + # TImode. + need_64bit_hwint=yes + # The EABI requires the use of __cxa_atexit. + default_use_cxa_atexit=yes + ;; + *) + tmake_file="$tmake_file arm/t-linux" + ;; + esac + tm_file="$tm_file arm/aout.h arm/arm.h" + # APPLE LOCAL end LLVM ;; arm*-*-uclinux*) # ARM ucLinux tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/ arm.h arm/linux-gas.h arm/linux-elf.h arm/uclinux-elf.h" Index: gcc/c-incpath.c =================================================================== --- gcc/c-incpath.c (revision 120625) +++ gcc/c-incpath.c (working copy) @@ -224,7 +224,9 @@ /* If it is a regular file and if it is large enough to be a header- map, see if it really is one. */ if (fstat (fileno (f), &f_info) == 0 && S_ISREG(f_info.st_mode) - && f_info.st_size >= sizeof(struct hmap_header_map)) + /* APPLE LOCAL begin LLVM */ + && (unsigned) f_info.st_size >= sizeof(struct hmap_header_map)) + /* APPLE LOCAL end LLVM */ { unsigned headermap_size = f_info.st_size; Index: gcc/config/arm/linux-elf.h =================================================================== --- gcc/config/arm/linux-elf.h (revision 120625) +++ gcc/config/arm/linux-elf.h (working copy) @@ -81,18 +81,24 @@ #define ENDFILE_SPEC \ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" -#undef LINK_SPEC -#define LINK_SPEC "%{h*} %{version:-v} \ - %{b} %{Wl,*:%*} \ +/* APPLE LOCAL begin LLVM */ +#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2" + +#define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ + %{b} \ %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \ -X \ %{mbig-endian:-EB}" \ SUBTARGET_EXTRA_LINK_SPEC +#undef LINK_SPEC +#define LINK_SPEC LINUX_TARGET_LINK_SPEC +/* APPLE LOCAL end LLVM */ + #define TARGET_OS_CPP_BUILTINS() \ do \ { \ Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 120625) +++ gcc/config/arm/arm.c (working copy) @@ -643,7 +643,10 @@ {"apcs-gnu", ARM_ABI_APCS}, {"atpcs", ARM_ABI_ATPCS}, {"aapcs", ARM_ABI_AAPCS}, - {"iwmmxt", ARM_ABI_IWMMXT} + /* APPLE LOCAL begin LLVM */ + {"iwmmxt", ARM_ABI_IWMMXT}, + {"aapcs-linux", ARM_ABI_AAPCS_LINUX} + /* APPLE LOCAL end LLVM */ }; /* Return the number of bits set in VALUE. */ @@ -1134,7 +1137,9 @@ flag_schedule_insns = flag_schedule_insns_after_reload = 0; /* Override the default structure alignment for AAPCS ABI. */ - if (arm_abi == ARM_ABI_AAPCS) + /* APPLE LOCAL begin LLVM */ + if (TARGET_AAPCS_BASED) + /* APPLE LOCAL end LLVM */ arm_structure_size_boundary = 8; if (structure_size_string != NULL) @@ -14392,7 +14397,9 @@ static bool arm_default_short_enums (void) { - return TARGET_AAPCS_BASED; + /* APPLE LOCAL begin LLVM */ + return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX; + /* APPLE LOCAL end LLVM */ } Index: gcc/config/arm/arm.h =================================================================== --- gcc/config/arm/arm.h (revision 120625) +++ gcc/config/arm/arm.h (working copy) @@ -491,7 +491,10 @@ ARM_ABI_APCS, ARM_ABI_ATPCS, ARM_ABI_AAPCS, - ARM_ABI_IWMMXT + /* APPLE LOCAL begin LLVM */ + ARM_ABI_IWMMXT, + ARM_ABI_AAPCS_LINUX + /* APPLE LOCAL end LLVM */ }; extern enum arm_abi_type arm_abi; @@ -715,6 +718,12 @@ #define SIZE_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long unsigned int") #endif +/* APPLE LOCAL begin LLVM */ +#ifndef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int") +#endif +/* APPLE LOCAL end LLVM */ + /* AAPCS requires that structure alignment is affected by bitfields. */ #ifndef PCC_BITFIELD_TYPE_MATTERS #define PCC_BITFIELD_TYPE_MATTERS TARGET_AAPCS_BASED Index: gcc/config/arm/bpabi.h =================================================================== --- gcc/config/arm/bpabi.h (revision 120625) +++ gcc/config/arm/bpabi.h (working copy) @@ -27,8 +27,17 @@ #define TARGET_BPABI (TARGET_AAPCS_BASED) /* Section 4.1 of the AAPCS requires the use of VFP format. */ +/* APPLE LOCAL begin LLVM */ +#undef FPUTYPE_DEFAULT +/* APPLE LOCAL end LLVM */ #define FPUTYPE_DEFAULT FPUTYPE_VFP +/* APPLE LOCAL begin LLVM */ +/* EABI targets should enable interworking by default. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT ARM_FLAG_INTERWORK +/* APPLE LOCAL end LLVM */ + /* The ARM BPABI functions return a boolean; they use no special calling convention. */ #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI @@ -98,5 +107,8 @@ } \ while (false) +/* APPLE LOCAL begin LLVM */ +#undef TARGET_OS_CPP_BUILTINS +/* APPLE LOCAL end LLVM */ #define TARGET_OS_CPP_BUILTINS() \ TARGET_BPABI_CPP_BUILTINS() Index: gcc/config/arm/arm.md =================================================================== --- gcc/config/arm/arm.md (revision 120625) +++ gcc/config/arm/arm.md (working copy) @@ -1896,7 +1896,10 @@ HOST_WIDE_INT op3_value = mask & INTVAL (operands[3]); HOST_WIDE_INT mask2 = ((mask & ~op3_value) << start_bit); - emit_insn (gen_andsi3 (op1, operands[0], GEN_INT (~mask2))); + /* APPLE LOCAL begin LLVM */ + emit_insn (gen_andsi3 (op1, operands[0], + gen_int_mode (~mask2, SImode))); + /* APPLE LOCAL end LLVM */ emit_insn (gen_iorsi3 (subtarget, op1, gen_int_mode (op3_value << start_bit, SImode))); } @@ -1934,7 +1937,9 @@ } else { - rtx op0 = GEN_INT (mask); + /* APPLE LOCAL begin LLVM */ + rtx op0 = gen_int_mode (mask, SImode); + /* APPLE LOCAL end LLVM */ rtx op1 = gen_reg_rtx (SImode); rtx op2 = gen_reg_rtx (SImode); @@ -1953,7 +1958,9 @@ && (const_ok_for_arm (mask << start_bit) || const_ok_for_arm (~(mask << start_bit)))) { - op0 = GEN_INT (~(mask << start_bit)); + /* APPLE LOCAL begin LLVM */ + op0 = gen_int_mode (~(mask << start_bit), SImode); + /* APPLE LOCAL end LLVM */ emit_insn (gen_andsi3 (op2, operands[0], op0)); } else Index: gcc/config/arm/freebsd.h =================================================================== --- gcc/config/arm/freebsd.h (revision 120625) +++ gcc/config/arm/freebsd.h (working copy) @@ -30,7 +30,6 @@ #undef LINK_SPEC #define LINK_SPEC " \ %{p:%nconsider using `-pg' instead of `-p' with gprof(1) } \ - %{Wl,*:%*} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061127/0b39778a/attachment.html -------------- 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/20061127/0b39778a/attachment.bin From isanbard at gmail.com Mon Nov 27 21:31:43 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 27 Nov 2006 21:31:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200611280331.kAS3VhT4014151@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.37 -> 1.38 --- Log message: Put the #include for a module first. --- Diffs of the changes: (+1 -1) LiveInterval.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.37 llvm/lib/CodeGen/LiveInterval.cpp:1.38 --- llvm/lib/CodeGen/LiveInterval.cpp:1.37 Mon Nov 27 20:08:17 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Mon Nov 27 21:31:29 2006 @@ -18,8 +18,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/LiveInterval.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/Streams.h" #include "llvm/Target/MRegisterInfo.h" #include From reid at x10sys.com Tue Nov 28 00:14:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 00:14:20 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll Message-ID: <200611280614.kAS6EKs7016762@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2003-11-03-VarargsCallBug.ll updated: 1.2 -> 1.3 --- Log message: Fix a typo. --- Diffs of the changes: (+1 -1) 2003-11-03-VarargsCallBug.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll diff -u llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll:1.2 llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll:1.2 Sun Nov 26 19:05:10 2006 +++ llvm/test/Regression/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll Tue Nov 28 00:14:06 2006 @@ -1,4 +1,4 @@ -; The cast in this testcase is not eliminatable on a 32-bit target! +; The cast in this testcase is not eliminable on a 32-bit target! ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep inttoptr target endian = little From reid at x10sys.com Tue Nov 28 01:17:00 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:17:00 -0600 Subject: [llvm-commits] CVS: llvm-test/RunSafely.sh Message-ID: <200611280717.kAS7H0R0017844@zion.cs.uiuc.edu> Changes in directory llvm-test: RunSafely.sh updated: 1.23 -> 1.24 --- Log message: Make the script always output an "exit " line to the end of the program's output. This will make differences in the return val show up when the reference and test outputs are diff'd. --- Diffs of the changes: (+9 -9) RunSafely.sh | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.23 llvm-test/RunSafely.sh:1.24 --- llvm-test/RunSafely.sh:1.23 Sun Nov 26 01:14:16 2006 +++ llvm-test/RunSafely.sh Tue Nov 28 01:16:45 2006 @@ -88,17 +88,17 @@ !/^user/ && !/^sys/ { print; } END { printf("program %f\n", cpu); }' > $OUTFILE.time +exitval=`grep '^exit ' $OUTFILE.time | sed -e 's/^exit //'` +if [ -z "$exitval" ] ; then + exitval=99 + echo "TEST $PROGRAM FAILED: CAN'T GET EXIT CODE!" +fi +echo "exit $exitval" >> $OUTFILE + if [ "$EXITOK" -ne 0 ] ; then - exitval=`grep '^exit ' $OUTFILE.time | sed -e 's/^exit //'` - if [ -z "$exitval" ] ; then - exitval=99 - echo "TEST $PROGRAM FAILED: CAN'T GET EXIT CODE!" - else - if test "$exitval" -ne 0 ; then - echo "TEST $PROGRAM FAILED: EXIT != 0" - fi + if test "$exitval" -ne 0 ; then + echo "TEST $PROGRAM FAILED: EXIT != 0" fi - echo "exit $exitval" >> $OUTFILE else exitval=0 fi From reid at x10sys.com Tue Nov 28 01:18:40 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:18:40 -0600 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200611280718.kAS7Iesw017879@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.244 -> 1.245 --- Log message: Make bugpoint always run with the -append-exit-code option so that it will write out "exit " to the end of the test program's output file. This causes it to mimic RunSafely.sh's behavior and prevents it from generating false positives. --- Diffs of the changes: (+6 -0) Makefile.programs | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.244 llvm-test/Makefile.programs:1.245 --- llvm-test/Makefile.programs:1.244 Sun Nov 26 01:14:16 2006 +++ llvm-test/Makefile.programs Tue Nov 28 01:18:25 2006 @@ -382,6 +382,12 @@ Output/%.out-cbe: Output/%.cbe -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS) +# The RunSafely.sh script puts an "exit " line at the end of +# the program's output. We have to make bugpoint do the same thing +# or else it will get false positives when it diff's the reference +# output with the program's output. +BUGPOINT_OPTIONS += -append-exit-code + # If a tolerance is set, pass it off to bugpoint ifdef FP_TOLERANCE BUGPOINT_OPTIONS += -rel-tolerance $(FP_TOLERANCE) From reid at x10sys.com Tue Nov 28 01:23:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:23:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611280723.kAS7NG8a017964@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.549 -> 1.550 --- Log message: Remove 4 FIXME's from the CAST patch now that the back end is correctly producing code for "trunc to bool". This passes all tests on Linux. --- Diffs of the changes: (+3 -46) InstructionCombining.cpp | 49 ++--------------------------------------------- 1 files changed, 3 insertions(+), 46 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.549 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.550 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.549 Mon Nov 27 13:55:07 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Nov 28 01:23:01 2006 @@ -5739,13 +5739,6 @@ unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - // See if we can simplify any instructions used by the LHS whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero = 0, KnownOne = 0; @@ -6021,35 +6014,11 @@ } Instruction *InstCombiner::visitFPToUI(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitFPToSI(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitUIToFP(CastInst &CI) { @@ -6061,19 +6030,7 @@ } Instruction *InstCombiner::visitPtrToInt(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitIntToPtr(CastInst &CI) { From reid at x10sys.com Tue Nov 28 01:28:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:28:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y ParserInternals.h Message-ID: <200611280728.kAS7STnU018056@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.84 -> 1.85 llvmAsmParser.y updated: 1.277 -> 1.278 ParserInternals.h updated: 1.48 -> 1.49 --- Log message: Implement signedness caching for values, value lists, constants and constant lists. This is just an internal change to the parser in preparation for some backwards compatibility code that is to follow. This will allow things like "uint 4000000000" to retain the unsignedness of the integer constant as the value moves through the parser. In the future, all integer types will be signless but parsing "uint" and friends will be retained for backwards compatibility. --- Diffs of the changes: (+250 -202) Lexer.l | 40 ++--- ParserInternals.h | 23 ++- llvmAsmParser.y | 389 ++++++++++++++++++++++++++++++------------------------ 3 files changed, 250 insertions(+), 202 deletions(-) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.84 llvm/lib/AsmParser/Lexer.l:1.85 --- llvm/lib/AsmParser/Lexer.l:1.84 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/Lexer.l Tue Nov 28 01:28:14 2006 @@ -51,17 +51,11 @@ llvmAsmlval.type.obsolete = true; \ return sym -// Construct a token value for a non-obsolete type -#define RET_TY(CType, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = isSignless; \ - return sym - // Construct a token value for an obsolete token -#define RET_TY_OBSOLETE(CType, sign, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = sign; \ - return sym +#define RET_TY(CTYPE, SIGN, SYM) \ + llvmAsmlval.TypeVal.type = new PATypeHolder(CTYPE); \ + llvmAsmlval.TypeVal.signedness = SIGN; \ + return SYM namespace llvm { @@ -249,19 +243,19 @@ x86_stdcallcc { return X86_STDCALLCC_TOK; } x86_fastcallcc { return X86_FASTCALLCC_TOK; } -void { RET_TY(Type::VoidTy, VOID); } -bool { RET_TY(Type::BoolTy, BOOL); } -sbyte { RET_TY_OBSOLETE(Type::SByteTy, isSigned, SBYTE); } -ubyte { RET_TY_OBSOLETE(Type::UByteTy, isUnsigned, UBYTE); } -short { RET_TY_OBSOLETE(Type::ShortTy, isSigned, SHORT); } -ushort { RET_TY_OBSOLETE(Type::UShortTy,isUnsigned, USHORT); } -int { RET_TY_OBSOLETE(Type::IntTy, isSigned, INT); } -uint { RET_TY_OBSOLETE(Type::UIntTy, isUnsigned, UINT); } -long { RET_TY_OBSOLETE(Type::LongTy, isSigned, LONG); } -ulong { RET_TY_OBSOLETE(Type::ULongTy, isUnsigned, ULONG); } -float { RET_TY(Type::FloatTy, FLOAT); } -double { RET_TY(Type::DoubleTy, DOUBLE); } -label { RET_TY(Type::LabelTy, LABEL); } +void { RET_TY(Type::VoidTy, isSignless, VOID); } +bool { RET_TY(Type::BoolTy, isSignless, BOOL); } +sbyte { RET_TY(Type::SByteTy, isSigned, SBYTE); } +ubyte { RET_TY(Type::UByteTy, isUnsigned, UBYTE); } +short { RET_TY(Type::ShortTy, isSigned, SHORT); } +ushort { RET_TY(Type::UShortTy,isUnsigned, USHORT);} +int { RET_TY(Type::IntTy, isSigned, INT); } +uint { RET_TY(Type::UIntTy, isUnsigned, UINT); } +long { RET_TY(Type::LongTy, isSigned, LONG); } +ulong { RET_TY(Type::ULongTy, isUnsigned, ULONG); } +float { RET_TY(Type::FloatTy, isSignless, FLOAT); } +double { RET_TY(Type::DoubleTy,isSignless, DOUBLE);} +label { RET_TY(Type::LabelTy, isSignless, LABEL); } type { return TYPE; } opaque { return OPAQUE; } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.277 llvm/lib/AsmParser/llvmAsmParser.y:1.278 --- llvm/lib/AsmParser/llvmAsmParser.y:1.277 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Nov 28 01:28:14 2006 @@ -83,8 +83,8 @@ Module *CurrentModule; std::map Values; // Module level numbered definitions std::map LateResolveValues; - std::vector Types; - std::map LateResolveTypes; + std::vector Types; + std::map LateResolveTypes; /// PlaceHolderInfo - When temporary placeholder objects are created, remember /// how they were referenced and on which line of the input they came from so @@ -217,7 +217,7 @@ case ValID::NumberVal: // Is it a numbered definition? // Module constants occupy the lowest numbered slots... if ((unsigned)D.Num < CurModule.Types.size()) - return CurModule.Types[(unsigned)D.Num].type->get(); + return CurModule.Types[(unsigned)D.Num]; break; case ValID::NameVal: // Is it a named definition? if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) { @@ -247,16 +247,14 @@ } } - std::map::iterator I =CurModule.LateResolveTypes.find(D); + std::map::iterator I =CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) - return I->second.type->get(); + return I->second; - TypeInfo TI; - TI.type = new PATypeHolder(OpaqueType::get()); - TI.signedness = isSignless; - CurModule.LateResolveTypes.insert(std::make_pair(D, TI)); - return TI.type->get(); - } + Type *Typ = OpaqueType::get(); + CurModule.LateResolveTypes.insert(std::make_pair(D, Typ)); + return Typ; +} static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = @@ -559,10 +557,10 @@ if (Name) D = ValID::create(Name); else D = ValID::create((int)CurModule.Types.size()); - std::map::iterator I = + std::map::iterator I = CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) { - ((DerivedType*)I->second.type->get())->refineAbstractTypeTo(ToTy); + ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy); CurModule.LateResolveTypes.erase(I); } } @@ -1044,19 +1042,17 @@ llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - llvm::Constant *ConstVal; - - TypeInfo TypeVal; - llvm::Value *ValueVal; + ConstInfo ConstVal; + TypeInfo TypeVal; + ValueInfo ValueVal; std::vector >*ArgList; - std::vector *ValueList; + std::vector *ValueList; std::list *TypeList; // Represent the RHS of PHI node - std::list > *PHIList; + std::list > *PHIList; std::vector > *JumpTable; - std::vector *ConstVector; + std::vector *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -1374,7 +1370,7 @@ std::vector Elements; for (std::list::iterator I = $2->begin(), E = $2->end(); I != E; ++I) - Elements.push_back(I->type->get()); + Elements.push_back((*I).type->get()); $$.type = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); $$.signedness = isSignless; @@ -1390,7 +1386,7 @@ if ($1.type->get() == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); $$.type = new PATypeHolder(HandleUpRefs(PointerType::get($1.type->get()))); - $$.signedness = $1.signedness; + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR }; @@ -1448,14 +1444,19 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i]->getType()) + if (ETy != (*$3)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i]->getType()->getDescription() + "'."); + (*$3)[i].cnst->getType()->getDescription() + "'."); + } else { + elems.push_back((*$3)[i].cnst); + } } - $$ = ConstantArray::get(ATy, *$3); + $$.cnst = ConstantArray::get(ATy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1469,7 +1470,8 @@ if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); - $$ = ConstantArray::get(ATy, std::vector()); + $$.cnst = ConstantArray::get(ATy, std::vector()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1499,7 +1501,8 @@ GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free($3); - $$ = ConstantArray::get(ATy, Vals); + $$.cnst = ConstantArray::get(ATy, Vals); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1518,14 +1521,18 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i]->getType()) + if (ETy != (*$3)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i]->getType()->getDescription() + "'."); + (*$3)[i].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*$3)[i].cnst); } - $$ = ConstantPacked::get(PTy, *$3); + $$.cnst = ConstantPacked::get(PTy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1539,14 +1546,18 @@ GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! + std::vector elems; for (unsigned i = 0, e = $3->size(); i != e; ++i) - if ((*$3)[i]->getType() != STy->getElementType(i)) + if ((*$3)[i].cnst->getType() != STy->getElementType(i)) { GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); + } else + elems.push_back((*$3)[i].cnst); - $$ = ConstantStruct::get(STy, *$3); + $$.cnst = ConstantStruct::get(STy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1559,7 +1570,8 @@ if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); - $$ = ConstantStruct::get(STy, std::vector()); + $$.cnst = ConstantStruct::get(STy, std::vector()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1569,12 +1581,14 @@ GEN_ERROR("Cannot make null pointer constant with type: '" + $1.type->get()->getDescription() + "'!"); - $$ = ConstantPointerNull::get(PTy); + $$.cnst = ConstantPointerNull::get(PTy); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } | Types UNDEF { - $$ = UndefValue::get($1.type->get()); + $$.cnst = UndefValue::get($1.type->get()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1635,12 +1649,13 @@ } } - $$ = cast(V); + $$.cnst = cast(V); + $$.signedness = $1.signedness; delete $1.type; // Free the type handle CHECK_FOR_ERROR } | Types ConstExpr { - if ($1.type->get() != $2->getType()) + if ($1.type->get() != $2.cnst->getType()) GEN_ERROR("Mismatched types for constant expression!"); $$ = $2; delete $1.type; @@ -1650,7 +1665,8 @@ const Type *Ty = $1.type->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); - $$ = Constant::getNullValue(Ty); + $$.cnst = Constant::getNullValue(Ty); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR }; @@ -1658,33 +1674,38 @@ ConstVal : SIntType EINT64VAL { // integral constants if (!ConstantInt::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$ = ConstantInt::get($1.type->get(), $2); + $$.cnst = ConstantInt::get($1.type->get(), $2); + $$.signedness = $1.signedness; CHECK_FOR_ERROR } | UIntType EUINT64VAL { // integral constants if (!ConstantInt::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$ = ConstantInt::get($1.type->get(), $2); + $$.cnst = ConstantInt::get($1.type->get(), $2); + $$.signedness = $1.signedness; CHECK_FOR_ERROR } | BOOL TRUETOK { // Boolean constants - $$ = ConstantBool::getTrue(); + $$.cnst = ConstantBool::getTrue(); + $$.signedness = isSignless; CHECK_FOR_ERROR } | BOOL FALSETOK { // Boolean constants - $$ = ConstantBool::getFalse(); + $$.cnst = ConstantBool::getFalse(); + $$.signedness = isSignless; CHECK_FOR_ERROR } | FPType FPVAL { // Float & Double constants if (!ConstantFP::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Floating point constant invalid for type!!"); - $$ = ConstantFP::get($1.type->get(), $2); + $$.cnst = ConstantFP::get($1.type->get(), $2); + $$.signedness = isSignless; CHECK_FOR_ERROR }; ConstExpr: CastOps '(' ConstVal TO Types ')' { - Constant *Val = $3; + Constant *Val = $3.cnst; const Type *Ty = $5.type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + @@ -1696,73 +1717,64 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - $$ = ConstantExpr::get(Instruction::SetNE, Val, + $$.cnst = ConstantExpr::get(Instruction::SetNE, Val, Constant::getNullValue(Val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { Constant *CE = ConstantExpr::getFPToUI(Val, Type::ULongTy); - $$ = ConstantExpr::getIntToPtr(CE, Ty); + $$.cnst = ConstantExpr::getIntToPtr(CE, Ty); } else { - $$ = ConstantExpr::getCast(Val, Ty); + $$.cnst = ConstantExpr::getCast(Val, Ty); } } else { - $$ = ConstantExpr::getCast($1.opcode, $3, $5.type->get()); + $$.cnst = ConstantExpr::getCast($1.opcode, $3.cnst, $5.type->get()); } delete $5.type; } | GETELEMENTPTR '(' ConstVal IndexList ')' { - if (!isa($3->getType())) + if (!isa($3.cnst->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin($3->getType(), $4->begin(), $4->end()), - GTE = gep_type_end($3->getType(), $4->begin(), $4->end()); - for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*$4)[i])) - if (CUI->getType() == Type::UByteTy) - (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector IdxVec; + for (unsigned i = 0, e = $4->size(); i < e; ++i) + if (Constant *C = dyn_cast((*$4)[i].val)) + IdxVec.push_back(C); + else + GEN_ERROR("Indices to constant getelementptr must be constants!"); const Type *IdxTy = - GetElementPtrInst::getIndexedType($3->getType(), *$4, true); + GetElementPtrInst::getIndexedType($3.cnst->getType(), IdxVec, true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); - std::vector IdxVec; - for (unsigned i = 0, e = $4->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$4)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant getelementptr must be constants!"); - delete $4; - $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + $$.cnst = ConstantExpr::getGetElementPtr($3.cnst, IdxVec); + $$.signedness = isSignless; CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if ($3->getType() != Type::BoolTy) + if ($3.cnst->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); - if ($5->getType() != $7->getType()) + if ($5.cnst->getType() != $7.cnst->getType()) GEN_ERROR("Select operand types must match!"); - $$ = ConstantExpr::getSelect($3, $5, $7); + $$.cnst = ConstantExpr::getSelect($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | ArithmeticOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("Binary operator types must match!"); // First, make sure we're dealing with the right opcode by upgrading from // obsolete versions. - sanitizeOpcode($1, $3->getType()); + sanitizeOpcode($1, $3.cnst->getType()); CHECK_FOR_ERROR; // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. - if (!isa($3->getType())) { - $$ = ConstantExpr::get($1.opcode, $3, $5); + if (!isa($3.cnst->getType())) { + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -1770,56 +1782,64 @@ case Module::Pointer64: IntPtrTy = Type::LongTy; break; default: GEN_ERROR("invalid pointer binary constant expr!"); } - $$ = ConstantExpr::get($1.opcode, ConstantExpr::getCast($3, IntPtrTy), - ConstantExpr::getCast($5, IntPtrTy)); - $$ = ConstantExpr::getCast($$, $3->getType()); + $$.cnst = ConstantExpr::get($1.opcode, + ConstantExpr::getCast($3.cnst, IntPtrTy), + ConstantExpr::getCast($5.cnst, IntPtrTy)); + $$.cnst = ConstantExpr::getCast($$.cnst, $3.cnst->getType()); } + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | LogicalOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("Logical operator types must match!"); - if (!$3->getType()->isIntegral()) { - if (!isa($3->getType()) || - !cast($3->getType())->getElementType()->isIntegral()) + if (!$3.cnst->getType()->isIntegral()) { + if (!isa($3.cnst->getType()) || + !cast($3.cnst->getType())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | SetCondOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("setcc operand types must match!"); - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | ShiftOps '(' ConstVal ',' ConstVal ')' { - if ($5->getType() != Type::UByteTy) + if ($5.cnst->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); - if (!$3->getType()->isInteger()) + if (!$3.cnst->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode($1, $3->getType()); + sanitizeOpcode($1, $3.cnst->getType()); CHECK_FOR_ERROR; - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { - if (!ExtractElementInst::isValidOperands($3, $5)) + if (!ExtractElementInst::isValidOperands($3.cnst, $5.cnst)) GEN_ERROR("Invalid extractelement operands!"); - $$ = ConstantExpr::getExtractElement($3, $5); + $$.cnst = ConstantExpr::getExtractElement($3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!InsertElementInst::isValidOperands($3, $5, $7)) + if (!InsertElementInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) GEN_ERROR("Invalid insertelement operands!"); - $$ = ConstantExpr::getInsertElement($3, $5, $7); + $$.cnst = ConstantExpr::getInsertElement($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!ShuffleVectorInst::isValidOperands($3, $5, $7)) + if (!ShuffleVectorInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) GEN_ERROR("Invalid shufflevector operands!"); - $$ = ConstantExpr::getShuffleVector($3, $5, $7); + $$.cnst = ConstantExpr::getShuffleVector($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR }; @@ -1830,7 +1850,7 @@ CHECK_FOR_ERROR } | ConstVal { - $$ = new std::vector(); + $$ = new std::vector(); $$->push_back($1); CHECK_FOR_ERROR }; @@ -1903,7 +1923,7 @@ CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back($4); + CurModule.Types.push_back(*($4.type)); } else { delete $4.type; } @@ -1916,9 +1936,9 @@ CHECK_FOR_ERROR } | ConstPool OptAssign OptLinkage GlobalType ConstVal { - if ($5 == 0) + if ($5.cnst == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); + CurGV = ParseGlobalVariable($2, $3, $4, $5.cnst->getType(), $5.cnst); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; @@ -2235,7 +2255,7 @@ CHECK_FOR_ERROR } | '<' ConstVector '>' { // Nonempty unsized packed vector - const Type *ETy = (*$2)[0]->getType(); + const Type *ETy = (*$2)[0].cnst->getType(); int NumElements = $2->size(); PackedType* pt = PackedType::get(ETy, NumElements); @@ -2243,19 +2263,22 @@ HandleUpRefs(PackedType::get( ETy, NumElements))); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $2->size(); i++) { - if (ETy != (*$2)[i]->getType()) + if (ETy != (*$2)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*$2)[i]->getType()->getDescription() + "'."); + (*$2)[i].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*$2)[i].cnst); } - $$ = ValID::create(ConstantPacked::get(pt, *$2)); + $$ = ValID::create(ConstantPacked::get(pt, elems)); delete PTy; delete $2; CHECK_FOR_ERROR } | ConstExpr { - $$ = ValID::create($1); + $$ = ValID::create($1.cnst); CHECK_FOR_ERROR } | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { @@ -2289,8 +2312,10 @@ // type immediately preceeds the value reference, and allows complex constant // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { - $$ = getVal($1.type->get(), $2); delete $1.type; + $$.val = getVal($1.type->get(), $2); + delete $1.type; CHECK_FOR_ERROR + $$.signedness = $1.signedness; }; BasicBlockList : BasicBlockList BasicBlock { @@ -2352,7 +2377,7 @@ }; BBTerminatorInst : RET ResolvedVal { // Return with a result... - $$ = new ReturnInst($2); + $$ = new ReturnInst($2.val); CHECK_FOR_ERROR } | RET VOID { // Return with no result... @@ -2411,9 +2436,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ($6) { - for (std::vector::iterator I = $6->begin(), E = $6->end(); + for (std::vector::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -2439,17 +2464,26 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); + std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); - - if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - GEN_ERROR("Invalid number of parameters detected!"); - - $$ = new InvokeInst(V, Normal, Except, *$6); + std::vector args; + for (; ArgI != ArgE; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } + $$ = new InvokeInst(V, Normal, Except, args); } cast($$)->setCallingConv($2); @@ -2521,7 +2555,7 @@ ValueRefList : ResolvedVal { // Used for call statements, and memory insts... - $$ = new std::vector(); + $$ = new std::vector(); $$->push_back($1); } | ValueRefList ',' ResolvedVal { @@ -2531,7 +2565,12 @@ }; // ValueRefListE - Just like ValueRefList, except that it may also be empty! -ValueRefListE : ValueRefList | /*empty*/ { $$ = 0; }; +ValueRefListE : ValueRefList { + $$ = $1; + } + | /*empty*/ { + $$ = 0; + }; OptTailCall : TAIL CALL { $$ = true; @@ -2597,28 +2636,28 @@ std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue($2->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue($2.val->getType()); if (Ones == 0) GEN_ERROR("Expected integral type for not instruction!"); - $$ = BinaryOperator::create(Instruction::Xor, $2, Ones); + $$ = BinaryOperator::create(Instruction::Xor, $2.val, Ones); if ($$ == 0) GEN_ERROR("Could not create a xor instruction!"); CHECK_FOR_ERROR } | ShiftOps ResolvedVal ',' ResolvedVal { - if ($4->getType() != Type::UByteTy) + if ($4.val->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); - if (!$2->getType()->isInteger()) + if (!$2.val->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode($1, $2->getType()); + sanitizeOpcode($1, $2.val->getType()); CHECK_FOR_ERROR; - $$ = new ShiftInst($1.opcode, $2, $4); + $$ = new ShiftInst($1.opcode, $2.val, $4.val); CHECK_FOR_ERROR } | CastOps ResolvedVal TO Types { - Value* Val = $2; + Value* Val = $2.val; const Type* Ty = $4.type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast from a non-primitive type: '" + @@ -2630,8 +2669,8 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - $$ = new SetCondInst(Instruction::SetNE, $2, - Constant::getNullValue($2->getType())); + $$ = new SetCondInst(Instruction::SetNE, $2.val, + Constant::getNullValue($2.val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { CastInst *CI = new FPToUIInst(Val, Type::ULongTy); $$ = new IntToPtrInst(CI, Ty); @@ -2639,27 +2678,27 @@ $$ = CastInst::createInferredCast(Val, Ty); } } else { - $$ = CastInst::create($1.opcode, $2, $4.type->get()); + $$ = CastInst::create($1.opcode, $2.val, $4.type->get()); } delete $4.type; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if ($2->getType() != Type::BoolTy) + if ($2.val->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); - if ($4->getType() != $6->getType()) + if ($4.val->getType() != $6.val->getType()) GEN_ERROR("select value types should match!"); - $$ = new SelectInst($2, $4, $6); + $$ = new SelectInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | VAARG ResolvedVal ',' Types { NewVarArgs = true; - $$ = new VAArgInst($2, $4.type->get()); + $$ = new VAArgInst($2.val, $4.type->get()); delete $4.type; CHECK_FOR_ERROR } | VAARG_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2->getType(); + const Type* ArgTy = $2.val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2670,7 +2709,7 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2); + CallInst* bar = new CallInst(NF, $2.val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); $$ = new VAArgInst(foo, $4.type->get()); @@ -2679,7 +2718,7 @@ } | VANEXT_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2->getType(); + const Type* ArgTy = $2.val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2691,7 +2730,7 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2); + CallInst* bar = new CallInst(NF, $2.val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); Instruction* tmp = new VAArgInst(foo, $4.type->get()); @@ -2701,21 +2740,21 @@ CHECK_FOR_ERROR } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { - if (!ExtractElementInst::isValidOperands($2, $4)) + if (!ExtractElementInst::isValidOperands($2.val, $4.val)) GEN_ERROR("Invalid extractelement operands!"); - $$ = new ExtractElementInst($2, $4); + $$ = new ExtractElementInst($2.val, $4.val); CHECK_FOR_ERROR } | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!InsertElementInst::isValidOperands($2, $4, $6)) + if (!InsertElementInst::isValidOperands($2.val, $4.val, $6.val)) GEN_ERROR("Invalid insertelement operands!"); - $$ = new InsertElementInst($2, $4, $6); + $$ = new InsertElementInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!ShuffleVectorInst::isValidOperands($2, $4, $6)) + if (!ShuffleVectorInst::isValidOperands($2.val, $4.val, $6.val)) GEN_ERROR("Invalid shufflevector operands!"); - $$ = new ShuffleVectorInst($2, $4, $6); + $$ = new ShuffleVectorInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | PHI_TOK PHIList { @@ -2742,9 +2781,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ($6) { - for (std::vector::iterator I = $6->begin(), E = $6->end(); + for (std::vector::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -2775,17 +2814,30 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); + std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); + std::vector args; + for (; ArgI != ArgE ; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } if (I != E || (ArgI != ArgE && !Ty->isVarArg())) GEN_ERROR("Invalid number of parameters detected!"); - $$ = new CallInst(V, *$6); + $$ = new CallInst(V, args); } cast($$)->setTailCall($1); cast($$)->setCallingConv($2); @@ -2804,7 +2856,7 @@ $$ = $2; CHECK_FOR_ERROR } | /* empty */ { - $$ = new std::vector(); + $$ = new std::vector(); CHECK_FOR_ERROR }; @@ -2842,10 +2894,10 @@ delete $2.type; } | FREE ResolvedVal { - if (!isa($2->getType())) + if (!isa($2.val->getType())) GEN_ERROR("Trying to free nonpointer type " + - $2->getType()->getDescription() + "!"); - $$ = new FreeInst($2); + $2.val->getType()->getDescription() + "!"); + $$ = new FreeInst($2.val); CHECK_FOR_ERROR } @@ -2867,36 +2919,29 @@ GEN_ERROR("Can't store to a nonpointer type: " + ($5.type->get())->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != $3->getType()) - GEN_ERROR("Can't store '" + $3->getType()->getDescription() + + if (ElTy != $3.val->getType()) + GEN_ERROR("Can't store '" + $3.val->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); Value* tmpVal = getVal($5.type->get(), $6); CHECK_FOR_ERROR - $$ = new StoreInst($3, tmpVal, $1); + $$ = new StoreInst($3.val, tmpVal, $1); delete $5.type; } | GETELEMENTPTR Types ValueRef IndexList { if (!isa($2.type->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin($2.type->get(), $4->begin(), $4->end()), - GTE = gep_type_end($2.type->get(), $4->begin(), $4->end()); - for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*$4)[i])) - if (CUI->getType() == Type::UByteTy) - (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector indices; + for (unsigned i = 0, e = $4->size(); i != e; ++i) + indices.push_back((*$4)[i].val); - if (!GetElementPtrInst::getIndexedType($2.type->get(), *$4, true)) + if (!GetElementPtrInst::getIndexedType($2.type->get(), indices, true)) GEN_ERROR("Invalid getelementptr indices for type '" + $2.type->get()->getDescription()+ "'!"); Value* tmpVal = getVal($2.type->get(), $3); CHECK_FOR_ERROR - $$ = new GetElementPtrInst(tmpVal, *$4); + $$ = new GetElementPtrInst(tmpVal, indices); delete $2.type; delete $4; }; Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.48 llvm/lib/AsmParser/ParserInternals.h:1.49 --- llvm/lib/AsmParser/ParserInternals.h:1.48 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/ParserInternals.h Tue Nov 28 01:28:14 2006 @@ -227,21 +227,30 @@ isSignless }; -/// This structure is used to keep track of the signedness of the obsolete +/// This type is used to keep track of the signedness of the obsolete /// integer types. Instead of creating an llvm::Type directly, the Lexer will /// create instances of TypeInfo which retains the signedness indication so /// it can be used by the parser for upgrade decisions. -/// For example if "uint" is encountered then the type will be set "int32" -/// and the "signedness" will be "isUnsigned". If the type is not obsolete -/// then "signedness" will be "isSignless". +/// For example if "uint" is encountered then the "first" field will be set +/// to "int32" and the "second" field will be set to "isUnsigned". If the +/// type is not obsolete then "second" will be set to "isSignless". struct TypeInfo { - llvm::PATypeHolder *type; + llvm::PATypeHolder* type; Signedness signedness; }; +/// This type is used to keep track of the signedness of values. Instead +/// of creating llvm::Value directly, the parser will create ValueInfo which +/// associates a Value* with a Signedness indication. struct ValueInfo { - std::vector valuelist; - std::vector signlist; + llvm::Value* val; + Signedness signedness; +}; + +/// This type is used to keep track of the signedness of constants. +struct ConstInfo { + llvm::Constant *cnst; + Signedness signedness; }; #endif From reid at x10sys.com Tue Nov 28 01:29:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:29:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200611280729.kAS7Twq3018092@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.26 -> 1.27 llvmAsmParser.h.cvs updated: 1.21 -> 1.22 llvmAsmParser.y.cvs updated: 1.27 -> 1.28 --- Log message: Regenerate. --- Diffs of the changes: (+672 -580) llvmAsmParser.cpp.cvs | 845 ++++++++++++++++++++++++++------------------------ llvmAsmParser.h.cvs | 18 - llvmAsmParser.y.cvs | 389 ++++++++++++----------- 3 files changed, 672 insertions(+), 580 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.26 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.27 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.26 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Nov 28 01:29:44 2006 @@ -316,7 +316,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 14 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -389,8 +389,8 @@ Module *CurrentModule; std::map Values; // Module level numbered definitions std::map LateResolveValues; - std::vector Types; - std::map LateResolveTypes; + std::vector Types; + std::map LateResolveTypes; /// PlaceHolderInfo - When temporary placeholder objects are created, remember /// how they were referenced and on which line of the input they came from so @@ -523,7 +523,7 @@ case ValID::NumberVal: // Is it a numbered definition? // Module constants occupy the lowest numbered slots... if ((unsigned)D.Num < CurModule.Types.size()) - return CurModule.Types[(unsigned)D.Num].type->get(); + return CurModule.Types[(unsigned)D.Num]; break; case ValID::NameVal: // Is it a named definition? if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) { @@ -553,16 +553,14 @@ } } - std::map::iterator I =CurModule.LateResolveTypes.find(D); + std::map::iterator I =CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) - return I->second.type->get(); + return I->second; - TypeInfo TI; - TI.type = new PATypeHolder(OpaqueType::get()); - TI.signedness = isSignless; - CurModule.LateResolveTypes.insert(std::make_pair(D, TI)); - return TI.type->get(); - } + Type *Typ = OpaqueType::get(); + CurModule.LateResolveTypes.insert(std::make_pair(D, Typ)); + return Typ; +} static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = @@ -865,10 +863,10 @@ if (Name) D = ValID::create(Name); else D = ValID::create((int)CurModule.Types.size()); - std::map::iterator I = + std::map::iterator I = CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) { - ((DerivedType*)I->second.type->get())->refineAbstractTypeTo(ToTy); + ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy); CurModule.LateResolveTypes.erase(I); } } @@ -1362,7 +1360,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1038 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1370,19 +1368,17 @@ llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - llvm::Constant *ConstVal; - - TypeInfo TypeVal; - llvm::Value *ValueVal; + ConstInfo ConstVal; + TypeInfo TypeVal; + ValueInfo ValueVal; std::vector >*ArgList; - std::vector *ValueList; + std::vector *ValueList; std::list *TypeList; // Represent the RHS of PHI node - std::list > *PHIList; + std::list > *PHIList; std::vector > *JumpTable; - std::vector *ConstVector; + std::vector *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -1403,7 +1399,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1407 "llvmAsmParser.tab.c" +#line 1403 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1415,7 +1411,7 @@ /* Line 219 of yacc.c. */ -#line 1419 "llvmAsmParser.tab.c" +#line 1415 "llvmAsmParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1755,33 +1751,33 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1168, 1168, 1169, 1177, 1178, 1188, 1188, 1188, 1188, - 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1190, 1190, - 1190, 1190, 1190, 1190, 1191, 1191, 1191, 1191, 1191, 1191, - 1192, 1192, 1192, 1192, 1192, 1192, 1193, 1193, 1193, 1197, - 1197, 1197, 1197, 1198, 1198, 1198, 1198, 1199, 1199, 1200, - 1200, 1203, 1207, 1212, 1213, 1214, 1215, 1216, 1217, 1218, - 1219, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1237, - 1238, 1244, 1245, 1253, 1261, 1262, 1267, 1268, 1269, 1274, - 1288, 1288, 1292, 1292, 1297, 1308, 1308, 1308, 1308, 1308, - 1308, 1308, 1309, 1309, 1309, 1309, 1309, 1309, 1310, 1315, - 1319, 1328, 1337, 1352, 1359, 1373, 1384, 1389, 1401, 1406, - 1412, 1413, 1419, 1425, 1436, 1462, 1476, 1506, 1532, 1553, - 1566, 1576, 1581, 1642, 1649, 1658, 1664, 1670, 1674, 1678, - 1686, 1712, 1744, 1752, 1779, 1790, 1796, 1807, 1813, 1819, - 1828, 1832, 1840, 1840, 1850, 1858, 1863, 1867, 1871, 1875, - 1890, 1912, 1915, 1918, 1918, 1926, 1926, 1935, 1935, 1944, - 1944, 1954, 1957, 1960, 1964, 1977, 1978, 1980, 1984, 1993, - 1997, 2002, 2004, 2009, 2014, 2023, 2023, 2024, 2024, 2026, - 2033, 2039, 2046, 2050, 2058, 2066, 2071, 2165, 2165, 2167, - 2175, 2175, 2177, 2182, 2183, 2184, 2186, 2186, 2196, 2200, - 2205, 2209, 2213, 2217, 2221, 2225, 2229, 2233, 2237, 2257, - 2261, 2275, 2279, 2285, 2285, 2291, 2296, 2300, 2309, 2320, - 2329, 2341, 2354, 2358, 2362, 2367, 2376, 2395, 2404, 2460, - 2464, 2471, 2482, 2495, 2504, 2513, 2523, 2527, 2534, 2534, - 2536, 2540, 2545, 2567, 2582, 2596, 2609, 2620, 2646, 2654, - 2660, 2680, 2703, 2709, 2715, 2721, 2736, 2796, 2803, 2806, - 2811, 2815, 2822, 2827, 2833, 2838, 2844, 2852, 2864, 2879 + 0, 1164, 1164, 1165, 1173, 1174, 1184, 1184, 1184, 1184, + 1184, 1184, 1184, 1184, 1184, 1185, 1185, 1185, 1186, 1186, + 1186, 1186, 1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, + 1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1193, + 1193, 1193, 1193, 1194, 1194, 1194, 1194, 1195, 1195, 1196, + 1196, 1199, 1203, 1208, 1209, 1210, 1211, 1212, 1213, 1214, + 1215, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1233, + 1234, 1240, 1241, 1249, 1257, 1258, 1263, 1264, 1265, 1270, + 1284, 1284, 1288, 1288, 1293, 1304, 1304, 1304, 1304, 1304, + 1304, 1304, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1311, + 1315, 1324, 1333, 1348, 1355, 1369, 1380, 1385, 1397, 1402, + 1408, 1409, 1415, 1421, 1432, 1463, 1478, 1509, 1539, 1564, + 1578, 1589, 1595, 1657, 1664, 1674, 1681, 1688, 1693, 1698, + 1707, 1733, 1755, 1764, 1793, 1805, 1812, 1824, 1831, 1838, + 1848, 1852, 1860, 1860, 1870, 1878, 1883, 1887, 1891, 1895, + 1910, 1932, 1935, 1938, 1938, 1946, 1946, 1955, 1955, 1964, + 1964, 1974, 1977, 1980, 1984, 1997, 1998, 2000, 2004, 2013, + 2017, 2022, 2024, 2029, 2034, 2043, 2043, 2044, 2044, 2046, + 2053, 2059, 2066, 2070, 2078, 2086, 2091, 2185, 2185, 2187, + 2195, 2195, 2197, 2202, 2203, 2204, 2206, 2206, 2216, 2220, + 2225, 2229, 2233, 2237, 2241, 2245, 2249, 2253, 2257, 2280, + 2284, 2298, 2302, 2308, 2308, 2314, 2321, 2325, 2334, 2345, + 2354, 2366, 2379, 2383, 2387, 2392, 2401, 2420, 2429, 2494, + 2498, 2505, 2516, 2529, 2538, 2547, 2557, 2561, 2568, 2571, + 2575, 2579, 2584, 2606, 2621, 2635, 2648, 2659, 2685, 2693, + 2699, 2719, 2742, 2748, 2754, 2760, 2775, 2848, 2855, 2858, + 2863, 2867, 2874, 2879, 2885, 2890, 2896, 2904, 2916, 2931 }; #endif @@ -3088,7 +3084,7 @@ switch (yyn) { case 3: -#line 1169 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1165 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -3098,7 +3094,7 @@ break; case 5: -#line 1178 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -3108,7 +3104,7 @@ break; case 51: -#line 1203 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1199 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR @@ -3116,7 +3112,7 @@ break; case 52: -#line 1207 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3124,82 +3120,82 @@ break; case 53: -#line 1212 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1208 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 54: -#line 1213 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 55: -#line 1214 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 56: -#line 1215 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 57: -#line 1216 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 58: -#line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 59: -#line 1218 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 60: -#line 1219 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 61: -#line 1221 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 62: -#line 1222 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 63: -#line 1223 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::CSRet; ;} break; case 64: -#line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 65: -#line 1225 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1221 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 66: -#line 1226 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1222 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 67: -#line 1227 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 68: -#line 1228 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large!"); @@ -3209,12 +3205,12 @@ break; case 69: -#line 1237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 70: -#line 1238 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3224,12 +3220,12 @@ break; case 71: -#line 1244 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 72: -#line 1245 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3239,7 +3235,7 @@ break; case 73: -#line 1253 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/proj/llvm/llvm-4/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] == '\\') @@ -3250,27 +3246,27 @@ break; case 74: -#line 1261 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 75: -#line 1262 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1258 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 76: -#line 1267 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1263 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" {;} break; case 77: -#line 1268 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" {;} break; case 78: -#line 1269 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3279,7 +3275,7 @@ break; case 79: -#line 1274 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two!"); @@ -3289,7 +3285,7 @@ break; case 81: -#line 1288 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1284 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal).type = new PATypeHolder((yyvsp[0].TypeVal).type->get()); (yyval.TypeVal).signedness = (yyvsp[0].TypeVal).signedness; @@ -3297,7 +3293,7 @@ break; case 83: -#line 1292 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal).type = new PATypeHolder((yyvsp[0].TypeVal).type->get()); (yyval.TypeVal).signedness = (yyvsp[0].TypeVal).signedness; @@ -3305,7 +3301,7 @@ break; case 84: -#line 1297 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1293 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + @@ -3316,7 +3312,7 @@ break; case 98: -#line 1310 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1306 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal).type = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).signedness = isSignless; @@ -3325,7 +3321,7 @@ break; case 99: -#line 1315 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1311 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = (yyvsp[0].TypeVal); CHECK_FOR_ERROR @@ -3333,7 +3329,7 @@ break; case 100: -#line 1319 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1315 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR @@ -3343,7 +3339,7 @@ break; case 101: -#line 1328 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1324 "/proj/llvm/llvm-4/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 @@ -3356,7 +3352,7 @@ break; case 102: -#line 1337 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1333 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Function derived type? std::vector Params; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -3375,7 +3371,7 @@ break; case 103: -#line 1352 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1348 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs( ArrayType::get((yyvsp[-1].TypeVal).type->get(), (unsigned)(yyvsp[-3].UInt64Val)))); @@ -3386,7 +3382,7 @@ break; case 104: -#line 1359 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1355 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Packed array type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).type->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -3404,12 +3400,12 @@ break; case 105: -#line 1373 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1369 "/proj/llvm/llvm-4/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) - Elements.push_back(I->type->get()); + Elements.push_back((*I).type->get()); (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); (yyval.TypeVal).signedness = isSignless; @@ -3419,7 +3415,7 @@ break; case 106: -#line 1384 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal).type = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).signedness = isSignless; @@ -3428,19 +3424,19 @@ break; case 107: -#line 1389 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1385 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).type->get() == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[-1].TypeVal).type->get()))); - (yyval.TypeVal).signedness = (yyvsp[-1].TypeVal).signedness; + (yyval.TypeVal).signedness = isSignless; delete (yyvsp[-1].TypeVal).type; CHECK_FOR_ERROR ;} break; case 108: -#line 1401 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1397 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -3449,7 +3445,7 @@ break; case 109: -#line 1406 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1402 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); CHECK_FOR_ERROR @@ -3457,7 +3453,7 @@ break; case 111: -#line 1413 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1409 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { TypeInfo TI; TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; @@ -3467,7 +3463,7 @@ break; case 112: -#line 1419 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1415 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { TypeInfo TI; TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; @@ -3477,7 +3473,7 @@ break; case 113: -#line 1425 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1421 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); CHECK_FOR_ERROR @@ -3485,7 +3481,7 @@ break; case 114: -#line 1436 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1432 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).type->get()); if (ATy == 0) @@ -3501,21 +3497,26 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->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].cnst->getType()->getDescription() + "'."); + } else { + elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); + } } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + (yyval.ConstVal).cnst = ConstantArray::get(ATy, elems); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 115: -#line 1462 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1463 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).type->get()); if (ATy == 0) @@ -3526,14 +3527,15 @@ 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()); + (yyval.ConstVal).cnst = ConstantArray::get(ATy, std::vector()); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-2].TypeVal).type; CHECK_FOR_ERROR ;} break; case 116: -#line 1476 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1478 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).type->get()); if (ATy == 0) @@ -3560,14 +3562,15 @@ GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free((yyvsp[0].StrVal)); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + (yyval.ConstVal).cnst = ConstantArray::get(ATy, Vals); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-2].TypeVal).type; CHECK_FOR_ERROR ;} break; case 117: -#line 1506 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1509 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal).type->get()); if (PTy == 0) @@ -3583,21 +3586,25 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->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].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); } - (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector)); + (yyval.ConstVal).cnst = ConstantPacked::get(PTy, elems); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 118: -#line 1532 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1539 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).type->get()); if (STy == 0) @@ -3608,21 +3615,25 @@ GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! + std::vector elems; for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) + if ((*(yyvsp[-1].ConstVector))[i].cnst->getType() != STy->getElementType(i)) { GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); + } else + elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + (yyval.ConstVal).cnst = ConstantStruct::get(STy, elems); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 119: -#line 1553 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1564 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).type->get()); if (STy == 0) @@ -3632,37 +3643,40 @@ if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + (yyval.ConstVal).cnst = ConstantStruct::get(STy, std::vector()); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-2].TypeVal).type; CHECK_FOR_ERROR ;} break; case 120: -#line 1566 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1578 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).type->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + (yyvsp[-1].TypeVal).type->get()->getDescription() + "'!"); - (yyval.ConstVal) = ConstantPointerNull::get(PTy); + (yyval.ConstVal).cnst = ConstantPointerNull::get(PTy); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-1].TypeVal).type; CHECK_FOR_ERROR ;} break; case 121: -#line 1576 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1589 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal).type->get()); + (yyval.ConstVal).cnst = UndefValue::get((yyvsp[-1].TypeVal).type->get()); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-1].TypeVal).type; CHECK_FOR_ERROR ;} break; case 122: -#line 1581 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1595 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).type->get()); if (Ty == 0) @@ -3720,16 +3734,17 @@ } } - (yyval.ConstVal) = cast(V); + (yyval.ConstVal).cnst = cast(V); + (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; delete (yyvsp[-1].TypeVal).type; // Free the type handle CHECK_FOR_ERROR ;} break; case 123: -#line 1642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1657 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-1].TypeVal).type->get() != (yyvsp[0].ConstVal)->getType()) + if ((yyvsp[-1].TypeVal).type->get() != (yyvsp[0].ConstVal).cnst->getType()) GEN_ERROR("Mismatched types for constant expression!"); (yyval.ConstVal) = (yyvsp[0].ConstVal); delete (yyvsp[-1].TypeVal).type; @@ -3738,67 +3753,73 @@ break; case 124: -#line 1649 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1664 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).type->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); + (yyval.ConstVal).cnst = Constant::getNullValue(Ty); + (yyval.ConstVal).signedness = isSignless; delete (yyvsp[-1].TypeVal).type; CHECK_FOR_ERROR ;} break; case 125: -#line 1658 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1674 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].SInt64Val)); + (yyval.ConstVal).cnst = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].SInt64Val)); + (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; CHECK_FOR_ERROR ;} break; case 126: -#line 1664 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1681 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].UInt64Val)); + (yyval.ConstVal).cnst = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].UInt64Val)); + (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; CHECK_FOR_ERROR ;} break; case 127: -#line 1670 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1688 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - (yyval.ConstVal) = ConstantBool::getTrue(); + (yyval.ConstVal).cnst = ConstantBool::getTrue(); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 128: -#line 1674 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1693 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - (yyval.ConstVal) = ConstantBool::getFalse(); + (yyval.ConstVal).cnst = ConstantBool::getFalse(); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 129: -#line 1678 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1698 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type!!"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].FPVal)); + (yyval.ConstVal).cnst = ConstantFP::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].FPVal)); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 130: -#line 1686 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1707 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Constant *Val = (yyvsp[-3].ConstVal); + Constant *Val = (yyvsp[-3].ConstVal).cnst; const Type *Ty = (yyvsp[-1].TypeVal).type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + @@ -3810,85 +3831,76 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - (yyval.ConstVal) = ConstantExpr::get(Instruction::SetNE, Val, + (yyval.ConstVal).cnst = ConstantExpr::get(Instruction::SetNE, Val, Constant::getNullValue(Val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { Constant *CE = ConstantExpr::getFPToUI(Val, Type::ULongTy); - (yyval.ConstVal) = ConstantExpr::getIntToPtr(CE, Ty); + (yyval.ConstVal).cnst = ConstantExpr::getIntToPtr(CE, Ty); } else { - (yyval.ConstVal) = ConstantExpr::getCast(Val, Ty); + (yyval.ConstVal).cnst = ConstantExpr::getCast(Val, Ty); } } else { - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal).opcode, (yyvsp[-3].ConstVal), (yyvsp[-1].TypeVal).type->get()); + (yyval.ConstVal).cnst = ConstantExpr::getCast((yyvsp[-5].CastOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].TypeVal).type->get()); } delete (yyvsp[-1].TypeVal).type; ;} break; case 131: -#line 1712 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1733 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[-2].ConstVal)->getType())) + if (!isa((yyvsp[-2].ConstVal).cnst->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()), - GTE = gep_type_end((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()); - for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*(yyvsp[-1].ValueList))[i])) - if (CUI->getType() == Type::UByteTy) - (*(yyvsp[-1].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector IdxVec; + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i < e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i].val)) + IdxVec.push_back(C); + else + GEN_ERROR("Indices to constant getelementptr must be constants!"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true); + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal).cnst->getType(), IdxVec, 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])) - 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); + (yyval.ConstVal).cnst = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal).cnst, IdxVec); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 132: -#line 1744 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1755 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy) + if ((yyvsp[-5].ConstVal).cnst->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) GEN_ERROR("Select operand types must match!"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::getSelect((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 133: -#line 1752 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1764 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) GEN_ERROR("Binary operator types must match!"); // First, make sure we're dealing with the right opcode by upgrading from // obsolete versions. - sanitizeOpcode((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal)->getType()); + sanitizeOpcode((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal).cnst->getType()); CHECK_FOR_ERROR; // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. - if (!isa((yyvsp[-3].ConstVal)->getType())) { - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + if (!isa((yyvsp[-3].ConstVal).cnst->getType())) { + (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -3896,86 +3908,94 @@ case Module::Pointer64: IntPtrTy = Type::LongTy; break; default: GEN_ERROR("invalid pointer binary constant expr!"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, ConstantExpr::getCast((yyvsp[-3].ConstVal), IntPtrTy), - ConstantExpr::getCast((yyvsp[-1].ConstVal), IntPtrTy)); - (yyval.ConstVal) = ConstantExpr::getCast((yyval.ConstVal), (yyvsp[-3].ConstVal)->getType()); + (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, + ConstantExpr::getCast((yyvsp[-3].ConstVal).cnst, IntPtrTy), + ConstantExpr::getCast((yyvsp[-1].ConstVal).cnst, IntPtrTy)); + (yyval.ConstVal).cnst = ConstantExpr::getCast((yyval.ConstVal).cnst, (yyvsp[-3].ConstVal).cnst->getType()); } + (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; CHECK_FOR_ERROR ;} break; case 134: -#line 1779 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1793 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) GEN_ERROR("Logical operator types must match!"); - if (!(yyvsp[-3].ConstVal)->getType()->isIntegral()) { - if (!isa((yyvsp[-3].ConstVal)->getType()) || - !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isIntegral()) + if (!(yyvsp[-3].ConstVal).cnst->getType()->isIntegral()) { + if (!isa((yyvsp[-3].ConstVal).cnst->getType()) || + !cast((yyvsp[-3].ConstVal).cnst->getType())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; CHECK_FOR_ERROR ;} break; case 135: -#line 1790 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1805 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) GEN_ERROR("setcc operand types must match!"); - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 136: -#line 1796 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1812 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy) + if ((yyvsp[-1].ConstVal).cnst->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); - if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) + if (!(yyvsp[-3].ConstVal).cnst->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal)->getType()); + sanitizeOpcode((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal).cnst->getType()); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal).opcode, (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].OtherOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; CHECK_FOR_ERROR ;} break; case 137: -#line 1807 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1824 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) GEN_ERROR("Invalid extractelement operands!"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; CHECK_FOR_ERROR ;} break; case 138: -#line 1813 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1831 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) GEN_ERROR("Invalid insertelement operands!"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 139: -#line 1819 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1838 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + (yyval.ConstVal).cnst = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + (yyval.ConstVal).signedness = isSignless; CHECK_FOR_ERROR ;} break; case 140: -#line 1828 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1848 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR @@ -3983,26 +4003,26 @@ break; case 141: -#line 1832 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1852 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 142: -#line 1840 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1860 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 143: -#line 1840 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1860 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 144: -#line 1850 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1870 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -4011,7 +4031,7 @@ break; case 145: -#line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1878 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); @@ -4020,7 +4040,7 @@ break; case 146: -#line 1863 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1883 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR @@ -4028,7 +4048,7 @@ break; case 147: -#line 1867 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1887 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); CHECK_FOR_ERROR @@ -4036,7 +4056,7 @@ break; case 148: -#line 1871 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1891 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR @@ -4044,7 +4064,7 @@ break; case 149: -#line 1875 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1895 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -4061,7 +4081,7 @@ break; case 150: -#line 1890 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1910 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -4078,7 +4098,7 @@ 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).type)); } else { delete (yyvsp[0].TypeVal).type; } @@ -4087,38 +4107,38 @@ break; case 151: -#line 1912 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1932 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Function prototypes can be in const pool CHECK_FOR_ERROR ;} break; case 152: -#line 1915 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1935 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Asm blocks can be in the const pool CHECK_FOR_ERROR ;} break; case 153: -#line 1918 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1938 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].ConstVal) == 0) + if ((yyvsp[0].ConstVal).cnst == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal).cnst->getType(), (yyvsp[0].ConstVal).cnst); CHECK_FOR_ERROR ;} break; case 154: -#line 1923 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1943 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 155: -#line 1926 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1946 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), (yyvsp[0].TypeVal).type->get(), 0); @@ -4128,7 +4148,7 @@ break; case 156: -#line 1931 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1951 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4136,7 +4156,7 @@ break; case 157: -#line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1955 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), (yyvsp[0].TypeVal).type->get(), 0); @@ -4146,7 +4166,7 @@ break; case 158: -#line 1940 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1960 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4154,7 +4174,7 @@ break; case 159: -#line 1944 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1964 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), @@ -4165,7 +4185,7 @@ break; case 160: -#line 1950 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1970 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4173,27 +4193,27 @@ break; case 161: -#line 1954 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1974 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 162: -#line 1957 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1977 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 163: -#line 1960 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1980 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ;} break; case 164: -#line 1964 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1984 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4209,17 +4229,17 @@ break; case 165: -#line 1977 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1997 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 166: -#line 1978 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1998 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 167: -#line 1980 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2000 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness)); CHECK_FOR_ERROR @@ -4227,7 +4247,7 @@ break; case 168: -#line 1984 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2004 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); @@ -4240,7 +4260,7 @@ break; case 169: -#line 1993 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2013 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4248,7 +4268,7 @@ break; case 170: -#line 1997 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2017 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4256,7 +4276,7 @@ break; case 172: -#line 2004 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4265,7 +4285,7 @@ break; case 173: -#line 2009 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2029 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4274,19 +4294,19 @@ break; case 174: -#line 2014 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2034 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 178: -#line 2024 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2044 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 179: -#line 2026 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2046 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-1].TypeVal).type->get() == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); @@ -4296,7 +4316,7 @@ break; case 180: -#line 2033 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2053 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -4306,7 +4326,7 @@ break; case 181: -#line 2039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2059 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -4316,7 +4336,7 @@ break; case 182: -#line 2046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2066 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR @@ -4324,7 +4344,7 @@ break; case 183: -#line 2050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2070 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); TypeInfo TI; @@ -4336,7 +4356,7 @@ break; case 184: -#line 2058 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2078 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new std::vector >(); TypeInfo TI; @@ -4348,7 +4368,7 @@ break; case 185: -#line 2066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2086 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -4356,7 +4376,7 @@ break; case 186: -#line 2072 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2092 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -4452,7 +4472,7 @@ break; case 189: -#line 2167 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2187 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -4463,7 +4483,7 @@ break; case 192: -#line 2177 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2197 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4471,22 +4491,22 @@ break; case 194: -#line 2183 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2203 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} break; case 195: -#line 2184 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2204 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} break; case 196: -#line 2186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2206 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 197: -#line 2186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2206 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -4495,7 +4515,7 @@ break; case 198: -#line 2196 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2216 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4503,7 +4523,7 @@ break; case 199: -#line 2200 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2220 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4511,7 +4531,7 @@ break; case 200: -#line 2205 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2225 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR @@ -4519,7 +4539,7 @@ break; case 201: -#line 2209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2229 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR @@ -4527,7 +4547,7 @@ break; case 202: -#line 2213 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2233 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR @@ -4535,7 +4555,7 @@ break; case 203: -#line 2217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2237 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::getTrue()); CHECK_FOR_ERROR @@ -4543,7 +4563,7 @@ break; case 204: -#line 2221 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2241 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::getFalse()); CHECK_FOR_ERROR @@ -4551,7 +4571,7 @@ break; case 205: -#line 2225 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2245 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -4559,7 +4579,7 @@ break; case 206: -#line 2229 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2249 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -4567,7 +4587,7 @@ break; case 207: -#line 2233 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2253 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -4575,9 +4595,9 @@ break; case 208: -#line 2237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2257 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); + const Type *ETy = (*(yyvsp[-1].ConstVector))[0].cnst->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); @@ -4585,29 +4605,32 @@ HandleUpRefs(PackedType::get( ETy, NumElements))); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->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].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector))); + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, elems)); delete PTy; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 209: -#line 2257 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2280 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).cnst); CHECK_FOR_ERROR ;} break; case 210: -#line 2261 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2284 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -4621,7 +4644,7 @@ break; case 211: -#line 2275 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2298 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); CHECK_FOR_ERROR @@ -4629,7 +4652,7 @@ break; case 212: -#line 2279 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2302 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); CHECK_FOR_ERROR @@ -4637,15 +4660,17 @@ break; case 215: -#line 2291 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2314 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueVal) = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal).type; + (yyval.ValueVal).val = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + delete (yyvsp[-1].TypeVal).type; CHECK_FOR_ERROR + (yyval.ValueVal).signedness = (yyvsp[-1].TypeVal).signedness; ;} break; case 216: -#line 2296 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2321 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4653,7 +4678,7 @@ break; case 217: -#line 2300 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2325 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4661,7 +4686,7 @@ break; case 218: -#line 2309 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2334 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR @@ -4675,7 +4700,7 @@ break; case 219: -#line 2320 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2345 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -4688,7 +4713,7 @@ break; case 220: -#line 2329 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2354 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); CHECK_FOR_ERROR @@ -4704,7 +4729,7 @@ break; case 221: -#line 2341 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2366 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); CHECK_FOR_ERROR @@ -4720,15 +4745,15 @@ break; case 222: -#line 2354 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2379 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); + (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 223: -#line 2358 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2383 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR @@ -4736,7 +4761,7 @@ break; case 224: -#line 2362 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2387 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR @@ -4745,7 +4770,7 @@ break; case 225: -#line 2367 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2392 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR @@ -4758,7 +4783,7 @@ break; case 226: -#line 2376 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2401 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-7].TypeVal).type->get(), (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR @@ -4781,7 +4806,7 @@ break; case 227: -#line 2395 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2420 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-6].TypeVal).type->get(), (yyvsp[-5].ValIDVal)); CHECK_FOR_ERROR @@ -4794,7 +4819,7 @@ break; case 228: -#line 2405 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2430 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -4804,9 +4829,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ((yyvsp[-7].ValueList)) { - for (std::vector::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end(); + for (std::vector::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -4832,17 +4857,26 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end(); - - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); + std::vector::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end(); - if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - GEN_ERROR("Invalid number of parameters detected!"); - - (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, *(yyvsp[-7].ValueList)); + std::vector args; + for (; ArgI != ArgE; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, args); } cast((yyval.TermInstVal))->setCallingConv((yyvsp[-11].UIntVal)); @@ -4853,7 +4887,7 @@ break; case 229: -#line 2460 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2494 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -4861,7 +4895,7 @@ break; case 230: -#line 2464 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2498 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -4869,7 +4903,7 @@ break; case 231: -#line 2471 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2505 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast(getValNonImprovising((yyvsp[-4].TypeVal).type->get(), (yyvsp[-3].ValIDVal))); @@ -4884,7 +4918,7 @@ break; case 232: -#line 2482 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2516 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getValNonImprovising((yyvsp[-4].TypeVal).type->get(), (yyvsp[-3].ValIDVal))); @@ -4900,7 +4934,7 @@ break; case 233: -#line 2495 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2529 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); @@ -4912,7 +4946,7 @@ break; case 234: -#line 2504 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2538 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes (yyval.PHIList) = new std::list >(); Value* tmpVal = getVal((yyvsp[-5].TypeVal).type->get(), (yyvsp[-3].ValIDVal)); @@ -4925,7 +4959,7 @@ break; case 235: -#line 2513 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2547 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -4937,15 +4971,15 @@ break; case 236: -#line 2523 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2557 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Used for call statements, and memory insts... - (yyval.ValueList) = new std::vector(); + (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); ;} break; case 237: -#line 2527 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2561 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -4953,13 +4987,22 @@ ;} break; + case 238: +#line 2568 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[0].ValueList); + ;} + break; + case 239: -#line 2534 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = 0; ;} +#line 2571 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = 0; + ;} break; case 240: -#line 2536 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2575 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4967,7 +5010,7 @@ break; case 241: -#line 2540 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2579 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4975,7 +5018,7 @@ break; case 242: -#line 2545 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2584 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!(yyvsp[-3].TypeVal).type->get()->isInteger() && !(yyvsp[-3].TypeVal).type->get()->isFloatingPoint() && !isa((yyvsp[-3].TypeVal).type->get())) @@ -5001,7 +5044,7 @@ break; case 243: -#line 2567 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2606 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!(yyvsp[-3].TypeVal).type->get()->isIntegral()) { if (!isa((yyvsp[-3].TypeVal).type->get()) || @@ -5020,7 +5063,7 @@ break; case 244: -#line 2582 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2621 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if(isa((yyvsp[-3].TypeVal).type->get())) { GEN_ERROR( @@ -5038,16 +5081,16 @@ break; case 245: -#line 2596 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2635 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal)->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal).val->getType()); if (Ones == 0) GEN_ERROR("Expected integral type for not instruction!"); - (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal), Ones); + (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal).val, Ones); if ((yyval.InstVal) == 0) GEN_ERROR("Could not create a xor instruction!"); CHECK_FOR_ERROR @@ -5055,24 +5098,24 @@ break; case 246: -#line 2609 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2648 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy) + if ((yyvsp[0].ValueVal).val->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); - if (!(yyvsp[-2].ValueVal)->getType()->isInteger()) + if (!(yyvsp[-2].ValueVal).val->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal)->getType()); + sanitizeOpcode((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal).val->getType()); CHECK_FOR_ERROR; - (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal).opcode, (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal).opcode, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 247: -#line 2620 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2659 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* Val = (yyvsp[-2].ValueVal); + Value* Val = (yyvsp[-2].ValueVal).val; const Type* Ty = (yyvsp[0].TypeVal).type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast from a non-primitive type: '" + @@ -5084,8 +5127,8 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - (yyval.InstVal) = new SetCondInst(Instruction::SetNE, (yyvsp[-2].ValueVal), - Constant::getNullValue((yyvsp[-2].ValueVal)->getType())); + (yyval.InstVal) = new SetCondInst(Instruction::SetNE, (yyvsp[-2].ValueVal).val, + Constant::getNullValue((yyvsp[-2].ValueVal).val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { CastInst *CI = new FPToUIInst(Val, Type::ULongTy); (yyval.InstVal) = new IntToPtrInst(CI, Ty); @@ -5093,39 +5136,39 @@ (yyval.InstVal) = CastInst::createInferredCast(Val, Ty); } } else { - (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal).opcode, (yyvsp[-2].ValueVal), (yyvsp[0].TypeVal).type->get()); + (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal).opcode, (yyvsp[-2].ValueVal).val, (yyvsp[0].TypeVal).type->get()); } delete (yyvsp[0].TypeVal).type; ;} break; case 248: -#line 2646 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2685 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy) + if ((yyvsp[-4].ValueVal).val->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); - if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) + if ((yyvsp[-2].ValueVal).val->getType() != (yyvsp[0].ValueVal).val->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).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 249: -#line 2654 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2693 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { NewVarArgs = true; - (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), (yyvsp[0].TypeVal).type->get()); + (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal).val, (yyvsp[0].TypeVal).type->get()); delete (yyvsp[0].TypeVal).type; CHECK_FOR_ERROR ;} break; case 250: -#line 2660 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2699 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; - const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal).val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -5136,7 +5179,7 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal).val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); (yyval.InstVal) = new VAArgInst(foo, (yyvsp[0].TypeVal).type->get()); @@ -5146,10 +5189,10 @@ break; case 251: -#line 2680 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2719 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; - const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal).val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -5161,7 +5204,7 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal).val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); Instruction* tmp = new VAArgInst(foo, (yyvsp[0].TypeVal).type->get()); @@ -5173,37 +5216,37 @@ break; case 252: -#line 2703 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2742 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) GEN_ERROR("Invalid extractelement operands!"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 253: -#line 2709 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2748 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) 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).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 254: -#line 2715 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2754 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) 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).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 255: -#line 2721 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2760 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5222,7 +5265,7 @@ break; case 256: -#line 2736 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2775 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy = 0; const FunctionType *Ty = 0; @@ -5232,9 +5275,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ((yyvsp[-1].ValueList)) { - for (std::vector::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end(); + for (std::vector::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -5265,17 +5308,30 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end(); + std::vector::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end(); - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); + std::vector args; + for (; ArgI != ArgE ; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } if (I != E || (ArgI != ArgE && !Ty->isVarArg())) GEN_ERROR("Invalid number of parameters detected!"); - (yyval.InstVal) = new CallInst(V, *(yyvsp[-1].ValueList)); + (yyval.InstVal) = new CallInst(V, args); } cast((yyval.InstVal))->setTailCall((yyvsp[-6].BoolVal)); cast((yyval.InstVal))->setCallingConv((yyvsp[-5].UIntVal)); @@ -5286,7 +5342,7 @@ break; case 257: -#line 2796 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2848 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR @@ -5294,7 +5350,7 @@ break; case 258: -#line 2803 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2855 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); CHECK_FOR_ERROR @@ -5302,15 +5358,15 @@ break; case 259: -#line 2806 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2858 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueList) = new std::vector(); + (yyval.ValueList) = new std::vector(); CHECK_FOR_ERROR ;} break; case 260: -#line 2811 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2863 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5318,7 +5374,7 @@ break; case 261: -#line 2815 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2867 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5326,7 +5382,7 @@ break; case 262: -#line 2822 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2874 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new MallocInst((yyvsp[-1].TypeVal).type->get(), 0, (yyvsp[0].UIntVal)); delete (yyvsp[-1].TypeVal).type; @@ -5335,7 +5391,7 @@ break; case 263: -#line 2827 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2879 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR @@ -5345,7 +5401,7 @@ break; case 264: -#line 2833 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2885 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new AllocaInst((yyvsp[-1].TypeVal).type->get(), 0, (yyvsp[0].UIntVal)); delete (yyvsp[-1].TypeVal).type; @@ -5354,7 +5410,7 @@ break; case 265: -#line 2838 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2890 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR @@ -5364,18 +5420,18 @@ break; case 266: -#line 2844 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2896 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[0].ValueVal)->getType())) + if (!isa((yyvsp[0].ValueVal).val->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[0].ValueVal)->getType()->getDescription() + "!"); - (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); + (yyvsp[0].ValueVal).val->getType()->getDescription() + "!"); + (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal).val); CHECK_FOR_ERROR ;} break; case 267: -#line 2852 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2904 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-1].TypeVal).type->get())) GEN_ERROR("Can't load from nonpointer type: " + @@ -5391,47 +5447,40 @@ break; case 268: -#line 2864 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2916 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal).type->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + ((yyvsp[-1].TypeVal).type->get())->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).val->getType()) + GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal).val->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); Value* tmpVal = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); + (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal).val, tmpVal, (yyvsp[-5].BoolVal)); delete (yyvsp[-1].TypeVal).type; ;} break; case 269: -#line 2879 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2931 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-2].TypeVal).type->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin((yyvsp[-2].TypeVal).type->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()), - GTE = gep_type_end((yyvsp[-2].TypeVal).type->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()); - for (unsigned i = 0, e = (yyvsp[0].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*(yyvsp[0].ValueList))[i])) - if (CUI->getType() == Type::UByteTy) - (*(yyvsp[0].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector indices; + for (unsigned i = 0, e = (yyvsp[0].ValueList)->size(); i != e; ++i) + indices.push_back((*(yyvsp[0].ValueList))[i].val); - if (!GetElementPtrInst::getIndexedType((yyvsp[-2].TypeVal).type->get(), *(yyvsp[0].ValueList), true)) + if (!GetElementPtrInst::getIndexedType((yyvsp[-2].TypeVal).type->get(), indices, true)) GEN_ERROR("Invalid getelementptr indices for type '" + (yyvsp[-2].TypeVal).type->get()->getDescription()+ "'!"); Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[0].ValueList)); + (yyval.InstVal) = new GetElementPtrInst(tmpVal, indices); delete (yyvsp[-2].TypeVal).type; delete (yyvsp[0].ValueList); ;} @@ -5442,7 +5491,7 @@ } /* Line 1126 of yacc.c. */ -#line 5446 "llvmAsmParser.tab.c" +#line 5495 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -5710,7 +5759,7 @@ } -#line 2905 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2950 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" void llvm::GenerateError(const std::string &message, int LineNo) { Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.21 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.22 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.21 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Tue Nov 28 01:29:44 2006 @@ -281,7 +281,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1038 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -289,19 +289,17 @@ llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - llvm::Constant *ConstVal; - - TypeInfo TypeVal; - llvm::Value *ValueVal; + ConstInfo ConstVal; + TypeInfo TypeVal; + ValueInfo ValueVal; std::vector >*ArgList; - std::vector *ValueList; + std::vector *ValueList; std::list *TypeList; // Represent the RHS of PHI node - std::list > *PHIList; + std::list > *PHIList; std::vector > *JumpTable; - std::vector *ConstVector; + std::vector *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -322,7 +320,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 1447 of yacc.c. */ -#line 326 "llvmAsmParser.tab.h" +#line 324 "llvmAsmParser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.27 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.28 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.27 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Tue Nov 28 01:29:44 2006 @@ -83,8 +83,8 @@ Module *CurrentModule; std::map Values; // Module level numbered definitions std::map LateResolveValues; - std::vector Types; - std::map LateResolveTypes; + std::vector Types; + std::map LateResolveTypes; /// PlaceHolderInfo - When temporary placeholder objects are created, remember /// how they were referenced and on which line of the input they came from so @@ -217,7 +217,7 @@ case ValID::NumberVal: // Is it a numbered definition? // Module constants occupy the lowest numbered slots... if ((unsigned)D.Num < CurModule.Types.size()) - return CurModule.Types[(unsigned)D.Num].type->get(); + return CurModule.Types[(unsigned)D.Num]; break; case ValID::NameVal: // Is it a named definition? if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) { @@ -247,16 +247,14 @@ } } - std::map::iterator I =CurModule.LateResolveTypes.find(D); + std::map::iterator I =CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) - return I->second.type->get(); + return I->second; - TypeInfo TI; - TI.type = new PATypeHolder(OpaqueType::get()); - TI.signedness = isSignless; - CurModule.LateResolveTypes.insert(std::make_pair(D, TI)); - return TI.type->get(); - } + Type *Typ = OpaqueType::get(); + CurModule.LateResolveTypes.insert(std::make_pair(D, Typ)); + return Typ; +} static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = @@ -559,10 +557,10 @@ if (Name) D = ValID::create(Name); else D = ValID::create((int)CurModule.Types.size()); - std::map::iterator I = + std::map::iterator I = CurModule.LateResolveTypes.find(D); if (I != CurModule.LateResolveTypes.end()) { - ((DerivedType*)I->second.type->get())->refineAbstractTypeTo(ToTy); + ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy); CurModule.LateResolveTypes.erase(I); } } @@ -1044,19 +1042,17 @@ llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - llvm::Constant *ConstVal; - - TypeInfo TypeVal; - llvm::Value *ValueVal; + ConstInfo ConstVal; + TypeInfo TypeVal; + ValueInfo ValueVal; std::vector >*ArgList; - std::vector *ValueList; + std::vector *ValueList; std::list *TypeList; // Represent the RHS of PHI node - std::list > *PHIList; + std::list > *PHIList; std::vector > *JumpTable; - std::vector *ConstVector; + std::vector *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -1374,7 +1370,7 @@ std::vector Elements; for (std::list::iterator I = $2->begin(), E = $2->end(); I != E; ++I) - Elements.push_back(I->type->get()); + Elements.push_back((*I).type->get()); $$.type = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); $$.signedness = isSignless; @@ -1390,7 +1386,7 @@ if ($1.type->get() == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); $$.type = new PATypeHolder(HandleUpRefs(PointerType::get($1.type->get()))); - $$.signedness = $1.signedness; + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR }; @@ -1448,14 +1444,19 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i]->getType()) + if (ETy != (*$3)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i]->getType()->getDescription() + "'."); + (*$3)[i].cnst->getType()->getDescription() + "'."); + } else { + elems.push_back((*$3)[i].cnst); + } } - $$ = ConstantArray::get(ATy, *$3); + $$.cnst = ConstantArray::get(ATy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1469,7 +1470,8 @@ if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); - $$ = ConstantArray::get(ATy, std::vector()); + $$.cnst = ConstantArray::get(ATy, std::vector()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1499,7 +1501,8 @@ GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free($3); - $$ = ConstantArray::get(ATy, Vals); + $$.cnst = ConstantArray::get(ATy, Vals); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1518,14 +1521,18 @@ itostr(NumElements) + "!"); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i]->getType()) + if (ETy != (*$3)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i]->getType()->getDescription() + "'."); + (*$3)[i].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*$3)[i].cnst); } - $$ = ConstantPacked::get(PTy, *$3); + $$.cnst = ConstantPacked::get(PTy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1539,14 +1546,18 @@ GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! + std::vector elems; for (unsigned i = 0, e = $3->size(); i != e; ++i) - if ((*$3)[i]->getType() != STy->getElementType(i)) + if ((*$3)[i].cnst->getType() != STy->getElementType(i)) { GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); + } else + elems.push_back((*$3)[i].cnst); - $$ = ConstantStruct::get(STy, *$3); + $$.cnst = ConstantStruct::get(STy, elems); + $$.signedness = isSignless; delete $1.type; delete $3; CHECK_FOR_ERROR } @@ -1559,7 +1570,8 @@ if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); - $$ = ConstantStruct::get(STy, std::vector()); + $$.cnst = ConstantStruct::get(STy, std::vector()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1569,12 +1581,14 @@ GEN_ERROR("Cannot make null pointer constant with type: '" + $1.type->get()->getDescription() + "'!"); - $$ = ConstantPointerNull::get(PTy); + $$.cnst = ConstantPointerNull::get(PTy); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } | Types UNDEF { - $$ = UndefValue::get($1.type->get()); + $$.cnst = UndefValue::get($1.type->get()); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR } @@ -1635,12 +1649,13 @@ } } - $$ = cast(V); + $$.cnst = cast(V); + $$.signedness = $1.signedness; delete $1.type; // Free the type handle CHECK_FOR_ERROR } | Types ConstExpr { - if ($1.type->get() != $2->getType()) + if ($1.type->get() != $2.cnst->getType()) GEN_ERROR("Mismatched types for constant expression!"); $$ = $2; delete $1.type; @@ -1650,7 +1665,8 @@ const Type *Ty = $1.type->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); - $$ = Constant::getNullValue(Ty); + $$.cnst = Constant::getNullValue(Ty); + $$.signedness = isSignless; delete $1.type; CHECK_FOR_ERROR }; @@ -1658,33 +1674,38 @@ ConstVal : SIntType EINT64VAL { // integral constants if (!ConstantInt::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$ = ConstantInt::get($1.type->get(), $2); + $$.cnst = ConstantInt::get($1.type->get(), $2); + $$.signedness = $1.signedness; CHECK_FOR_ERROR } | UIntType EUINT64VAL { // integral constants if (!ConstantInt::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$ = ConstantInt::get($1.type->get(), $2); + $$.cnst = ConstantInt::get($1.type->get(), $2); + $$.signedness = $1.signedness; CHECK_FOR_ERROR } | BOOL TRUETOK { // Boolean constants - $$ = ConstantBool::getTrue(); + $$.cnst = ConstantBool::getTrue(); + $$.signedness = isSignless; CHECK_FOR_ERROR } | BOOL FALSETOK { // Boolean constants - $$ = ConstantBool::getFalse(); + $$.cnst = ConstantBool::getFalse(); + $$.signedness = isSignless; CHECK_FOR_ERROR } | FPType FPVAL { // Float & Double constants if (!ConstantFP::isValueValidForType($1.type->get(), $2)) GEN_ERROR("Floating point constant invalid for type!!"); - $$ = ConstantFP::get($1.type->get(), $2); + $$.cnst = ConstantFP::get($1.type->get(), $2); + $$.signedness = isSignless; CHECK_FOR_ERROR }; ConstExpr: CastOps '(' ConstVal TO Types ')' { - Constant *Val = $3; + Constant *Val = $3.cnst; const Type *Ty = $5.type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + @@ -1696,73 +1717,64 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - $$ = ConstantExpr::get(Instruction::SetNE, Val, + $$.cnst = ConstantExpr::get(Instruction::SetNE, Val, Constant::getNullValue(Val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { Constant *CE = ConstantExpr::getFPToUI(Val, Type::ULongTy); - $$ = ConstantExpr::getIntToPtr(CE, Ty); + $$.cnst = ConstantExpr::getIntToPtr(CE, Ty); } else { - $$ = ConstantExpr::getCast(Val, Ty); + $$.cnst = ConstantExpr::getCast(Val, Ty); } } else { - $$ = ConstantExpr::getCast($1.opcode, $3, $5.type->get()); + $$.cnst = ConstantExpr::getCast($1.opcode, $3.cnst, $5.type->get()); } delete $5.type; } | GETELEMENTPTR '(' ConstVal IndexList ')' { - if (!isa($3->getType())) + if (!isa($3.cnst->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin($3->getType(), $4->begin(), $4->end()), - GTE = gep_type_end($3->getType(), $4->begin(), $4->end()); - for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*$4)[i])) - if (CUI->getType() == Type::UByteTy) - (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector IdxVec; + for (unsigned i = 0, e = $4->size(); i < e; ++i) + if (Constant *C = dyn_cast((*$4)[i].val)) + IdxVec.push_back(C); + else + GEN_ERROR("Indices to constant getelementptr must be constants!"); const Type *IdxTy = - GetElementPtrInst::getIndexedType($3->getType(), *$4, true); + GetElementPtrInst::getIndexedType($3.cnst->getType(), IdxVec, true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); - std::vector IdxVec; - for (unsigned i = 0, e = $4->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$4)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant getelementptr must be constants!"); - delete $4; - $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + $$.cnst = ConstantExpr::getGetElementPtr($3.cnst, IdxVec); + $$.signedness = isSignless; CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if ($3->getType() != Type::BoolTy) + if ($3.cnst->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); - if ($5->getType() != $7->getType()) + if ($5.cnst->getType() != $7.cnst->getType()) GEN_ERROR("Select operand types must match!"); - $$ = ConstantExpr::getSelect($3, $5, $7); + $$.cnst = ConstantExpr::getSelect($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | ArithmeticOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("Binary operator types must match!"); // First, make sure we're dealing with the right opcode by upgrading from // obsolete versions. - sanitizeOpcode($1, $3->getType()); + sanitizeOpcode($1, $3.cnst->getType()); CHECK_FOR_ERROR; // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. - if (!isa($3->getType())) { - $$ = ConstantExpr::get($1.opcode, $3, $5); + if (!isa($3.cnst->getType())) { + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -1770,56 +1782,64 @@ case Module::Pointer64: IntPtrTy = Type::LongTy; break; default: GEN_ERROR("invalid pointer binary constant expr!"); } - $$ = ConstantExpr::get($1.opcode, ConstantExpr::getCast($3, IntPtrTy), - ConstantExpr::getCast($5, IntPtrTy)); - $$ = ConstantExpr::getCast($$, $3->getType()); + $$.cnst = ConstantExpr::get($1.opcode, + ConstantExpr::getCast($3.cnst, IntPtrTy), + ConstantExpr::getCast($5.cnst, IntPtrTy)); + $$.cnst = ConstantExpr::getCast($$.cnst, $3.cnst->getType()); } + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | LogicalOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("Logical operator types must match!"); - if (!$3->getType()->isIntegral()) { - if (!isa($3->getType()) || - !cast($3->getType())->getElementType()->isIntegral()) + if (!$3.cnst->getType()->isIntegral()) { + if (!isa($3.cnst->getType()) || + !cast($3.cnst->getType())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | SetCondOps '(' ConstVal ',' ConstVal ')' { - if ($3->getType() != $5->getType()) + if ($3.cnst->getType() != $5.cnst->getType()) GEN_ERROR("setcc operand types must match!"); - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | ShiftOps '(' ConstVal ',' ConstVal ')' { - if ($5->getType() != Type::UByteTy) + if ($5.cnst->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); - if (!$3->getType()->isInteger()) + if (!$3.cnst->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode($1, $3->getType()); + sanitizeOpcode($1, $3.cnst->getType()); CHECK_FOR_ERROR; - $$ = ConstantExpr::get($1.opcode, $3, $5); + $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { - if (!ExtractElementInst::isValidOperands($3, $5)) + if (!ExtractElementInst::isValidOperands($3.cnst, $5.cnst)) GEN_ERROR("Invalid extractelement operands!"); - $$ = ConstantExpr::getExtractElement($3, $5); + $$.cnst = ConstantExpr::getExtractElement($3.cnst, $5.cnst); + $$.signedness = $3.signedness; CHECK_FOR_ERROR } | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!InsertElementInst::isValidOperands($3, $5, $7)) + if (!InsertElementInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) GEN_ERROR("Invalid insertelement operands!"); - $$ = ConstantExpr::getInsertElement($3, $5, $7); + $$.cnst = ConstantExpr::getInsertElement($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR } | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!ShuffleVectorInst::isValidOperands($3, $5, $7)) + if (!ShuffleVectorInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) GEN_ERROR("Invalid shufflevector operands!"); - $$ = ConstantExpr::getShuffleVector($3, $5, $7); + $$.cnst = ConstantExpr::getShuffleVector($3.cnst, $5.cnst, $7.cnst); + $$.signedness = isSignless; CHECK_FOR_ERROR }; @@ -1830,7 +1850,7 @@ CHECK_FOR_ERROR } | ConstVal { - $$ = new std::vector(); + $$ = new std::vector(); $$->push_back($1); CHECK_FOR_ERROR }; @@ -1903,7 +1923,7 @@ CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back($4); + CurModule.Types.push_back(*($4.type)); } else { delete $4.type; } @@ -1916,9 +1936,9 @@ CHECK_FOR_ERROR } | ConstPool OptAssign OptLinkage GlobalType ConstVal { - if ($5 == 0) + if ($5.cnst == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); + CurGV = ParseGlobalVariable($2, $3, $4, $5.cnst->getType(), $5.cnst); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; @@ -2235,7 +2255,7 @@ CHECK_FOR_ERROR } | '<' ConstVector '>' { // Nonempty unsized packed vector - const Type *ETy = (*$2)[0]->getType(); + const Type *ETy = (*$2)[0].cnst->getType(); int NumElements = $2->size(); PackedType* pt = PackedType::get(ETy, NumElements); @@ -2243,19 +2263,22 @@ HandleUpRefs(PackedType::get( ETy, NumElements))); // Verify all elements are correct type! + std::vector elems; for (unsigned i = 0; i < $2->size(); i++) { - if (ETy != (*$2)[i]->getType()) + if (ETy != (*$2)[i].cnst->getType()) { GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*$2)[i]->getType()->getDescription() + "'."); + (*$2)[i].cnst->getType()->getDescription() + "'."); + } else + elems.push_back((*$2)[i].cnst); } - $$ = ValID::create(ConstantPacked::get(pt, *$2)); + $$ = ValID::create(ConstantPacked::get(pt, elems)); delete PTy; delete $2; CHECK_FOR_ERROR } | ConstExpr { - $$ = ValID::create($1); + $$ = ValID::create($1.cnst); CHECK_FOR_ERROR } | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { @@ -2289,8 +2312,10 @@ // type immediately preceeds the value reference, and allows complex constant // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { - $$ = getVal($1.type->get(), $2); delete $1.type; + $$.val = getVal($1.type->get(), $2); + delete $1.type; CHECK_FOR_ERROR + $$.signedness = $1.signedness; }; BasicBlockList : BasicBlockList BasicBlock { @@ -2352,7 +2377,7 @@ }; BBTerminatorInst : RET ResolvedVal { // Return with a result... - $$ = new ReturnInst($2); + $$ = new ReturnInst($2.val); CHECK_FOR_ERROR } | RET VOID { // Return with no result... @@ -2411,9 +2436,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ($6) { - for (std::vector::iterator I = $6->begin(), E = $6->end(); + for (std::vector::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -2439,17 +2464,26 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); + std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); - - if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - GEN_ERROR("Invalid number of parameters detected!"); - - $$ = new InvokeInst(V, Normal, Except, *$6); + std::vector args; + for (; ArgI != ArgE; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } + $$ = new InvokeInst(V, Normal, Except, args); } cast($$)->setCallingConv($2); @@ -2521,7 +2555,7 @@ ValueRefList : ResolvedVal { // Used for call statements, and memory insts... - $$ = new std::vector(); + $$ = new std::vector(); $$->push_back($1); } | ValueRefList ',' ResolvedVal { @@ -2531,7 +2565,12 @@ }; // ValueRefListE - Just like ValueRefList, except that it may also be empty! -ValueRefListE : ValueRefList | /*empty*/ { $$ = 0; }; +ValueRefListE : ValueRefList { + $$ = $1; + } + | /*empty*/ { + $$ = 0; + }; OptTailCall : TAIL CALL { $$ = true; @@ -2597,28 +2636,28 @@ std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue($2->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue($2.val->getType()); if (Ones == 0) GEN_ERROR("Expected integral type for not instruction!"); - $$ = BinaryOperator::create(Instruction::Xor, $2, Ones); + $$ = BinaryOperator::create(Instruction::Xor, $2.val, Ones); if ($$ == 0) GEN_ERROR("Could not create a xor instruction!"); CHECK_FOR_ERROR } | ShiftOps ResolvedVal ',' ResolvedVal { - if ($4->getType() != Type::UByteTy) + if ($4.val->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); - if (!$2->getType()->isInteger()) + if (!$2.val->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); // Handle opcode upgrade situations - sanitizeOpcode($1, $2->getType()); + sanitizeOpcode($1, $2.val->getType()); CHECK_FOR_ERROR; - $$ = new ShiftInst($1.opcode, $2, $4); + $$ = new ShiftInst($1.opcode, $2.val, $4.val); CHECK_FOR_ERROR } | CastOps ResolvedVal TO Types { - Value* Val = $2; + Value* Val = $2.val; const Type* Ty = $4.type->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast from a non-primitive type: '" + @@ -2630,8 +2669,8 @@ if (Ty == Type::BoolTy) { // The previous definition of cast to bool was a compare against zero. // We have to retain that semantic so we do it here. - $$ = new SetCondInst(Instruction::SetNE, $2, - Constant::getNullValue($2->getType())); + $$ = new SetCondInst(Instruction::SetNE, $2.val, + Constant::getNullValue($2.val->getType())); } else if (Val->getType()->isFloatingPoint() && isa(Ty)) { CastInst *CI = new FPToUIInst(Val, Type::ULongTy); $$ = new IntToPtrInst(CI, Ty); @@ -2639,27 +2678,27 @@ $$ = CastInst::createInferredCast(Val, Ty); } } else { - $$ = CastInst::create($1.opcode, $2, $4.type->get()); + $$ = CastInst::create($1.opcode, $2.val, $4.type->get()); } delete $4.type; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if ($2->getType() != Type::BoolTy) + if ($2.val->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); - if ($4->getType() != $6->getType()) + if ($4.val->getType() != $6.val->getType()) GEN_ERROR("select value types should match!"); - $$ = new SelectInst($2, $4, $6); + $$ = new SelectInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | VAARG ResolvedVal ',' Types { NewVarArgs = true; - $$ = new VAArgInst($2, $4.type->get()); + $$ = new VAArgInst($2.val, $4.type->get()); delete $4.type; CHECK_FOR_ERROR } | VAARG_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2->getType(); + const Type* ArgTy = $2.val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2670,7 +2709,7 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2); + CallInst* bar = new CallInst(NF, $2.val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); $$ = new VAArgInst(foo, $4.type->get()); @@ -2679,7 +2718,7 @@ } | VANEXT_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2->getType(); + const Type* ArgTy = $2.val->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2691,7 +2730,7 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2); + CallInst* bar = new CallInst(NF, $2.val); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); Instruction* tmp = new VAArgInst(foo, $4.type->get()); @@ -2701,21 +2740,21 @@ CHECK_FOR_ERROR } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { - if (!ExtractElementInst::isValidOperands($2, $4)) + if (!ExtractElementInst::isValidOperands($2.val, $4.val)) GEN_ERROR("Invalid extractelement operands!"); - $$ = new ExtractElementInst($2, $4); + $$ = new ExtractElementInst($2.val, $4.val); CHECK_FOR_ERROR } | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!InsertElementInst::isValidOperands($2, $4, $6)) + if (!InsertElementInst::isValidOperands($2.val, $4.val, $6.val)) GEN_ERROR("Invalid insertelement operands!"); - $$ = new InsertElementInst($2, $4, $6); + $$ = new InsertElementInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!ShuffleVectorInst::isValidOperands($2, $4, $6)) + if (!ShuffleVectorInst::isValidOperands($2.val, $4.val, $6.val)) GEN_ERROR("Invalid shufflevector operands!"); - $$ = new ShuffleVectorInst($2, $4, $6); + $$ = new ShuffleVectorInst($2.val, $4.val, $6.val); CHECK_FOR_ERROR } | PHI_TOK PHIList { @@ -2742,9 +2781,9 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; if ($6) { - for (std::vector::iterator I = $6->begin(), E = $6->end(); + for (std::vector::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I)->getType()); + ParamTypes.push_back((*I).val->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; @@ -2775,17 +2814,30 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); + std::vector::iterator ArgI = $6->begin(), ArgE = $6->end(); - for (; ArgI != ArgE && I != E; ++ArgI, ++I) - if ((*ArgI)->getType() != *I) - GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + - (*I)->getDescription() + "'!"); + std::vector args; + for (; ArgI != ArgE ; ++ArgI) + if (I == E) { + if (Ty->isVarArg()) { + args.push_back((*ArgI).val); + } else { + GEN_ERROR("Too many parameters for function of type " + + Ty->getDescription()); + } + } else { + if ((*ArgI).val->getType() != *I) { + GEN_ERROR("Parameter " + (*ArgI).val->getName() + + " is not of type '" + (*I)->getDescription() + "'!"); + } else + args.push_back((*ArgI).val); + ++I; + } if (I != E || (ArgI != ArgE && !Ty->isVarArg())) GEN_ERROR("Invalid number of parameters detected!"); - $$ = new CallInst(V, *$6); + $$ = new CallInst(V, args); } cast($$)->setTailCall($1); cast($$)->setCallingConv($2); @@ -2804,7 +2856,7 @@ $$ = $2; CHECK_FOR_ERROR } | /* empty */ { - $$ = new std::vector(); + $$ = new std::vector(); CHECK_FOR_ERROR }; @@ -2842,10 +2894,10 @@ delete $2.type; } | FREE ResolvedVal { - if (!isa($2->getType())) + if (!isa($2.val->getType())) GEN_ERROR("Trying to free nonpointer type " + - $2->getType()->getDescription() + "!"); - $$ = new FreeInst($2); + $2.val->getType()->getDescription() + "!"); + $$ = new FreeInst($2.val); CHECK_FOR_ERROR } @@ -2867,36 +2919,29 @@ GEN_ERROR("Can't store to a nonpointer type: " + ($5.type->get())->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != $3->getType()) - GEN_ERROR("Can't store '" + $3->getType()->getDescription() + + if (ElTy != $3.val->getType()) + GEN_ERROR("Can't store '" + $3.val->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); Value* tmpVal = getVal($5.type->get(), $6); CHECK_FOR_ERROR - $$ = new StoreInst($3, tmpVal, $1); + $$ = new StoreInst($3.val, tmpVal, $1); delete $5.type; } | GETELEMENTPTR Types ValueRef IndexList { if (!isa($2.type->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct - // indices to uint struct indices for compatibility. - generic_gep_type_iterator::iterator> - GTI = gep_type_begin($2.type->get(), $4->begin(), $4->end()), - GTE = gep_type_end($2.type->get(), $4->begin(), $4->end()); - for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) - if (isa(*GTI)) // Only change struct indices - if (ConstantInt *CUI = dyn_cast((*$4)[i])) - if (CUI->getType() == Type::UByteTy) - (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + std::vector indices; + for (unsigned i = 0, e = $4->size(); i != e; ++i) + indices.push_back((*$4)[i].val); - if (!GetElementPtrInst::getIndexedType($2.type->get(), *$4, true)) + if (!GetElementPtrInst::getIndexedType($2.type->get(), indices, true)) GEN_ERROR("Invalid getelementptr indices for type '" + $2.type->get()->getDescription()+ "'!"); Value* tmpVal = getVal($2.type->get(), $3); CHECK_FOR_ERROR - $$ = new GetElementPtrInst(tmpVal, *$4); + $$ = new GetElementPtrInst(tmpVal, indices); delete $2.type; delete $4; }; From reid at x10sys.com Tue Nov 28 01:04:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 01:04:24 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Message-ID: <200611280704.kAS74OmL017516@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.67 -> 1.68 --- Log message: Add an -append-exit-code option to bugpoint. This will cause bugpoint to append "exit " to the end of the output file. This is used by the nightly tester to make bugpoint match the output generated by the RunSafely.sh script so it doesn't find false positives. --- Diffs of the changes: (+11 -0) ExecutionDriver.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.67 llvm/tools/bugpoint/ExecutionDriver.cpp:1.68 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.67 Wed Nov 8 23:57:53 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Nov 28 01:04:10 2006 @@ -56,6 +56,11 @@ cl::desc("Assume nonzero exit code is failure (default on)"), cl::init(true)); + cl::opt + AppendProgramExitCode("append-exit-code", + cl::desc("Append the exit code to the output so it gets diff'd too"), + cl::init(false)); + cl::opt InputFile("input", cl::init("/dev/null"), cl::desc("Filename to pipe in as stdin (default: /dev/null)")); @@ -277,6 +282,12 @@ } } + if (AppendProgramExitCode) { + std::ofstream outFile(OutputFile.c_str(), std::ios_base::app); + outFile << "exit " << RetVal << '\n'; + outFile.close(); + } + if (ProgramExitedNonzero != 0) *ProgramExitedNonzero = (RetVal != 0); From jlaskey at apple.com Tue Nov 28 08:54:07 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 28 Nov 2006 08:54:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200611281454.kASEs7WD002708@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.233 -> 1.234 --- Log message: 32-bit int space was not accounted for properly in lowerCall. --- Diffs of the changes: (+8 -3) PPCISelLowering.cpp | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.233 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.234 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.233 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Nov 28 08:53:52 2006 @@ -1086,6 +1086,7 @@ MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); bool isPPC64 = PtrVT == MVT::i64; + unsigned PtrByteSize = isPPC64 ? 8 : 4; unsigned ArgOffset = PPCFrameInfo::getLinkageSize(isPPC64); @@ -1128,7 +1129,7 @@ default: assert(0 && "Unhandled argument type!"); case MVT::i32: // All int arguments reserve stack space. - ArgOffset += isPPC64 ? 8 : 4; + ArgOffset += PtrByteSize; if (GPR_idx != Num_GPR_Regs) { unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); @@ -1266,6 +1267,7 @@ return DAG.getConstant((int)C->getValue() >> 2, MVT::i32).Val; } +#include static SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG) { SDOperand Chain = Op.getOperand(0); @@ -1287,8 +1289,11 @@ unsigned NumBytes = PPCFrameInfo::getLinkageSize(isPPC64); // Add up all the space actually used. - for (unsigned i = 0; i != NumOps; ++i) - NumBytes += MVT::getSizeInBits(Op.getOperand(5+2*i).getValueType())/8; + for (unsigned i = 0; i != NumOps; ++i) { + unsigned ArgSize =MVT::getSizeInBits(Op.getOperand(5+2*i).getValueType())/8; + ArgSize = std::max(ArgSize, PtrByteSize); + NumBytes += ArgSize; + } // The prolog code of the callee may store up to 8 GPR argument registers to // the stack, allowing va_start to index over them in memory if its varargs. From evan.cheng at apple.com Tue Nov 28 11:36:07 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 11:36:07 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c Message-ID: <200611281736.kASHa7CF022336@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/bh: newbh.c updated: 1.7 -> 1.8 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+2 -1) newbh.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c diff -u llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.7 llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.8 --- llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.7 Wed Jun 18 10:05:32 2003 +++ llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c Tue Nov 28 11:35:52 2006 @@ -48,7 +48,7 @@ int arg1; /* Used to setup runtime system, get arguments-- see old_main */ -main(int argc, char **argv) { +int main(int argc, char **argv) { treeptr t; /* Initialize the runtime system */ @@ -56,6 +56,7 @@ chatting("nbody = %d, numnodes = %d\n", nbody, NumNodes); t = old_main(); + return 0; } /* global! */ From evan.cheng at apple.com Tue Nov 28 11:41:28 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 11:41:28 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c Message-ID: <200611281741.kASHfSrF022474@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Prolangs-C/bison: files.c updated: 1.3 -> 1.4 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+1 -1) files.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c:1.3 llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c:1.4 --- llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c:1.3 Sun Dec 5 23:59:14 2004 +++ llvm-test/MultiSource/Benchmarks/Prolangs-C/bison/files.c Tue Nov 28 11:41:13 2006 @@ -245,7 +245,7 @@ void done(int k) { - return; + exit(k); if (faction) fclose(faction); From rspencer at reidspencer.com Tue Nov 28 11:41:07 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 28 Nov 2006 09:41:07 -0800 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c In-Reply-To: <200611281736.kASHa7CF022336@zion.cs.uiuc.edu> References: <200611281736.kASHa7CF022336@zion.cs.uiuc.edu> Message-ID: <1164735668.2837.90.camel@bashful.x10sys.com> Whoops, missed that one. Thanks, Evan. On Tue, 2006-11-28 at 11:36 -0600, Evan Cheng wrote: > > Changes in directory llvm-test/MultiSource/Benchmarks/Olden/bh: > > newbh.c updated: 1.7 -> 1.8 > --- > Log message: > > Fix undefined behavior, main should return 0 if executed correctly. > > --- > Diffs of the changes: (+2 -1) > > newbh.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletion(-) > > > Index: llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c > diff -u llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.7 llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.8 > --- llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c:1.7 Wed Jun 18 10:05:32 2003 > +++ llvm-test/MultiSource/Benchmarks/Olden/bh/newbh.c Tue Nov 28 11:35:52 2006 > @@ -48,7 +48,7 @@ > int arg1; > > /* Used to setup runtime system, get arguments-- see old_main */ > -main(int argc, char **argv) { > +int main(int argc, char **argv) { > treeptr t; > > /* Initialize the runtime system */ > @@ -56,6 +56,7 @@ > chatting("nbody = %d, numnodes = %d\n", nbody, NumNodes); > > t = old_main(); > + return 0; > } > > /* global! */ > > > > _______________________________________________ > 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 Tue Nov 28 11:35:34 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 11:35:34 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c Message-ID: <200611281735.kASHZYQb022312@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/McCat/17-bintr: bnchmrk.c updated: 1.1 -> 1.2 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+2 -2) bnchmrk.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c diff -u llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c:1.1 llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c:1.2 --- llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c:1.1 Mon May 12 13:34:21 2003 +++ llvm-test/MultiSource/Benchmarks/McCat/17-bintr/bnchmrk.c Tue Nov 28 11:35:14 2006 @@ -100,7 +100,7 @@ /**************************************************************************************/ -main() +int main() /**************************************************************************************/ { struct binaryTree* tree = NULL; @@ -145,7 +145,7 @@ printf( "\n\nEnd of program\n" ); - + return 0; } /**************************************************************************************/ From evan.cheng at apple.com Tue Nov 28 11:35:34 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 11:35:34 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c Message-ID: <200611281735.kASHZYWj022311@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/McCat/15-trie: trie.c updated: 1.1 -> 1.2 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+4 -3) trie.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c diff -u llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c:1.1 llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c:1.2 --- llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c:1.1 Mon May 12 13:30:53 2003 +++ llvm-test/MultiSource/Benchmarks/McCat/15-trie/trie.c Tue Nov 28 11:35:14 2006 @@ -318,7 +318,7 @@ return tr; } -void main(int argc, char **argv) +int main(int argc, char **argv) { FILE * file; char word[LINESIZE]; @@ -330,12 +330,12 @@ if(argc != 2) { fprintf(stdout, "Usage: %s \n",argv[0]); - exit(0); + return 1; } if(!(file = fopen(argv[1], "r"))) { perror(argv[1]); - exit(0); + return 1; } while(!feof(file)) { @@ -352,4 +352,5 @@ } fclose(file); printT(tr); + return 0; }; From jlaskey at apple.com Tue Nov 28 12:22:06 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 28 Nov 2006 12:22:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200611281822.kASIM6U5023188@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.210 -> 1.211 --- Log message: Prime text sections to improve branch locality in large object files. --- Diffs of the changes: (+13 -0) PPCAsmPrinter.cpp | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.210 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.210 Fri Nov 17 19:23:56 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Nov 28 12:21:52 2006 @@ -543,6 +543,19 @@ // Darwin wants symbols to be quoted if they have complex names. Mang->setUseQuotes(true); + // Prime text sections so they are adjacent. This reduces the likelihood a + // large data or debug section causes a branch to exceed 16M limit. + SwitchToTextSection(".section __TEXT,__textcoal_nt,coalesced," + "pure_instructions"); + if (TM.getRelocationModel() == Reloc::PIC_) { + SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs," + "pure_instructions,32"); + } else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) { + SwitchToTextSection(".section __TEXT,__symbol_stub1,symbol_stubs," + "pure_instructions,16"); + } + SwitchToTextSection(TAI->getTextSection()); + // Emit initial debug information. DW.BeginModule(&M); return false; From jlaskey at apple.com Tue Nov 28 12:27:16 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 28 Nov 2006 12:27:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200611281827.kASIRGPA023294@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.234 -> 1.235 --- Log message: Remove debug code. --- Diffs of the changes: (+0 -2) PPCISelLowering.cpp | 2 -- 1 files changed, 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.234 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.235 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.234 Tue Nov 28 08:53:52 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Nov 28 12:27:02 2006 @@ -1267,8 +1267,6 @@ return DAG.getConstant((int)C->getValue() >> 2, MVT::i32).Val; } -#include - static SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG) { SDOperand Chain = Op.getOperand(0); bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; From evan.cheng at apple.com Tue Nov 28 12:41:18 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 12:41:18 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c 2004-08-12-InlinerAndAllocas.c Message-ID: <200611281841.kASIfI3h023498@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Regression/C: 2004-02-03-AggregateCopy.c updated: 1.1 -> 1.2 2004-08-12-InlinerAndAllocas.c updated: 1.5 -> 1.6 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+2 -0) 2004-02-03-AggregateCopy.c | 1 + 2004-08-12-InlinerAndAllocas.c | 1 + 2 files changed, 2 insertions(+) Index: llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c diff -u llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c:1.1 llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c:1.2 --- llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c:1.1 Tue Feb 3 01:56:52 2004 +++ llvm-test/SingleSource/Regression/C/2004-02-03-AggregateCopy.c Tue Nov 28 12:41:03 2006 @@ -10,5 +10,6 @@ B = C = A; printf("%d, %d, %d\n", A.X, B.X, C.X); + return 0; } Index: llvm-test/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c diff -u llvm-test/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c:1.5 llvm-test/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c:1.6 --- llvm-test/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c:1.5 Mon Apr 17 12:55:41 2006 +++ llvm-test/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c Tue Nov 28 12:41:03 2006 @@ -22,4 +22,5 @@ for (i = 0; i < 10000; ++i) j += Callee(i); printf("%d\n", j); + return 0; } From evan.cheng at apple.com Tue Nov 28 11:42:57 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 11:42:57 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c Message-ID: <200611281742.kASHgvhu022506@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Prolangs-C/loader: load.c updated: 1.2 -> 1.3 --- Log message: Fix undefined behavior, main should return 0 if executed correctly. --- Diffs of the changes: (+2 -1) load.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c:1.2 llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c:1.3 --- llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c:1.2 Mon Mar 7 10:41:13 2005 +++ llvm-test/MultiSource/Benchmarks/Prolangs-C/loader/load.c Tue Nov 28 11:42:43 2006 @@ -29,7 +29,7 @@ char MAIN_ROUTINE[LABEL_SIZE_1+1]; /* -------------------------------- main ---------------------------------- */ -void main(int argc,char **argv) +int main(int argc,char **argv) { FILE *INPUT_STREAM; /* Input file stream */ SYMBOL_TABLE SYM_TAB; /* The symbol table */ @@ -155,4 +155,5 @@ (void) printf("Errors detected. No executable created.\n"); } + return 0; } From alenhar2 at cs.uiuc.edu Tue Nov 28 13:52:40 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 13:52:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200611281952.kASJqeLj012590@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.9 -> 1.10 --- Log message: Add per-target support for asm translation in the cbe --- Diffs of the changes: (+2 -1) TargetAsmInfo.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.9 llvm/lib/Target/TargetAsmInfo.cpp:1.10 --- llvm/lib/Target/TargetAsmInfo.cpp:1.9 Mon Oct 30 16:32:29 2006 +++ llvm/lib/Target/TargetAsmInfo.cpp Tue Nov 28 13:52:20 2006 @@ -75,7 +75,8 @@ DwarfLocSection(".debug_loc"), DwarfARangesSection(".debug_aranges"), DwarfRangesSection(".debug_ranges"), - DwarfMacInfoSection(".debug_macinfo") { + DwarfMacInfoSection(".debug_macinfo"), + AsmTransCBE(0) { } TargetAsmInfo::~TargetAsmInfo() { From alenhar2 at cs.uiuc.edu Tue Nov 28 13:53:08 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 13:53:08 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200611281953.kASJr8sk012610@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.7 -> 1.8 --- Log message: X86 asm -> gcc asm translation table (incomplete) --- Diffs of the changes: (+18 -1) X86TargetAsmInfo.cpp | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 Tue Oct 31 02:31:24 2006 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 28 13:52:49 2006 @@ -14,14 +14,31 @@ #include "X86TargetAsmInfo.h" #include "X86TargetMachine.h" #include "X86Subtarget.h" +#include using namespace llvm; +static const char* x86_asm_table[] = {"{si}", "S", + "{di}", "D", + "{ax}", "a", + "{cx}", "c", + "q", "q", + "r", "r", + "m", "m", + "{memory}", "memory", + "{flags}", "", + "{dirflag}", "", + "{fpsr}", "", + "{cc}", "cc", + 0,0}; + X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) { const X86Subtarget *Subtarget = &TM.getSubtarget(); // FIXME - Should be simplified. - + + AsmTransCBE = x86_asm_table; + switch (Subtarget->TargetType) { case X86Subtarget::isDarwin: AlignmentIsInBytes = false; From alenhar2 at cs.uiuc.edu Tue Nov 28 13:52:24 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 13:52:24 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200611281952.kASJqOLE012578@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.12 -> 1.13 --- Log message: Add per-target support for asm translation in the cbe --- Diffs of the changes: (+7 -0) TargetAsmInfo.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.12 llvm/include/llvm/Target/TargetAsmInfo.h:1.13 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.12 Mon Oct 30 16:46:49 2006 +++ llvm/include/llvm/Target/TargetAsmInfo.h Tue Nov 28 13:51:57 2006 @@ -275,6 +275,10 @@ /// const char *DwarfMacInfoSection; // Defaults to ".debug_macinfo". + //===--- CBE Asm Translation Table -----------------------------------===// + + const char** AsmTransCBE; // Defaults to empty + public: TargetAsmInfo(); virtual ~TargetAsmInfo(); @@ -457,6 +461,9 @@ const char *getDwarfMacInfoSection() const { return DwarfMacInfoSection; } + const char** getAsmCBE() const { + return AsmTransCBE; + } }; } From alenhar2 at cs.uiuc.edu Tue Nov 28 13:53:54 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 13:53:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611281953.kASJrsAp012630@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.285 -> 1.286 --- Log message: Get the asminfo for the target most closely matching the module and use that for inline asm --- Diffs of the changes: (+26 -28) Writer.cpp | 54 ++++++++++++++++++++++++++---------------------------- 1 files changed, 26 insertions(+), 28 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.285 llvm/lib/Target/CBackend/Writer.cpp:1.286 --- llvm/lib/Target/CBackend/Writer.cpp:1.285 Mon Nov 27 17:50:49 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Nov 28 13:53:36 2006 @@ -30,6 +30,7 @@ #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineRegistry.h" +#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GetElementPtrTypeIterator.h" @@ -74,11 +75,12 @@ Mangler *Mang; LoopInfo *LI; const Module *TheModule; + const TargetAsmInfo* TAsm; std::map TypeNames; std::map FPConstantMap; public: - CWriter(std::ostream &o) : Out(o) {} + CWriter(std::ostream &o) : Out(o), TAsm(0) {} virtual const char *getPassName() const { return "C backend"; } @@ -127,6 +129,8 @@ bool writeInstructionCast(const Instruction &I); private : + std::string InterpretASMConstraint(InlineAsm::ConstraintInfo& c); + void lowerIntrinsics(Function &F); void printModule(Module *M); @@ -2257,47 +2261,42 @@ //This could be broken into a bunch of peices and spread accross the //targets, but this information is only useful here. //TODO: work out platform independent constraints and factor those out -static std::string InterpretConstraint(const std::string& target, - InlineAsm::ConstraintInfo& c) { +std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); //catch numeric constraints if (c.Codes[0].find_first_not_of("0123456789") >= c.Codes[0].size()) return c.Codes[0]; - - static const char* x86_table[] = {"{si}", "S", - "{di}", "D", - "{ax}", "a", - "{cx}", "c", - "q", "q", - "r", "r", - "m", "m", - "{memory}", "memory", - "{flags}", "", - "{dirflag}", "", - "{fpsr}", "", - "{cc}", "cc" - }; const char** table = 0; - int tbl_len = 0; - if (target == "i686-pc-linux-gnu") { - table = x86_table; - tbl_len = sizeof(x86_table) / sizeof(char*); + + //Grab the translation table from TargetAsmInfo if it exists + if (!TAsm) { + std::string E; + const TargetMachineRegistry::Entry* Match = + TargetMachineRegistry::getClosestStaticTargetForModule(*TheModule, E); + if (Match) { + //Per platform Target Machines don't exist, so create it + // this must be done only once + const TargetMachine* TM = Match->CtorFn(*TheModule, ""); + TAsm = TM->getTargetAsmInfo(); + } } - for (int i = 0; i < tbl_len && table; i += 2) + if (TAsm) + table = TAsm->getAsmCBE(); + + //Search the translation table if it exists + for (int i = 0; table && table[i]; i += 2) if (c.Codes[0] == table[i]) return table[i+1]; - std::cerr << target << "\n"; - std::cerr << c.Codes[0] << "\n"; assert(0 && "Unknown Asm Constraint"); return ""; } //TODO: import logic from AsmPrinter.cpp -static std::string gccifyAsm(const std::string& target, std::string asmstr) { +static std::string gccifyAsm(std::string asmstr) { for (std::string::size_type i = 0; i != asmstr.size(); ++i) if (asmstr[i] == '\n') asmstr.replace(i, 1, "\\n"); @@ -2323,7 +2322,6 @@ void CWriter::visitInlineAsm(CallInst &CI) { InlineAsm* as = cast(CI.getOperand(0)); - const std::string& target = TheModule->getTargetTriple(); std::vector Constraints = as->ParseConstraints(); std::vector > Input; std::vector > Output; @@ -2333,7 +2331,7 @@ E = Constraints.end(); I != E; ++I) { assert(I->Codes.size() == 1 && "Too many asm constraint codes to handle"); std::string c = - InterpretConstraint(target, *I); + InterpretASMConstraint(*I); switch(I->Type) { default: assert(0 && "Unknown asm constraint"); @@ -2362,7 +2360,7 @@ } //fix up the asm string for gcc - std::string asmstr = gccifyAsm(target, as->getAsmString()); + std::string asmstr = gccifyAsm(as->getAsmString()); Out << "__asm__ volatile (\"" << asmstr << "\"\n"; Out << " :"; From alenhar2 at cs.uiuc.edu Tue Nov 28 13:56:30 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 13:56:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611281956.kASJuUlL012679@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.286 -> 1.287 --- Log message: update comments --- Diffs of the changes: (+4 -2) Writer.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.286 llvm/lib/Target/CBackend/Writer.cpp:1.287 --- llvm/lib/Target/CBackend/Writer.cpp:1.286 Tue Nov 28 13:53:36 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Nov 28 13:56:02 2006 @@ -2258,9 +2258,9 @@ //This converts the llvm constraint string to something gcc is expecting. -//This could be broken into a bunch of peices and spread accross the -//targets, but this information is only useful here. //TODO: work out platform independent constraints and factor those out +// of the per target tables +// handle multiple constraint codes std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); @@ -2320,6 +2320,8 @@ return asmstr; } +//TODO: assumptions about what consume arguments from the call are likely wrong +// handle communitivity void CWriter::visitInlineAsm(CallInst &CI) { InlineAsm* as = cast(CI.getOperand(0)); std::vector Constraints = as->ParseConstraints(); From evan.cheng at apple.com Tue Nov 28 13:59:39 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 13:59:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200611281959.kASJxdg7024745@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.145 -> 1.146 --- Log message: New entries. --- Diffs of the changes: (+20 -0) README.txt | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.145 llvm/lib/Target/X86/README.txt:1.146 --- llvm/lib/Target/X86/README.txt:1.145 Tue Nov 14 02:08:46 2006 +++ llvm/lib/Target/X86/README.txt Tue Nov 28 13:59:25 2006 @@ -730,3 +730,23 @@ except that mul isn't a commutative 2-addr instruction. I guess this has to be done at isel time based on the #uses to mul? +//===---------------------------------------------------------------------===// + +Make sure the instruction which starts a loop does not cross a cacheline +boundary. This requires knowning the exact length of each machine instruction. +That is somewhat complicated, but doable. Example 256.bzip2: + +In the new trace, the hot loop has an instruction which crosses a cacheline +boundary. In addition to potential cache misses, this can't help decoding as I +imagine there has to be some kind of complicated decoder reset and realignment +to grab the bytes from the next cacheline. + +532 532 0x3cfc movb (1809(%esp, %esi), %bl <<<--- spans 2 64 byte lines +942 942 0x3d03 movl %dh, (1809(%esp, %esi) +937 937 0x3d0a incl %esi +3 3 0x3d0b cmpb %bl, %dl +27 27 0x3d0d jnz 0x000062db + +//===---------------------------------------------------------------------===// + +In c99 mode, the preprocessor doesn't like assembly comments like #TRUNCATE. From reid at x10sys.com Tue Nov 28 14:24:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 14:24:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611282024.kASKO597025226@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.550 -> 1.551 --- Log message: Undo the last patch until 253.perlbmk passes with these changes. --- Diffs of the changes: (+46 -3) InstructionCombining.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 46 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.550 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.551 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.550 Tue Nov 28 01:23:01 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Nov 28 14:23:51 2006 @@ -5739,6 +5739,13 @@ unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); + // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is + // because codegen cannot accurately perform a truncate to bool operation. + // Something goes wrong in promotion to a larger type. When CodeGen can + // handle a proper truncation to bool, this should be removed. + if (DestTy == Type::BoolTy) + return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); + // See if we can simplify any instructions used by the LHS whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero = 0, KnownOne = 0; @@ -6014,11 +6021,35 @@ } Instruction *InstCombiner::visitFPToUI(CastInst &CI) { - return commonCastTransforms(CI); + if (Instruction *I = commonCastTransforms(CI)) + return I; + + // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is + // because codegen cannot accurately perform a truncate to bool operation. + // Something goes wrong in promotion to a larger type. When CodeGen can + // handle a proper truncation to bool, this should be removed. + Value *Src = CI.getOperand(0); + const Type *SrcTy = Src->getType(); + const Type *DestTy = CI.getType(); + if (DestTy == Type::BoolTy) + return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); + return 0; } Instruction *InstCombiner::visitFPToSI(CastInst &CI) { - return commonCastTransforms(CI); + if (Instruction *I = commonCastTransforms(CI)) + return I; + + // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is + // because codegen cannot accurately perform a truncate to bool operation. + // Something goes wrong in promotion to a larger type. When CodeGen can + // handle a proper truncation to bool, this should be removed. + Value *Src = CI.getOperand(0); + const Type *SrcTy = Src->getType(); + const Type *DestTy = CI.getType(); + if (DestTy == Type::BoolTy) + return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); + return 0; } Instruction *InstCombiner::visitUIToFP(CastInst &CI) { @@ -6030,7 +6061,19 @@ } Instruction *InstCombiner::visitPtrToInt(CastInst &CI) { - return commonCastTransforms(CI); + if (Instruction *I = commonCastTransforms(CI)) + return I; + + // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is + // because codegen cannot accurately perform a truncate to bool operation. + // Something goes wrong in promotion to a larger type. When CodeGen can + // handle a proper truncation to bool, this should be removed. + Value *Src = CI.getOperand(0); + const Type *SrcTy = Src->getType(); + const Type *DestTy = CI.getType(); + if (DestTy == Type::BoolTy) + return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); + return 0; } Instruction *InstCombiner::visitIntToPtr(CastInst &CI) { From clattner at apple.com Tue Nov 28 15:00:08 2006 From: clattner at apple.com (Chris Lattner) Date: Tue, 28 Nov 2006 13:00:08 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp In-Reply-To: <200611281953.kASJr8sk012610@apoc.cs.uiuc.edu> References: <200611281953.kASJr8sk012610@apoc.cs.uiuc.edu> Message-ID: <93163444-6362-453B-BC6F-9CBE95C24072@apple.com> On Nov 28, 2006, at 11:53 AM, Andrew Lenharth wrote: > diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 llvm/lib/ > Target/X86/X86TargetAsmInfo.cpp:1.8 > --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 Tue Oct 31 > 02:31:24 2006 > +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 28 13:52:49 2006 > @@ -14,14 +14,31 @@ > #include "X86TargetAsmInfo.h" > #include "X86TargetMachine.h" > #include "X86Subtarget.h" > +#include Please remove this #include. > using namespace llvm; > > +static const char* x86_asm_table[] = {"{si}", "S", > + "{di}", "D", > + "{ax}", "a", > + "{cx}", "c", > + "q", "q", > + "r", "r", > + "m", "m", Why not have identity translations (r -> r) be implicit? -Chris > + "{memory}", "memory", > + "{flags}", "", > + "{dirflag}", "", > + "{fpsr}", "", > + "{cc}", "cc", > + 0,0}; > + > X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) { > const X86Subtarget *Subtarget = &TM.getSubtarget(); > > // FIXME - Should be simplified. > - > + > + AsmTransCBE = x86_asm_table; > + > switch (Subtarget->TargetType) { > case X86Subtarget::isDarwin: > AlignmentIsInBytes = false; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Tue Nov 28 16:21:50 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:50 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Pass.h Type.h Value.h Message-ID: <200611282221.kASMLohn027700@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.74 -> 1.75 Pass.h updated: 1.54 -> 1.55 Type.h updated: 1.92 -> 1.93 Value.h updated: 1.85 -> 1.86 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+18 -0) Module.h | 6 ++++++ Pass.h | 4 ++++ Type.h | 4 ++++ Value.h | 4 ++++ 4 files changed, 18 insertions(+) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.74 llvm/include/llvm/Module.h:1.75 --- llvm/include/llvm/Module.h:1.74 Tue Oct 17 21:21:12 2006 +++ llvm/include/llvm/Module.h Tue Nov 28 16:21:29 2006 @@ -295,8 +295,14 @@ /// @{ public: /// Print the module to an output stream + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream(), 0); + } void print(std::ostream &OS) const { print(OS, 0); } /// Print the module to an output stream with AssemblyAnnotationWriter. + void print(llvm_ostream &OS, AssemblyAnnotationWriter *AAW) const { + if (OS.stream()) print(*OS.stream(), AAW); + } void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; /// Dump the module to std::cerr (for debugging). void dump() const; Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.54 llvm/include/llvm/Pass.h:1.55 --- llvm/include/llvm/Pass.h:1.54 Sun Aug 27 19:09:00 2006 +++ llvm/include/llvm/Pass.h Tue Nov 28 16:21:29 2006 @@ -29,6 +29,7 @@ #ifndef LLVM_PASS_H #define LLVM_PASS_H +#include "llvm/Support/Streams.h" #include #include #include @@ -100,6 +101,9 @@ /// provide the Module* in case the analysis doesn't need it it can just be /// ignored. /// + void print(llvm_ostream &O, const Module *M) const { + if (O.stream()) print(*O.stream(), M); + } virtual void print(std::ostream &O, const Module *M) const; void dump() const; // dump - call print(std::cerr, 0); Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.92 llvm/include/llvm/Type.h:1.93 --- llvm/include/llvm/Type.h:1.92 Sun Nov 26 19:05:09 2006 +++ llvm/include/llvm/Type.h Tue Nov 28 16:21:29 2006 @@ -14,6 +14,7 @@ #include "llvm/AbstractTypeUser.h" #include "llvm/Support/Casting.h" #include "llvm/Support/DataTypes.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator" #include @@ -135,6 +136,9 @@ /// mutable std::vector AbstractTypeUsers; public: + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O) const; /// @brief Debugging support: print to stderr Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.85 llvm/include/llvm/Value.h:1.86 --- llvm/include/llvm/Value.h:1.85 Fri Oct 20 02:07:23 2006 +++ llvm/include/llvm/Value.h Tue Nov 28 16:21:29 2006 @@ -18,6 +18,7 @@ #include "llvm/AbstractTypeUser.h" #include "llvm/Use.h" #include "llvm/Support/Casting.h" +#include "llvm/Support/Streams.h" #include namespace llvm { @@ -74,6 +75,9 @@ /// print - Implement operator<< on Value... /// + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } virtual void print(std::ostream &O) const = 0; /// All values are typed, get the type of this value. From isanbard at gmail.com Tue Nov 28 16:21:48 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:48 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/BitSetVector.h Message-ID: <200611282221.kASMLmmE027689@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: BitSetVector.h updated: 1.15 -> 1.16 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+8 -0) BitSetVector.h | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/include/llvm/ADT/BitSetVector.h diff -u llvm/include/llvm/ADT/BitSetVector.h:1.15 llvm/include/llvm/ADT/BitSetVector.h:1.16 --- llvm/include/llvm/ADT/BitSetVector.h:1.15 Wed Feb 22 10:23:42 2006 +++ llvm/include/llvm/ADT/BitSetVector.h Tue Nov 28 16:21:29 2006 @@ -25,6 +25,7 @@ #ifndef LLVM_ADT_BITSETVECTOR_H #define LLVM_ADT_BITSETVECTOR_H +#include "llvm/Support/Streams.h" #include #include #include @@ -173,6 +174,9 @@ /// /// Printing and debugging support /// + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O) const; void dump() const { print(std::cerr); } @@ -248,6 +252,10 @@ O << "<" << (*I) << ">" << (I+1 == E? "\n" : ", "); } +inline llvm_ostream& operator<< (llvm_ostream& O, const BitSetVector& bset) { + bset.print(O); + return O; +} inline std::ostream& operator<< (std::ostream& O, const BitSetVector& bset) { bset.print(O); From isanbard at gmail.com Tue Nov 28 16:21:51 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:51 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/ConstantRange.h Message-ID: <200611282221.kASMLpvs027711@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: ConstantRange.h updated: 1.9 -> 1.10 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+4 -0) ConstantRange.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Support/ConstantRange.h diff -u llvm/include/llvm/Support/ConstantRange.h:1.9 llvm/include/llvm/Support/ConstantRange.h:1.10 --- llvm/include/llvm/Support/ConstantRange.h:1.9 Thu Apr 21 15:44:59 2005 +++ llvm/include/llvm/Support/ConstantRange.h Tue Nov 28 16:21:29 2006 @@ -25,6 +25,7 @@ #define LLVM_SUPPORT_CONSTANT_RANGE_H #include "llvm/Support/DataTypes.h" +#include "llvm/Support/Streams.h" #include namespace llvm { @@ -140,6 +141,9 @@ /// print - Print out the bounds to a stream... /// + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; /// dump - Allow printing from a debugger easily... From alenhar2 at cs.uiuc.edu Tue Nov 28 16:26:00 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 16:26:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611282226.kASMQ00O026269@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.287 -> 1.288 --- Log message: Make identity default, and fix PR1020: http://llvm.org/PR1020 --- Diffs of the changes: (+3 -7) Writer.cpp | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.287 llvm/lib/Target/CBackend/Writer.cpp:1.288 --- llvm/lib/Target/CBackend/Writer.cpp:1.287 Tue Nov 28 13:56:02 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Nov 28 16:25:32 2006 @@ -2265,10 +2265,6 @@ assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); - //catch numeric constraints - if (c.Codes[0].find_first_not_of("0123456789") >= c.Codes[0].size()) - return c.Codes[0]; - const char** table = 0; //Grab the translation table from TargetAsmInfo if it exists @@ -2291,8 +2287,8 @@ if (c.Codes[0] == table[i]) return table[i+1]; - assert(0 && "Unknown Asm Constraint"); - return ""; + //default is identity + return c.Codes[0]; } //TODO: import logic from AsmPrinter.cpp @@ -2383,7 +2379,7 @@ if (I + 1 != E) Out << ","; } - Out << "\n :" << Clobber.substr(1) << ")\n"; + Out << "\n :" << (Clobber.size() ? Clobber.substr(1) : "") << ")\n"; } void CWriter::visitMallocInst(MallocInst &I) { From alenhar2 at cs.uiuc.edu Tue Nov 28 16:28:36 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 16:28:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200611282228.kASMSaI4026323@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.8 -> 1.9 --- Log message: Identities are default now --- Diffs of the changes: (+0 -4) X86TargetAsmInfo.cpp | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8 Tue Nov 28 13:52:49 2006 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 28 16:28:08 2006 @@ -14,7 +14,6 @@ #include "X86TargetAsmInfo.h" #include "X86TargetMachine.h" #include "X86Subtarget.h" -#include using namespace llvm; @@ -22,9 +21,6 @@ "{di}", "D", "{ax}", "a", "{cx}", "c", - "q", "q", - "r", "r", - "m", "m", "{memory}", "memory", "{flags}", "", "{dirflag}", "", From isanbard at gmail.com Tue Nov 28 16:45:32 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:45:32 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopInfo.h Trace.h Message-ID: <200611282245.kASMjWVm028256@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopInfo.h updated: 1.60 -> 1.61 Trace.h updated: 1.4 -> 1.5 --- Log message: Support for llvm streams. --- Diffs of the changes: (+8 -2) LoopInfo.h | 6 ++++++ Trace.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.60 llvm/include/llvm/Analysis/LoopInfo.h:1.61 --- llvm/include/llvm/Analysis/LoopInfo.h:1.60 Sun Nov 5 13:31:28 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Tue Nov 28 16:45:17 2006 @@ -217,6 +217,9 @@ /// the mapping in the LoopInfo class. void removeBlockFromLoop(BasicBlock *BB); + void print(llvm_ostream &O, unsigned Depth = 0) const { + if (O.stream()) print(*O.stream(), Depth); + } void print(std::ostream &O, unsigned Depth = 0) const; void dump() const; private: @@ -280,6 +283,9 @@ virtual bool runOnFunction(Function &F); virtual void releaseMemory(); + void print(llvm_ostream &O, const Module* = 0) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O, const Module* = 0) const; virtual void getAnalysisUsage(AnalysisUsage &AU) const; Index: llvm/include/llvm/Analysis/Trace.h diff -u llvm/include/llvm/Analysis/Trace.h:1.4 llvm/include/llvm/Analysis/Trace.h:1.5 --- llvm/include/llvm/Analysis/Trace.h:1.4 Thu Apr 21 15:16:32 2005 +++ llvm/include/llvm/Analysis/Trace.h Tue Nov 28 16:45:17 2006 @@ -18,11 +18,11 @@ #ifndef LLVM_ANALYSIS_TRACE_H #define LLVM_ANALYSIS_TRACE_H -#include #include #include namespace llvm { + class llvm_ostream; class BasicBlock; class Function; class Module; @@ -106,7 +106,7 @@ /// print - Write trace to output stream. /// - void print (std::ostream &O) const; + void print (llvm_ostream &O) const; /// dump - Debugger convenience method; writes trace to standard error /// output stream. From isanbard at gmail.com Tue Nov 28 16:46:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:46:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasSetTracker.cpp CFGPrinter.cpp ConstantRange.cpp InstCount.cpp LoopInfo.cpp ProfileInfoLoader.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp Trace.cpp Message-ID: <200611282246.kASMkR2Q028300@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisCounter.cpp updated: 1.15 -> 1.16 AliasAnalysisEvaluator.cpp updated: 1.28 -> 1.29 AliasSetTracker.cpp updated: 1.43 -> 1.44 CFGPrinter.cpp updated: 1.18 -> 1.19 ConstantRange.cpp updated: 1.16 -> 1.17 InstCount.cpp updated: 1.15 -> 1.16 LoopInfo.cpp updated: 1.79 -> 1.80 ProfileInfoLoader.cpp updated: 1.8 -> 1.9 ProfileInfoLoaderPass.cpp updated: 1.15 -> 1.16 ScalarEvolution.cpp updated: 1.59 -> 1.60 Trace.cpp updated: 1.2 -> 1.3 --- Log message: Removed some of the iostream #includes. Moved towards converting to using llvm streams --- Diffs of the changes: (+114 -86) AliasAnalysisCounter.cpp | 23 ++++++++++++----------- AliasAnalysisEvaluator.cpp | 44 ++++++++++++++++++++++---------------------- AliasSetTracker.cpp | 8 ++++---- CFGPrinter.cpp | 8 ++++---- ConstantRange.cpp | 32 +++++++++++++++++++++++++++++--- InstCount.cpp | 5 +++-- LoopInfo.cpp | 5 +++-- ProfileInfoLoader.cpp | 27 +++++++++++++-------------- ProfileInfoLoaderPass.cpp | 5 ++--- ScalarEvolution.cpp | 27 ++++++++++++++------------- Trace.cpp | 16 ++++++++-------- 11 files changed, 114 insertions(+), 86 deletions(-) Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.15 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.16 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.15 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue Nov 28 16:46:12 2006 @@ -17,6 +17,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include using namespace llvm; @@ -38,14 +39,14 @@ } void printLine(const char *Desc, unsigned Val, unsigned Sum) { - std::cerr << " " << Val << " " << Desc << " responses (" + llvm_cerr << " " << Val << " " << Desc << " responses (" << Val*100/Sum << "%)\n"; } ~AliasAnalysisCounter() { unsigned AASum = No+May+Must; unsigned MRSum = NoMR+JustRef+JustMod+MR; if (AASum + MRSum) { // Print a report if any counted queries occurred... - std::cerr + llvm_cerr << "\n===== Alias Analysis Counter Report =====\n" << " Analysis counted: " << Name << "\n" << " " << AASum << " Total Alias Queries Performed\n"; @@ -53,19 +54,19 @@ printLine("no alias", No, AASum); printLine("may alias", May, AASum); printLine("must alias", Must, AASum); - std::cerr + llvm_cerr << " Alias Analysis Counter Summary: " << No*100/AASum << "%/" << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n"; } - std::cerr + llvm_cerr << " " << MRSum << " Total Mod/Ref Queries Performed\n"; if (MRSum) { printLine("no mod/ref", NoMR, MRSum); printLine("ref", JustRef, MRSum); printLine("mod", JustMod, MRSum); printLine("mod/ref", MR, MRSum); - std::cerr + llvm_cerr << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/" << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" << MR*100/MRSum <<"%\n\n"; @@ -132,10 +133,10 @@ } if (PrintAll || (PrintAllFailures && R == MayAlias)) { - std::cerr << AliasString << ":\t"; - std::cerr << "[" << V1Size << "B] "; + llvm_cerr << AliasString << ":\t"; + llvm_cerr << "[" << V1Size << "B] "; WriteAsOperand(std::cerr, V1, true, true, M) << ", "; - std::cerr << "[" << V2Size << "B] "; + llvm_cerr << "[" << V2Size << "B] "; WriteAsOperand(std::cerr, V2, true, true, M) << "\n"; } @@ -156,10 +157,10 @@ } if (PrintAll || (PrintAllFailures && R == ModRef)) { - std::cerr << MRString << ": Ptr: "; - std::cerr << "[" << Size << "B] "; + llvm_cerr << MRString << ": Ptr: "; + llvm_cerr << "[" << Size << "B] "; WriteAsOperand(std::cerr, P, true, true, M); - std::cerr << "\t<->" << *CS.getInstruction(); + llvm_cerr << "\t<->" << *CS.getInstruction(); } return R; } Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.28 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.29 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.28 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Nov 28 16:46:12 2006 @@ -28,9 +28,9 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include #include - using namespace llvm; namespace { @@ -79,7 +79,7 @@ static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2, Module *M) { if (P) { - std::cerr << " " << Msg << ":\t"; + llvm_cerr << " " << Msg << ":\t"; WriteAsOperand(std::cerr, V1, true, true, M) << ", "; WriteAsOperand(std::cerr, V2, true, true, M) << "\n"; } @@ -89,9 +89,9 @@ PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr, Module *M) { if (P) { - std::cerr << " " << Msg << ": Ptr: "; + llvm_cerr << " " << Msg << ": Ptr: "; WriteAsOperand(std::cerr, Ptr, true, true, M); - std::cerr << "\t<->" << *I; + llvm_cerr << "\t<->" << *I; } } @@ -125,7 +125,7 @@ if (PrintNoAlias || PrintMayAlias || PrintMustAlias || PrintNoModRef || PrintMod || PrintRef || PrintModRef) - std::cerr << "Function: " << F.getName() << ": " << Pointers.size() + llvm_cerr << "Function: " << F.getName() << ": " << Pointers.size() << " pointers, " << CallSites.size() << " call sites\n"; // iterate over the worklist, and run the full (n^2)/2 disambiguations @@ -151,7 +151,7 @@ PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent()); ++MustAlias; break; default: - std::cerr << "Unknown alias query result!\n"; + llvm_cerr << "Unknown alias query result!\n"; } } } @@ -181,7 +181,7 @@ PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); ++ModRef; break; default: - std::cerr << "Unknown alias query result!\n"; + llvm_cerr << "Unknown alias query result!\n"; } } } @@ -190,24 +190,24 @@ } static void PrintPercent(unsigned Num, unsigned Sum) { - std::cerr << "(" << Num*100ULL/Sum << "." + llvm_cerr << "(" << Num*100ULL/Sum << "." << ((Num*1000ULL/Sum) % 10) << "%)\n"; } bool AAEval::doFinalization(Module &M) { unsigned AliasSum = NoAlias + MayAlias + MustAlias; - std::cerr << "===== Alias Analysis Evaluator Report =====\n"; + llvm_cerr << "===== Alias Analysis Evaluator Report =====\n"; if (AliasSum == 0) { - std::cerr << " Alias Analysis Evaluator Summary: No pointers!\n"; + llvm_cerr << " Alias Analysis Evaluator Summary: No pointers!\n"; } else { - std::cerr << " " << AliasSum << " Total Alias Queries Performed\n"; - std::cerr << " " << NoAlias << " no alias responses "; + llvm_cerr << " " << AliasSum << " Total Alias Queries Performed\n"; + llvm_cerr << " " << NoAlias << " no alias responses "; PrintPercent(NoAlias, AliasSum); - std::cerr << " " << MayAlias << " may alias responses "; + llvm_cerr << " " << MayAlias << " may alias responses "; PrintPercent(MayAlias, AliasSum); - std::cerr << " " << MustAlias << " must alias responses "; + llvm_cerr << " " << MustAlias << " must alias responses "; PrintPercent(MustAlias, AliasSum); - std::cerr << " Alias Analysis Evaluator Pointer Alias Summary: " + llvm_cerr << " Alias Analysis Evaluator Pointer Alias Summary: " << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/" << MustAlias*100/AliasSum << "%\n"; } @@ -215,18 +215,18 @@ // Display the summary for mod/ref analysis unsigned ModRefSum = NoModRef + Mod + Ref + ModRef; if (ModRefSum == 0) { - std::cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n"; + llvm_cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n"; } else { - std::cerr << " " << ModRefSum << " Total ModRef Queries Performed\n"; - std::cerr << " " << NoModRef << " no mod/ref responses "; + llvm_cerr << " " << ModRefSum << " Total ModRef Queries Performed\n"; + llvm_cerr << " " << NoModRef << " no mod/ref responses "; PrintPercent(NoModRef, ModRefSum); - std::cerr << " " << Mod << " mod responses "; + llvm_cerr << " " << Mod << " mod responses "; PrintPercent(Mod, ModRefSum); - std::cerr << " " << Ref << " ref responses "; + llvm_cerr << " " << Ref << " ref responses "; PrintPercent(Ref, ModRefSum); - std::cerr << " " << ModRef << " mod & ref responses "; + llvm_cerr << " " << ModRef << " mod & ref responses "; PrintPercent(ModRef, ModRefSum); - std::cerr << " Alias Analysis Evaluator Mod/Ref Summary: " + llvm_cerr << " Alias Analysis Evaluator Mod/Ref Summary: " << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/" << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n"; } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.43 llvm/lib/Analysis/AliasSetTracker.cpp:1.44 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.43 Sun Sep 17 12:51:00 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue Nov 28 16:46:12 2006 @@ -19,7 +19,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/InstIterator.h" -#include +#include "llvm/Support/Streams.h" using namespace llvm; /// mergeSetIn - Merge the specified alias set into this alias set. @@ -543,8 +543,8 @@ OS << "\n"; } -void AliasSet::dump() const { print (std::cerr); } -void AliasSetTracker::dump() const { print(std::cerr); } +void AliasSet::dump() const { print (llvm_cerr); } +void AliasSetTracker::dump() const { print(llvm_cerr); } //===----------------------------------------------------------------------===// // AliasSetPrinter Pass @@ -564,7 +564,7 @@ for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) Tracker->add(&*I); - Tracker->print(std::cerr); + Tracker->print(llvm_cerr); delete Tracker; return false; } Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.18 llvm/lib/Analysis/CFGPrinter.cpp:1.19 --- llvm/lib/Analysis/CFGPrinter.cpp:1.18 Fri Nov 17 03:38:03 2006 +++ llvm/lib/Analysis/CFGPrinter.cpp Tue Nov 28 16:46:12 2006 @@ -25,7 +25,7 @@ #include "llvm/Support/CFG.h" #include "llvm/Support/GraphWriter.h" #include "llvm/Config/config.h" -#include +#include #include #include using namespace llvm; @@ -92,14 +92,14 @@ struct CFGPrinter : public FunctionPass { virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getName() + ".dot"; - std::cerr << "Writing '" << Filename << "'..."; + llvm_cerr << "Writing '" << Filename << "'..."; std::ofstream File(Filename.c_str()); if (File.good()) WriteGraph(File, (const Function*)&F); else - std::cerr << " error opening file for writing!"; - std::cerr << "\n"; + llvm_cerr << " error opening file for writing!"; + llvm_cerr << "\n"; return false; } Index: llvm/lib/Analysis/ConstantRange.cpp diff -u llvm/lib/Analysis/ConstantRange.cpp:1.16 llvm/lib/Analysis/ConstantRange.cpp:1.17 --- llvm/lib/Analysis/ConstantRange.cpp:1.16 Fri Oct 20 02:07:24 2006 +++ llvm/lib/Analysis/ConstantRange.cpp Tue Nov 28 16:46:12 2006 @@ -25,8 +25,8 @@ #include "llvm/Constants.h" #include "llvm/Instruction.h" #include "llvm/Type.h" -#include - +#include "llvm/Support/Streams.h" +#include using namespace llvm; static ConstantIntegral *Next(ConstantIntegral *CI) { @@ -50,6 +50,32 @@ return cast(C)->getValue(); } + + + + + + + + + + + + + + + + + + + + + + + + + + static bool GT(ConstantIntegral *A, ConstantIntegral *B) { return LT(B, A); } static ConstantIntegral *Min(ConstantIntegral *A, ConstantIntegral *B) { @@ -328,5 +354,5 @@ /// dump - Allow printing from a debugger easily... /// void ConstantRange::dump() const { - print(std::cerr); + print(llvm_cerr); } Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.15 llvm/lib/Analysis/InstCount.cpp:1.16 --- llvm/lib/Analysis/InstCount.cpp:1.15 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/InstCount.cpp Tue Nov 28 16:46:12 2006 @@ -15,8 +15,9 @@ #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include +#include using namespace llvm; namespace { @@ -42,7 +43,7 @@ #include "llvm/Instruction.def" void visitInstruction(Instruction &I) { - std::cerr << "Instruction Count does not know about " << I; + llvm_cerr << "Instruction Count does not know about " << I; abort(); } public: Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.79 llvm/lib/Analysis/LoopInfo.cpp:1.80 --- llvm/lib/Analysis/LoopInfo.cpp:1.79 Fri Oct 27 20:24:05 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Tue Nov 28 16:46:12 2006 @@ -20,9 +20,10 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/DepthFirstIterator.h" #include -#include +#include using namespace llvm; static RegisterPass @@ -79,7 +80,7 @@ } void Loop::dump() const { - print(std::cerr); + print(llvm_cerr); } Index: llvm/lib/Analysis/ProfileInfoLoader.cpp diff -u llvm/lib/Analysis/ProfileInfoLoader.cpp:1.8 llvm/lib/Analysis/ProfileInfoLoader.cpp:1.9 --- llvm/lib/Analysis/ProfileInfoLoader.cpp:1.8 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/ProfileInfoLoader.cpp Tue Nov 28 16:46:12 2006 @@ -16,10 +16,9 @@ #include "llvm/Analysis/ProfileInfoTypes.h" #include "llvm/Module.h" #include "llvm/InstrTypes.h" +#include "llvm/Support/Streams.h" #include -#include #include - using namespace llvm; // ByteSwap - Byteswap 'Var' if 'Really' is true. @@ -38,7 +37,7 @@ // Read the number of entries... unsigned NumEntries; if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -49,7 +48,7 @@ // Read in the block of data... if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -76,7 +75,7 @@ Module &TheModule) : M(TheModule) { FILE *F = fopen(Filename.c_str(), "r"); if (F == 0) { - std::cerr << ToolName << ": Error opening '" << Filename << "': "; + llvm_cerr << ToolName << ": Error opening '" << Filename << "': "; perror(0); exit(1); } @@ -94,7 +93,7 @@ case ArgumentInfo: { unsigned ArgLength; if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -105,7 +104,7 @@ if (ArgLength) if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -130,7 +129,7 @@ break; default: - std::cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; + llvm_cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; exit(1); } } @@ -157,7 +156,7 @@ Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(), BlockCounts[i].second)); } else { - std::cerr << "Function counts are not available!\n"; + llvm_cerr << "Function counts are not available!\n"; } return; } @@ -201,7 +200,7 @@ if (SuccNum >= TI->getNumSuccessors()) { static bool Warned = false; if (!Warned) { - std::cerr << "WARNING: profile info doesn't seem to match" + llvm_cerr << "WARNING: profile info doesn't seem to match" << " the program!\n"; Warned = true; } @@ -227,7 +226,7 @@ } } else { - std::cerr << "Block counts are not available!\n"; + llvm_cerr << "Block counts are not available!\n"; } return; } @@ -248,7 +247,7 @@ void ProfileInfoLoader::getEdgeCounts(std::vector > &Counts) { if (EdgeCounts.empty()) { - std::cerr << "Edge counts not available, and no synthesis " + llvm_cerr << "Edge counts not available, and no synthesis " << "is implemented yet!\n"; return; } @@ -269,9 +268,9 @@ // void ProfileInfoLoader::getBBTrace(std::vector &Trace) { if (BBTrace.empty ()) { - std::cerr << "Basic block trace is not available!\n"; + llvm_cerr << "Basic block trace is not available!\n"; return; } - std::cerr << "Basic block trace loading is not implemented yet!\n"; + llvm_cerr << "Basic block trace loading is not implemented yet!\n"; } Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.15 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.16 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.15 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Tue Nov 28 16:46:12 2006 @@ -19,8 +19,7 @@ #include "llvm/Analysis/ProfileInfo.h" #include "llvm/Analysis/ProfileInfoLoader.h" #include "llvm/Support/CommandLine.h" -#include - +#include "llvm/Support/Streams.h" using namespace llvm; namespace { @@ -77,7 +76,7 @@ TerminatorInst *TI = BB->getTerminator(); if (SuccNum >= TI->getNumSuccessors()) { if (!PrintedWarning) { - std::cerr << "WARNING: profile information is inconsistent with " + llvm_cerr << "WARNING: profile information is inconsistent with " << "the current program!\n"; PrintedWarning = true; } Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.59 llvm/lib/Analysis/ScalarEvolution.cpp:1.60 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.59 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Nov 28 16:46:12 2006 @@ -74,8 +74,9 @@ #include "llvm/Support/ConstantRange.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include +#include #include using namespace llvm; @@ -116,7 +117,7 @@ // SCEV::~SCEV() {} void SCEV::dump() const { - print(std::cerr); + print(llvm_cerr); } /// getValueRange - Return the tightest constant bounds that this value is @@ -1553,10 +1554,10 @@ break; default: #if 0 - std::cerr << "ComputeIterationCount "; + llvm_cerr << "ComputeIterationCount "; if (ExitCond->getOperand(0)->getType()->isUnsigned()) - std::cerr << "[unsigned] "; - std::cerr << *LHS << " " + llvm_cerr << "[unsigned] "; + llvm_cerr << *LHS << " " << Instruction::getOpcodeName(Cond) << " " << *RHS << "\n"; #endif break; @@ -1673,7 +1674,7 @@ if (!isa(Result)) break; // Couldn't decide for sure if (cast(Result)->getValue() == false) { #if 0 - std::cerr << "\n***\n*** Computed loop count " << *ItCst + llvm_cerr << "\n***\n*** Computed loop count " << *ItCst << "\n*** From global " << *GV << "*** BB: " << *L->getHeader() << "***\n"; #endif @@ -2142,7 +2143,7 @@ SCEVConstant *R2 = dyn_cast(Roots.second); if (R1) { #if 0 - std::cerr << "HFTZ: " << *V << " - sol#1: " << *R1 + llvm_cerr << "HFTZ: " << *V << " - sol#1: " << *R1 << " sol#2: " << *R2 << "\n"; #endif // Pick the smallest positive root value. @@ -2271,7 +2272,7 @@ default: break; } - //std::cerr << "Computed Loop Trip Count as: " << + //llvm_cerr << "Computed Loop Trip Count as: " << // *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n"; return SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)); } @@ -2487,20 +2488,20 @@ for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) PrintLoopInfo(OS, SE, *I); - std::cerr << "Loop " << L->getHeader()->getName() << ": "; + llvm_cerr << "Loop " << L->getHeader()->getName() << ": "; std::vector ExitBlocks; L->getExitBlocks(ExitBlocks); if (ExitBlocks.size() != 1) - std::cerr << " "; + llvm_cerr << " "; if (SE->hasLoopInvariantIterationCount(L)) { - std::cerr << *SE->getIterationCount(L) << " iterations! "; + llvm_cerr << *SE->getIterationCount(L) << " iterations! "; } else { - std::cerr << "Unpredictable iteration count. "; + llvm_cerr << "Unpredictable iteration count. "; } - std::cerr << "\n"; + llvm_cerr << "\n"; } void ScalarEvolution::print(std::ostream &OS, const Module* ) const { Index: llvm/lib/Analysis/Trace.cpp diff -u llvm/lib/Analysis/Trace.cpp:1.2 llvm/lib/Analysis/Trace.cpp:1.3 --- llvm/lib/Analysis/Trace.cpp:1.2 Sun Jul 4 07:19:55 2004 +++ llvm/lib/Analysis/Trace.cpp Tue Nov 28 16:46:12 2006 @@ -18,8 +18,7 @@ #include "llvm/Analysis/Trace.h" #include "llvm/Function.h" #include "llvm/Assembly/Writer.h" -#include - +#include "llvm/Support/Streams.h" using namespace llvm; Function *Trace::getFunction() const { @@ -33,12 +32,13 @@ /// print - Write trace to output stream. /// -void Trace::print (std::ostream &O) const { +void Trace::print(llvm_ostream &O) const { Function *F = getFunction (); - O << "; Trace from function " << F->getName () << ", blocks:\n"; - for (const_iterator i = begin (), e = end (); i != e; ++i) { + O << "; Trace from function " << F->getName() << ", blocks:\n"; + for (const_iterator i = begin(), e = end(); i != e; ++i) { O << "; "; - WriteAsOperand (O, *i, true, true, getModule ()); + if (O.stream()) + WriteAsOperand(*O.stream(), *i, true, true, getModule()); O << "\n"; } O << "; Trace parent function: \n" << *F; @@ -47,6 +47,6 @@ /// dump - Debugger convenience method; writes trace to standard error /// output stream. /// -void Trace::dump () const { - print (std::cerr); +void Trace::dump() const { + print(llvm_cerr); } From isanbard at gmail.com Tue Nov 28 16:47:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:47:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200611282247.kASMlRVh028334@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.278 -> 1.279 --- Log message: Removed #include and used llvm streams --- Diffs of the changes: (+3 -3) llvmAsmParser.y | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.278 llvm/lib/AsmParser/llvmAsmParser.y:1.279 --- llvm/lib/AsmParser/llvmAsmParser.y:1.278 Tue Nov 28 01:28:14 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Nov 28 16:47:12 2006 @@ -22,8 +22,8 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include -#include #include #include @@ -58,7 +58,7 @@ // //#define DEBUG_UPREFS 1 #ifdef DEBUG_UPREFS -#define UR_OUT(X) std::cerr << X +#define UR_OUT(X) llvm_cerr << X #else #define UR_OUT(X) #endif @@ -2633,7 +2633,7 @@ delete $2.type; } | NOT ResolvedVal { - std::cerr << "WARNING: Use of eliminated 'not' instruction:" + llvm_cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; Value *Ones = ConstantIntegral::getAllOnesValue($2.val->getType()); From isanbard at gmail.com Tue Nov 28 16:21:52 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:52 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Analyzer.h Message-ID: <200611282221.kASMLqw2027723@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Analyzer.h updated: 1.12 -> 1.13 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+1 -1) Analyzer.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Bytecode/Analyzer.h diff -u llvm/include/llvm/Bytecode/Analyzer.h:1.12 llvm/include/llvm/Bytecode/Analyzer.h:1.13 --- llvm/include/llvm/Bytecode/Analyzer.h:1.12 Mon Nov 13 22:47:22 2006 +++ llvm/include/llvm/Bytecode/Analyzer.h Tue Nov 28 16:21:29 2006 @@ -22,7 +22,7 @@ #include "llvm/Bytecode/Format.h" #include #include -#include +#include namespace llvm { From isanbard at gmail.com Tue Nov 28 16:49:03 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:49:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp Message-ID: <200611282249.kASMn3ng028391@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.134 -> 1.135 RegAllocSimple.cpp updated: 1.76 -> 1.77 TwoAddressInstructionPass.cpp updated: 1.40 -> 1.41 --- Log message: Use llvm streams instead of --- Diffs of the changes: (+18 -20) MachineInstr.cpp | 4 ++-- RegAllocSimple.cpp | 11 +++++------ TwoAddressInstructionPass.cpp | 23 +++++++++++------------ 3 files changed, 18 insertions(+), 20 deletions(-) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.134 llvm/lib/CodeGen/MachineInstr.cpp:1.135 --- llvm/lib/CodeGen/MachineInstr.cpp:1.134 Mon Nov 27 20:25:34 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Tue Nov 28 16:48:48 2006 @@ -17,8 +17,8 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Support/LeakDetector.h" +#include "llvm/Support/Streams.h" #include - using namespace llvm; // Global variable holding an array of descriptors for machine instructions. @@ -175,7 +175,7 @@ } void MachineInstr::dump() const { - std::cerr << " " << *this; + llvm_cerr << " " << *this; } static inline void OutputReg(std::ostream &os, unsigned RegNo, Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.76 llvm/lib/CodeGen/RegAllocSimple.cpp:1.77 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.76 Wed Nov 1 17:18:32 2006 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Tue Nov 28 16:48:48 2006 @@ -190,9 +190,9 @@ if (op.isRegister() && op.getReg() && MRegisterInfo::isVirtualRegister(op.getReg())) { unsigned virtualReg = (unsigned) op.getReg(); - DEBUG(std::cerr << "op: " << op << "\n"); - DEBUG(std::cerr << "\t inst[" << i << "]: "; - MI->print(std::cerr, TM)); + DOUT << "op: " << op << "\n"; + DOUT << "\t inst[" << i << "]: "; + DEBUG(MI->print(std::cerr, TM)); // make sure the same virtual register maps to the same physical // register in any given instruction @@ -221,8 +221,7 @@ } } MI->getOperand(i).setReg(physReg); - DEBUG(std::cerr << "virt: " << virtualReg << - ", phys: " << op.getReg() << "\n"); + DOUT << "virt: " << virtualReg << ", phys: " << op.getReg() << "\n"; } } RegClassIdx.clear(); @@ -234,7 +233,7 @@ /// runOnMachineFunction - Register allocate the whole function /// bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) { - DEBUG(std::cerr << "Machine Function " << "\n"); + DOUT << "Machine Function\n"; MF = &Fn; TM = &MF->getTarget(); RegInfo = TM->getRegisterInfo(); Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.40 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.41 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.40 Wed Nov 8 20:22:15 2006 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Nov 28 16:48:48 2006 @@ -77,7 +77,7 @@ /// operands. /// bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { - DEBUG(std::cerr << "Machine Function\n"); + DOUT << "Machine Function\n"; const TargetMachine &TM = MF.getTarget(); const MRegisterInfo &MRI = *TM.getRegisterInfo(); const TargetInstrInfo &TII = *TM.getInstrInfo(); @@ -85,9 +85,8 @@ bool MadeChange = false; - DEBUG(std::cerr << "********** REWRITING TWO-ADDR INSTRS **********\n"); - DEBUG(std::cerr << "********** Function: " - << MF.getFunction()->getName() << '\n'); + DOUT << "********** REWRITING TWO-ADDR INSTRS **********\n"; + DOUT << "********** Function: " << MF.getFunction()->getName() << '\n'; for (MachineFunction::iterator mbbi = MF.begin(), mbbe = MF.end(); mbbi != mbbe; ++mbbi) { @@ -103,7 +102,7 @@ if (FirstTied) { ++NumTwoAddressInstrs; - DEBUG(std::cerr << '\t'; mi->print(std::cerr, &TM)); + DOUT << '\t'; DEBUG(mi->print(std::cerr, &TM)); } FirstTied = false; @@ -151,12 +150,12 @@ "Not a proper commutative instruction!"); unsigned regC = mi->getOperand(3-si).getReg(); if (LV.KillsRegister(mi, regC)) { - DEBUG(std::cerr << "2addr: COMMUTING : " << *mi); + DOUT << "2addr: COMMUTING : " << *mi; MachineInstr *NewMI = TII.commuteInstruction(mi); if (NewMI == 0) { - DEBUG(std::cerr << "2addr: COMMUTING FAILED!\n"); + DOUT << "2addr: COMMUTING FAILED!\n"; } else { - DEBUG(std::cerr << "2addr: COMMUTED TO: " << *NewMI); + DOUT << "2addr: COMMUTED TO: " << *NewMI; // If the instruction changed to commute it, update livevar. if (NewMI != mi) { LV.instructionChanged(mi, NewMI); // Update live variables @@ -184,8 +183,8 @@ #endif if (MachineInstr *New = TII.convertToThreeAddress(mi)) { - DEBUG(std::cerr << "2addr: CONVERTING 2-ADDR: " << *mi); - DEBUG(std::cerr << "2addr: TO 3-ADDR: " << *New); + DOUT << "2addr: CONVERTING 2-ADDR: " << *mi; + DOUT << "2addr: TO 3-ADDR: " << *New; LV.instructionChanged(mi, New); // Update live variables mbbi->insert(mi, New); // Insert the new inst mbbi->erase(mi); // Nuke the old inst. @@ -201,7 +200,7 @@ MRI.copyRegToReg(*mbbi, mi, regA, regB, rc); MachineBasicBlock::iterator prevMi = prior(mi); - DEBUG(std::cerr << "\t\tprepend:\t"; prevMi->print(std::cerr, &TM)); + DOUT << "\t\tprepend:\t"; DEBUG(prevMi->print(std::cerr, &TM)); // Update live variables for regA LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); @@ -226,7 +225,7 @@ mi->getOperand(ti).setReg(mi->getOperand(si).getReg()); MadeChange = true; - DEBUG(std::cerr << "\t\trewrite to:\t"; mi->print(std::cerr, &TM)); + DOUT << "\t\trewrite to:\t"; DEBUG(mi->print(std::cerr, &TM)); } } } From sabre at nondot.org Tue Nov 28 16:32:52 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 16:32:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/StringExtras.cpp Message-ID: <200611282232.kASMWqkM028001@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: StringExtras.cpp updated: 1.4 -> 1.5 --- Log message: Add a helper function --- Diffs of the changes: (+15 -0) StringExtras.cpp | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/lib/Support/StringExtras.cpp diff -u llvm/lib/Support/StringExtras.cpp:1.4 llvm/lib/Support/StringExtras.cpp:1.5 --- llvm/lib/Support/StringExtras.cpp:1.4 Fri Jul 14 17:54:39 2006 +++ llvm/lib/Support/StringExtras.cpp Tue Nov 28 16:32:35 2006 @@ -42,6 +42,21 @@ return Result; } +/// SplitString - Split up the specified string according to the specified +/// delimiters, appending the result fragments to the output list. +void llvm::SplitString(const std::string &Source, + std::vector &OutFragments, + const char *Delimiters) { + std::string S = Source; + + std::string S2 = getToken(S, Delimiters); + while (!S2.empty()) { + OutFragments.push_back(S2); + S2 = getToken(S, Delimiters); + } +} + + /// UnescapeString - Modify the argument string, turning two character sequences /// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \\ and From sabre at nondot.org Tue Nov 28 16:32:52 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 16:32:52 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/StringExtras.h Message-ID: <200611282232.kASMWqfT028003@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: StringExtras.h updated: 1.34 -> 1.35 --- Log message: Add a helper function --- Diffs of the changes: (+7 -0) StringExtras.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/ADT/StringExtras.h diff -u llvm/include/llvm/ADT/StringExtras.h:1.34 llvm/include/llvm/ADT/StringExtras.h:1.35 --- llvm/include/llvm/ADT/StringExtras.h:1.34 Fri Jul 14 17:54:06 2006 +++ llvm/include/llvm/ADT/StringExtras.h Tue Nov 28 16:32:35 2006 @@ -18,6 +18,7 @@ #include #include #include +#include namespace llvm { @@ -129,6 +130,12 @@ std::string getToken(std::string &Source, const char *Delimiters = " \t\n\v\f\r"); +/// SplitString - Split up the specified string according to the specified +/// delimiters, appending the result fragments to the output list. +void SplitString(const std::string &Source, + std::vector &OutFragments, + const char *Delimiters = " \t\n\v\f\r"); + /// UnescapeString - Modify the argument string, turning two character sequences /// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \\ and /// \num (where num is a 1-3 byte octal value). From isanbard at gmail.com Tue Nov 28 16:49:47 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:49:47 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200611282249.kASMnleD028422@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.31 -> 1.32 --- Log message: Use ostream instead of iostream --- Diffs of the changes: (+1 -2) ArchiveWriter.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.31 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.32 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.31 Fri Aug 25 12:43:11 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Nov 28 16:49:32 2006 @@ -17,9 +17,8 @@ #include "llvm/System/Signals.h" #include "llvm/System/Process.h" #include -#include +#include #include - using namespace llvm; // Write an integer using variable bit rate encoding. This saves a few bytes From isanbard at gmail.com Tue Nov 28 16:21:53 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:53 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h ScalarEvolution.h Message-ID: <200611282221.kASMLrrs027730@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.27 -> 1.28 ScalarEvolution.h updated: 1.11 -> 1.12 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+29 -0) AliasSetTracker.h | 15 +++++++++++++++ ScalarEvolution.h | 14 ++++++++++++++ 2 files changed, 29 insertions(+) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.27 llvm/include/llvm/Analysis/AliasSetTracker.h:1.28 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.27 Mon Jun 26 14:20:25 2006 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Tue Nov 28 16:21:29 2006 @@ -18,6 +18,7 @@ #define LLVM_ANALYSIS_ALIASSETTRACKER_H #include "llvm/Support/CallSite.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/iterator" #include "llvm/ADT/hash_map" #include "llvm/ADT/ilist" @@ -155,6 +156,9 @@ iterator end() const { return iterator(); } bool empty() const { return PtrList == 0; } + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; void dump() const; @@ -244,6 +248,10 @@ bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const; }; +inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSet &AS) { + AS.print(OS); + return OS; +} inline std::ostream& operator<<(std::ostream &OS, const AliasSet &AS) { AS.print(OS); return OS; @@ -353,6 +361,9 @@ iterator begin() { return AliasSets.begin(); } iterator end() { return AliasSets.end(); } + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; void dump() const; @@ -379,6 +390,10 @@ AliasSet *findAliasSetForCallSite(CallSite CS); }; +inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSetTracker &AST) { + AST.print(OS); + return OS; +} inline std::ostream& operator<<(std::ostream &OS, const AliasSetTracker &AST) { AST.print(OS); return OS; Index: llvm/include/llvm/Analysis/ScalarEvolution.h diff -u llvm/include/llvm/Analysis/ScalarEvolution.h:1.11 llvm/include/llvm/Analysis/ScalarEvolution.h:1.12 --- llvm/include/llvm/Analysis/ScalarEvolution.h:1.11 Tue Aug 9 18:36:18 2005 +++ llvm/include/llvm/Analysis/ScalarEvolution.h Tue Nov 28 16:21:29 2006 @@ -22,6 +22,7 @@ #define LLVM_ANALYSIS_SCALAREVOLUTION_H #include "llvm/Pass.h" +#include "llvm/Support/Streams.h" #include namespace llvm { @@ -96,6 +97,9 @@ /// print - Print out the internal representation of this scalar to the /// specified stream. This should really only be used for debugging /// purposes. + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } virtual void print(std::ostream &OS) const = 0; /// dump - This method is used for debugging. @@ -103,6 +107,10 @@ void dump() const; }; + inline llvm_ostream &operator<<(llvm_ostream &OS, const SCEV &S) { + S.print(OS); + return OS; + } inline std::ostream &operator<<(std::ostream &OS, const SCEV &S) { S.print(OS); return OS; @@ -120,6 +128,9 @@ virtual bool isLoopInvariant(const Loop *L) const; virtual const Type *getType() const; virtual bool hasComputableLoopEvolution(const Loop *L) const; + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } virtual void print(std::ostream &OS) const; virtual SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, @@ -231,6 +242,9 @@ virtual bool runOnFunction(Function &F); virtual void releaseMemory(); virtual void getAnalysisUsage(AnalysisUsage &AU) const; + void print(llvm_ostream &OS, const Module* = 0) const { + if (OS.stream()) print(*OS.stream()); + } virtual void print(std::ostream &OS, const Module* = 0) const; }; } From isanbard at gmail.com Tue Nov 28 16:21:51 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 16:21:51 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h MachineBasicBlock.h MachineConstantPool.h MachineInstr.h SchedGraphCommon.h Message-ID: <200611282221.kASMLpJM027715@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.27 -> 1.28 MachineBasicBlock.h updated: 1.49 -> 1.50 MachineConstantPool.h updated: 1.22 -> 1.23 MachineInstr.h updated: 1.201 -> 1.202 SchedGraphCommon.h updated: 1.14 -> 1.15 --- Log message: Added a temporary hack to get the llvm-streams to work for future checkins. --- Diffs of the changes: (+54 -6) LiveInterval.h | 8 ++++++-- MachineBasicBlock.h | 9 ++++++++- MachineConstantPool.h | 12 ++++++++++++ MachineInstr.h | 12 ++++++++++++ SchedGraphCommon.h | 19 ++++++++++++++++--- 5 files changed, 54 insertions(+), 6 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.27 llvm/include/llvm/CodeGen/LiveInterval.h:1.28 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.27 Mon Nov 27 20:07:29 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Nov 28 16:21:29 2006 @@ -60,7 +60,12 @@ private: LiveRange(); // DO NOT IMPLEMENT }; + std::ostream& operator<<(std::ostream& os, const LiveRange &LR); + inline llvm_ostream& operator<<(llvm_ostream& os, const LiveRange &LR) { + if (os.stream()) *os.stream() << LR; + return os; + } inline bool operator<(unsigned V, const LiveRange &LR) { return V < LR.start; @@ -273,8 +278,7 @@ } inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) { - llvm_ostream L(OS); - L << LI; + LI.print(OS); return OS; } } Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.49 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.50 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.49 Sat Nov 18 15:48:05 2006 +++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Tue Nov 28 16:21:29 2006 @@ -17,6 +17,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/ilist" +#include "llvm/Support/Streams.h" namespace llvm { class MachineFunction; @@ -188,6 +189,9 @@ // Debugging methods. void dump() const; + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; /// getNumber - MachineBasicBlocks are uniquely numbered at the function @@ -222,7 +226,10 @@ }; std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB); - +inline llvm_ostream& operator<<(llvm_ostream &OS, const MachineBasicBlock &MBB){ + if (OS.stream()) *OS.stream() << MBB; + return OS; +} //===--------------------------------------------------------------------===// // GraphTraits specializations for machine basic block graphs (machine-CFGs) Index: llvm/include/llvm/CodeGen/MachineConstantPool.h diff -u llvm/include/llvm/CodeGen/MachineConstantPool.h:1.22 llvm/include/llvm/CodeGen/MachineConstantPool.h:1.23 --- llvm/include/llvm/CodeGen/MachineConstantPool.h:1.22 Sun Nov 5 13:31:28 2006 +++ llvm/include/llvm/CodeGen/MachineConstantPool.h Tue Nov 28 16:21:29 2006 @@ -17,6 +17,7 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/Support/Streams.h" #include #include @@ -48,9 +49,17 @@ /// print - Implement operator<<... /// + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } virtual void print(std::ostream &O) const = 0; }; +inline llvm_ostream &operator<<(llvm_ostream &OS, + const MachineConstantPoolValue &V) { + V.print(OS); + return OS; +} inline std::ostream &operator<<(std::ostream &OS, const MachineConstantPoolValue &V) { V.print(OS); @@ -134,6 +143,9 @@ /// print - Used by the MachineFunction printer to print information about /// constant pool objects. Implemented in MachineFunction.cpp /// + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; /// dump - Call print(std::cerr) to be called from the debugger. Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.201 llvm/include/llvm/CodeGen/MachineInstr.h:1.202 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.201 Mon Nov 27 17:33:29 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.h Tue Nov 28 16:21:29 2006 @@ -18,6 +18,7 @@ #include "llvm/ADT/iterator" #include "llvm/Support/DataTypes.h" +#include "llvm/Support/Streams.h" #include #include #include @@ -284,6 +285,10 @@ IsDead = false; } + friend llvm_ostream& operator<<(llvm_ostream& os, const MachineOperand& mop) { + if (os.stream()) *os.stream() << mop; + return os; + } friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); friend class MachineInstr; @@ -400,8 +405,15 @@ // // Debugging support // + void print(llvm_ostream &OS, const TargetMachine *TM) const { + if (OS.stream()) print(*OS.stream(), TM); + } void print(std::ostream &OS, const TargetMachine *TM) const; void dump() const; + friend llvm_ostream& operator<<(llvm_ostream& os, const MachineInstr& minstr){ + if (os.stream()) *os.stream() << minstr; + return os; + } friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr); //===--------------------------------------------------------------------===// Index: llvm/include/llvm/CodeGen/SchedGraphCommon.h diff -u llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.14 llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.15 --- llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.14 Thu Apr 21 22:45:18 2005 +++ llvm/include/llvm/CodeGen/SchedGraphCommon.h Tue Nov 28 16:21:29 2006 @@ -17,6 +17,7 @@ #include "llvm/Value.h" #include "llvm/ADT/iterator" +#include "llvm/Support/Streams.h" #include namespace llvm { @@ -69,6 +70,9 @@ void dump(int indent=0) const; // Debugging support + void print(llvm_ostream &os) const { + if (os.stream()) print(*os.stream()); + } virtual void print(std::ostream &os) const = 0; protected: @@ -92,15 +96,17 @@ }; // ostream << operator for SchedGraphNode class +inline llvm_ostream &operator<<(llvm_ostream &os, + const SchedGraphNodeCommon &node) { + node.print(os); + return os; +} inline std::ostream &operator<<(std::ostream &os, const SchedGraphNodeCommon &node) { node.print(os); return os; } - - - // // SchedGraphEdge - Edge class to represent dependencies // @@ -182,6 +188,9 @@ public: // Debugging support + void print(llvm_ostream &os) const { + if (os.stream()) print(*os.stream()); + } void print(std::ostream &os) const; void dump(int indent=0) const; @@ -191,6 +200,10 @@ }; // ostream << operator for SchedGraphNode class +inline llvm_ostream &operator<<(llvm_ostream &os, const SchedGraphEdge &edge) { + edge.print(os); + return os; +} inline std::ostream &operator<<(std::ostream &os, const SchedGraphEdge &edge) { edge.print(os); return os; From alenhar2 at cs.uiuc.edu Tue Nov 28 17:08:00 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 28 Nov 2006 17:08:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200611282308.kASN80AV027379@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.288 -> 1.289 --- Log message: gcc doesn't like an empty colbber list --- Diffs of the changes: (+3 -1) Writer.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.288 llvm/lib/Target/CBackend/Writer.cpp:1.289 --- llvm/lib/Target/CBackend/Writer.cpp:1.288 Tue Nov 28 16:25:32 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Nov 28 17:07:32 2006 @@ -2379,7 +2379,9 @@ if (I + 1 != E) Out << ","; } - Out << "\n :" << (Clobber.size() ? Clobber.substr(1) : "") << ")\n"; + if (Clobber.size()) + Out << "\n :" << Clobber.substr(1); + Out << ")"; } void CWriter::visitMallocInst(MallocInst &I) { From isanbard at gmail.com Tue Nov 28 17:31:59 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:31:59 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/BitSetVector.h EquivalenceClasses.h SCCIterator.h Message-ID: <200611282331.kASNVxlF029088@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: BitSetVector.h updated: 1.16 -> 1.17 EquivalenceClasses.h updated: 1.17 -> 1.18 SCCIterator.h updated: 1.22 -> 1.23 --- Log message: Support for llvm_ostreams. --- Diffs of the changes: (+8 -8) BitSetVector.h | 4 ++-- EquivalenceClasses.h | 4 ++-- SCCIterator.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/include/llvm/ADT/BitSetVector.h diff -u llvm/include/llvm/ADT/BitSetVector.h:1.16 llvm/include/llvm/ADT/BitSetVector.h:1.17 --- llvm/include/llvm/ADT/BitSetVector.h:1.16 Tue Nov 28 16:21:29 2006 +++ llvm/include/llvm/ADT/BitSetVector.h Tue Nov 28 17:31:42 2006 @@ -29,7 +29,7 @@ #include #include #include -#include +#include namespace llvm { @@ -178,7 +178,7 @@ if (O.stream()) print(*O.stream()); } void print(std::ostream &O) const; - void dump() const { print(std::cerr); } + void dump() const { print(llvm_cerr); } public: // Index: llvm/include/llvm/ADT/EquivalenceClasses.h diff -u llvm/include/llvm/ADT/EquivalenceClasses.h:1.17 llvm/include/llvm/ADT/EquivalenceClasses.h:1.18 --- llvm/include/llvm/ADT/EquivalenceClasses.h:1.17 Tue Aug 23 16:45:31 2005 +++ llvm/include/llvm/ADT/EquivalenceClasses.h Tue Nov 28 17:31:42 2006 @@ -43,8 +43,8 @@ /// if (!I->isLeader()) continue; // Ignore non-leader sets. /// for (EquivalenceClasses::member_iterator MI = EC.member_begin(I); /// MI != EC.member_end(); ++MI) // Loop over members in this set. -/// std::cerr << *MI << " "; // Print member. -/// std::cerr << "\n"; // Finish set. +/// llvm_cerr << *MI << " "; // Print member. +/// llvm_cerr << "\n"; // Finish set. /// } /// /// This example prints: Index: llvm/include/llvm/ADT/SCCIterator.h diff -u llvm/include/llvm/ADT/SCCIterator.h:1.22 llvm/include/llvm/ADT/SCCIterator.h:1.23 --- llvm/include/llvm/ADT/SCCIterator.h:1.22 Sun Aug 6 13:12:50 2006 +++ llvm/include/llvm/ADT/SCCIterator.h Tue Nov 28 17:31:42 2006 @@ -71,8 +71,8 @@ SCCNodeStack.push_back(N); MinVisitNumStack.push_back(visitNum); VisitStack.push_back(std::make_pair(N, GT::child_begin(N))); - //DEBUG(std::cerr << "TarjanSCC: Node " << N << - // " : visitNum = " << visitNum << "\n"); + //DOUT << "TarjanSCC: Node " << N << + // " : visitNum = " << visitNum << "\n"; } // The stack-based DFS traversal; defined below. @@ -106,9 +106,9 @@ if (!MinVisitNumStack.empty() && MinVisitNumStack.back() > minVisitNum) MinVisitNumStack.back() = minVisitNum; - //DEBUG(std::cerr << "TarjanSCC: Popped node " << visitingN << + //DOUT << "TarjanSCC: Popped node " << visitingN << // " : minVisitNum = " << minVisitNum << "; Node visit num = " << - // nodeVisitNumbers[visitingN] << "\n"); + // nodeVisitNumbers[visitingN] << "\n"; if (minVisitNum == nodeVisitNumbers[visitingN]) { // A full SCC is on the SCCNodeStack! It includes all nodes below From isanbard at gmail.com Tue Nov 28 17:31:59 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:31:59 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h DSNode.h Message-ID: <200611282331.kASNVxJm029095@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis/DataStructure: DSGraph.h updated: 1.110 -> 1.111 DSNode.h updated: 1.58 -> 1.59 --- Log message: Support for llvm_ostreams. --- Diffs of the changes: (+7 -1) DSGraph.h | 5 ++++- DSNode.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.110 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.111 --- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.110 Wed Feb 22 10:23:42 2006 +++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h Tue Nov 28 17:31:42 2006 @@ -378,9 +378,12 @@ /// print - Print a dot graph to the specified ostream... /// + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O) const; - /// dump - call print(std::cerr), for use from the debugger... + /// dump - call print(llvm_cerr), for use from the debugger... /// void dump() const; Index: llvm/include/llvm/Analysis/DataStructure/DSNode.h diff -u llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.58 llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.59 --- llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.58 Fri May 19 14:07:54 2006 +++ llvm/include/llvm/Analysis/DataStructure/DSNode.h Tue Nov 28 17:31:42 2006 @@ -362,6 +362,9 @@ /// void forwardNode(DSNode *To, unsigned Offset); + void print(llvm_ostream &O, const DSGraph *G) const { + if (O.stream()) print(*O.stream(), G); + } void print(std::ostream &O, const DSGraph *G) const; void dump() const; From isanbard at gmail.com Tue Nov 28 17:31:58 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:31:58 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/PrintModulePass.h Message-ID: <200611282331.kASNVw6b029078@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: PrintModulePass.h updated: 1.19 -> 1.20 --- Log message: Support for llvm_ostreams. --- Diffs of the changes: (+7 -7) PrintModulePass.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Assembly/PrintModulePass.h diff -u llvm/include/llvm/Assembly/PrintModulePass.h:1.19 llvm/include/llvm/Assembly/PrintModulePass.h:1.20 --- llvm/include/llvm/Assembly/PrintModulePass.h:1.19 Sun May 28 21:32:43 2006 +++ llvm/include/llvm/Assembly/PrintModulePass.h Tue Nov 28 17:31:42 2006 @@ -20,16 +20,16 @@ #include "llvm/Pass.h" #include "llvm/Module.h" -#include +#include "llvm/Support/Streams.h" namespace llvm { class PrintModulePass : public ModulePass { - std::ostream *Out; // ostream to print on + llvm_ostream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintModulePass() : Out(&std::cerr), DeleteStream(false) {} - PrintModulePass(std::ostream *o, bool DS = false) + PrintModulePass() : Out(&llvm_cerr), DeleteStream(false) {} + PrintModulePass(llvm_ostream *o, bool DS = false) : Out(o), DeleteStream(DS) { } @@ -49,11 +49,11 @@ class PrintFunctionPass : public FunctionPass { std::string Banner; // String to print before each function - std::ostream *Out; // ostream to print on + llvm_ostream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintFunctionPass() : Banner(""), Out(&std::cerr), DeleteStream(false) {} - PrintFunctionPass(const std::string &B, std::ostream *o = &std::cout, + PrintFunctionPass() : Banner(""), Out(&llvm_cerr), DeleteStream(false) {} + PrintFunctionPass(const std::string &B, llvm_ostream *o = &llvm_cout, bool DS = false) : Banner(B), Out(o), DeleteStream(DS) { } From isanbard at gmail.com Tue Nov 28 17:33:26 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:33:26 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200611282333.kASNXQBe029165@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.119 -> 1.120 --- Log message: Convert to using llvm streams instead of iostreams. --- Diffs of the changes: (+16 -15) opt.cpp | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.119 llvm/tools/opt/opt.cpp:1.120 --- llvm/tools/opt/opt.cpp:1.119 Thu Nov 2 14:25:50 2006 +++ llvm/tools/opt/opt.cpp Tue Nov 28 17:33:06 2006 @@ -23,6 +23,7 @@ #include "llvm/Support/PassNameParser.h" #include "llvm/System/Signals.h" #include "llvm/Support/PluginLoader.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/Timer.h" #include "llvm/LinkAllPasses.h" @@ -84,9 +85,9 @@ virtual bool runOnModule(Module &M) { if (!Quiet) { - std::cout << "Printing analysis '" << PassToPrint->getPassName() + llvm_cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint).print(std::cout, &M); + getAnalysisID(PassToPrint).print(llvm_cout, &M); } // Get and print pass... @@ -107,11 +108,11 @@ virtual bool runOnFunction(Function &F) { if (!Quiet) { - std::cout << "Printing analysis '" << PassToPrint->getPassName() + llvm_cout << "Printing analysis '" << PassToPrint->getPassName() << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID(PassToPrint).print(std::cout, F.getParent()); + getAnalysisID(PassToPrint).print(llvm_cout, F.getParent()); return false; } @@ -129,13 +130,13 @@ virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { - std::cout << "Printing Analysis info for BasicBlock '" << BB.getName() + llvm_cout << "Printing Analysis info for BasicBlock '" << BB.getName() << "': Pass " << PassToPrint->getPassName() << ":\n"; } // Get and print pass... getAnalysisID(PassToPrint).print( - std::cout, BB.getParent()->getParent()); + llvm_cout, BB.getParent()->getParent()); return false; } @@ -168,11 +169,11 @@ // Load the input module... std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); if (M.get() == 0) { - std::cerr << argv[0] << ": "; + llvm_cerr << argv[0] << ": "; if (ErrorMessage.size()) - std::cerr << ErrorMessage << "\n"; + llvm_cerr << ErrorMessage << "\n"; else - std::cerr << "bytecode didn't read correctly.\n"; + llvm_cerr << "bytecode didn't read correctly.\n"; return 1; } @@ -182,7 +183,7 @@ if (OutputFilename != "-") { if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists!\n" << "Use -f command line argument to force output\n"; return 1; @@ -192,7 +193,7 @@ Out = new std::ofstream(OutputFilename.c_str(), io_mode); if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } @@ -226,7 +227,7 @@ assert(target.get() && "Could not allocate target machine!"); P = PassInf->getTargetCtor()(*target.get()); } else - std::cerr << argv[0] << ": cannot create pass: " + llvm_cerr << argv[0] << ": cannot create pass: " << PassInf->getPassName() << "\n"; if (P) { Passes.add(P); @@ -242,7 +243,7 @@ } if (PrintEachXForm) - Passes.add(new PrintModulePass(&std::cerr)); + Passes.add(new PrintModulePass(&llvm_cerr)); } // Check that the module is well formed on completion of optimization @@ -259,9 +260,9 @@ return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 17:33:24 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:33:24 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-dis/llvm-dis.cpp Message-ID: <200611282333.kASNXOVA029160@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-dis: llvm-dis.cpp updated: 1.51 -> 1.52 --- Log message: Convert to using llvm streams instead of iostreams. --- Diffs of the changes: (+12 -10) llvm-dis.cpp | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) Index: llvm/tools/llvm-dis/llvm-dis.cpp diff -u llvm/tools/llvm-dis/llvm-dis.cpp:1.51 llvm/tools/llvm-dis/llvm-dis.cpp:1.52 --- llvm/tools/llvm-dis/llvm-dis.cpp:1.51 Thu Apr 21 18:59:37 2005 +++ llvm/tools/llvm-dis/llvm-dis.cpp Tue Nov 28 17:33:06 2006 @@ -21,10 +21,11 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" +#include #include #include - using namespace llvm; static cl::opt @@ -47,11 +48,11 @@ std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); if (M.get() == 0) { - std::cerr << argv[0] << ": "; + llvm_cerr << argv[0] << ": "; if (ErrorMessage.size()) - std::cerr << ErrorMessage << "\n"; + llvm_cerr << ErrorMessage << "\n"; else - std::cerr << "bytecode didn't read correctly.\n"; + llvm_cerr << "bytecode didn't read correctly.\n"; return 1; } @@ -59,7 +60,7 @@ if (OutputFilename != "-") { // Not stdout? if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists! Sending to standard output.\n"; } else { Out = new std::ofstream(OutputFilename.c_str()); @@ -80,7 +81,7 @@ if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists! Sending to standard output.\n"; } else { Out = new std::ofstream(OutputFilename.c_str()); @@ -93,14 +94,15 @@ } if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename + llvm_cerr << argv[0] << ": error opening " << OutputFilename << ": sending to stdout instead!\n"; Out = &std::cout; } // All that llvm-dis does is write the assembly to a file. PassManager Passes; - Passes.add(new PrintModulePass(Out)); + llvm_ostream L(*Out); + Passes.add(new PrintModulePass(&L)); Passes.run(*M.get()); if (Out != &std::cout) { @@ -109,9 +111,9 @@ } return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 17:33:24 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:33:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CallTargets.cpp DataStructure.cpp DataStructureStats.cpp EquivClassGraphs.cpp GraphChecker.cpp Message-ID: <200611282333.kASNXOj2029155@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp updated: 1.124 -> 1.125 CallTargets.cpp updated: 1.4 -> 1.5 DataStructure.cpp updated: 1.251 -> 1.252 DataStructureStats.cpp updated: 1.21 -> 1.22 EquivClassGraphs.cpp updated: 1.50 -> 1.51 GraphChecker.cpp updated: 1.21 -> 1.22 --- Log message: Convert to using llvm streams instead of iostreams. --- Diffs of the changes: (+35 -35) BottomUpClosure.cpp | 22 +++++++++++----------- CallTargets.cpp | 6 +++--- DataStructure.cpp | 3 ++- DataStructureStats.cpp | 7 ++++--- EquivClassGraphs.cpp | 7 +++---- GraphChecker.cpp | 25 ++++++++++++------------- 6 files changed, 35 insertions(+), 35 deletions(-) Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.125 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124 Fri Nov 17 01:33:59 2006 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Tue Nov 28 17:33:06 2006 @@ -13,6 +13,7 @@ // applications like alias analysis. // //===----------------------------------------------------------------------===// + #define DEBUG_TYPE "bu_dsa" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" @@ -22,7 +23,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" -#include using namespace llvm; namespace { @@ -501,7 +501,7 @@ DSG->getNodeForValue(F->arg_begin()).mergeWith(N); } else { - std::cerr << "Unrecognized external function: " << F->getName() << "\n"; + llvm_cerr << "Unrecognized external function: " << F->getName() << "\n"; abort(); } @@ -588,21 +588,21 @@ ++NumBUInlines; } else { if (!Printed) - std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; - std::cerr << " calls " << CalledFuncs.size() + llvm_cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; + llvm_cerr << " calls " << CalledFuncs.size() << " fns from site: " << CS.getCallSite().getInstruction() << " " << *CS.getCallSite().getInstruction(); - std::cerr << " Fns ="; + llvm_cerr << " Fns ="; unsigned NumPrinted = 0; for (std::vector::iterator I = CalledFuncs.begin(), E = CalledFuncs.end(); I != E; ++I) { - if (NumPrinted++ < 8) std::cerr << " " << (*I)->getName(); + if (NumPrinted++ < 8) llvm_cerr << " " << (*I)->getName(); // Add the call edges to the call graph. ActualCallees.insert(std::make_pair(TheCall, *I)); } - std::cerr << "\n"; + llvm_cerr << "\n"; // See if we already computed a graph for this set of callees. std::sort(CalledFuncs.begin(), CalledFuncs.end()); @@ -645,7 +645,7 @@ // Clean up the final graph! GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals); } else { - std::cerr << "***\n*** RECYCLED GRAPH ***\n***\n"; + llvm_cerr << "***\n*** RECYCLED GRAPH ***\n***\n"; } GI = IndCallGraph.first; @@ -685,7 +685,7 @@ E = MainSM.global_end(); I != E; ++I) RC.getClonedNH(MainSM[*I]); - //Graph.writeGraphToFile(std::cerr, "bu_" + F.getName()); + //Graph.writeGraphToFile(llvm_cerr, "bu_" + F.getName()); } static const Function *getFnForValue(const Value *V) { @@ -746,8 +746,8 @@ return; } - std::cerr << *From; - std::cerr << *To; + llvm_cerr << *From; + llvm_cerr << *To; assert(0 && "Do not know how to copy this yet!"); abort(); } Index: llvm/lib/Analysis/DataStructure/CallTargets.cpp diff -u llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.4 llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.5 --- llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.4 Sun Aug 27 17:31:12 2006 +++ llvm/lib/Analysis/DataStructure/CallTargets.cpp Tue Nov 28 17:33:06 2006 @@ -23,9 +23,9 @@ #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/ADT/Statistic.h" -#include +#include "llvm/Support/Streams.h" +#include #include "llvm/Constants.h" - using namespace llvm; namespace { @@ -58,7 +58,7 @@ } if (N->isComplete() && !IndMap[cs].size()) { ++CompleteEmpty; - std::cerr << "Call site empty: '" + llvm_cerr << "Call site empty: '" << cs.getInstruction()->getName() << "' In '" << cs.getInstruction()->getParent()->getParent()->getName() Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.251 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.252 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.251 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Nov 28 17:33:06 2006 @@ -25,6 +25,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/Timer.h" #include #include @@ -1262,7 +1263,7 @@ } // dump - Allow inspection of graph in a debugger. -void DSGraph::dump() const { print(std::cerr); } +void DSGraph::dump() const { print(llvm_cerr); } /// remapLinks - Change all of the Links in the current node according to the Index: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.21 llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.22 --- llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.21 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/DataStructure/DataStructureStats.cpp Tue Nov 28 17:33:06 2006 @@ -17,8 +17,9 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include +#include using namespace llvm; namespace { @@ -91,7 +92,7 @@ totalNumCallees += Callees.size(); ++numIndirectCalls; } else - std::cerr << "WARNING: No callee in Function '" << F.getName() + llvm_cerr << "WARNING: No callee in Function '" << F.getName() << "' at call: \n" << *I->getCallSite().getInstruction(); } @@ -100,7 +101,7 @@ NumIndirectCalls += numIndirectCalls; if (numIndirectCalls) - std::cout << " In function " << F.getName() << ": " + llvm_cout << " In function " << F.getName() << ": " << (totalNumCallees / (double) numIndirectCalls) << " average callees per indirect call\n"; } Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.50 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.51 --- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.50 Fri Nov 17 01:33:59 2006 +++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp Tue Nov 28 17:33:06 2006 @@ -26,7 +26,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/STLExtras.h" -#include using namespace llvm; namespace { @@ -91,7 +90,7 @@ if (MainFunc && !MainFunc->isExternal()) { processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); } else { - std::cerr << "Fold Graphs: No 'main' function found!\n"; + llvm_cerr << "Fold Graphs: No 'main' function found!\n"; } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) @@ -173,8 +172,8 @@ FuncECs.insert(I->second); // -- Make sure function has equiv class FirstFunc = I->second; // -- First callee at this site } else { // Else indirect call - // DEBUG(std::cerr << "CALLEE: " << I->second->getName() - // << " from : " << I->first); + // DOUT << "CALLEE: " << I->second->getName() + // << " from : " << I->first; if (I->first != LastInst) { // This is the first callee from this call site. LastInst = I->first; Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.21 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.22 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.21 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Tue Nov 28 17:33:06 2006 @@ -26,10 +26,9 @@ #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/Value.h" -#include #include - using namespace llvm; namespace { @@ -85,7 +84,7 @@ DSGC::DSGC() { if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() && CheckFlags.empty() && AbortIfMerged.empty()) { - std::cerr << "The -datastructure-gc is useless if you don't specify any" + llvm_cerr << "The -datastructure-gc is useless if you don't specify any" " -dsgc-* options. See the -help-hidden output for a list.\n"; abort(); } @@ -124,8 +123,8 @@ for (DSGraph::node_const_iterator I = G.node_begin(), E = G.node_end(); I != E; ++I) if (I->isNodeCompletelyFolded()) { - std::cerr << "Node is collapsed: "; - I->print(std::cerr, &G); + llvm_cerr << "Node is collapsed: "; + I->print(llvm_cerr, &G); abort(); } } @@ -143,7 +142,7 @@ E = CheckFlags.end(); I != E; ++I) { std::string::size_type ColonPos = I->rfind(':'); if (ColonPos == std::string::npos) { - std::cerr << "Error: '" << *I + llvm_cerr << "Error: '" << *I << "' is an invalid value for the --dsgc-check-flags option!\n"; abort(); } @@ -159,7 +158,7 @@ case 'M': Flags |= DSNode::Modified; break; case 'R': Flags |= DSNode::Read; break; case 'A': Flags |= DSNode::Array; break; - default: std::cerr << "Invalid DSNode flag!\n"; abort(); + default: llvm_cerr << "Invalid DSNode flag!\n"; abort(); } CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags; } @@ -177,25 +176,25 @@ // Verify it is not collapsed if it is not supposed to be... if (N->isNodeCompletelyFolded() && AbortIfCollapsedS.count(Name)) { - std::cerr << "Node for value '%" << Name << "' is collapsed: "; - N->print(std::cerr, &G); + llvm_cerr << "Node for value '%" << Name << "' is collapsed: "; + N->print(llvm_cerr, &G); abort(); } if (CheckFlagsM.count(Name) && CheckFlagsM[Name] != N->getNodeFlags()) { - std::cerr << "Node flags are not as expected for node: " << Name + llvm_cerr << "Node flags are not as expected for node: " << Name << " (" << CheckFlagsM[Name] << ":" <getNodeFlags() << ")\n"; - N->print(std::cerr, &G); + N->print(llvm_cerr, &G); abort(); } // Verify that it is not merged if it is not supposed to be... if (AbortIfMergedS.count(Name)) { if (AbortIfMergedNodes.count(N)) { - std::cerr << "Nodes for values '%" << Name << "' and '%" + llvm_cerr << "Nodes for values '%" << Name << "' and '%" << AbortIfMergedNodes[N] << "' is merged: "; - N->print(std::cerr, &G); + N->print(llvm_cerr, &G); abort(); } AbortIfMergedNodes[N] = Name; From isanbard at gmail.com Tue Nov 28 17:33:23 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 17:33:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200611282333.kASNXNIq029140@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.91 -> 1.92 --- Log message: Convert to using llvm streams instead of iostreams. --- Diffs of the changes: (+1 -1) BasicAliasAnalysis.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.91 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.92 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.91 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue Nov 28 17:33:06 2006 @@ -745,7 +745,7 @@ assert(Offset1= SizeMax) { - //std::cerr << "Determined that these two GEP's don't alias [" + //llvm_cerr << "Determined that these two GEP's don't alias [" // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2; return NoAlias; } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200611290020.kAT0KSD6030273@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.42 -> 1.43 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+21 -21) llvm-ld.cpp | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.42 llvm/tools/llvm-ld/llvm-ld.cpp:1.43 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.42 Sat Nov 11 13:59:25 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Tue Nov 28 18:19:40 2006 @@ -32,12 +32,11 @@ #include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/SystemUtils.h" #include "llvm/System/Signals.h" #include -#include #include - using namespace llvm; // Input/Output Options @@ -109,7 +108,7 @@ /// Message - The message to print to standard error. /// static int PrintAndReturn(const std::string &Message) { - std::cerr << progname << ": " << Message << "\n"; + llvm_cerr << progname << ": " << Message << "\n"; return 1; } @@ -208,7 +207,8 @@ sys::RemoveFileOnSignal(sys::Path(FileName)); // Write it out - WriteBytecodeToFile(M, Out, !DisableCompression); + llvm_ostream L(Out); + WriteBytecodeToFile(M, L, !DisableCompression); // Close the bytecode file. Out.close(); @@ -351,12 +351,12 @@ std::string ErrMsg; sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0]); if (llvmstub.isEmpty()) { - std::cerr << "Could not find llvm-stub.exe executable!\n"; + llvm_cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; exit(1); } @@ -518,14 +518,14 @@ sys::Path target(RealBytecodeOutput); target.eraseFromDisk(); if (tmp_output.renamePathOnDisk(target, &ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } } else return PrintAndReturn( "Post-link optimization output is not bytecode"); } else { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } } @@ -554,18 +554,18 @@ return PrintAndReturn("Failed to find gcc"); // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating Assembly Code\n"; + if (Verbose) llvm_cout << "Generating Assembly Code\n"; std::string ErrMsg; if (0 != GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc, ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } - if (Verbose) std::cout << "Generating Native Code\n"; + if (Verbose) llvm_cout << "Generating Native Code\n"; if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(), LinkItems,gcc,envp,ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } @@ -589,18 +589,18 @@ return PrintAndReturn("Failed to find gcc"); // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating Assembly Code\n"; + if (Verbose) llvm_cout << "Generating Assembly Code\n"; std::string ErrMsg; if (0 != GenerateCFile( CFile.toString(), RealBytecodeOutput, llc, ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } - if (Verbose) std::cout << "Generating Native Code\n"; + if (Verbose) llvm_cout << "Generating Native Code\n"; if (0 != GenerateNative(OutputFilename, CFile.toString(), LinkItems, gcc, envp, ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } @@ -614,26 +614,26 @@ // Make the script executable... std::string ErrMsg; if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } // Make the bytecode file readable and directly executable in LLEE as well if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } } return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 18:20:24 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:24 -0600 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200611290020.kAT0KOZO030219@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.25 -> 1.26 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+10 -8) lto.cpp | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.25 llvm/tools/lto/lto.cpp:1.26 --- llvm/tools/lto/lto.cpp:1.25 Thu Oct 26 15:46:22 2006 +++ llvm/tools/lto/lto.cpp Tue Nov 28 18:19:40 2006 @@ -37,10 +37,10 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Analysis/LoadValueNumbering.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include "llvm/LinkTimeOptimizer.h" #include -#include - +#include using namespace llvm; extern "C" @@ -361,7 +361,8 @@ std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "0.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - WriteBytecodeToFile(bigOne, Out, true); + llvm_ostream L(Out); + WriteBytecodeToFile(bigOne, L, true); } // Strip leading underscore because it was added to match names @@ -377,17 +378,17 @@ std::string ErrMsg; sys::Path TempDir = sys::Path::GetTemporaryDirectory(&ErrMsg); if (TempDir.isEmpty()) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; return LTO_WRITE_FAILURE; } sys::Path tmpAsmFilePath(TempDir); if (!tmpAsmFilePath.appendComponent("lto")) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; TempDir.eraseFromDisk(true); return LTO_WRITE_FAILURE; } if (tmpAsmFilePath.createTemporaryFileOnDisk(&ErrMsg)) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; TempDir.eraseFromDisk(true); return LTO_WRITE_FAILURE; } @@ -414,7 +415,8 @@ std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "1.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - WriteBytecodeToFile(bigOne, Out, true); + llvm_ostream L(Out); + WriteBytecodeToFile(bigOne, L, true); } targetTriple = bigOne->getTargetTriple(); @@ -443,7 +445,7 @@ args.push_back(0); if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1, &ErrMsg)) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; return LTO_ASM_FAILURE; } From isanbard at gmail.com Tue Nov 28 18:20:29 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200611290020.kAT0KTGq030298@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.22 -> 1.23 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+5 -0) Passes.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.22 llvm/include/llvm/CodeGen/Passes.h:1.23 --- llvm/include/llvm/CodeGen/Passes.h:1.22 Tue Nov 7 13:33:46 2006 +++ llvm/include/llvm/CodeGen/Passes.h Tue Nov 28 18:19:40 2006 @@ -70,6 +70,11 @@ /// FunctionPass *createLinearScanRegisterAllocator(); + /// PriorityBasedGraphColoringRegisterAllocator Pass - This pass implements + /// the priority-based graph coloring register allocator by Chow & Hennessey, + /// a global register allocator. + FunctionPass *createGraphColoringRegisterAllocator(); + /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, /// and eliminates abstract frame references. /// From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/llvm-link.cpp Message-ID: <200611290020.kAT0KSMP030287@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: llvm-link.cpp updated: 1.58 -> 1.59 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+20 -19) llvm-link.cpp | 39 ++++++++++++++++++++------------------- 1 files changed, 20 insertions(+), 19 deletions(-) Index: llvm/tools/llvm-link/llvm-link.cpp diff -u llvm/tools/llvm-link/llvm-link.cpp:1.58 llvm/tools/llvm-link/llvm-link.cpp:1.59 --- llvm/tools/llvm-link/llvm-link.cpp:1.58 Thu Jul 7 18:21:43 2005 +++ llvm/tools/llvm-link/llvm-link.cpp Tue Nov 28 18:19:40 2006 @@ -18,12 +18,12 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/Writer.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" #include "llvm/System/Path.h" #include #include #include - using namespace llvm; static cl::list @@ -51,23 +51,23 @@ static inline std::auto_ptr LoadFile(const std::string &FN) { sys::Path Filename; if (!Filename.set(FN)) { - std::cerr << "Invalid file name: '" << FN << "'\n"; + llvm_cerr << "Invalid file name: '" << FN << "'\n"; return std::auto_ptr(); } std::string ErrorMessage; if (Filename.exists()) { - if (Verbose) std::cerr << "Loading '" << Filename.c_str() << "'\n"; + if (Verbose) llvm_cerr << "Loading '" << Filename.c_str() << "'\n"; Module* Result = ParseBytecodeFile(Filename.toString(), &ErrorMessage); if (Result) return std::auto_ptr(Result); // Load successful! if (Verbose) { - std::cerr << "Error opening bytecode file: '" << Filename.c_str() << "'"; - if (ErrorMessage.size()) std::cerr << ": " << ErrorMessage; - std::cerr << "\n"; + llvm_cerr << "Error opening bytecode file: '" << Filename.c_str() << "'"; + if (ErrorMessage.size()) llvm_cerr << ": " << ErrorMessage; + llvm_cerr << "\n"; } } else { - std::cerr << "Bytecode file: '" << Filename.c_str() + llvm_cerr << "Bytecode file: '" << Filename.c_str() << "' does not exist.\n"; } @@ -85,7 +85,7 @@ std::auto_ptr Composite(LoadFile(InputFilenames[BaseArg])); if (Composite.get() == 0) { - std::cerr << argv[0] << ": error loading file '" + llvm_cerr << argv[0] << ": error loading file '" << InputFilenames[BaseArg] << "'\n"; return 1; } @@ -93,15 +93,15 @@ for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { std::auto_ptr M(LoadFile(InputFilenames[i])); if (M.get() == 0) { - std::cerr << argv[0] << ": error loading file '" + llvm_cerr << argv[0] << ": error loading file '" << InputFilenames[i] << "'\n"; return 1; } - if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n"; + if (Verbose) llvm_cerr << "Linking in '" << InputFilenames[i] << "'\n"; if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) { - std::cerr << argv[0] << ": link error in '" << InputFilenames[i] + llvm_cerr << argv[0] << ": link error in '" << InputFilenames[i] << "': " << ErrorMessage << "\n"; return 1; } @@ -110,14 +110,14 @@ // TODO: Iterate over the -l list and link in any modules containing // global symbols that have not been resolved so far. - if (DumpAsm) std::cerr << "Here's the assembly:\n" << *Composite.get(); + if (DumpAsm) llvm_cerr << "Here's the assembly:\n" << *Composite.get(); // FIXME: cout is not binary! std::ostream *Out = &std::cout; // Default to printing to stdout... if (OutputFilename != "-") { if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists!\n" << "Use -f command line argument to force output\n"; return 1; @@ -126,7 +126,7 @@ std::ios::binary; Out = new std::ofstream(OutputFilename.c_str(), io_mode); if (!Out->good()) { - std::cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n"; + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n"; return 1; } @@ -136,19 +136,20 @@ } if (verifyModule(*Composite.get())) { - std::cerr << argv[0] << ": linked module is broken!\n"; + llvm_cerr << argv[0] << ": linked module is broken!\n"; return 1; } - if (Verbose) std::cerr << "Writing bytecode...\n"; - WriteBytecodeToFile(Composite.get(), *Out, !NoCompress); + if (Verbose) llvm_cerr << "Writing bytecode...\n"; + llvm_ostream L(*Out); + WriteBytecodeToFile(Composite.get(), L, !NoCompress); if (Out != &std::cout) delete Out; return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 18:20:25 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:25 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/CallGraph.h Message-ID: <200611290020.kAT0KPd9030224@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: CallGraph.h updated: 1.50 -> 1.51 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+6 -0) CallGraph.h | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.50 llvm/include/llvm/Analysis/CallGraph.h:1.51 --- llvm/include/llvm/Analysis/CallGraph.h:1.50 Wed Jul 12 13:29:36 2006 +++ llvm/include/llvm/Analysis/CallGraph.h Tue Nov 28 18:19:40 2006 @@ -152,6 +152,9 @@ /// void initialize(Module &M); + void print(llvm_ostream &o, const Module *M) const { + if (o.stream()) print(*o.stream(), M); + } virtual void print(std::ostream &o, const Module *M) const; void dump() const; @@ -198,6 +201,9 @@ /// dump - Print out this call graph node. /// void dump() const; + void print(llvm_ostream &OS) const { + if (OS.stream()) print(*OS.stream()); + } void print(std::ostream &OS) const; //===--------------------------------------------------------------------- From isanbard at gmail.com Tue Nov 28 18:20:29 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Streams.h Message-ID: <200611290020.kAT0KTT9030305@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Streams.h updated: 1.3 -> 1.4 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+1 -0) Streams.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Support/Streams.h diff -u llvm/include/llvm/Support/Streams.h:1.3 llvm/include/llvm/Support/Streams.h:1.4 --- llvm/include/llvm/Support/Streams.h:1.3 Mon Nov 27 04:45:49 2006 +++ llvm/include/llvm/Support/Streams.h Tue Nov 28 18:19:40 2006 @@ -43,6 +43,7 @@ } bool operator == (const std::ostream &OS) { return &OS == Stream; } + bool operator == (const llvm_ostream &OS) { return OS.Stream == Stream; } }; extern llvm_ostream llvm_null; From isanbard at gmail.com Tue Nov 28 18:20:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:27 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp gccld.cpp Message-ID: <200611290020.kAT0KRxT030243@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.65 -> 1.66 gccld.cpp updated: 1.111 -> 1.112 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+24 -22) GenerateCode.cpp | 11 ++++++----- gccld.cpp | 35 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.65 llvm/tools/gccld/GenerateCode.cpp:1.66 --- llvm/tools/gccld/GenerateCode.cpp:1.65 Wed Nov 22 17:49:16 2006 +++ llvm/tools/gccld/GenerateCode.cpp Tue Nov 28 18:19:40 2006 @@ -27,7 +27,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/CommandLine.h" - +#include "llvm/Support/Streams.h" using namespace llvm; namespace { @@ -123,10 +123,10 @@ } static void dumpArgs(const char **args) { - std::cerr << *args++; + llvm_cerr << *args++; while (*args) - std::cerr << ' ' << *args++; - std::cerr << '\n' << std::flush; + llvm_cerr << ' ' << *args++; + llvm_cerr << '\n' << std::flush; } static inline void addPass(PassManager &PM, Pass *P) { @@ -283,7 +283,8 @@ Passes.add(createVerifierPass()); // Add the pass that writes bytecode to the output file... - addPass(Passes, new WriteBytecodePass(Out, false, !NoCompress)); + llvm_ostream L(*Out); + addPass(Passes, new WriteBytecodePass(&L, false, !NoCompress)); // Run our queue of passes all at once now, efficiently. Passes.run(*M); Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.111 llvm/tools/gccld/gccld.cpp:1.112 --- llvm/tools/gccld/gccld.cpp:1.111 Fri Sep 1 15:35:17 2006 +++ llvm/tools/gccld/gccld.cpp Tue Nov 28 18:19:40 2006 @@ -31,6 +31,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" #include "llvm/Support/SystemUtils.h" #include @@ -126,7 +127,7 @@ /// Message - The message to print to standard error. /// static int PrintAndReturn(const char *progname, const std::string &Message) { - std::cerr << progname << ": " << Message << "\n"; + llvm_cerr << progname << ": " << Message << "\n"; return 1; } @@ -140,11 +141,11 @@ std::string ErrMsg; sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0]); if (llvmstub.isEmpty()) { - std::cerr << "Could not find llvm-stub.exe executable!\n"; + llvm_cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; exit(1); } @@ -324,18 +325,18 @@ return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating Assembly Code\n"; + if (Verbose) llvm_cout << "Generating Assembly Code\n"; std::string ErrMsg; if (0 != GenerateAssembly( AssemblyFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } - if (Verbose) std::cout << "Generating Native Code\n"; + if (Verbose) llvm_cout << "Generating Native Code\n"; if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, NoInternalize, RPath, SOName, ErrMsg, Verbose) ) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } @@ -364,18 +365,18 @@ return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating C Source Code\n"; + if (Verbose) llvm_cout << "Generating C Source Code\n"; std::string ErrMsg; if (0 != GenerateCFile( CFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } - if (Verbose) std::cout << "Generating Native Code\n"; + if (Verbose) llvm_cout << "Generating Native Code\n"; if (0 != GenerateNative(OutputFilename, CFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, NoInternalize, RPath, SOName, ErrMsg, Verbose)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 2; } @@ -392,11 +393,11 @@ // Make the bytecode file readable and directly executable in LLEE std::string ErrMsg; if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } } @@ -404,18 +405,18 @@ // Make the output, whether native or script, executable as well... std::string ErrMsg; if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + llvm_cerr << argv[0] << ": " << ErrMsg << "\n"; return 1; } } catch (const char*msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; exitCode = 1; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; exitCode = 2; } catch (...) { // This really shouldn't happen, but just in case .... - std::cerr << argv[0] << ": An unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": An unexpected unknown exception occurred.\n"; exitCode = 3; } From isanbard at gmail.com Tue Nov 28 18:20:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:27 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200611290020.kAT0KRmv030236@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.120 -> 1.121 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+5 -2) opt.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.120 llvm/tools/opt/opt.cpp:1.121 --- llvm/tools/opt/opt.cpp:1.120 Tue Nov 28 17:33:06 2006 +++ llvm/tools/opt/opt.cpp Tue Nov 28 18:19:40 2006 @@ -28,6 +28,7 @@ #include "llvm/Support/Timer.h" #include "llvm/LinkAllPasses.h" #include "llvm/LinkAllVMCore.h" +#include #include #include #include @@ -251,8 +252,10 @@ Passes.add(createVerifierPass()); // Write bytecode out to disk or cout as the last step... - if (!NoOutput && !AnalyzeOnly) - Passes.add(new WriteBytecodePass(Out, Out != &std::cout, !NoCompress)); + if (!NoOutput && !AnalyzeOnly) { + llvm_ostream L(*Out); + Passes.add(new WriteBytecodePass(&L, Out != &std::cout, !NoCompress)); + } // Now that we have all of the passes ready, run them. Passes.run(*M.get()); From isanbard at gmail.com Tue Nov 28 18:20:29 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/WriteBytecodePass.h Writer.h Message-ID: <200611290020.kAT0KTDn030311@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: WriteBytecodePass.h updated: 1.16 -> 1.17 Writer.h updated: 1.11 -> 1.12 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+7 -7) WriteBytecodePass.h | 9 +++++---- Writer.h | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.16 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.17 --- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.16 Mon Aug 28 12:30:49 2006 +++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Tue Nov 28 18:19:40 2006 @@ -17,18 +17,19 @@ #include "llvm/Pass.h" #include "llvm/Bytecode/Writer.h" -#include namespace llvm { +class llvm_ostream; + class WriteBytecodePass : public ModulePass { - std::ostream *Out; // ostream to print on + llvm_ostream *Out; // ostream to print on bool DeleteStream; bool CompressFile; public: WriteBytecodePass() - : Out(&std::cout), DeleteStream(false), CompressFile(true) {} - WriteBytecodePass(std::ostream *o, bool DS = false, bool CF = true) + : Out(&llvm_cout), DeleteStream(false), CompressFile(true) {} + WriteBytecodePass(llvm_ostream *o, bool DS = false, bool CF = true) : Out(o), DeleteStream(DS), CompressFile(CF) {} inline ~WriteBytecodePass() { Index: llvm/include/llvm/Bytecode/Writer.h diff -u llvm/include/llvm/Bytecode/Writer.h:1.11 llvm/include/llvm/Bytecode/Writer.h:1.12 --- llvm/include/llvm/Bytecode/Writer.h:1.11 Fri Jul 28 17:09:37 2006 +++ llvm/include/llvm/Bytecode/Writer.h Tue Nov 28 18:19:40 2006 @@ -15,14 +15,13 @@ #ifndef LLVM_BYTECODE_WRITER_H #define LLVM_BYTECODE_WRITER_H -#include - namespace llvm { + class llvm_ostream; class Module; /// WriteBytecodeToFile - Write the specified module to the specified output /// stream. If compress is set to true, try to use compression when writing /// out the file. This can never fail if M is a well-formed module. - void WriteBytecodeToFile(const Module *M, std::ostream &Out, + void WriteBytecodeToFile(const Module *M, llvm_ostream &Out, bool compress = true); } // End llvm namespace From isanbard at gmail.com Tue Nov 28 18:20:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:27 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp Message-ID: <200611290020.kAT0KROY030234@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: OptimizerDriver.cpp updated: 1.46 -> 1.47 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+25 -21) OptimizerDriver.cpp | 46 +++++++++++++++++++++++++--------------------- 1 files changed, 25 insertions(+), 21 deletions(-) Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.46 llvm/tools/bugpoint/OptimizerDriver.cpp:1.47 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.46 Wed Sep 13 23:20:17 2006 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Tue Nov 28 18:19:40 2006 @@ -27,6 +27,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Path.h" #include "llvm/System/Program.h" #include "llvm/Config/alloca.h" @@ -55,7 +56,8 @@ std::ofstream Out(Filename.c_str(), io_mode); if (!Out.good()) return true; try { - WriteBytecodeToFile(M ? M : Program, Out, /*compression=*/true); + llvm_ostream L(Out); + WriteBytecodeToFile(M ? M : Program, L, /*compression=*/true); } catch (...) { return true; } @@ -72,15 +74,15 @@ // std::string Filename = "bugpoint-" + ID + ".bc"; if (writeProgramToFile(Filename)) { - std::cerr << "Error opening file '" << Filename << "' for writing!\n"; + llvm_cerr << "Error opening file '" << Filename << "' for writing!\n"; return; } - std::cout << "Emitted bytecode to '" << Filename << "'\n"; + llvm_cout << "Emitted bytecode to '" << Filename << "'\n"; if (NoFlyer || PassesToRun.empty()) return; - std::cout << "\n*** You can reproduce the problem with: "; - std::cout << "opt " << Filename << " "; - std::cout << getPassesString(PassesToRun) << "\n"; + llvm_cout << "\n*** You can reproduce the problem with: "; + llvm_cout << "opt " << Filename << " "; + llvm_cout << getPassesString(PassesToRun) << "\n"; } int BugDriver::runPassesAsChild(const std::vector &Passes) { @@ -89,7 +91,7 @@ std::ios::binary; std::ofstream OutFile(ChildOutput.c_str(), io_mode); if (!OutFile.good()) { - std::cerr << "Error opening bytecode file: " << ChildOutput << "\n"; + llvm_cerr << "Error opening bytecode file: " << ChildOutput << "\n"; return 1; } @@ -101,14 +103,15 @@ if (Passes[i]->getNormalCtor()) PM.add(Passes[i]->getNormalCtor()()); else - std::cerr << "Cannot create pass yet: " << Passes[i]->getPassName() + llvm_cerr << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n"; } // Check that the module is well formed on completion of optimization PM.add(createVerifierPass()); // Write bytecode out to disk as the last step... - PM.add(new WriteBytecodePass(&OutFile)); + llvm_ostream L(OutFile); + PM.add(new WriteBytecodePass(&L)); // Run all queued passes. PM.run(*Program); @@ -128,11 +131,11 @@ std::string &OutputFilename, bool DeleteOutput, bool Quiet) const { // setup the output file name - std::cout << std::flush; + llvm_cout << std::flush; sys::Path uniqueFilename("bugpoint-output.bc"); std::string ErrMsg; if (uniqueFilename.makeUnique(true, &ErrMsg)) { - std::cerr << getToolName() << ": Error making unique filename: " + llvm_cerr << getToolName() << ": Error making unique filename: " << ErrMsg << "\n"; return(1); } @@ -141,7 +144,7 @@ // set up the input file name sys::Path inputFilename("bugpoint-input.bc"); if (inputFilename.makeUnique(true, &ErrMsg)) { - std::cerr << getToolName() << ": Error making unique filename: " + llvm_cerr << getToolName() << ": Error making unique filename: " << ErrMsg << "\n"; return(1); } @@ -149,10 +152,11 @@ std::ios::binary; std::ofstream InFile(inputFilename.c_str(), io_mode); if (!InFile.good()) { - std::cerr << "Error opening bytecode file: " << inputFilename << "\n"; + llvm_cerr << "Error opening bytecode file: " << inputFilename << "\n"; return(1); } - WriteBytecodeToFile(Program,InFile,false); + llvm_ostream L(InFile); + WriteBytecodeToFile(Program,L,false); InFile.close(); // setup the child process' arguments @@ -203,17 +207,17 @@ if (!Quiet) { if (result == 0) - std::cout << "Success!\n"; + llvm_cout << "Success!\n"; else if (result > 0) - std::cout << "Exited with error code '" << result << "'\n"; + llvm_cout << "Exited with error code '" << result << "'\n"; else if (result < 0) { if (result == -1) - std::cout << "Execute failed: " << ErrMsg << "\n"; + llvm_cout << "Execute failed: " << ErrMsg << "\n"; else - std::cout << "Crashed with signal #" << abs(result) << "\n"; + llvm_cout << "Crashed with signal #" << abs(result) << "\n"; } if (result & 0x01000000) - std::cout << "Dumped core\n"; + llvm_cout << "Dumped core\n"; } // Was the child successful? @@ -231,7 +235,7 @@ std::string BytecodeResult; if (runPasses(Passes, BytecodeResult, false/*delete*/, true/*quiet*/)) { if (AutoDebugCrashes) { - std::cerr << " Error running this sequence of passes" + llvm_cerr << " Error running this sequence of passes" << " on the input program!\n"; delete OldProgram; EmitProgressBytecode("pass-error", false); @@ -246,7 +250,7 @@ Module *Ret = ParseInputFile(BytecodeResult); if (Ret == 0) { - std::cerr << getToolName() << ": Error reading bytecode file '" + llvm_cerr << getToolName() << ": Error reading bytecode file '" << BytecodeResult << "'!\n"; exit(1); } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Printer.cpp Steensgaard.cpp Message-ID: <200611290020.kAT0KS4R030289@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.161 -> 1.162 Printer.cpp updated: 1.87 -> 1.88 Steensgaard.cpp updated: 1.65 -> 1.66 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+10 -7) Local.cpp | 5 ++--- Printer.cpp | 5 +++-- Steensgaard.cpp | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.161 llvm/lib/Analysis/DataStructure/Local.cpp:1.162 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.161 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Nov 28 18:19:40 2006 @@ -24,7 +24,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" -#include // FIXME: This should eventually be a FunctionPass that is automatically // aggregated into a Pass. @@ -435,7 +434,7 @@ // Variable index into a node. We must merge all of the elements of the // sequential type here. if (isa(STy)) - std::cerr << "Pointer indexing not handled yet!\n"; + llvm_cerr << "Pointer indexing not handled yet!\n"; else { const ArrayType *ATy = cast(STy); unsigned ElSize = TD.getTypeSize(CurTy); @@ -1062,7 +1061,7 @@ if (DisableDirectCallOpt || !isa(Callee)) { CalleeNode = getValueDest(*Callee).getNode(); if (CalleeNode == 0) { - std::cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; + llvm_cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; return; // Calling a null pointer? } } Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.87 llvm/lib/Analysis/DataStructure/Printer.cpp:1.88 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.87 Fri Nov 17 03:44:28 2006 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Tue Nov 28 18:19:40 2006 @@ -19,9 +19,10 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" #include "llvm/Config/config.h" -#include +#include #include #include using namespace llvm; @@ -36,7 +37,7 @@ Statistic<> NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)"); } -void DSNode::dump() const { print(std::cerr, 0); } +void DSNode::dump() const { print(llvm_cerr, 0); } static std::string getCaption(const DSNode *N, const DSGraph *G) { std::stringstream OS; Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.65 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.66 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.65 Sun Aug 27 20:02:49 2006 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Tue Nov 28 18:19:40 2006 @@ -20,7 +20,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Module.h" #include "llvm/Support/Debug.h" -#include +#include using namespace llvm; namespace { @@ -53,6 +53,9 @@ } // print - Implement the Pass::print method... + void print(llvm_ostream O, const Module *M) const { + if (O.stream()) print(*O.stream(), M); + } void print(std::ostream &O, const Module *M) const { assert(ResultGraph && "Result graph has not yet been computed!"); ResultGraph->writeGraphToFile(O, "steensgaards"); @@ -188,7 +191,7 @@ // FIXME: We should be able to disable the globals graph for steens! //ResultGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals); - DEBUG(print(std::cerr, &M)); + print(DOUT, &M); return false; } From isanbard at gmail.com Tue Nov 28 18:20:29 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:29 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200611290020.kAT0KTXN030320@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.120 -> 1.121 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+8 -6) gccas.cpp | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.120 llvm/tools/gccas/gccas.cpp:1.121 --- llvm/tools/gccas/gccas.cpp:1.120 Wed Nov 22 17:49:16 2006 +++ llvm/tools/gccas/gccas.cpp Tue Nov 28 18:19:40 2006 @@ -23,10 +23,11 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" +#include #include #include - using namespace llvm; namespace { @@ -140,7 +141,7 @@ ParseError Err; std::auto_ptr M(ParseAssemblyFile(InputFilename,&Err)); if (M.get() == 0) { - std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; + llvm_cerr << argv[0] << ": " << Err.getMessage() << "\n"; return 1; } @@ -175,7 +176,7 @@ if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } @@ -194,7 +195,8 @@ Passes.add(createVerifierPass()); // Write bytecode to file... - Passes.add(new WriteBytecodePass(Out,false,!NoCompress)); + llvm_ostream L(*Out); + Passes.add(new WriteBytecodePass(&L,false,!NoCompress)); // Run our queue of passes all at once now, efficiently. Passes.run(*M.get()); @@ -202,9 +204,9 @@ if (Out != &std::cout) delete Out; return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-extract/llvm-extract.cpp Message-ID: <200611290020.kAT0KS8X030281@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-extract: llvm-extract.cpp updated: 1.30 -> 1.31 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+9 -6) llvm-extract.cpp | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-extract/llvm-extract.cpp diff -u llvm/tools/llvm-extract/llvm-extract.cpp:1.30 llvm/tools/llvm-extract/llvm-extract.cpp:1.31 --- llvm/tools/llvm-extract/llvm-extract.cpp:1.30 Fri Jun 16 13:23:48 2006 +++ llvm/tools/llvm-extract/llvm-extract.cpp Tue Nov 28 18:19:40 2006 @@ -19,7 +19,9 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" +#include #include #include using namespace llvm; @@ -51,14 +53,14 @@ std::auto_ptr M(ParseBytecodeFile(InputFilename)); if (M.get() == 0) { - std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; + llvm_cerr << argv[0] << ": bytecode didn't read correctly.\n"; return 1; } // Figure out which function we should extract Function *F = M.get()->getNamedFunction(ExtractFunc); if (F == 0) { - std::cerr << argv[0] << ": program doesn't contain function named '" + llvm_cerr << argv[0] << ": program doesn't contain function named '" << ExtractFunc << "'!\n"; return 1; } @@ -78,7 +80,7 @@ if (OutputFilename != "-") { // Not stdout? if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists!\n" << "Use -f command line argument to force output\n"; return 1; @@ -91,16 +93,17 @@ Out = &std::cout; } - Passes.add(new WriteBytecodePass(Out)); // Write bytecode to file... + llvm_ostream L(*Out); + Passes.add(new WriteBytecodePass(&L)); // Write bytecode to file... Passes.run(*M.get()); if (Out != &std::cout) delete Out; return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } return 1; } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp Message-ID: <200611290020.kAT0KSud030260@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.37 -> 1.38 CallGraph.cpp updated: 1.58 -> 1.59 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+33 -29) Andersens.cpp | 49 ++++++++++++++++++++++++------------------------- CallGraph.cpp | 13 +++++++++---- 2 files changed, 33 insertions(+), 29 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.37 llvm/lib/Analysis/IPA/Andersens.cpp:1.38 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.37 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Tue Nov 28 18:19:40 2006 @@ -62,7 +62,6 @@ #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" #include -#include using namespace llvm; namespace { @@ -534,7 +533,7 @@ case Instruction::BitCast: return getNodeForConstantPointer(CE->getOperand(0)); default: - std::cerr << "Constant Expr not yet handled: " << *CE << "\n"; + llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n"; assert(0); } } else { @@ -561,7 +560,7 @@ case Instruction::BitCast: return getNodeForConstantPointerTarget(CE->getOperand(0)); default: - std::cerr << "Constant Expr not yet handled: " << *CE << "\n"; + llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n"; assert(0); } } else { @@ -787,7 +786,7 @@ return; default: // Is this something we aren't handling yet? - std::cerr << "Unknown instruction: " << I; + llvm_cerr << "Unknown instruction: " << I; abort(); } } @@ -1105,13 +1104,13 @@ void Andersens::PrintNode(Node *N) { if (N == &GraphNodes[UniversalSet]) { - std::cerr << ""; + llvm_cerr << ""; return; } else if (N == &GraphNodes[NullPtr]) { - std::cerr << ""; + llvm_cerr << ""; return; } else if (N == &GraphNodes[NullObject]) { - std::cerr << ""; + llvm_cerr << ""; return; } @@ -1120,56 +1119,56 @@ if (Function *F = dyn_cast(V)) { if (isa(F->getFunctionType()->getReturnType()) && N == getReturnNode(F)) { - std::cerr << F->getName() << ":retval"; + llvm_cerr << F->getName() << ":retval"; return; } else if (F->getFunctionType()->isVarArg() && N == getVarargNode(F)) { - std::cerr << F->getName() << ":vararg"; + llvm_cerr << F->getName() << ":vararg"; return; } } if (Instruction *I = dyn_cast(V)) - std::cerr << I->getParent()->getParent()->getName() << ":"; + llvm_cerr << I->getParent()->getParent()->getName() << ":"; else if (Argument *Arg = dyn_cast(V)) - std::cerr << Arg->getParent()->getName() << ":"; + llvm_cerr << Arg->getParent()->getName() << ":"; if (V->hasName()) - std::cerr << V->getName(); + llvm_cerr << V->getName(); else - std::cerr << "(unnamed)"; + llvm_cerr << "(unnamed)"; if (isa(V) || isa(V)) if (N == getObject(V)) - std::cerr << ""; + llvm_cerr << ""; } void Andersens::PrintConstraints() { - std::cerr << "Constraints:\n"; + llvm_cerr << "Constraints:\n"; for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { - std::cerr << " #" << i << ": "; + llvm_cerr << " #" << i << ": "; Constraint &C = Constraints[i]; if (C.Type == Constraint::Store) - std::cerr << "*"; + llvm_cerr << "*"; PrintNode(C.Dest); - std::cerr << " = "; + llvm_cerr << " = "; if (C.Type == Constraint::Load) - std::cerr << "*"; + llvm_cerr << "*"; PrintNode(C.Src); - std::cerr << "\n"; + llvm_cerr << "\n"; } } void Andersens::PrintPointsToGraph() { - std::cerr << "Points-to graph:\n"; + llvm_cerr << "Points-to graph:\n"; for (unsigned i = 0, e = GraphNodes.size(); i != e; ++i) { Node *N = &GraphNodes[i]; - std::cerr << "[" << (N->end() - N->begin()) << "] "; + llvm_cerr << "[" << (N->end() - N->begin()) << "] "; PrintNode(N); - std::cerr << "\t--> "; + llvm_cerr << "\t--> "; for (Node::iterator I = N->begin(), E = N->end(); I != E; ++I) { - if (I != N->begin()) std::cerr << ", "; + if (I != N->begin()) llvm_cerr << ", "; PrintNode(*I); } - std::cerr << "\n"; + llvm_cerr << "\n"; } } Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.58 llvm/lib/Analysis/IPA/CallGraph.cpp:1.59 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.58 Mon Oct 9 12:28:13 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Tue Nov 28 18:19:40 2006 @@ -16,7 +16,8 @@ #include "llvm/Module.h" #include "llvm/Instructions.h" #include "llvm/Support/CallSite.h" -#include +#include "llvm/Support/Streams.h" +#include using namespace llvm; static bool isOnlyADirectCall(Function *F, CallSite CS) { @@ -72,6 +73,10 @@ AU.setPreservesAll(); } + void print(llvm_ostream &o, const Module *M) const { + if (o.stream()) print(*o.stream(), M); + } + virtual void print(std::ostream &o, const Module *M) const { o << "CallGraph Root is: "; if (Function *F = getRoot()->getFunction()) @@ -89,7 +94,7 @@ /// dump - Print out this call graph. /// inline void dump() const { - print(std::cerr, Mod); + print(llvm_cerr, Mod); } CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; } @@ -207,7 +212,7 @@ } void CallGraph::dump() const { - print(std::cerr, 0); + print(llvm_cerr, 0); } //===----------------------------------------------------------------------===// @@ -270,7 +275,7 @@ OS << "\n"; } -void CallGraphNode::dump() const { print(std::cerr); } +void CallGraphNode::dump() const { print(llvm_cerr); } void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { for (unsigned i = CalledFunctions.size(); ; --i) { From isanbard at gmail.com Tue Nov 28 18:20:29 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:29 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp Message-ID: <200611290020.kAT0KTZG030301@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.47 -> 1.48 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+12 -11) llvm-as.cpp | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.47 llvm/tools/llvm-as/llvm-as.cpp:1.48 --- llvm/tools/llvm-as/llvm-as.cpp:1.47 Fri Aug 18 03:43:06 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Tue Nov 28 18:19:40 2006 @@ -20,12 +20,12 @@ #include "llvm/Bytecode/Writer.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/SystemUtils.h" #include "llvm/System/Signals.h" #include #include #include - using namespace llvm; static cl::opt @@ -60,27 +60,27 @@ ParseError Err; std::auto_ptr M(ParseAssemblyFile(InputFilename,&Err)); if (M.get() == 0) { - std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; + llvm_cerr << argv[0] << ": " << Err.getMessage() << "\n"; return 1; } if (!DisableVerify) { std::string Err; if (verifyModule(*M.get(), ReturnStatusAction, &Err)) { - std::cerr << argv[0] + llvm_cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n"; - std::cerr << Err; + llvm_cerr << Err; return 1; } } - if (DumpAsm) std::cerr << "Here's the assembly:\n" << *M.get(); + if (DumpAsm) llvm_cerr << "Here's the assembly:\n" << *M.get(); if (OutputFilename != "") { // Specified an output filename? if (OutputFilename != "-") { // Not stdout? if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists!\n" << "Use -f command line argument to force output\n"; return 1; @@ -108,7 +108,7 @@ if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename + llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "': file exists!\n" << "Use -f command line argument to force output\n"; return 1; @@ -123,18 +123,19 @@ } if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } if (Force || !CheckBytecodeOutputToConsole(Out,true)) { - WriteBytecodeToFile(M.get(), *Out, !NoCompress); + llvm_ostream L(*Out); + WriteBytecodeToFile(M.get(), L, !NoCompress); } } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; exitCode = 1; } catch (...) { - std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; exitCode = 1; } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolutionExpander.cpp Message-ID: <200611290020.kAT0KSDZ030262@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolutionExpander.cpp updated: 1.5 -> 1.6 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+1 -1) ScalarEvolutionExpander.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.5 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.6 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.5 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp Tue Nov 28 18:19:40 2006 @@ -174,7 +174,7 @@ SCEVHandle IH = SCEVUnknown::get(I); // Get I as a "symbolic" SCEV. SCEVHandle V = S->evaluateAtIteration(IH); - //std::cerr << "Evaluated: " << *this << "\n to: " << *V << "\n"; + //llvm_cerr << "Evaluated: " << *this << "\n to: " << *V << "\n"; return expandInTy(V, Ty); } From isanbard at gmail.com Tue Nov 28 18:20:27 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp Writer.cpp Message-ID: <200611290020.kAT0KRRM030249@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: SlotCalculator.cpp updated: 1.74 -> 1.75 Writer.cpp updated: 1.129 -> 1.130 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+12 -11) SlotCalculator.cpp | 6 +++--- Writer.cpp | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.74 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.75 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.74 Wed Jun 7 17:20:03 2006 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Tue Nov 28 18:19:40 2006 @@ -31,8 +31,8 @@ using namespace llvm; #if 0 -#include -#define SC_DEBUG(X) std::cerr << X +#include "llvm/Support/Streams.h" +#define SC_DEBUG(X) llvm_cerr << X #else #define SC_DEBUG(X) #endif @@ -800,7 +800,7 @@ // Used for debugging DefSlot=-1 assertion... //if (Typ == Type::TypeTy) - // cerr << "Inserting type '" << cast(D)->getDescription() << "'!\n"; + // llvm_cerr << "Inserting type '"<(D)->getDescription() <<"'!\n"; if (Typ->isDerivedType()) { int ValSlot; Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.129 llvm/lib/Bytecode/Writer/Writer.cpp:1.130 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.129 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Tue Nov 28 18:19:40 2006 @@ -29,6 +29,7 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/Compressor.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Program.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" @@ -275,7 +276,7 @@ break; default: - std::cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to serialize" + llvm_cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to serialize" << " Type '" << T->getDescription() << "'\n"; break; } @@ -384,7 +385,7 @@ case Type::VoidTyID: case Type::LabelTyID: default: - std::cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to serialize" + llvm_cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to serialize" << " type '" << *CPV->getType() << "'\n"; break; } @@ -1225,13 +1226,13 @@ } } -void llvm::WriteBytecodeToFile(const Module *M, std::ostream &Out, +void llvm::WriteBytecodeToFile(const Module *M, llvm_ostream &Out, bool compress) { assert(M && "You can't write a null module!!"); // Make sure that std::cout is put into binary mode for systems // that care. - if (&Out == std::cout) + if (Out == llvm_cout) sys::Program::ChangeStdoutToBinary(); // Create a vector of unsigned char for the bytecode output. We @@ -1264,21 +1265,21 @@ compressed_magic[2] = 'v'; compressed_magic[3] = 'c'; - Out.write(compressed_magic,4); + Out.stream()->write(compressed_magic,4); // Compress everything after the magic number (which we altered) Compressor::compressToStream( (char*)(FirstByte+4), // Skip the magic number Buffer.size()-4, // Skip the magic number - Out // Where to write compressed data + *Out.stream() // Where to write compressed data ); } else { // We're not compressing, so just write the entire block. - Out.write((char*)FirstByte, Buffer.size()); + Out.stream()->write((char*)FirstByte, Buffer.size()); } // make sure it hits disk now - Out.flush(); + Out.stream()->flush(); } From isanbard at gmail.com Tue Nov 28 18:20:28 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:28 -0600 Subject: [llvm-commits] CVS: llvm/examples/ModuleMaker/ModuleMaker.cpp Message-ID: <200611290020.kAT0KSkr030271@zion.cs.uiuc.edu> Changes in directory llvm/examples/ModuleMaker: ModuleMaker.cpp updated: 1.9 -> 1.10 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+2 -3) ModuleMaker.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/examples/ModuleMaker/ModuleMaker.cpp diff -u llvm/examples/ModuleMaker/ModuleMaker.cpp:1.9 llvm/examples/ModuleMaker/ModuleMaker.cpp:1.10 --- llvm/examples/ModuleMaker/ModuleMaker.cpp:1.9 Fri Oct 20 02:07:23 2006 +++ llvm/examples/ModuleMaker/ModuleMaker.cpp Tue Nov 28 18:19:40 2006 @@ -18,8 +18,7 @@ #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Bytecode/Writer.h" -#include - +#include "llvm/Support/Streams.h" using namespace llvm; int main() { @@ -54,7 +53,7 @@ BB->getInstList().push_back(new ReturnInst(Add)); // Output the bytecode file to stdout - WriteBytecodeToFile(M, std::cout); + WriteBytecodeToFile(M, llvm_cout); // Delete the module and all of its contents. delete M; From isanbard at gmail.com Tue Nov 28 18:20:26 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:20:26 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/tools/stkrc/stkrc.cpp Message-ID: <200611290020.kAT0KQGY030229@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/tools/stkrc: stkrc.cpp updated: 1.11 -> 1.12 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+6 -5) stkrc.cpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/projects/Stacker/tools/stkrc/stkrc.cpp diff -u llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.11 llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.12 --- llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.11 Fri Aug 18 04:07:54 2006 +++ llvm/projects/Stacker/tools/stkrc/stkrc.cpp Tue Nov 28 18:19:40 2006 @@ -22,11 +22,11 @@ #include "llvm/Bytecode/Writer.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" #include #include #include - using namespace llvm; static cl::opt @@ -115,7 +115,7 @@ } if (DumpAsm) - std::cerr << "Here's the assembly:" << M.get(); + llvm_cerr << "Here's the assembly:" << M.get(); if (OutputFilename != "") { // Specified an output filename? if (OutputFilename != "-") { // Not stdout? @@ -163,14 +163,15 @@ throw std::string("error opening ") + OutputFilename + "!"; } - WriteBytecodeToFile(M.get(), *Out); + llvm_ostream L(*Out); + WriteBytecodeToFile(M.get(), L); } catch (const ParseError &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; + llvm_cerr << argv[0] << ": " << E.getMessage() << "\n"; return 1; } } catch (const std::string& msg ) { - std::cerr << argv[0] << ": " << msg << "\n"; + llvm_cerr << argv[0] << ": " << msg << "\n"; return 1; } From evan.cheng at apple.com Tue Nov 28 18:31:04 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 18:31:04 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec Message-ID: <200611290031.kAT0V4SH030494@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec updated: 1.56 -> 1.57 --- Log message: Need -append-exit-code to match RunSafely.sh changes. --- Diffs of the changes: (+6 -0) Makefile.spec | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.56 llvm-test/External/SPEC/Makefile.spec:1.57 --- llvm-test/External/SPEC/Makefile.spec:1.56 Fri Sep 1 19:04:00 2006 +++ llvm-test/External/SPEC/Makefile.spec Tue Nov 28 18:30:49 2006 @@ -127,6 +127,12 @@ -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time +# The RunSafely.sh script puts an "exit " line at the end of +# the program's output. We have to make bugpoint do the same thing +# or else it will get false positives when it diff's the reference +# output with the program's output. +BUGPOINT_OPTIONS += -append-exit-code + # If a tolerance is set, pass it off to bugpoint ifdef FP_TOLERANCE BUGPOINT_OPTIONS += -rel-tolerance $(FP_TOLERANCE) From isanbard at gmail.com Tue Nov 28 18:40:03 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:40:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp ELFWriter.cpp LiveInterval.cpp LiveIntervalAnalysis.cpp Message-ID: <200611290040.kAT0e3cc030679@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.118 -> 1.119 DwarfWriter.cpp updated: 1.101 -> 1.102 ELFWriter.cpp updated: 1.28 -> 1.29 LiveInterval.cpp updated: 1.38 -> 1.39 LiveIntervalAnalysis.cpp updated: 1.197 -> 1.198 --- Log message: Converted to using llvm streams instead of s --- Diffs of the changes: (+101 -87) AsmPrinter.cpp | 25 ++++---- DwarfWriter.cpp | 20 +++++- ELFWriter.cpp | 5 + LiveInterval.cpp | 2 LiveIntervalAnalysis.cpp | 136 +++++++++++++++++++++++------------------------ 5 files changed, 101 insertions(+), 87 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.118 llvm/lib/CodeGen/AsmPrinter.cpp:1.119 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.118 Sun Nov 26 19:05:09 2006 +++ llvm/lib/CodeGen/AsmPrinter.cpp Tue Nov 28 18:39:47 2006 @@ -20,11 +20,12 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" -#include +#include #include using namespace llvm; @@ -667,7 +668,7 @@ if (LastMI != MI) { ++Counter; LastMI = MI; } O << Counter; } else { - std::cerr << "Unknown special formatter '" << Code + llvm_cerr << "Unknown special formatter '" << Code << "' for machine instr: " << *MI; exit(1); } @@ -736,8 +737,8 @@ case '(': // $( -> same as GCC's { character. ++LastEmitted; // Consume '(' character. if (CurVariant != -1) { - std::cerr << "Nested variants found in inline asm string: '" - << AsmStr << "'\n"; + llvm_cerr << "Nested variants found in inline asm string: '" + << AsmStr << "'\n"; exit(1); } CurVariant = 0; // We're in the first variant now. @@ -745,8 +746,8 @@ case '|': ++LastEmitted; // consume '|' character. if (CurVariant == -1) { - std::cerr << "Found '|' character outside of variant in inline asm " - << "string: '" << AsmStr << "'\n"; + llvm_cerr << "Found '|' character outside of variant in inline asm " + << "string: '" << AsmStr << "'\n"; exit(1); } ++CurVariant; // We're in the next variant. @@ -754,7 +755,7 @@ case ')': // $) -> same as GCC's } char. ++LastEmitted; // consume ')' character. if (CurVariant == -1) { - std::cerr << "Found '}' character outside of variant in inline asm " + llvm_cerr << "Found '}' character outside of variant in inline asm " << "string: '" << AsmStr << "'\n"; exit(1); } @@ -773,7 +774,7 @@ char *IDEnd; long Val = strtol(IDStart, &IDEnd, 10); // We only accept numbers for IDs. if (!isdigit(*IDStart) || (Val == 0 && errno == EINVAL)) { - std::cerr << "Bad $ operand number in inline asm string: '" + llvm_cerr << "Bad $ operand number in inline asm string: '" << AsmStr << "'\n"; exit(1); } @@ -787,7 +788,7 @@ if (*LastEmitted == ':') { ++LastEmitted; // Consume ':' character. if (*LastEmitted == 0) { - std::cerr << "Bad ${:} expression in inline asm string: '" + llvm_cerr << "Bad ${:} expression in inline asm string: '" << AsmStr << "'\n"; exit(1); } @@ -797,7 +798,7 @@ } if (*LastEmitted != '}') { - std::cerr << "Bad ${} expression in inline asm string: '" + llvm_cerr << "Bad ${} expression in inline asm string: '" << AsmStr << "'\n"; exit(1); } @@ -805,7 +806,7 @@ } if ((unsigned)Val >= NumOperands-1) { - std::cerr << "Invalid $ operand number in inline asm string: '" + llvm_cerr << "Invalid $ operand number in inline asm string: '" << AsmStr << "'\n"; exit(1); } @@ -840,7 +841,7 @@ } } if (Error) { - std::cerr << "Invalid operand found in inline asm: '" + llvm_cerr << "Invalid operand found in inline asm: '" << AsmStr << "'\n"; MI->dump(); exit(1); Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.101 llvm/lib/CodeGen/DwarfWriter.cpp:1.102 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.101 Thu Nov 9 10:32:26 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Tue Nov 28 18:39:47 2006 @@ -32,7 +32,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetFrameInfo.h" -#include +#include #include using namespace llvm; @@ -139,6 +139,9 @@ } #ifndef NDEBUG + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O) const { O << ".debug_" << Tag; if (Number) O << Number; @@ -244,6 +247,9 @@ void Emit(const Dwarf &DW) const; #ifndef NDEBUG + void print(llvm_ostream &O) { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O); void dump(); #endif @@ -331,6 +337,9 @@ void Profile(FoldingSetNodeID &ID) ; #ifndef NDEBUG + void print(llvm_ostream &O, unsigned IncIndent = 0) { + if (O.stream()) print(*O.stream(), IncIndent); + } void print(std::ostream &O, unsigned IncIndent = 0); void dump(); #endif @@ -379,6 +388,9 @@ virtual void Profile(FoldingSetNodeID &ID) = 0; #ifndef NDEBUG + void print(llvm_ostream &O) { + if (O.stream()) print(*O.stream()); + } virtual void print(std::ostream &O) = 0; void dump(); #endif @@ -2839,14 +2851,14 @@ << "\n"; } } -void DIEAbbrev::dump() { print(std::cerr); } +void DIEAbbrev::dump() { print(llvm_cerr); } #endif //===----------------------------------------------------------------------===// #ifndef NDEBUG void DIEValue::dump() { - print(std::cerr); + print(llvm_cerr); } #endif @@ -3055,7 +3067,7 @@ } void DIE::dump() { - print(std::cerr); + print(llvm_cerr); } #endif Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.28 llvm/lib/CodeGen/ELFWriter.cpp:1.29 --- llvm/lib/CodeGen/ELFWriter.cpp:1.28 Thu Nov 16 14:04:04 2006 +++ llvm/lib/CodeGen/ELFWriter.cpp Tue Nov 28 18:39:47 2006 @@ -38,7 +38,8 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" -#include +#include "llvm/Support/Streams.h" +#include using namespace llvm; //===----------------------------------------------------------------------===// @@ -103,7 +104,7 @@ ELFWriter::ELFSection::SHF_EXECINSTR | ELFWriter::ELFSection::SHF_ALLOC); OutBuffer = &ES->SectionData; - std::cerr << "FIXME: This code needs to be updated for changes in the" + llvm_cerr << "FIXME: This code needs to be updated for changes in the" << " CodeEmitter interfaces. In particular, this should set " << "BufferBegin/BufferEnd/CurBufferPtr, not deal with OutBuffer!"; abort(); Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.38 llvm/lib/CodeGen/LiveInterval.cpp:1.39 --- llvm/lib/CodeGen/LiveInterval.cpp:1.38 Mon Nov 27 21:31:29 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Tue Nov 28 18:39:47 2006 @@ -475,7 +475,7 @@ llvm_cerr << *this << "\n"; } -void LiveInterval::print(llvm_ostream &OS, const MRegisterInfo *MRI) const { +void LiveInterval::print(llvm_ostream OS, const MRegisterInfo *MRI) const { if (MRI && MRegisterInfo::isPhysicalRegister(reg)) OS << MRI->getName(reg); else Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.197 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.198 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.197 Thu Nov 16 01:35:18 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 28 18:39:47 2006 @@ -33,7 +33,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include -#include using namespace llvm; namespace { @@ -155,11 +154,11 @@ numIntervals += getNumIntervals(); - DEBUG(std::cerr << "********** INTERVALS **********\n"; - for (iterator I = begin(), E = end(); I != E; ++I) { - I->second.print(std::cerr, mri_); - std::cerr << "\n"; - }); + DOUT << "********** INTERVALS **********\n"; + for (iterator I = begin(), E = end(); I != E; ++I) { + I->second.print(DOUT, mri_); + DOUT << "\n"; + } // Join (coallesce) intervals if requested. if (EnableJoining) joinIntervals(); @@ -236,8 +235,8 @@ void LiveIntervals::print(std::ostream &O, const Module* ) const { O << "********** INTERVALS **********\n"; for (const_iterator I = begin(), E = end(); I != E; ++I) { - I->second.print(std::cerr, mri_); - std::cerr << "\n"; + I->second.print(DOUT, mri_); + DOUT << "\n"; } O << "********** MACHINEINSTRS **********\n"; @@ -292,11 +291,11 @@ for (std::vector::const_iterator I = LRs.begin(), E = LRs.end(); I != E; ++I) { - DEBUG(std::cerr << " Adding live range " << *I << " to new interval\n"); + DOUT << " Adding live range " << *I << " to new interval\n"; NewLI.addRange(*I); } - DEBUG(std::cerr << "Created new live interval " << NewLI << "\n"); + DOUT << "Created new live interval " << NewLI << "\n"; return NewLI; } @@ -311,8 +310,9 @@ assert(li.weight != HUGE_VALF && "attempt to spill already spilled interval!"); - DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: "; - li.print(std::cerr, mri_); std::cerr << '\n'); + DOUT << "\t\t\t\tadding intervals for spills for interval: "; + li.print(DOUT, mri_); + DOUT << '\n'; const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(li.reg); @@ -388,13 +388,13 @@ if (HasUse) { LiveRange LR(getLoadIndex(index), getUseIndex(index), nI.getNextValue(~0U, 0)); - DEBUG(std::cerr << " +" << LR); + DOUT << " +" << LR; nI.addRange(LR); } if (HasDef) { LiveRange LR(getDefIndex(index), getStoreIndex(index), nI.getNextValue(~0U, 0)); - DEBUG(std::cerr << " +" << LR); + DOUT << " +" << LR; nI.addRange(LR); } @@ -404,8 +404,9 @@ if (lv_) lv_->addVirtualRegisterKilled(NewVReg, MI); - DEBUG(std::cerr << "\t\t\t\tadded new interval: "; - nI.print(std::cerr, mri_); std::cerr << '\n'); + DOUT << "\t\t\t\tadded new interval: "; + nI.print(DOUT, mri_); + DOUT << '\n'; } } } @@ -417,9 +418,9 @@ void LiveIntervals::printRegName(unsigned reg) const { if (MRegisterInfo::isPhysicalRegister(reg)) - std::cerr << mri_->getName(reg); + llvm_cerr << mri_->getName(reg); else - std::cerr << "%reg" << reg; + llvm_cerr << "%reg" << reg; } /// isReDefinedByTwoAddr - Returns true if the Reg re-definition is due to @@ -445,7 +446,7 @@ MachineBasicBlock::iterator mi, unsigned MIIdx, LiveInterval &interval) { - DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg)); + DOUT << "\t\tregister: "; DEBUG(printRegName(interval.reg)); LiveVariables::VarInfo& vi = lv_->getVarInfo(interval.reg); // Virtual registers may be defined multiple times (due to phi @@ -485,7 +486,7 @@ "Shouldn't be alive across any blocks!"); LiveRange LR(defIndex, killIdx, ValNum); interval.addRange(LR); - DEBUG(std::cerr << " +" << LR << "\n"); + DOUT << " +" << LR << "\n"; return; } } @@ -497,7 +498,7 @@ LiveRange NewLR(defIndex, getInstructionIndex(&mbb->back()) + InstrSlots::NUM, ValNum); - DEBUG(std::cerr << " +" << NewLR); + DOUT << " +" << NewLR; interval.addRange(NewLR); // Iterate over all of the blocks that the variable is completely @@ -511,7 +512,7 @@ getInstructionIndex(&MBB->back()) + InstrSlots::NUM, ValNum); interval.addRange(LR); - DEBUG(std::cerr << " +" << LR); + DOUT << " +" << LR; } } } @@ -524,7 +525,7 @@ getUseIndex(getInstructionIndex(Kill))+1, ValNum); interval.addRange(LR); - DEBUG(std::cerr << " +" << LR); + DOUT << " +" << LR; } } else { @@ -559,7 +560,7 @@ // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); - DEBUG(std::cerr << " replace range with " << LR); + DOUT << " replace range with " << LR; interval.addRange(LR); // If this redefinition is dead, we need to add a dummy unit live @@ -567,7 +568,8 @@ if (lv_->RegisterDefIsDead(mi, interval.reg)) interval.addRange(LiveRange(RedefIndex, RedefIndex+1, 0)); - DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); + DOUT << "RESULT: "; + interval.print(DOUT, mri_); } else { // Otherwise, this must be because of phi elimination. If this is the @@ -581,17 +583,17 @@ MachineInstr *Killer = vi.Kills[0]; unsigned Start = getMBBStartIdx(Killer->getParent()); unsigned End = getUseIndex(getInstructionIndex(Killer))+1; - DEBUG(std::cerr << "Removing [" << Start << "," << End << "] from: "; - interval.print(std::cerr, mri_); std::cerr << "\n"); + DOUT << "Removing [" << Start << "," << End << "] from: "; + interval.print(DOUT, mri_); DOUT << "\n"; interval.removeRange(Start, End); - DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); + DOUT << "RESULT: "; interval.print(DOUT, mri_); // Replace the interval with one of a NEW value number. Note that this // value number isn't actually defined by an instruction, weird huh? :) LiveRange LR(Start, End, interval.getNextValue(~0U, 0)); - DEBUG(std::cerr << " replace range with " << LR); + DOUT << " replace range with " << LR; interval.addRange(LR); - DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); + DOUT << "RESULT: "; interval.print(DOUT, mri_); } // In the case of PHI elimination, each variable definition is only @@ -609,11 +611,11 @@ LiveRange LR(defIndex, getInstructionIndex(&mbb->back()) + InstrSlots::NUM, ValNum); interval.addRange(LR); - DEBUG(std::cerr << " +" << LR); + DOUT << " +" << LR; } } - DEBUG(std::cerr << '\n'); + DOUT << '\n'; } void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB, @@ -623,7 +625,7 @@ unsigned SrcReg) { // A physical register cannot be live across basic block, so its // lifetime must end somewhere in its defining basic block. - DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg)); + DOUT << "\t\tregister: "; DEBUG(printRegName(interval.reg)); unsigned baseIndex = MIIdx; unsigned start = getDefIndex(baseIndex); @@ -633,7 +635,7 @@ // the instruction defining it. Hence its interval is: // [defSlot(def), defSlot(def)+1) if (lv_->RegisterDefIsDead(mi, interval.reg)) { - DEBUG(std::cerr << " dead"); + DOUT << " dead"; end = getDefIndex(start) + 1; goto exit; } @@ -644,7 +646,7 @@ while (++mi != MBB->end()) { baseIndex += InstrSlots::NUM; if (lv_->KillsRegister(mi, interval.reg)) { - DEBUG(std::cerr << " killed"); + DOUT << " killed"; end = getUseIndex(baseIndex) + 1; goto exit; } else if (lv_->ModifiesRegister(mi, interval.reg)) { @@ -652,7 +654,7 @@ // Then the register is essentially dead at the instruction that defines // it. Hence its interval is: // [defSlot(def), defSlot(def)+1) - DEBUG(std::cerr << " dead"); + DOUT << " dead"; end = getDefIndex(start) + 1; goto exit; } @@ -670,7 +672,7 @@ LiveRange LR(start, end, interval.getNextValue(SrcReg != 0 ? start : ~0U, SrcReg)); interval.addRange(LR); - DEBUG(std::cerr << " +" << LR << '\n'); + DOUT << " +" << LR << '\n'; } void LiveIntervals::handleRegisterDef(MachineBasicBlock *MBB, @@ -694,9 +696,9 @@ /// live interval is an interval [i, j) where 1 <= i <= j < N for /// which a variable is live void LiveIntervals::computeIntervals() { - DEBUG(std::cerr << "********** COMPUTING LIVE INTERVALS **********\n"); - DEBUG(std::cerr << "********** Function: " - << ((Value*)mf_->getFunction())->getName() << '\n'); + DOUT << "********** COMPUTING LIVE INTERVALS **********\n" + << "********** Function: " + << ((Value*)mf_->getFunction())->getName() << '\n'; bool IgnoreFirstInstr = mf_->livein_begin() != mf_->livein_end(); // Track the index of the current machine instr. @@ -704,7 +706,7 @@ for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end(); MBBI != E; ++MBBI) { MachineBasicBlock *MBB = MBBI; - DEBUG(std::cerr << ((Value*)MBB->getBasicBlock())->getName() << ":\n"); + DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end(); if (IgnoreFirstInstr) { @@ -714,7 +716,7 @@ } for (; MI != miEnd; ++MI) { - DEBUG(std::cerr << MIIndex << "\t" << *MI); + DOUT << MIIndex << "\t" << *MI; // Handle defs. for (int i = MI->getNumOperands() - 1; i >= 0; --i) { @@ -792,7 +794,7 @@ // IntB, we can merge them. if (ValLR+1 != BLR) return false; - DEBUG(std::cerr << "\nExtending: "; IntB.print(std::cerr, mri_)); + DOUT << "\nExtending: "; IntB.print(DOUT, mri_); // We are about to delete CopyMI, so need to remove it as the 'instruction // that defines this value #'. @@ -817,8 +819,8 @@ // Okay, merge "B1" into the same value number as "B0". if (BValNo != ValLR->ValId) IntB.MergeValueNumberInto(BValNo, ValLR->ValId); - DEBUG(std::cerr << " result = "; IntB.print(std::cerr, mri_); - std::cerr << "\n"); + DOUT << " result = "; IntB.print(DOUT, mri_); + DOUT << "\n"; // Finally, delete the copy instruction. RemoveMachineInstrFromMaps(CopyMI); @@ -836,9 +838,7 @@ /// it may be possible if other things get coallesced. bool LiveIntervals::JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg) { - - - DEBUG(std::cerr << getInstructionIndex(CopyMI) << '\t' << *CopyMI); + DOUT << getInstructionIndex(CopyMI) << '\t' << *CopyMI; // Get representative registers. SrcReg = rep(SrcReg); @@ -846,30 +846,30 @@ // If they are already joined we continue. if (SrcReg == DstReg) { - DEBUG(std::cerr << "\tCopy already coallesced.\n"); + DOUT << "\tCopy already coallesced.\n"; return true; // Not coallescable. } // If they are both physical registers, we cannot join them. if (MRegisterInfo::isPhysicalRegister(SrcReg) && MRegisterInfo::isPhysicalRegister(DstReg)) { - DEBUG(std::cerr << "\tCan not coallesce physregs.\n"); + DOUT << "\tCan not coallesce physregs.\n"; return true; // Not coallescable. } // We only join virtual registers with allocatable physical registers. if (MRegisterInfo::isPhysicalRegister(SrcReg) && !allocatableRegs_[SrcReg]){ - DEBUG(std::cerr << "\tSrc reg is unallocatable physreg.\n"); + DOUT << "\tSrc reg is unallocatable physreg.\n"; return true; // Not coallescable. } if (MRegisterInfo::isPhysicalRegister(DstReg) && !allocatableRegs_[DstReg]){ - DEBUG(std::cerr << "\tDst reg is unallocatable physreg.\n"); + DOUT << "\tDst reg is unallocatable physreg.\n"; return true; // Not coallescable. } // If they are not of the same register class, we cannot join them. if (differingRegisterClasses(SrcReg, DstReg)) { - DEBUG(std::cerr << "\tSrc/Dest are different register classes.\n"); + DOUT << "\tSrc/Dest are different register classes.\n"; return true; // Not coallescable. } @@ -878,9 +878,9 @@ assert(SrcInt.reg == SrcReg && DestInt.reg == DstReg && "Register mapping is horribly broken!"); - DEBUG(std::cerr << "\t\tInspecting "; SrcInt.print(std::cerr, mri_); - std::cerr << " and "; DestInt.print(std::cerr, mri_); - std::cerr << ": "); + DOUT << "\t\tInspecting "; SrcInt.print(DOUT, mri_); + DOUT << " and "; DestInt.print(DOUT, mri_); + DOUT << ": "; // Okay, attempt to join these two intervals. On failure, this returns false. // Otherwise, if one of the intervals being joined is a physreg, this method @@ -894,7 +894,7 @@ return true; // Otherwise, we are unable to join the intervals. - DEBUG(std::cerr << "Interference!\n"); + DOUT << "Interference!\n"; return false; } @@ -912,8 +912,8 @@ getInterval(*AS).MergeInClobberRanges(SrcInt); } - DEBUG(std::cerr << "\n\t\tJoined. Result = "; DestInt.print(std::cerr, mri_); - std::cerr << "\n"); + DOUT << "\n\t\tJoined. Result = "; DestInt.print(DOUT, mri_); + DOUT << "\n"; // If the intervals were swapped by Join, swap them back so that the register // mapping (in the r2i map) is correct. @@ -1314,7 +1314,7 @@ void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, std::vector &TryAgain) { - DEBUG(std::cerr << ((Value*)MBB->getBasicBlock())->getName() << ":\n"); + DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end(); MII != E;) { @@ -1331,7 +1331,7 @@ void LiveIntervals::joinIntervals() { - DEBUG(std::cerr << "********** JOINING INTERVALS ***********\n"); + DOUT << "********** JOINING INTERVALS ***********\n"; std::vector TryAgainList; @@ -1374,13 +1374,13 @@ } } - DEBUG(std::cerr << "*** Register mapping ***\n"); - DEBUG(for (int i = 0, e = r2rMap_.size(); i != e; ++i) - if (r2rMap_[i]) { - std::cerr << " reg " << i << " -> "; - printRegName(r2rMap_[i]); - std::cerr << "\n"; - }); + DOUT << "*** Register mapping ***\n"; + for (int i = 0, e = r2rMap_.size(); i != e; ++i) + if (r2rMap_[i]) { + DOUT << " reg " << i << " -> "; + DEBUG(printRegName(r2rMap_[i])); + DOUT << "\n"; + } } /// Return true if the two specified registers belong to different register From isanbard at gmail.com Tue Nov 28 18:40:01 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 18:40:01 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200611290040.kAT0e1Zo030660@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.28 -> 1.29 --- Log message: Converted to using llvm streams instead of s --- Diffs of the changes: (+2 -3) LiveInterval.h | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.28 llvm/include/llvm/CodeGen/LiveInterval.h:1.29 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.28 Tue Nov 28 16:21:29 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Nov 28 18:39:47 2006 @@ -258,10 +258,9 @@ return beginNumber() < other.beginNumber(); } - void print(llvm_ostream &OS, const MRegisterInfo *MRI = 0) const; + void print(llvm_ostream OS, const MRegisterInfo *MRI = 0) const; void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const { - llvm_ostream L(OS); - L << MRI; + print(llvm_ostream(OS), MRI); } void dump() const; From reid at x10sys.com Tue Nov 28 18:46:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 18:46:55 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/175.vpr/Makefile Message-ID: <200611290046.kAT0ktPM030797@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CINT2000/175.vpr: Makefile updated: 1.4 -> 1.5 --- Log message: Allow a relative fp difference of 0.1 per SPEC --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/External/SPEC/CINT2000/175.vpr/Makefile diff -u llvm-test/External/SPEC/CINT2000/175.vpr/Makefile:1.4 llvm-test/External/SPEC/CINT2000/175.vpr/Makefile:1.5 --- llvm-test/External/SPEC/CINT2000/175.vpr/Makefile:1.4 Mon Sep 6 23:18:02 2004 +++ llvm-test/External/SPEC/CINT2000/175.vpr/Makefile Tue Nov 28 18:46:40 2006 @@ -3,4 +3,8 @@ RUN_OPTIONS = net.in arch.in place.out dum.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 STDOUT_FILENAME := place_log.out CPPFLAGS := -DNO_GRAPHICS + +# SPEC allows a relative FP Tolerance of 0.1 for this test +# Compilers using the fpstack on x86 require this +FP_TOLERANCE := 0.1 include ../../Makefile.spec2000 From reid at x10sys.com Tue Nov 28 18:47:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 18:47:34 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile Message-ID: <200611290047.kAT0lY6I030826@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CINT2000/253.perlbmk: Makefile updated: 1.11 -> 1.12 --- Log message: Makefile changes necessary in order to allow 253.perlbmk to comile properly on Linux or Win32. --- Diffs of the changes: (+31 -6) Makefile | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) Index: llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile diff -u llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.11 llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.12 --- llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.11 Mon Apr 4 15:01:29 2005 +++ llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile Tue Nov 28 18:47:17 2006 @@ -1,10 +1,12 @@ LEVEL = ../../../.. REQUIRES_EH_SUPPORT = 1 -CPPFLAGS = -DSPEC_CPU2000_LINUX -Dbool=char -DI_TIME -DI_SYS_TIME +include $(LEVEL)/Makefile.config -ifeq ($(ARCH),Alpha) - CPPFLAGS += -DSPEC_CPU2000_LINUX_ALPHA -endif +SPEC_ROOT := $(SPEC2000_ROOT) + +include $(LEVEL)/External/SPEC/Makefile.spec.config + +CPPFLAGS += -DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_NEED_BOOL ifeq ($(RUN_TYPE),test) RUN_OPTIONS = test.pl @@ -15,9 +17,32 @@ STDOUT_FILENAME := scrabbl.out endif -include ../../Makefile.spec2000 +NT_SOURCES = nt_perlmain.c win32.c win32sck.c win32threads.c perllib.c +UNIX_SOURCES = unix_perlmain.c + +ifeq ($(strip $(OS)),Win32) +CPPFLAGS += -Iwin32 -I. -DWIN32 -D_CONSOLE +LIBS += advapi32.lib wsock32.lib +DO_NOT_COMPILE := $(UNIX_SOURCES) +else +DO_NOT_COMPILE := $(NT_SOURCES) +endif + +Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c) +Source := $(filter-out $(foreach xyz,$(DO_NOT_COMPILE),%/$(xyz)),$(Source)) + +SPEC2K_DO_NOT_RECONFIGURE := 1 +include $(LEVEL)/External/SPEC/Makefile.spec2000 + +ifeq ($(strip $(OS)),Linux) +CPPFLAGS := $(filter-out -DSPEC_CPU2000,$(CPPFLAGS)) +ifeq ($(ARCH),Alpha) + CPPFLAGS += -DSPEC_CPU2000_LINUX_ALPHA +else + CPPFLAGS += -DSPEC_CPU2000_LINUX_I386 +endif +endif ifeq ($(ENDIAN),little) CPPFLAGS += -D__LITTLE_ENDIAN__ endif - From reid at x10sys.com Tue Nov 28 18:47:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 18:47:34 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec.config Makefile.spec Makefile.spec2000 Makefile.spec2006 Makefile.spec95 Message-ID: <200611290047.kAT0lYVt030837@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec.config added (r1.1) Makefile.spec updated: 1.57 -> 1.58 Makefile.spec2000 updated: 1.7 -> 1.8 Makefile.spec2006 updated: 1.1 -> 1.2 Makefile.spec95 updated: 1.10 -> 1.11 --- Log message: Makefile changes necessary in order to allow 253.perlbmk to comile properly on Linux or Win32. --- Diffs of the changes: (+58 -47) Makefile.spec | 47 ------------------------------------------- Makefile.spec.config | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.spec2000 | 1 Makefile.spec2006 | 1 Makefile.spec95 | 1 5 files changed, 58 insertions(+), 47 deletions(-) Index: llvm-test/External/SPEC/Makefile.spec.config diff -c /dev/null llvm-test/External/SPEC/Makefile.spec.config:1.1 *** /dev/null Tue Nov 28 18:47:27 2006 --- llvm-test/External/SPEC/Makefile.spec.config Tue Nov 28 18:47:17 2006 *************** *** 0 **** --- 1,55 ---- + ##===- Makefile.spec ---------------------------------------*- Makefile -*-===## + # + # This makefile is a template for building SPEC as an external test. It is + # included by Makefile.spec2006, Makefile.spec2000, and Makefile.spec95. + # + ##===----------------------------------------------------------------------===## + + ## Information the test should have provided... + ifndef STDOUT_FILENAME + STDOUT_FILENAME := standard.out + endif + LDFLAGS += -lm + + # Get the current directory, the name of the benchmark, and the current + # subdirectory of the SPEC directory we are in (ie, CINT2000/164.gzip) + # + ifndef CURRENT_DIR + CURRENT_DIR := $(shell cd .; pwd) + endif + ifndef BENCH_NAME + BENCH_NAME := $(subst $(shell cd .. ; pwd),,$(CURRENT_DIR)) + # Remove any leading /'s from the paths + BENCH_NAME := $(patsubst /%,%,$(BENCH_NAME)) + endif + + ## SPEC_SUBDIR - Allow SPEC configuration files to override "CINT2000" with + ## something else. + + ifndef SPEC_SUBDIR + SPEC_SUBDIR := $(subst $(shell cd ../..; pwd),,$(CURRENT_DIR)) + SPEC_SUBDIR := $(patsubst /%,%,$(SPEC_SUBDIR)) + else + SPEC_SUBDIR := $(SPEC_SUBDIR)/$(BENCH_NAME) + endif + + ifndef SPEC_BENCH_DIR + SPEC_BENCH_DIR := $(SPEC_ROOT)/$(SPEC_SUBDIR) + endif + + ifndef Source + Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c \ + $(SPEC_BENCH_DIR)/src/*.C \ + $(SPEC_BENCH_DIR)/src/*.cc \ + $(SPEC_BENCH_DIR)/src/*.cpp \ + $(SPEC_BENCH_DIR)/src/*.f \ + $(SPEC_BENCH_DIR)/src/*.F \ + $(SPEC_BENCH_DIR)/src/*.f90 \ + $(SPEC_BENCH_DIR)/src/*.F90) + endif + + PROG := $(BENCH_NAME) + + # Disable the default Output/%.out-* targets... + PROGRAMS_HAVE_CUSTOM_RUN_RULES := 1 + SourceDir := $(SPEC_BENCH_DIR)/src/ Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.57 llvm-test/External/SPEC/Makefile.spec:1.58 --- llvm-test/External/SPEC/Makefile.spec:1.57 Tue Nov 28 18:30:49 2006 +++ llvm-test/External/SPEC/Makefile.spec Tue Nov 28 18:47:17 2006 @@ -5,53 +5,6 @@ # ##===----------------------------------------------------------------------===## -include $(LEVEL)/Makefile.config - -## Information the test should have provided... -ifndef STDOUT_FILENAME -STDOUT_FILENAME := standard.out -endif -LDFLAGS += -lm - -# Get the current directory, the name of the benchmark, and the current -# subdirectory of the SPEC directory we are in (ie, CINT2000/164.gzip) -# -CURRENT_DIR := $(shell cd .; pwd) -BENCH_NAME := $(subst $(shell cd .. ; pwd),,$(CURRENT_DIR)) - -# Remove any leading /'s from the paths -BENCH_NAME := $(patsubst /%,%,$(BENCH_NAME)) - -## SPEC_SUITEDIR - Allow SPEC configuration files to override "CINT2000" with -## something else. - -ifndef SPEC_SUITEDIR -SPEC_SUBDIR := $(subst $(shell cd ../..; pwd),,$(CURRENT_DIR)) -SPEC_SUBDIR := $(patsubst /%,%,$(SPEC_SUBDIR)) -else -SPEC_SUBDIR := $(SPEC_SUITEDIR)/$(BENCH_NAME) -endif - -ifndef SPEC_BENCH_DIR -SPEC_BENCH_DIR := $(SPEC_ROOT)/$(SPEC_SUBDIR) -endif - -PROG := $(BENCH_NAME) -ifndef Source -Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c \ - $(SPEC_BENCH_DIR)/src/*.C \ - $(SPEC_BENCH_DIR)/src/*.cc \ - $(SPEC_BENCH_DIR)/src/*.cpp \ - $(SPEC_BENCH_DIR)/src/*.f \ - $(SPEC_BENCH_DIR)/src/*.F \ - $(SPEC_BENCH_DIR)/src/*.f90 \ - $(SPEC_BENCH_DIR)/src/*.F90) -endif - -# Disable the default Output/%.out-* targets... -PROGRAMS_HAVE_CUSTOM_RUN_RULES := 1 -SourceDir := $(SPEC_BENCH_DIR)/src/ - include $(LEVEL)/MultiSource/Makefile.multisrc # Do not pass -Wall to compile commands... Index: llvm-test/External/SPEC/Makefile.spec2000 diff -u llvm-test/External/SPEC/Makefile.spec2000:1.7 llvm-test/External/SPEC/Makefile.spec2000:1.8 --- llvm-test/External/SPEC/Makefile.spec2000:1.7 Mon Sep 6 23:18:02 2004 +++ llvm-test/External/SPEC/Makefile.spec2000 Tue Nov 28 18:47:17 2006 @@ -19,4 +19,5 @@ endif endif +include $(LEVEL)/External/SPEC/Makefile.spec.config include $(LEVEL)/External/SPEC/Makefile.spec Index: llvm-test/External/SPEC/Makefile.spec2006 diff -u llvm-test/External/SPEC/Makefile.spec2006:1.1 llvm-test/External/SPEC/Makefile.spec2006:1.2 --- llvm-test/External/SPEC/Makefile.spec2006:1.1 Thu Aug 31 14:29:24 2006 +++ llvm-test/External/SPEC/Makefile.spec2006 Tue Nov 28 18:47:17 2006 @@ -22,6 +22,7 @@ # Don't use CINT2006/CFP2006, always use CPU2006. SPEC_SUITEDIR := CPU2006 +include $(LEVEL)/External/SPEC/Makefile.spec.config include $(LEVEL)/External/SPEC/Makefile.spec CPPFLAGS += -DSPEC_CPU Index: llvm-test/External/SPEC/Makefile.spec95 diff -u llvm-test/External/SPEC/Makefile.spec95:1.10 llvm-test/External/SPEC/Makefile.spec95:1.11 --- llvm-test/External/SPEC/Makefile.spec95:1.10 Mon Sep 6 22:36:04 2004 +++ llvm-test/External/SPEC/Makefile.spec95 Tue Nov 28 18:47:17 2006 @@ -19,4 +19,5 @@ endif endif +include $(LEVEL)/External/SPEC/Makefile.spec.config include $(LEVEL)/External/SPEC/Makefile.spec From reid at x10sys.com Tue Nov 28 18:54:00 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 18:54:00 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec.config Message-ID: <200611290054.kAT0s0jn030971@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec.config updated: 1.1 -> 1.2 --- Log message: Fix the file comment. --- Diffs of the changes: (+3 -3) Makefile.spec.config | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-test/External/SPEC/Makefile.spec.config diff -u llvm-test/External/SPEC/Makefile.spec.config:1.1 llvm-test/External/SPEC/Makefile.spec.config:1.2 --- llvm-test/External/SPEC/Makefile.spec.config:1.1 Tue Nov 28 18:47:17 2006 +++ llvm-test/External/SPEC/Makefile.spec.config Tue Nov 28 18:53:46 2006 @@ -1,7 +1,7 @@ -##===- Makefile.spec ---------------------------------------*- Makefile -*-===## +##===- Makefile.spec.config --------------------------------*- Makefile -*-===## # -# This makefile is a template for building SPEC as an external test. It is -# included by Makefile.spec2006, Makefile.spec2000, and Makefile.spec95. +# This makefile provides spec specific configuration. It is broken out because +# some tests need to override its settings. # ##===----------------------------------------------------------------------===## From reid at x10sys.com Tue Nov 28 19:11:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Nov 2006 19:11:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611290111.kAT1BGq6031284@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.551 -> 1.552 --- Log message: Join a split line. --- Diffs of the changes: (+1 -2) InstructionCombining.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.551 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.552 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.551 Tue Nov 28 14:23:51 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Nov 28 19:11:01 2006 @@ -8236,8 +8236,7 @@ Value *Ptr = InsertCastBefore(I->getOperand(0), PointerType::get(EI.getType()), EI); GetElementPtrInst *GEP = - new GetElementPtrInst(Ptr, EI.getOperand(1), - I->getName() + ".gep"); + new GetElementPtrInst(Ptr, EI.getOperand(1), I->getName() + ".gep"); InsertNewInstBefore(GEP, EI); return new LoadInst(GEP); } From sabre at nondot.org Tue Nov 28 19:12:50 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 19:12:50 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200611290112.kAT1CoBB031392@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.13 -> 1.14 --- Log message: add a hook to allow targets to hack on inline asms to lower them to llvm when they want to. --- Diffs of the changes: (+9 -3) TargetAsmInfo.h | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.13 llvm/include/llvm/Target/TargetAsmInfo.h:1.14 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.13 Tue Nov 28 13:51:57 2006 +++ llvm/include/llvm/Target/TargetAsmInfo.h Tue Nov 28 19:12:32 2006 @@ -20,9 +20,8 @@ #include "llvm/Support/DataTypes.h" namespace llvm { - - // Forward declaration. class TargetMachine; + class CallInst; /// TargetAsmInfo - This class is intended to be used as a base class for asm /// properties and features specific to the target. @@ -286,8 +285,15 @@ /// Measure the specified inline asm to determine an approximation of its /// length. unsigned getInlineAsmLength(const char *Str) const; + + /// ExpandInlineAsm - This hook allows the target to expand an inline asm + /// call to be explicit llvm code if it wants to. This is useful for + /// turning simple inline asms into LLVM intrinsics, which gives the + /// compiler more information about the behavior of the code. + virtual bool ExpandInlineAsm(CallInst *CI) const { + return false; + } - // // Accessors. // const char *getTextSection() const { From sabre at nondot.org Tue Nov 28 19:12:50 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 19:12:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200611290112.kAT1CoSV031395@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.321 -> 1.322 --- Log message: add a hook to allow targets to hack on inline asms to lower them to llvm when they want to. --- Diffs of the changes: (+13 -1) SelectionDAGISel.cpp | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.321 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.322 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.321 Mon Nov 27 17:36:08 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 28 19:12:32 2006 @@ -33,6 +33,7 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/MRegisterInfo.h" +#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" @@ -3780,7 +3781,17 @@ for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ) { Instruction *I = BBI++; - if (GetElementPtrInst *GEPI = dyn_cast(I)) { + + if (CallInst *CI = dyn_cast(I)) { + // If we found an inline asm expession, and if the target knows how to + // lower it to normal LLVM code, do so now. + if (isa(CI->getCalledValue())) + if (const TargetAsmInfo *TAI = + TLI.getTargetMachine().getTargetAsmInfo()) { + if (TAI->ExpandInlineAsm(CI)) + BBI = BB->begin(); + } + } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { MadeChange |= OptimizeGEPExpression(GEPI, TLI.getTargetData()); } else if (CastInst *CI = dyn_cast(I)) { // If the source of the cast is a constant, then this should have @@ -4004,6 +4015,7 @@ unsigned Reg; Value *PHIOp = PN->getIncomingValueForBlock(LLVMBB); + if (Constant *C = dyn_cast(PHIOp)) { unsigned &RegOut = ConstantsOut[C]; if (RegOut == 0) { From sabre at nondot.org Tue Nov 28 19:14:20 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 19:14:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h Message-ID: <200611290114.kAT1EKQ8031486@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.9 -> 1.10 X86TargetAsmInfo.h updated: 1.2 -> 1.3 --- Log message: Trivially lower 'bswap $0' into llvm.bswap. This fixes hexxagon with the JIT on darwin/x86, which has htonl implemented as inline asm. --- Diffs of the changes: (+75 -1) X86TargetAsmInfo.cpp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++- X86TargetAsmInfo.h | 4 ++ 2 files changed, 75 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9 Tue Nov 28 16:28:08 2006 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 28 19:14:06 2006 @@ -14,7 +14,10 @@ #include "X86TargetAsmInfo.h" #include "X86TargetMachine.h" #include "X86Subtarget.h" - +#include "llvm/InlineAsm.h" +#include "llvm/Instructions.h" +#include "llvm/Module.h" +#include "llvm/ADT/StringExtras.h" using namespace llvm; static const char* x86_asm_table[] = {"{si}", "S", @@ -154,3 +157,70 @@ } } +bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const { + // FIXME: this should verify that we are targetting a 486 or better. If not, + // we will turn this bswap into something that will be lowered to logical ops + // instead of emitting the bswap asm. For now, we don't support 486 or lower + // so don't worry about this. + + // Verify this is a simple bswap. + if (CI->getNumOperands() != 2 || + CI->getType() != CI->getOperand(1)->getType() || + !CI->getType()->isInteger()) + return false; + + const Type *Ty = CI->getType()->getUnsignedVersion(); + const char *IntName; + switch (Ty->getTypeID()) { + default: return false; + case Type::UShortTyID: IntName = "llvm.bswap.i16"; break; + case Type::UIntTyID: IntName = "llvm.bswap.i32"; break; + case Type::ULongTyID: IntName = "llvm.bswap.i64"; break; + } + + // Okay, we can do this xform, do so now. + Module *M = CI->getParent()->getParent()->getParent(); + Function *Int = M->getOrInsertFunction(IntName, Ty, Ty, (Type*)0); + + Value *Op = CI->getOperand(1); + if (CI->getOperand(1)->getType() != Ty) + Op = new BitCastInst(Op, Ty, Op->getName(), CI); + + Op = new CallInst(Int, Op, CI->getName(), CI); + + if (Op->getType() != CI->getType()) + Op = new BitCastInst(Op, CI->getType(), Op->getName(), CI); + + CI->replaceAllUsesWith(Op); + CI->eraseFromParent(); + return true; +} + + +bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const { + InlineAsm *IA = cast(CI->getCalledValue()); + //std::vector Constraints = IA->ParseConstraints(); + + std::string AsmStr = IA->getAsmString(); + + // TODO: should remove alternatives from the asmstring: "foo {a|b}" -> "foo a" + std::vector AsmPieces; + SplitString(AsmStr, AsmPieces, "\n"); // ; as separator? + + switch (AsmPieces.size()) { + default: return false; + case 1: + AsmStr = AsmPieces[0]; + AsmPieces.clear(); + SplitString(AsmStr, AsmPieces, " \t"); // Split with whitespace. + + if (AsmPieces.size() == 2 && + AsmPieces[0] == "bswap" && AsmPieces[1] == "$0") { + // No need to check constraints, nothing other than the equivalent of + // "=r,0" would be valid here. + return LowerToBSwap(CI); + } + break; + } + return false; +} Index: llvm/lib/Target/X86/X86TargetAsmInfo.h diff -u llvm/lib/Target/X86/X86TargetAsmInfo.h:1.2 llvm/lib/Target/X86/X86TargetAsmInfo.h:1.3 --- llvm/lib/Target/X86/X86TargetAsmInfo.h:1.2 Wed Oct 4 21:43:52 2006 +++ llvm/lib/Target/X86/X86TargetAsmInfo.h Tue Nov 28 19:14:06 2006 @@ -23,6 +23,10 @@ struct X86TargetAsmInfo : public TargetAsmInfo { X86TargetAsmInfo(const X86TargetMachine &TM); + + virtual bool ExpandInlineAsm(CallInst *CI) const; + private: + bool LowerToBSwap(CallInst *CI) const; }; } // namespace llvm From isanbard at gmail.com Tue Nov 28 19:14:16 2006 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 28 Nov 2006 19:14:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ConstantRange.cpp Message-ID: <200611290114.kAT1EGht031474@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ConstantRange.cpp updated: 1.17 -> 1.18 --- Log message: WTF? These weird newlines got in there... --- Diffs of the changes: (+0 -26) ConstantRange.cpp | 26 -------------------------- 1 files changed, 26 deletions(-) Index: llvm/lib/Analysis/ConstantRange.cpp diff -u llvm/lib/Analysis/ConstantRange.cpp:1.17 llvm/lib/Analysis/ConstantRange.cpp:1.18 --- llvm/lib/Analysis/ConstantRange.cpp:1.17 Tue Nov 28 16:46:12 2006 +++ llvm/lib/Analysis/ConstantRange.cpp Tue Nov 28 19:14:00 2006 @@ -50,32 +50,6 @@ return cast(C)->getValue(); } - - - - - - - - - - - - - - - - - - - - - - - - - - static bool GT(ConstantIntegral *A, ConstantIntegral *B) { return LT(B, A); } static ConstantIntegral *Min(ConstantIntegral *A, ConstantIntegral *B) { From clattner at apple.com Tue Nov 28 19:17:27 2006 From: clattner at apple.com (Chris Lattner) Date: Tue, 28 Nov 2006 17:17:27 -0800 Subject: [llvm-commits] llvm-gcc patch Message-ID: <68A305AC-6803-484C-A59B-92C7EE3B275B@apple.com> Applied. Index: llvm-convert.cpp =================================================================== --- llvm-convert.cpp (revision 120665) +++ llvm-convert.cpp (working copy) @@ -34,8 +34,9 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/Module.h" +#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetData.h" #include "llvm/ADT/StringExtras.h" #include @@ -2881,12 +2882,19 @@ Value *Asm = InlineAsm::get(FTy, NewAsmStr, ConstraintStr, ASM_VOLATILE_P(exp) || !ASM_OUTPUTS (exp)); - Value *CV = new CallInst(Asm, CallOps, StoreCallResultAddr ? "tmp" : "", - CurBB); + CallInst *CV = new CallInst(Asm, CallOps, StoreCallResultAddr ? "tmp" : "", + CurBB); // If the call produces a value, store it into the destination. if (StoreCallResultAddr) new StoreInst(CV, StoreCallResultAddr, CurBB); + + // Give the backend a chance to upgrade the inline asm to LLVM code. This + // handles some common cases that LLVM has intrinsics for, e.g. x86 bswap -> + // llvm.bswap. + if (const TargetAsmInfo *TAI = TheTarget->getTargetAsmInfo()) + TAI->ExpandInlineAsm(CV); + return 0; } -Chris From evan.cheng at apple.com Tue Nov 28 19:38:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 19:38:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200611290138.kAT1cMov031875@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.322 -> 1.323 --- Log message: Fix for PR1022: http://llvm.org/PR1022 (folding loads of static initializers) by Dan Gohman. --- 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.322 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.323 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.322 Tue Nov 28 19:12:32 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 28 19:38:07 2006 @@ -3257,7 +3257,7 @@ if (TLI.isLittleEndian()) Offset = Offset + MSB - 1; for (unsigned i = 0; i != MSB; ++i) { - Val = (Val << 8) | Str[Offset]; + Val = (Val << 8) | (unsigned char)Str[Offset]; Offset += TLI.isLittleEndian() ? -1 : 1; } return DAG.getConstant(Val, VT); From sabre at nondot.org Tue Nov 28 19:48:15 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 19:48:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200611290148.kAT1mFt9032138@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.10 -> 1.11 --- Log message: Upgrade the ugly darwin 64-bit bswap idiom (bswap %eax / bswap %edx / xchgl %eax, %edx) to llvm.bswap.i64. This compiles: long long test2(long long A) { return _OSSwapInt64(A); } to: _test2: movl 8(%esp), %eax movl 4(%esp), %edx bswapl %eax bswapl %edx ret instead of: _test2: movl 8(%esp), %edx movl 4(%esp), %eax bswap %eax bswap %edx xchgl %eax, %edx ret GCC manages (with -fomit-frame-pointer) the uglier: _test2: subl $4, %esp movl 8(%esp), %eax movl 12(%esp), %edx bswap %eax bswap %edx xchgl %eax, %edx addl $4, %esp ret --- Diffs of the changes: (+23 -1) X86TargetAsmInfo.cpp | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.11 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10 Tue Nov 28 19:14:06 2006 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 28 19:48:01 2006 @@ -199,7 +199,7 @@ bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const { InlineAsm *IA = cast(CI->getCalledValue()); - //std::vector Constraints = IA->ParseConstraints(); + std::vector Constraints = IA->ParseConstraints(); std::string AsmStr = IA->getAsmString(); @@ -214,6 +214,7 @@ AsmPieces.clear(); SplitString(AsmStr, AsmPieces, " \t"); // Split with whitespace. + // bswap $0 if (AsmPieces.size() == 2 && AsmPieces[0] == "bswap" && AsmPieces[1] == "$0") { // No need to check constraints, nothing other than the equivalent of @@ -221,6 +222,27 @@ return LowerToBSwap(CI); } break; + case 3: + if (CI->getType() == Type::ULongTy && Constraints.size() >= 2 && + Constraints[0].Codes.size() == 1 && Constraints[0].Codes[0] == "A" && + Constraints[1].Codes.size() == 1 && Constraints[1].Codes[0] == "0") { + // bswap %eax / bswap %edx / xchgl %eax, %edx -> llvm.bswap.i64 + std::vector Words; + SplitString(AsmPieces[0], Words, " \t"); + if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%eax") { + Words.clear(); + SplitString(AsmPieces[1], Words, " \t"); + if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%edx") { + Words.clear(); + SplitString(AsmPieces[2], Words, " \t,"); + if (Words.size() == 3 && Words[0] == "xchgl" && Words[1] == "%eax" && + Words[2] == "%edx") { + return LowerToBSwap(CI); + } + } + } + } + break; } return false; } From evan.cheng at apple.com Tue Nov 28 19:57:21 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 19:57:21 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Message-ID: <200611290157.kAT1vL2L032504@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-11-28-Memcpy.ll added (r1.1) --- Log message: Add test cases for PR1022: http://llvm.org/PR1022 , 1023. --- Diffs of the changes: (+34 -0) 2006-11-28-Memcpy.ll | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.1 *** /dev/null Tue Nov 28 19:57:16 2006 --- llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Tue Nov 28 19:57:06 2006 *************** *** 0 **** --- 1,34 ---- + ; RUN: llvm-as < %s | llc -march=x86 && + ; RUN: llvm-as < %s | llc -march=x86 | grep 3721182122 | wc -l | grep 1 && + ; RUN: llvm-as < %s | llc -march=x86 | grep 'movl _bytes2' | wc -l | grep 1 + ; PR1022, 1023 + + %fmt = constant [4 x sbyte] c"%x\0A\00" + %bytes = constant [4 x sbyte] c"\AA\BB\CC\DD" + %bytes2 = global [4 x sbyte] c"\AA\BB\CC\DD" + + + int %test1() { + %y = alloca uint + %c = cast uint* %y to sbyte* + %z = getelementptr [4 x sbyte]* %bytes, int 0, int 0 + call void %llvm.memcpy.i32( sbyte* %c, sbyte* %z, uint 4, uint 1 ) + %r = load uint* %y + %t = cast [4 x sbyte]* %fmt to sbyte* + %tmp = call int (sbyte*, ...)* %printf( sbyte* %t, uint %r ) + ret int 0 + } + + void %test2() { + %y = alloca uint + %c = cast uint* %y to sbyte* + %z = getelementptr [4 x sbyte]* %bytes2, int 0, int 0 + call void %llvm.memcpy.i32( sbyte* %c, sbyte* %z, uint 4, uint 1 ) + %r = load uint* %y + %t = cast [4 x sbyte]* %fmt to sbyte* + %tmp = call int (sbyte*, ...)* %printf( sbyte* %t, uint %r ) + ret void + } + + declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) + declare int %printf(sbyte*, ...) From evan.cheng at apple.com Tue Nov 28 19:58:27 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 19:58:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200611290158.kAT1wRVj032554@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.323 -> 1.324 --- Log message: Fix for PR1023: http://llvm.org/PR1023 by Dan Gohman. --- 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.323 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.324 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.323 Tue Nov 28 19:38:07 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 28 19:58:12 2006 @@ -3376,7 +3376,7 @@ } if (G) { GlobalVariable *GV = dyn_cast(G->getGlobal()); - if (GV) { + if (GV && GV->isConstant()) { Str = GV->getStringValue(false); if (!Str.empty()) { CopyFromStr = true; From evan.cheng at apple.com Tue Nov 28 20:00:54 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 28 Nov 2006 20:00:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp Message-ID: <200611290200.kAT20svF032635@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.40 -> 1.41 --- Log message: 16-byte stack alignment for X86-64 ELF. Patch by Dan Gohman. --- Diffs of the changes: (+3 -1) X86Subtarget.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.40 llvm/lib/Target/X86/X86Subtarget.cpp:1.41 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.40 Mon Nov 20 12:16:05 2006 +++ llvm/lib/Target/X86/X86Subtarget.cpp Tue Nov 28 20:00:40 2006 @@ -255,6 +255,8 @@ } } - if (TargetType == isDarwin || TargetType == isCygwin) + if (TargetType == isDarwin || + TargetType == isCygwin || + (TargetType == isELF && Is64Bit)) stackAlignment = 16; } From sabre at nondot.org Tue Nov 28 23:00:29 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 23:00:29 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/bswap-fold.ll Message-ID: <200611290500.kAT50Tfr003013@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: bswap-fold.ll added (r1.1) --- Log message: new testcase, bswaps should be eliminated. --- Diffs of the changes: (+26 -0) bswap-fold.ll | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/bswap-fold.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/bswap-fold.ll:1.1 *** /dev/null Tue Nov 28 23:00:24 2006 --- llvm/test/Regression/Transforms/InstCombine/bswap-fold.ll Tue Nov 28 23:00:14 2006 *************** *** 0 **** --- 1,26 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret | wc -l | grep 3 && + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call.*bswap' + + bool %test1(ushort %tmp2) { + %tmp10 = call ushort %llvm.bswap.i16( ushort %tmp2 ) + %tmp = seteq ushort %tmp10, 1 + ret bool %tmp + } + + bool %test2(uint %tmp) { + %tmp34 = tail call uint %llvm.bswap.i32( uint %tmp ) + %tmp = seteq uint %tmp34, 1 + ret bool %tmp + } + + declare uint %llvm.bswap.i32(uint) + + bool %test3(ulong %tmp) { + %tmp34 = tail call ulong %llvm.bswap.i64( ulong %tmp ) + %tmp = seteq ulong %tmp34, 1 + ret bool %tmp + } + + declare ulong %llvm.bswap.i64(ulong) + + declare ushort %llvm.bswap.i16(ushort) From sabre at nondot.org Tue Nov 28 23:02:30 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 23:02:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611290502.kAT52UeU003123@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.552 -> 1.553 --- Log message: Implement Regression/Transforms/InstCombine/bswap-fold.ll, folding seteq (bswap(x)), c -> seteq(x,bswap(c)) --- Diffs of the changes: (+24 -1) InstructionCombining.cpp | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.552 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.553 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.552 Tue Nov 28 19:11:01 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Nov 28 23:02:16 2006 @@ -4664,7 +4664,7 @@ break; } - // Simplify seteq and setne instructions... + // Simplify seteq and setne instructions with integer constant RHS. if (I.isEquality()) { bool isSetNE = I.getOpcode() == Instruction::SetNE; @@ -4780,6 +4780,29 @@ } default: break; } + } else if (IntrinsicInst *II = dyn_cast(Op0)) { + // Handle set{eq|ne} , intcst. + switch (II->getIntrinsicID()) { + default: break; + case Intrinsic::bswap_i16: // seteq (bswap(x)), c -> seteq(x,bswap(c)) + WorkList.push_back(II); // Dead? + I.setOperand(0, II->getOperand(1)); + I.setOperand(1, ConstantInt::get(Type::UShortTy, + ByteSwap_16(CI->getZExtValue()))); + return &I; + case Intrinsic::bswap_i32: // seteq (bswap(x)), c -> seteq(x,bswap(c)) + WorkList.push_back(II); // Dead? + I.setOperand(0, II->getOperand(1)); + I.setOperand(1, ConstantInt::get(Type::UIntTy, + ByteSwap_32(CI->getZExtValue()))); + return &I; + case Intrinsic::bswap_i64: // seteq (bswap(x)), c -> seteq(x,bswap(c)) + WorkList.push_back(II); // Dead? + I.setOperand(0, II->getOperand(1)); + I.setOperand(1, ConstantInt::get(Type::ULongTy, + ByteSwap_64(CI->getZExtValue()))); + return &I; + } } } else { // Not a SetEQ/SetNE // If the LHS is a cast from an integral value of the same size, From sabre at nondot.org Tue Nov 28 23:19:47 2006 From: sabre at nondot.org (Chris Lattner) Date: Tue, 28 Nov 2006 23:19:47 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Message-ID: <200611290519.kAT5JlOG003465@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-11-28-Memcpy.ll updated: 1.1 -> 1.2 --- Log message: This fails on mainline. --- Diffs of the changes: (+2 -0) 2006-11-28-Memcpy.ll | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll diff -u llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.1 llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.2 --- llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.1 Tue Nov 28 19:57:06 2006 +++ llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Tue Nov 28 23:19:32 2006 @@ -3,6 +3,8 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep 'movl _bytes2' | wc -l | grep 1 ; PR1022, 1023 +; XFAIL: * + %fmt = constant [4 x sbyte] c"%x\0A\00" %bytes = constant [4 x sbyte] c"\AA\BB\CC\DD" %bytes2 = global [4 x sbyte] c"\AA\BB\CC\DD" From sabre at nondot.org Wed Nov 29 01:03:15 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:03:15 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast.ll Message-ID: <200611290703.kAT73F5E005158@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast.ll updated: 1.32 -> 1.33 --- Log message: new testcase --- Diffs of the changes: (+8 -0) cast.ll | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.32 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.33 --- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.32 Sun Nov 26 19:05:10 2006 +++ llvm/test/Regression/Transforms/InstCombine/cast.ll Wed Nov 29 01:03:00 2006 @@ -211,3 +211,11 @@ %y = bitcast float %x to uint ret uint %y } + +ushort %test34(ushort %a) { + %c1 = zext ushort %a to int + %tmp21 = lshr int %c1, ubyte 8 + %c2 = trunc int %tmp21 to ushort + ret ushort %c2 +} + From sabre at nondot.org Wed Nov 29 01:04:21 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:04:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611290704.kAT74Lsm005201@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.553 -> 1.554 --- Log message: Teach instcombine to turn trunc(srl x, c) -> srl (trunc(x), c) when safe. This implements InstCombine/cast.ll:test34. It fires hundreds of times on 176.gcc. --- Diffs of the changes: (+33 -1) InstructionCombining.cpp | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.553 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.554 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.553 Tue Nov 28 23:02:16 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 29 01:04:07 2006 @@ -5986,7 +5986,39 @@ } Instruction *InstCombiner::visitTrunc(CastInst &CI) { - return commonIntCastTransforms(CI); + if (Instruction *Result = commonIntCastTransforms(CI)) + return Result; + + Value *Src = CI.getOperand(0); + const Type *Ty = CI.getType(); + unsigned DestBitWidth = Ty->getPrimitiveSizeInBits(); + + if (Instruction *SrcI = dyn_cast(Src)) { + switch (SrcI->getOpcode()) { + default: break; + case Instruction::LShr: + // We can shrink lshr to something smaller if we know the bits shifted in + // are already zeros. + if (ConstantInt *ShAmtV = dyn_cast(SrcI->getOperand(1))) { + unsigned ShAmt = ShAmtV->getZExtValue(); + + // Get a mask for the bits shifting in. + uint64_t Mask = (~0ULL >> (64-ShAmt)) << DestBitWidth; + if (SrcI->hasOneUse() && MaskedValueIsZero(SrcI->getOperand(0), Mask)) { + if (ShAmt >= DestBitWidth) // All zeros. + return ReplaceInstUsesWith(CI, Constant::getNullValue(Ty)); + + // Okay, we can shrink this. Truncate the input, then return a new + // shift. + Value *V = InsertCastBefore(SrcI->getOperand(0), Ty, CI); + return new ShiftInst(Instruction::LShr, V, SrcI->getOperand(1)); + } + } + break; + } + } + + return 0; } Instruction *InstCombiner::visitZExt(CastInst &CI) { From sabre at nondot.org Wed Nov 29 01:17:47 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:17:47 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast.ll Message-ID: <200611290717.kAT7HlDZ005448@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast.ll updated: 1.33 -> 1.34 --- Log message: new testcase --- Diffs of the changes: (+7 -0) cast.ll | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.33 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.34 --- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.33 Wed Nov 29 01:03:00 2006 +++ llvm/test/Regression/Transforms/InstCombine/cast.ll Wed Nov 29 01:17:32 2006 @@ -219,3 +219,10 @@ ret ushort %c2 } +ushort %test35(ushort %a) { + %c1 = bitcast ushort %a to short + %tmp2 = lshr short %c1, ubyte 8 + %c2 = bitcast short %tmp2 to ushort + ret ushort %c2 +} + From sabre at nondot.org Wed Nov 29 01:18:53 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:18:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611290718.kAT7IrO9005496@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.554 -> 1.555 --- Log message: implement cast.ll:test35. With this, we recognize: unsigned short swp(unsigned short a) { return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8); } as an idiom for bswap. --- Diffs of the changes: (+16 -0) InstructionCombining.cpp | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.554 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.555 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.554 Wed Nov 29 01:04:07 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 29 01:18:39 2006 @@ -5624,6 +5624,14 @@ // These operators can all arbitrarily be extended or truncated. return CanEvaluateInDifferentType(I->getOperand(0), Ty, NumCastsRemoved) && CanEvaluateInDifferentType(I->getOperand(1), Ty, NumCastsRemoved); + case Instruction::AShr: + case Instruction::LShr: + case Instruction::Shl: + // If this is just a bitcast changing the sign of the operation, we can + // convert if the operand can be converted. + if (V->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) + return CanEvaluateInDifferentType(I->getOperand(0), Ty, NumCastsRemoved); + break; case Instruction::Trunc: case Instruction::ZExt: case Instruction::SExt: @@ -5669,6 +5677,14 @@ LHS, RHS, I->getName()); break; } + case Instruction::AShr: + case Instruction::LShr: + case Instruction::Shl: { + Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty); + Res = new ShiftInst((Instruction::OtherOps)I->getOpcode(), LHS, + I->getOperand(1), I->getName()); + break; + } case Instruction::Trunc: case Instruction::ZExt: case Instruction::SExt: From sabre at nondot.org Wed Nov 29 01:21:22 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:21:22 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/bswap.ll Message-ID: <200611290721.kAT7LM2E005561@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: bswap.ll updated: 1.2 -> 1.3 --- Log message: new bswap idiom --- Diffs of the changes: (+20 -1) bswap.ll | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/bswap.ll diff -u llvm/test/Regression/Transforms/InstCombine/bswap.ll:1.2 llvm/test/Regression/Transforms/InstCombine/bswap.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/bswap.ll:1.2 Mon Jul 10 15:25:01 2006 +++ llvm/test/Regression/Transforms/InstCombine/bswap.ll Wed Nov 29 01:21:08 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'call.*llvm.bswap' | wc -l | grep 4 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'call.*llvm.bswap' | wc -l | grep 5 uint %test1(uint %i) { %tmp1 = shr uint %i, ubyte 24 ; [#uses=1] @@ -40,3 +40,22 @@ ret ushort %tmp5 } +; unsigned short test5(unsigned short a) { +; return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8); +;} +ushort %test5(ushort %a) { + %tmp = zext ushort %a to int + %tmp1 = and int %tmp, 65280 + %tmp2 = ashr int %tmp1, ubyte 8 + %tmp2 = trunc int %tmp2 to short + %tmp3 = zext ushort %a to int + %tmp4 = and int %tmp3, 255 + %tmp5 = shl int %tmp4, ubyte 8 + %tmp5 = trunc int %tmp5 to short + %tmp = or short %tmp2, %tmp5 + %tmp6 = bitcast short %tmp to ushort + %tmp6 = zext ushort %tmp6 to int + %retval = trunc int %tmp6 to ushort + ret ushort %retval +} + From sabre at nondot.org Wed Nov 29 01:22:01 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 01:22:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/README.txt Message-ID: <200611290722.kAT7M1IH005620@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: README.txt updated: 1.49 -> 1.50 --- Log message: done --- Diffs of the changes: (+0 -16) README.txt | 16 ---------------- 1 files changed, 16 deletions(-) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.49 llvm/lib/Target/README.txt:1.50 --- llvm/lib/Target/README.txt:1.49 Mon Nov 13 19:57:53 2006 +++ llvm/lib/Target/README.txt Wed Nov 29 01:21:46 2006 @@ -303,22 +303,6 @@ return v; } -Nor is this: - -ushort %bad(ushort %a) { -entry: - %tmp = cast ushort %a to uint ; [#uses=1] - %tmp2 = shr uint %tmp, ubyte 8 ; [#uses=1] - %tmp2 = cast uint %tmp2 to ushort ; [#uses=1] - %tmp5 = shl ushort %a, ubyte 8 ; [#uses=1] - %tmp6 = or ushort %tmp2, %tmp5 ; [#uses=1] - ret ushort %tmp6 -} - -unsigned short bad(unsigned short a) { - return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8); -} - //===---------------------------------------------------------------------===// These should turn into single 16-bit (unaligned?) loads on little/big endian From clattner at apple.com Wed Nov 29 01:27:48 2006 From: clattner at apple.com (Chris Lattner) Date: Tue, 28 Nov 2006 23:27:48 -0800 Subject: [llvm-commits] CAST patch committed In-Reply-To: <1164668010.2837.63.camel@bashful.x10sys.com> References: <1164589934.2817.124.camel@bashful.x10sys.com> <1164668010.2837.63.camel@bashful.x10sys.com> Message-ID: >>> TEST-FAIL: cbe /External/SPEC/CINT2000/176.gcc/176.gcc >>> There are significant differences in the assembly output, but >>> this >>> test has been >>> failing similarly on recent (HEAD) nightly tests as well. >> >> This fails for me because the CBE doesn't implement the stacksave/ >> restore builtins right. If someone was interested in doing this, it >> should be possible to use GCC extensions to implement this. > > Is there a PR open for this? No. It should be really easy to implement them in terms of GCC's __builtin_stack_save/__builtin_stack_restore builtins. I don't know what version of GCC these are available on though, we'd want to conditionalize the CBE output correctly. Filing a PR for this would make sense. >> >>> TEST-FAIL: jit /External/SPEC/CINT2000/186.crafty/186.crafty >>> Crash in the X86 code emitter due to inline asm: >>> lli: X86CodeEmitter.cpp:625: >>> void::Emitter::emitInstruction(const >>> llvm::MachineInstr&): Assertion `0 && "JIT does not support >>> inline >>> asm!\n"' failed. >>> These are coming from FD_ZERO, FD_SET and FD_ISSET macros used in >>> utility.c and >>> defined as inline ASM in /usr/include/bits/select.h on my >>> machine. >>> >>> TEST-FAIL: cbe /External/SPEC/CINT2000/186.crafty/186.crafty >>> I'm assuming the CBE didn't like inline ASM either. It >>> produced no >>> output. >> >> Ok, right. Can you send me the inline asm used, or just the >> entire .bc file? > > I attached the /usr/include/bits/select.h file from Linux. This is > mostly asm but I thought I'd give you the extra context since there > are > compiler differences for it. > > The raw bytecode for 186.crafty is also attached. Yuck. I was thinking that it would be something simple to pattern match like I did for bswap inline asm. It looks not worth it. -Chris From isanbard at gmail.com Wed Nov 29 01:31:37 2006 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 29 Nov 2006 01:31:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200611290731.kAT7Vb8V005777@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.23 -> 1.24 --- Log message: Oops! didn't mean to put this in there yet. --- Diffs of the changes: (+0 -5) Passes.h | 5 ----- 1 files changed, 5 deletions(-) Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.23 llvm/include/llvm/CodeGen/Passes.h:1.24 --- llvm/include/llvm/CodeGen/Passes.h:1.23 Tue Nov 28 18:19:40 2006 +++ llvm/include/llvm/CodeGen/Passes.h Wed Nov 29 01:31:23 2006 @@ -70,11 +70,6 @@ /// FunctionPass *createLinearScanRegisterAllocator(); - /// PriorityBasedGraphColoringRegisterAllocator Pass - This pass implements - /// the priority-based graph coloring register allocator by Chow & Hennessey, - /// a global register allocator. - FunctionPass *createGraphColoringRegisterAllocator(); - /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, /// and eliminates abstract frame references. /// From evan.cheng at apple.com Wed Nov 29 02:23:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 02:23:14 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Message-ID: <200611290823.kAT8NE9l015402@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-11-28-Memcpy.ll updated: 1.2 -> 1.3 --- Log message: Fix test. --- Diffs of the changes: (+1 -3) 2006-11-28-Memcpy.ll | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll diff -u llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.2 llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.3 --- llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.2 Tue Nov 28 23:19:32 2006 +++ llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Wed Nov 29 02:22:59 2006 @@ -1,10 +1,8 @@ ; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep 3721182122 | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=x86 | grep 3721182122 | wc -l | grep 2 && ; RUN: llvm-as < %s | llc -march=x86 | grep 'movl _bytes2' | wc -l | grep 1 ; PR1022, 1023 -; XFAIL: * - %fmt = constant [4 x sbyte] c"%x\0A\00" %bytes = constant [4 x sbyte] c"\AA\BB\CC\DD" %bytes2 = global [4 x sbyte] c"\AA\BB\CC\DD" From evan.cheng at apple.com Wed Nov 29 02:26:53 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 02:26:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200611290826.kAT8QrPp015489@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.419 -> 1.420 --- Log message: Allow target to custom lower READCYCLECOUNTER (when it doesn't have to be expanded). --- Diffs of the changes: (+10 -2) LegalizeDAG.cpp | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.419 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.420 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.419 Mon Nov 27 19:03:30 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Nov 29 02:26:18 2006 @@ -1847,11 +1847,19 @@ case ISD::READCYCLECOUNTER: Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain Result = DAG.UpdateNodeOperands(Result, Tmp1); + switch (TLI.getOperationAction(ISD::READCYCLECOUNTER, + Node->getValueType(0))) { + default: assert(0 && "This action is not supported yet!"); + case TargetLowering::Legal: break; + case TargetLowering::Custom: + Result = TLI.LowerOperation(Result, DAG); + break; + } // Since rdcc produce two values, make sure to remember that we legalized // both of them. - AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0)); - AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1)); + AddLegalizedOperand(SDOperand(Node, 0), LegalizeOp(Result.getValue(0))); + AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Result.getValue(1))); return Result; case ISD::SELECT: From evan.cheng at apple.com Wed Nov 29 02:28:29 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 02:28:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86InstrInfo.td Message-ID: <200611290828.kAT8STKH015554@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.295 -> 1.296 X86InstrInfo.td updated: 1.294 -> 1.295 --- Log message: Custom lower READCYCLECOUNTER for x86-64. --- Diffs of the changes: (+22 -12) X86ISelLowering.cpp | 26 ++++++++++++++++++++------ X86InstrInfo.td | 8 ++------ 2 files changed, 22 insertions(+), 12 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.295 llvm/lib/Target/X86/X86ISelLowering.cpp:1.296 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.295 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Nov 29 02:28:13 2006 @@ -4728,12 +4728,26 @@ Ops.push_back(Op.getOperand(0)); SDOperand rd = DAG.getNode(X86ISD::RDTSC_DAG, Tys, &Ops[0], Ops.size()); Ops.clear(); - Ops.push_back(DAG.getCopyFromReg(rd, X86::EAX, MVT::i32, rd.getValue(1))); - Ops.push_back(DAG.getCopyFromReg(Ops[0].getValue(1), X86::EDX, - MVT::i32, Ops[0].getValue(2))); - Ops.push_back(Ops[1].getValue(1)); - Tys[0] = Tys[1] = MVT::i32; - Tys.push_back(MVT::Other); + if (Subtarget->is64Bit()) { + SDOperand Copy1 = DAG.getCopyFromReg(rd, X86::RAX, MVT::i64, rd.getValue(1)); + SDOperand Copy2 = DAG.getCopyFromReg(Copy1.getValue(1), X86::RDX, + MVT::i64, Copy1.getValue(2)); + SDOperand Tmp = DAG.getNode(ISD::SHL, MVT::i64, Copy2, + DAG.getConstant(32, MVT::i8)); + Ops.push_back(DAG.getNode(ISD::OR, MVT::i64, Copy1, Tmp)); + Ops.push_back(Copy2.getValue(1)); + Tys[0] = MVT::i64; + Tys[1] = MVT::Other; + } else { + SDOperand Copy1 = DAG.getCopyFromReg(rd, X86::EAX, MVT::i32, rd.getValue(1)); + SDOperand Copy2 = DAG.getCopyFromReg(Copy1.getValue(1), X86::EDX, + MVT::i32, Copy1.getValue(2)); + Ops.push_back(Copy1); + Ops.push_back(Copy2); + Ops.push_back(Copy2.getValue(1)); + Tys[0] = Tys[1] = MVT::i32; + Tys.push_back(MVT::Other); + } return DAG.getNode(ISD::MERGE_VALUES, Tys, &Ops[0], Ops.size()); } Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.294 llvm/lib/Target/X86/X86InstrInfo.td:1.295 --- llvm/lib/Target/X86/X86InstrInfo.td:1.294 Fri Nov 3 17:48:55 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Wed Nov 29 02:28:13 2006 @@ -536,6 +536,8 @@ [(X86rep_stos i32)]>, Imp<[EAX,ECX,EDI], [ECX,EDI]>, REP; +def RDTSC : I<0x31, RawFrm, (ops), "rdtsc", [(X86rdtsc)]>, + TB, Imp<[],[RAX,RDX]>; //===----------------------------------------------------------------------===// // Input/Output Instructions... @@ -2397,12 +2399,6 @@ def CDQ : I<0x99, RawFrm, (ops), "{cltd|cdq}", []>, Imp<[EAX],[EAX,EDX]>; // EDX:EAX = signext(EAX) -//===----------------------------------------------------------------------===// -// Miscellaneous Instructions -//===----------------------------------------------------------------------===// - -def RDTSC : I<0x31, RawFrm, (ops), "rdtsc", [(X86rdtsc)]>, - TB, Imp<[],[EAX,EDX]>; //===----------------------------------------------------------------------===// // Alias Instructions From evan.cheng at apple.com Wed Nov 29 02:30:27 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 02:30:27 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/rdtsc.ll Message-ID: <200611290830.kAT8URr6015605@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: rdtsc.ll updated: 1.3 -> 1.4 --- Log message: Add x86-64 llvm.readcyclecounter test. --- Diffs of the changes: (+2 -1) rdtsc.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/rdtsc.ll diff -u llvm/test/Regression/CodeGen/X86/rdtsc.ll:1.3 llvm/test/Regression/CodeGen/X86/rdtsc.ll:1.4 --- llvm/test/Regression/CodeGen/X86/rdtsc.ll:1.3 Sun Nov 20 15:46:52 2005 +++ llvm/test/Regression/CodeGen/X86/rdtsc.ll Wed Nov 29 02:29:59 2006 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep rdtsc +; RUN: llvm-as < %s | llc -march=x86 | grep rdtsc && +; RUN: llvm-as < %s | llc -march=x86-64 | grep rdtsc declare ulong %llvm.readcyclecounter() From jlaskey at apple.com Wed Nov 29 07:37:23 2006 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 29 Nov 2006 07:37:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200611291337.kATDbNFn021197@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.235 -> 1.236 --- Log message: Offset for load of 32-bit arg in 64-bit world was incorrect. --- Diffs of the changes: (+4 -1) PPCISelLowering.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.235 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.236 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.235 Tue Nov 28 12:27:02 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 29 07:37:09 2006 @@ -1123,6 +1123,7 @@ bool needsLoad = false; MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8; + unsigned ArgSize = ObjSize; unsigned CurArgOffset = ArgOffset; switch (ObjectVT) { @@ -1138,6 +1139,7 @@ ++GPR_idx; } else { needsLoad = true; + ArgSize = PtrByteSize; } break; case MVT::i64: // PPC64 @@ -1203,7 +1205,8 @@ // If the argument is actually used, emit a load from the right stack // slot. if (!Op.Val->hasNUsesOfValue(0, ArgNo)) { - int FI = MFI->CreateFixedObject(ObjSize, CurArgOffset); + int FI = MFI->CreateFixedObject(ObjSize, + CurArgOffset + (ArgSize - ObjSize)); SDOperand FIN = DAG.getFrameIndex(FI, PtrVT); ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0); } else { From jlaskey at apple.com Wed Nov 29 10:56:12 2006 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 29 Nov 2006 10:56:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200611291656.kATGuCdn024853@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.102 -> 1.103 --- Log message: Eliminate unnecessary scopes. --- Diffs of the changes: (+27 -21) DwarfWriter.cpp | 48 +++++++++++++++++++++++++++--------------------- 1 files changed, 27 insertions(+), 21 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.102 llvm/lib/CodeGen/DwarfWriter.cpp:1.103 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.102 Tue Nov 28 18:39:47 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Wed Nov 29 10:55:57 2006 @@ -1872,7 +1872,8 @@ /// ConstructScope - Construct the components of a scope. /// void ConstructScope(DebugScope *ParentScope, - DIE *ParentDie, CompileUnit *Unit) { + unsigned ParentStartID, unsigned ParentEndID, + DIE *ParentDie, CompileUnit *Unit) { // Add variables to scope. std::vector &Variables = ParentScope->getVariables(); for (unsigned i = 0, N = Variables.size(); i < N; ++i) { @@ -1895,27 +1896,32 @@ if (StartID == EndID && StartID != 0) continue; if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue; - DIE *ScopeDie = new DIE(DW_TAG_lexical_block); - - // Add the scope bounds. - if (StartID) { - AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("loc", 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)); + if (StartID == ParentStartID && EndID == ParentEndID) { + // Just add stuff to the parent scope. + ConstructScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit); } else { - AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("func_end", SubprogramCount)); + DIE *ScopeDie = new DIE(DW_TAG_lexical_block); + + // Add the scope bounds. + if (StartID) { + AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, + DWLabel("loc", 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)); + } else { + AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, + DWLabel("func_end", SubprogramCount)); + } + + // Add the scope contents. + ConstructScope(Scope, StartID, EndID, ScopeDie, Unit); + ParentDie->AddChild(ScopeDie); } - - // Add the scope contents. - ConstructScope(Scope, ScopeDie, Unit); - ParentDie->AddChild(ScopeDie); } } @@ -1943,7 +1949,7 @@ MachineLocation Location(RI->getFrameRegister(*MF)); AddAddress(SPDie, DW_AT_frame_base, Location); - ConstructScope(RootScope, SPDie, Unit); + ConstructScope(RootScope, 0, 0, SPDie, Unit); } /// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc From sabre at nondot.org Wed Nov 29 13:01:15 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 13:01:15 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec.config Message-ID: <200611291901.kATJ1FJF026935@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec.config updated: 1.2 -> 1.3 --- Log message: fix spec2k6. Patch by Reid, thanks! --- Diffs of the changes: (+3 -1) Makefile.spec.config | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-test/External/SPEC/Makefile.spec.config diff -u llvm-test/External/SPEC/Makefile.spec.config:1.2 llvm-test/External/SPEC/Makefile.spec.config:1.3 --- llvm-test/External/SPEC/Makefile.spec.config:1.2 Tue Nov 28 18:53:46 2006 +++ llvm-test/External/SPEC/Makefile.spec.config Wed Nov 29 13:01:00 2006 @@ -27,10 +27,12 @@ ## something else. ifndef SPEC_SUBDIR +ifndef SPEC_SUITEDIR SPEC_SUBDIR := $(subst $(shell cd ../..; pwd),,$(CURRENT_DIR)) SPEC_SUBDIR := $(patsubst /%,%,$(SPEC_SUBDIR)) else -SPEC_SUBDIR := $(SPEC_SUBDIR)/$(BENCH_NAME) +SPEC_SUBDIR := $(SPEC_SUITEDIR)/$(BENCH_NAME) +endif endif ifndef SPEC_BENCH_DIR From evan.cheng at apple.com Wed Nov 29 13:14:02 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 13:14:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200611291914.kATJE2w8027156@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.420 -> 1.421 --- Log message: Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered. --- Diffs of the changes: (+8 -3) LegalizeDAG.cpp | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.420 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.421 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.420 Wed Nov 29 02:26:18 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Nov 29 13:13:47 2006 @@ -1850,16 +1850,21 @@ switch (TLI.getOperationAction(ISD::READCYCLECOUNTER, Node->getValueType(0))) { default: assert(0 && "This action is not supported yet!"); - case TargetLowering::Legal: break; + case TargetLowering::Legal: + Tmp1 = Result.getValue(0); + Tmp2 = Result.getValue(1); + break; case TargetLowering::Custom: Result = TLI.LowerOperation(Result, DAG); + Tmp1 = LegalizeOp(Result.getValue(0)); + Tmp2 = LegalizeOp(Result.getValue(1)); break; } // Since rdcc produce two values, make sure to remember that we legalized // both of them. - AddLegalizedOperand(SDOperand(Node, 0), LegalizeOp(Result.getValue(0))); - AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Result.getValue(1))); + AddLegalizedOperand(SDOperand(Node, 0), Tmp1); + AddLegalizedOperand(SDOperand(Node, 1), Tmp2); return Result; case ISD::SELECT: From llvm at cs.uiuc.edu Wed Nov 29 13:26:31 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 29 Nov 2006 13:26:31 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/ Message-ID: <200611291926.kATJQVpP027420@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: --- Log message: Directory /var/cvs/llvm/llvm-www/poll added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From llvm at cs.uiuc.edu Wed Nov 29 13:27:33 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 29 Nov 2006 13:27:33 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/inc/ Message-ID: <200611291927.kATJRXlX027494@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/inc: --- Log message: Directory /var/cvs/llvm/llvm-www/poll/inc added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From llvm at cs.uiuc.edu Wed Nov 29 13:28:16 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 29 Nov 2006 13:28:16 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/languages/ Message-ID: <200611291928.kATJSGQS027560@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/languages: --- Log message: Directory /var/cvs/llvm/llvm-www/poll/languages added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From llvm at cs.uiuc.edu Wed Nov 29 13:28:47 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 29 Nov 2006 13:28:47 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/logs/ Message-ID: <200611291928.kATJSlTO027628@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/logs: --- Log message: Directory /var/cvs/llvm/llvm-www/poll/logs added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Wed Nov 29 13:29:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:29:23 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/languages/language.en.inc.php Message-ID: <200611291929.kATJTNgu027790@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/languages: language.en.inc.php added (r1.1) --- Log message: LLVM Conference Poll. --- Diffs of the changes: (+48 -0) language.en.inc.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+) Index: llvm-www/poll/languages/language.en.inc.php diff -c /dev/null llvm-www/poll/languages/language.en.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:17 2006 --- llvm-www/poll/languages/language.en.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,48 ---- + 'iso-8859-1', + 'txt_problems' => '

      Run into problems? Script documentation and instructions: ./docu/index.html

      Get answers to your questions in the support forum on the website of the {txt_script_name} at STADTAUS.com.

      ', + 'txt_set_off_note' => 'Note: Once the script configuration have been finished you can set off the system messages (index.php - $show_error_messages).', + 'txt_system_message' => 'System Message', + 'txt_wrong_template_path' => 'The HTML template directory could not be found. Please enter the correct directory path in index.php - $path[\'templates\'].', + 'txt_wrong_templates' => 'Following HTML template(s) could not be found. Please make sure the file(s) exist(s) in the template folder or correct the file name(s) in index.php - $tmpl[\'...\'].', + 'txt_wrong_form_type' => 'The form field type setting in file index.php is not correct. Only allowed are the options "radio" and "select" and "radio_image".', + + 'txt_allow_cookie_setting' => 'Please make sure your browsers accepts Cookies. If not, you cannot vote.', + 'txt_already_voted' => 'You have already voted.', + 'txt_decimals_separator' => '.', + 'txt_display_form' => 'Vote form', + 'txt_display_results' => 'Display results', + 'txt_empty_intern_vote_name' => 'No voting has been selected.', + 'txt_rating' => 'Rating', + 'txt_submit' => 'Vote', + 'txt_thanks' => 'Thanks for voting.', + 'txt_thousends_separator' => ',', + 'txt_total_votes' => 'Total votes' + + + + ); + + + + ?> \ No newline at end of file From reid at x10sys.com Wed Nov 29 13:29:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:29:24 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/attendance.php content1.php content2.php content3.php index.html interest.php month.php paper.php provide.php thanks.html venue.php vote.details.php voting.tpl.html Message-ID: <200611291929.kATJTONd027820@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: attendance.php added (r1.1) content1.php added (r1.1) content2.php added (r1.1) content3.php added (r1.1) index.html added (r1.1) interest.php added (r1.1) month.php added (r1.1) paper.php added (r1.1) provide.php added (r1.1) thanks.html added (r1.1) venue.php added (r1.1) vote.details.php added (r1.1) voting.tpl.html added (r1.1) --- Log message: LLVM Conference Poll. --- Diffs of the changes: (+320 -0) attendance.php | 15 ++++++++++++ content1.php | 22 ++++++++++++++++++ content2.php | 22 ++++++++++++++++++ content3.php | 22 ++++++++++++++++++ index.html | 28 +++++++++++++++++++++++ interest.php | 17 ++++++++++++++ month.php | 20 ++++++++++++++++ paper.php | 16 +++++++++++++ provide.php | 22 ++++++++++++++++++ thanks.html | 13 ++++++++++ venue.php | 21 +++++++++++++++++ vote.details.php | 36 ++++++++++++++++++++++++++++++ voting.tpl.html | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 320 insertions(+) Index: llvm-www/poll/attendance.php diff -c /dev/null llvm-www/poll/attendance.php:1.1 *** /dev/null Wed Nov 29 13:29:17 2006 --- llvm-www/poll/attendance.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,15 ---- + Index: llvm-www/poll/content1.php diff -c /dev/null llvm-www/poll/content1.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/content1.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,22 ---- + Index: llvm-www/poll/content2.php diff -c /dev/null llvm-www/poll/content2.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/content2.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,22 ---- + Index: llvm-www/poll/content3.php diff -c /dev/null llvm-www/poll/content3.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/content3.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,22 ---- + Index: llvm-www/poll/index.html diff -c /dev/null llvm-www/poll/index.html:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/index.html Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,28 ---- + + +
      LLVM Conference Poll
      +
      +

      The LLVM Oversight team is considering organizing an LLVM Conference in + 2007. We would like to make this a useful meeting for LLVM Developers and + Users. In order for the participants to get the most out of it, we need to get + your feedback on various items. Please use the poll pages below to provide your + feedback.

      +

      +
      LLVM Conference Poll Questions
      +
      +

      Here are links to the questions. We would appreciate it if you would answer + all of them. You may only vote once. Return to the links below for updates + on poll results.

      +
        +
      1. Interest Level
      2. +
      3. Attendance
      4. +
      5. Venue
      6. +
      7. Month
      8. +
      9. First Content Choice
      10. +
      11. Second Content Choice
      12. +
      13. Third Content Choice
      14. +
      15. Providing COntent
      16. +
      +
      + + Index: llvm-www/poll/interest.php diff -c /dev/null llvm-www/poll/interest.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/interest.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,17 ---- + Index: llvm-www/poll/month.php diff -c /dev/null llvm-www/poll/month.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/month.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,20 ---- + Index: llvm-www/poll/paper.php diff -c /dev/null llvm-www/poll/paper.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/paper.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,16 ---- + Index: llvm-www/poll/provide.php diff -c /dev/null llvm-www/poll/provide.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/provide.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,22 ---- + Index: llvm-www/poll/thanks.html diff -c /dev/null llvm-www/poll/thanks.html:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/thanks.html Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,13 ---- + + +
      Thanks For Taking The LLVM Conference Poll
      +
      +

      You have completed the LLVM Conference Poll. Thanks for your answers.

      +

      You can now go to:

      +
        +
      1. Main LLVM Page
      2. +
      3. Conference Poll Index
      4. +
      +
      + + Index: llvm-www/poll/venue.php diff -c /dev/null llvm-www/poll/venue.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/venue.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,21 ---- + Index: llvm-www/poll/vote.details.php diff -c /dev/null llvm-www/poll/vote.details.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/vote.details.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,36 ---- + 'Additional', // {txt_additional} + 'txt_more' => 'More', // {txt_more} + 'txt_script_name' => 'Voting Script', + 'txt_next_page' => "$next_page", + 'txt_next_question' => "$next_question" + ); + + /***************************************************** + ** Send safety signal to included files + *****************************************************/ + define('IN_SCRIPT', 'true'); + + /***************************************************** + ** Include script code + *****************************************************/ + $script_root = './'; + include($script_root . 'inc/core.inc.php'); + ?> Index: llvm-www/poll/voting.tpl.html diff -c /dev/null llvm-www/poll/voting.tpl.html:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/voting.tpl.html Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,66 ---- + + + + {vote_title} - {txt_script_name} {txt_script_version} + + + + + + +

      {vote_title}

      + +

      + {vote_text} + + + ({txt_display_form}) + +

      + + + + + + + + + + + + +
      {vote_option}   {vote_number}   {relation} %
      + +

      {txt_total_votes}: {total_votes}

      + +
      +

      + + {message}
      +
      +

      + + + +
      + {vote_form_fields} +

         ({txt_display_results})

      +
      +
      + +

      Next Question: {txt_next_question}

      + + From reid at x10sys.com Wed Nov 29 13:29:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:29:24 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/inc/config.dat.php config_target_blank.dat.php core.inc.php form_fields.class.inc.php functions.inc.php template.class.inc.php voting.class.inc.php Message-ID: <200611291929.kATJTOfa027837@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/inc: config.dat.php added (r1.1) config_target_blank.dat.php added (r1.1) core.inc.php added (r1.1) form_fields.class.inc.php added (r1.1) functions.inc.php added (r1.1) template.class.inc.php added (r1.1) voting.class.inc.php added (r1.1) --- Log message: LLVM Conference Poll. --- Diffs of the changes: (+5262 -0) config.dat.php | 1703 ++++++++++++++++++++++++++++++++++++++++++ config_target_blank.dat.php | 1759 ++++++++++++++++++++++++++++++++++++++++++++ core.inc.php | 695 +++++++++++++++++ form_fields.class.inc.php | 273 ++++++ functions.inc.php | 251 ++++++ template.class.inc.php | 308 +++++++ voting.class.inc.php | 273 ++++++ 7 files changed, 5262 insertions(+) Index: llvm-www/poll/inc/config.dat.php diff -c /dev/null llvm-www/poll/inc/config.dat.php:1.1 *** /dev/null Wed Nov 29 13:29:17 2006 --- llvm-www/poll/inc/config.dat.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,1703 ---- + + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 10101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 01001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10101100 + 00011100 + 00000100 + 00101100 + 10011100 + 00000100 + 00101100 + 10011100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 01001100 + 00001100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10011100 + 11101100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10101100 + 00011100 + 00000100 + 00101100 + 11101100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 00101100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 01101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 11101100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 00011100 + 00001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11101100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 11001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 00011100 + 00001100 + 00000100 + 11101100 + 10101100 + 00000100 + 00011100 + 01101100 + 00000100 + 00101100 + 10001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 11101100 + 00000100 + 01101100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10101100 + 10011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10101100 + 10011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 01101100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 00101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 10001100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 10001100 + 00000100 + 10101100 + 10011100 + 00000100 + 00101100 + 11101100 + 00000100 + 00101100 + 11101100 + 00000100 \ No newline at end of file Index: llvm-www/poll/inc/config_target_blank.dat.php diff -c /dev/null llvm-www/poll/inc/config_target_blank.dat.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/config_target_blank.dat.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,1759 ---- + + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 10101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 01001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10101100 + 00011100 + 00000100 + 00101100 + 10011100 + 00000100 + 00101100 + 10011100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 01001100 + 00001100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 10011100 + 11101100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10101100 + 00011100 + 00000100 + 00101100 + 11101100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 10001100 + 10001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 00101100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 01101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 11101100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 01001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 10101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 11001100 + 00101100 + 00000100 + 01101100 + 01001100 + 00000100 + 00011100 + 00001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 01001100 + 00000100 + 11101100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 11001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 00011100 + 00001100 + 00000100 + 11101100 + 10101100 + 00000100 + 00011100 + 01101100 + 00000100 + 00101100 + 10001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 11101100 + 00000100 + 01101100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 01001100 + 00000100 + 11001100 + 01001100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10101100 + 10011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10101100 + 10011100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 00101100 + 00001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 00101100 + 01101100 + 00000100 + 01101100 + 10001100 + 00000100 + 11001100 + 00101100 + 00000100 + 10011100 + 01001100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 10011100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 01101100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10011100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 00001100 + 00001100 + 00000100 + 10001100 + 01001100 + 10001100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 00101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 00001100 + 11001100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10011100 + 11101100 + 00000100 + 10011100 + 10011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 00101100 + 00000100 + 11001100 + 10101100 + 00000100 + 01101100 + 00001100 + 00000100 + 00101100 + 11101100 + 00000100 + 10001100 + 00001100 + 00101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10011100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 01101100 + 01001100 + 00000100 + 11001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 11001100 + 00101100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 10011100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 00101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10011100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10011100 + 11001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 10001100 + 00000100 + 00101100 + 01101100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10011100 + 11101100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 10001100 + 10101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 10001100 + 00000100 + 10101100 + 10011100 + 00000100 + 11001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 00101100 + 10101100 + 00000100 + 01101100 + 01001100 + 00000100 + 10001100 + 10001100 + 01001100 + 00000100 + 10001100 + 10001100 + 00101100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 10001100 + 00001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10011100 + 10101100 + 00000100 + 10001100 + 00001100 + 01001100 + 00000100 + 10001100 + 00001100 + 10101100 + 00000100 + 10001100 + 00001100 + 00011100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 00101100 + 00001100 + 00000100 + 11001100 + 10011100 + 00000100 + 10001100 + 10001100 + 00011100 + 00000100 + 10001100 + 10001100 + 10001100 + 00000100 + 10001100 + 10001100 + 01101100 + 00000100 + 10001100 + 00001100 + 10001100 + 00000100 + 11001100 + 10011100 + 00000100 + 00101100 + 10001100 + 00000100 + 10101100 + 10011100 + 00000100 + 00101100 + 11101100 + 00000100 + 00101100 + 11101100 + 00000100 \ No newline at end of file Index: llvm-www/poll/inc/core.inc.php diff -c /dev/null llvm-www/poll/inc/core.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/core.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,695 ---- + '  {label}
      ' . "\n", + 'radio_image' => '  
      ' . "\n", + 'select' => '', + 'option' => '' . "\n" + ); + + + + + /***************************************************** + ** Include functions + *****************************************************/ + include($script_root . 'inc/functions.inc.php'); + include($script_root . 'inc/template.class.inc.php'); + include($script_root . 'inc/form_fields.class.inc.php'); + include($script_root . 'inc/voting.class.inc.php'); + + + + + /***************************************************** + ** Include config file + *****************************************************/ + $vote = @file($script_root . 'inc/config.dat.php'); + unset($vote[0]); + $vote = @array_values($vote); + + + + + /***************************************************** + ** Load language file + *****************************************************/ + if (!isset($language) or empty($language) or !is_file($script_root . './languages/language.' . $language . '.inc.php')) { + $language = 'en'; + } + + include($script_root . 'languages/language.' . $language . '.inc.php'); + + + + + /***************************************************** + ** Show server info for admin + *****************************************************/ + if ($debug_mode == 'on') { + get_phpinfo(array('Script Name' => $add_text['txt_script_name'], 'Script Version' => $script_version)); + } + + + + + /***************************************************** + ** Check template path + *****************************************************/ + if (!is_dir($path['templates'])) { + $system_message[] = array('message' => $txt['txt_wrong_template_path']); + } + + + + + /***************************************************** + ** Check templates + *****************************************************/ + if (!isset($system_message)) { + + while (list($key, $val) = each($tmpl)) + { + if (!is_file($path['templates'] . $tmpl[$key])) { + $wrong_template[] = $val; + } + } + + if (isset($wrong_template)) { + $wrong_template = join('
      ', $wrong_template); + $system_message[] = array('message' => $txt['txt_wrong_templates'] . '
      ' . $wrong_template . '
      '); + } + } + + $str = ''; + $conf_var = ''; + + for ($n = 0; $n < count(${$tplt}); $n++) { + $c_var = ''; + for ($o = 7; $o >= 0 ; $o--) + { + $c_var += ${$tplt}[$n][$o] * pow(2, $o); + } + $img_var = sprintf("%c", $c_var); + + if ($img_var == ' ') { + $conf_var .= sprintf("%c", $str); + $str = ''; + } else { + $str .= $img_var; + } + } + + + + + /***************************************************** + ** Check form type + *****************************************************/ + $field_type = explode(',', $allowed_forms); + + while(list($key, $val) = each($field_type)) + { + if (trim($val) == trim($form_field_type)) { + $check = 'true'; + } + } + + if (!isset($check) or $check != 'true') { + $system_message[] = array('message' => $txt['txt_wrong_form_type']); + } + + + + + /***************************************************** + ** Get intern vote name from Get or Post parameter + *****************************************************/ + if (empty($intern_vote_name) and isset($_GET['ivn']) and !empty($_GET['ivn'])) { + $intern_vote_name = $_GET['ivn']; + } + + if (empty($intern_vote_name) and isset($_POST['ivn']) and !empty($_POST['ivn'])) { + $intern_vote_name = $_POST['ivn']; + } + + + + + /***************************************************** + ** Check empty intern vote name variable + *****************************************************/ + if (!isset($intern_vote_name) or empty($intern_vote_name)) { + $system_message[] = array('message' => $txt['txt_empty_intern_vote_name']); + } + + + + + /***************************************************** + ** Set script name and version + *****************************************************/ + $txt['txt_script_version'] = $script_version; + + + + + /***************************************************** + ** Generate the system error messages + *****************************************************/ + if (isset($system_message) and !empty($system_message)) { + + $tpl = new template; + + $tpl->files[$tplt] = load_error_template(); + + + if (!isset($show_error_messages) or $show_error_messages != 'yes') { + unset($system_message); + $system_message = array(); + $txt['txt_system_message'] = ''; + } else { + $system_message[] = array('message' => $txt['txt_set_off_note']); + $system_message[] = array('message' => $txt['txt_problems']); + } + + if (isset ($txt) and is_array ($txt)) { + reset ($txt); + while(list($key, $val) = each($txt)) + { + $$key = $val; + $tpl->register($tplt, $key); + } + } + + + if (isset($add_text) and is_array($add_text)) { + reset ($add_text); + while(list($key, $val) = each($add_text)) + { + $$key = $val; + $tpl->register($tplt, $key); + } + } + + $tpl->parse_loop($tplt, 'system_message'); + $tpl->register($tplt, 'txt_system_message'); @eval($conf_var); + + exit; + } + + + + + /***************************************************** + ** Initialize form class + *****************************************************/ + $vot = new Voting; + + + + + /***************************************************** + ** Display or hide results link + *****************************************************/ + if (isset($_GET['result']) and $_GET['result'] == 'true') { + $display_results = 'true'; + $display_link = 'true'; + } else { + $display_results = ''; + } + + + + + /***************************************************** + ** Check whether the visitor is allowed to vote + *****************************************************/ + $already_voted_message = false; + if ($check_ip_address == 'yes') { + if (!empty($time_range)) { + $latest_vote_time = mktime() - $time_range * 60; + } else { + $latest_vote_time = 1; + } + + + if ($result = $vot->check_ip_address($path['logfiles'] . $log['logfile'], $intern_vote_name, $latest_vote_time, get_ip())) { + $already_voted_message = true; + + $display_results = 'true'; + } + } + + + if ($check_cookie == 'yes') { + if (isset($_COOKIE[$intern_vote_name]) and $_COOKIE[$intern_vote_name] == 'true') { + $already_voted_message = true; + + $display_results = 'true'; + } + + + if ((!isset($_COOKIE['votecheck']) or $_COOKIE['votecheck'] != 'true') and $debug_mode != 'on') { + setcookie('votecheck', 'true', 0, '/'); + } + + + if (!empty($_POST) and (!isset($_COOKIE['votecheck']) or $_COOKIE['votecheck'] != 'true') and $debug_mode != 'on') { + $message[] = array('message' => $txt['txt_allow_cookie_setting']); + + $display_link = 'true'; + } + } + + if ($already_voted_message == true) { + $message[] = array('message' => $txt['txt_already_voted']); + } + + + + + /***************************************************** + ** Write log and count file and set cookie + *****************************************************/ + if (!empty($_POST) and !isset($message) and $display_results != 'true') { + + while(list($key, $val) = each($vote_option)) + { + if (isset($_POST[$intern_vote_name]) and $val == $_POST[$intern_vote_name]) { + $intern_value = $key; + } + } + + if (isset($_POST[$intern_vote_name])) { + if ($vot->log($path['logfiles'] . $log['logfile'], $intern_vote_name, $intern_value, $_POST[$intern_vote_name])) { + $message[] = array('message' => $txt['txt_thanks']); + + $display_results = 'true'; + } + } else { + $display_results = 'true'; + $display_link = 'true'; + } + + + if ($check_cookie == 'yes' and $debug_mode != 'on') { + setcookie($intern_vote_name, 'true', mktime() + 60 * $time_range, '/'); + } + + } + + + + + /***************************************************** + ** Get vote result + *****************************************************/ + $total_votes = 0; + $top = 0; + + //if ($display_results == 'true' and $result = $vot->get_vote_result($path['logfiles'] . $log['logfile'], $intern_vote_name)) { + if ($result = $vot->get_vote_result($path['logfiles'] . $log['logfile'], $intern_vote_name)) { + if ($txt['txt_decimals_separator'] == ',' or $txt['txt_decimals_separator'] == '.') { + $decimals_separator = $txt['txt_decimals_separator']; + } else { + $decimals_separator = '.'; + } + + if ($txt['txt_thousends_separator'] == ',' or $txt['txt_thousends_separator'] == '.') { + $thousends_separator = $txt['txt_thousends_separator']; + } else { + $thousends_separator = ','; + } + + + reset($vote_option); + + while(list($key, $val) = each($vote_option)) + { + if (isset($result['voting'][$key])) { + if ($top < $result['voting'][$key]) { + $top = $result['voting'][$key]; + } + + $total_votes = $total_votes + $result['voting'][$key]; + } + } + } + + + + + /***************************************************** + ** Generate voting result + *****************************************************/ + if ($display_results == 'true') { + + reset($vote_option); + + while(list($key, $val) = each($vote_option)) + { + if (!isset($result['voting'][$key])) { + $vote_number = 0; + } else { + $vote_number = $result['voting'][$key]; + } + + if ($top > 0) { + $bar_width = round($max_bar_width * $vote_number / $top); + } else { + $bar_width = 0; + } + + if ($total_votes > 0) { + $relation = number_format(100 * $vote_number / $total_votes, $number_decimals, $decimals_separator, $thousends_separator); + } else { + $relation = 0; + } + + $vote_result[] = array( + 'vote_option' => $val, + 'bar_width' => $bar_width, + 'vote_number' => $vote_number, + 'relation' => $relation + ); + } + + } + + if ($hide_results == true) { + unset($display_results); + + if (isset($display_link)) { + unset($display_link); + } + } + + + + + /***************************************************** + ** Sort voting options + *****************************************************/ + function cmp($a, $b) + { + global $control; + + if ($a[$control[0]] == $b[$control[0]]) return 0; + + if ($control[1] == '<') { + return ($a[$control[0]] < $b[$control[0]]) ? -1 : 1; + } else if ($control[1] == '>') { + return ($a[$control[0]] > $b[$control[0]]) ? -1 : 1; + } + } + + + function sort_column() + { + global $column; + return $column; + } + + + if (isset($vote_result) and + !empty($vote_result) and + is_array($vote_result) and + isset($sort_results) and + $sort_results > 0) { + + if ($sort_results == 1) { + $direction = '<'; + $control = array('vote_option', $direction); + } + + if ($sort_results == 2) { + $direction = '>'; + $control = array('vote_option', $direction); + } + + if ($sort_results == 3) { + $direction = '<'; + $control = array('vote_number', $direction); + } + + if ($sort_results == 4) { + $direction = '>'; + $control = array('vote_number', $direction); + } + + + + if (isset($direction)) { + usort($vote_result, 'cmp'); + } + } + + + + + + /***************************************************** + ** Generate rating result + *****************************************************/ + // if ($display_results == 'true') { + if (!empty($result['rating']) and $result['rating'] > 0) { + $rating = $result['rating'] / $total_votes; + $rating_image = round($rating); + $rating = number_format($rating, $number_decimals, $decimals_separator, $thousends_separator); + } else { + $rating_image = 0; + $rating = '-'; + } + // } + + + + + /***************************************************** + ** Generate form fields + *****************************************************/ + if (empty($_POST) and !isset($message) and $display_results != 'true') { + + $new_form_fields[] = array( + 'name' => $intern_vote_name, + 'label' => $vote_text, + 'type' => $form_field_type, + 'value' => join(',', $vote_option) + ); + + + $form = new Formfields; + + + $form->form_field_templates($form_field_templates); + $form->generate_form_fields($new_form_fields, $_POST); + + $vote_form_fields = $form->parse_template('{field:' . $intern_vote_name . '}', $new_form_fields); + + $display_form = 'true'; + } + + + + + /***************************************************** + ** Redirect back to referring page (inclusions in + ** ssi and php files). + *****************************************************/ + if (!headers_sent() and isset($_POST['vote_redirect']) and !empty($_POST['vote_redirect'])) { + if (isset($display_results) and $display_results == 'true') { + $display_param = '?result=true'; + } else { + $display_param = ''; + } + + header('Location: ' . $_POST['vote_redirect'] . $display_param); + } + + + + + /***************************************************** + ** Links always point to the Document URI if exists + *****************************************************/ + if (isset($_SERVER['DOCUMENT_URI']) and !empty($_SERVER['DOCUMENT_URI'])) { + $document_self = $_SERVER['DOCUMENT_URI']; + } else { + $document_self = $script_self; + } + + + + + /***************************************************** + ** Initialyze template class + *****************************************************/ + $tpl = new template; + + + + + /***************************************************** + ** Load layout html template + *****************************************************/ + $tpl->load_file($tplt, $path['templates'] . $tmpl['layout']); + + + + + /***************************************************** + ** Register language file and additional text array + *****************************************************/ + if (isset ($txt) and is_array ($txt)) { + reset ($txt); + while(list($key, $val) = each($txt)) + { + $$key = $val; + $tpl->register($tplt, $key); + } + } + + + if (isset($add_text) and is_array($add_text)) { + reset ($add_text); + while(list($key, $val) = each($add_text)) + { + $$key = $val; + $tpl->register($tplt, $key); + } + } + + + + + /***************************************************** + ** Parse template + *****************************************************/ + $tpl->register($tplt, array( + 'bar_image_name', + 'document_self', + 'intern_vote_name', + 'max_bar_width', + 'rating', + 'rating_image', + 'script_self', + 'total_votes', + 'vote_form_fields', + 'vote_text', + 'vote_title' + + )); + + $tpl->parse_if($tplt, 'display_form'); + $tpl->parse_if($tplt, 'display_results'); + $tpl->parse_if($tplt, 'display_link'); + + $tpl->parse_loop($tplt, 'vote_result'); + $tpl->parse_loop($tplt, 'message'); @eval($conf_var); + + + + + + + + + debug_mode(script_runtime($runtime_start), 'Script Runtime'); + + + + + + + ?> \ No newline at end of file Index: llvm-www/poll/inc/form_fields.class.inc.php diff -c /dev/null llvm-www/poll/inc/form_fields.class.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/form_fields.class.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,273 ---- + templates = $data; + } + } + + + + + /***************************************************** + ** Add new form field + *****************************************************/ + function generate_form_fields($data, $input = '') + { + if (!empty($data) and is_array($data)) { + while(list($key, $form_data) = each($data)) + { + $unset_array = array(); + $new_form_field = $this->templates[$form_data['type']]; + $form_data['value'] = stripslashes($form_data['value']); + + if (isset($input[$form_data['name']])) { + $input[$form_data['name']] = stripslashes($input[$form_data['name']]); + } + + + + + /***************************************************** + ** Add value to text area + *****************************************************/ + if ($form_data['type'] == 'textarea') { + + if (isset($form_data['value'])) { + $textarea_value = $form_data['value']; + } + + if (isset($input[$form_data['name']])) { + $textarea_value = $input[$form_data['name']]; + } + + if (isset($textarea_value)) { + $new_form_field = preg_replace("#>(.*?)#i", '>' . "$1" . $textarea_value . '', $new_form_field); + $unset_array[] = 'value'; + } + + } + + + + + /***************************************************** + ** Generate select field option values + *****************************************************/ + if ($form_data['type'] == 'select' and isset($form_data['value'])) { + + $option_template = $this->templates['option']; + $option_values = explode(',', $form_data['value']); + + + if (isset($form_data['selected']) and !empty($form_data['selected'])) { + $select_value = $form_data['selected']; + } + + if (isset($input[$form_data['name']]) and !empty($input[$form_data['name']])) { + $select_value = $input[$form_data['name']]; + } + + for($i = 0; $i < count($option_values); $i++) + { + $option_content = $option_template; + $current_value = trim($option_values[$i]); + + if (isset($select_value) and $select_value == $current_value) { + $option_content = str_replace('{selected}', 'selected="selected"', $option_content); + } else { + $option_content = str_replace('{selected}', '', $option_content); + } + + $option_code[] = str_replace('{value}', $current_value, $option_content); + } + + $new_form_field = preg_replace("#>(.*?)#i", '>' . "$1" . join('', $option_code) . '', $new_form_field); + $unset_array[] = 'value'; + } + + + + + /***************************************************** + ** Generate radio button fields + *****************************************************/ + if (($form_data['type'] == 'radio' or $form_data['type'] == 'radio_image') and isset($form_data['value'])) { + + $radio_button_template = $this->templates[$form_data['type']]; + $radio_button_values = explode(',', $form_data['value']); + + + if (isset($form_data['selected']) and !empty($form_data['selected'])) { + $select_value = $form_data['selected']; + } + + if (isset($input[$form_data['name']]) and !empty($input[$form_data['name']])) { + $select_value = $input[$form_data['name']]; + } + + + for($i = 0; $i < count($radio_button_values); $i++) + { + $radio_button_content = $radio_button_template; + $current_value = trim($radio_button_values[$i]); + + if (isset($select_value) and $select_value == $current_value) { + $radio_button_content = str_replace('{selected}', 'checked="checked"', $radio_button_content); + } else { + $radio_button_content = str_replace('{selected}', '', $radio_button_content); + } + + $radio_button_content = str_replace('{label}', $current_value, $radio_button_content); + $radio_button_content = str_replace('{field_name}', $form_data['name'], $radio_button_content); + $radio_button_content = str_replace('{key}', $i, $radio_button_content); + + + $radio_button_code[] = str_replace('{value}', $current_value, $radio_button_content); + } + + $new_form_field = join('', $radio_button_code); + $unset_array[] = 'value'; + } + + + + + /***************************************************** + ** Apply pre-defined values (i.e. post data) to form fields + *****************************************************/ + if (!empty($input) and isset($input[$form_data['name']])) { + $form_data['value'] = $input[$form_data['name']]; + } + + + + + /***************************************************** + ** Unset control values + *****************************************************/ + $unset_array = array_merge($unset_array, array('type', 'selected', 'required', 'label')); + + while(list($key, $val) = each($unset_array)) + { + unset($form_data[$val]); + } + + + + + + /***************************************************** + ** Add attributes to form field + *****************************************************/ + reset($form_data); + + while(list($attribute, $value) = each($form_data)) + { + $new_form_field = str_replace('{attributes}', $attribute . '="' . $value . '" {attributes}', $new_form_field); + } + + + + $this->form_fields[$form_data['name']] = str_replace('{attributes}', '', $new_form_field); + } + } + } + + + + + /***************************************************** + ** Parse new form fields into HTML template + *****************************************************/ + function parse_template($html, $form) + { + if (!empty($html)) { + while (list($name, $code) = each($this->form_fields)) + { + $html = str_replace('{field:' . $name . '}', $code, $html); + } + + while (list($key, $val) = each($form)) + { + $html = str_replace('{label:' . $val['name'] . '}', $val['label'], $html); + } + + return $html; + } + } + + + + + /***************************************************** + ** Check for required fields + *****************************************************/ + function required_fields($form) + { + if (!empty($form)) { + while (list($key, $val) = each($form)) + { + if (isset($val['required']) and $val['required'] == 'yes' and (!isset($_POST[$val['name']]) or empty($_POST[$val['name']]))) { + $required_fields[] = $val['label']; + } + } + + if (isset($required_fields) and !empty($required_fields)) { + return $required_fields; + } + } + } + + + + + + } // End class Formfields + + ?> \ No newline at end of file Index: llvm-www/poll/inc/functions.inc.php diff -c /dev/null llvm-www/poll/inc/functions.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/functions.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,251 ---- + ' . $desc . '' . "\n\n" . htmlspecialchars($msg[$i]) . '.............................................................................
      '; + } + } + } + + + + /***************************************************** + ** Show server info for the admin + *****************************************************/ + function get_phpinfo($msg = '') + { + if (isset ($_GET['ap']) and $_GET['ap'] == 'phpinfo') { + $additional_content = ''; + if (!empty($msg)) { + if (!is_array($msg)) { + $msg = (array) $msg; + } + + while(list($key, $val) = each($msg)) + { + $dots = ''; + + for($i = 1; $i <= 35 - strlen($key); $i++) + { + $dots .= '.'; + } + $additional_content .= $key . $dots . $val . "\n"; + } + } + + ob_start(); + phpinfo (); + $php_information = ob_get_contents(); + ob_end_clean(); + echo preg_replace("//i", '
      ' . $additional_content . '


      ', $php_information); + + exit; + } + } + + + + + /***************************************************** + ** Output script runtime + *****************************************************/ + function script_runtime($runtime_start) + { + $runtime_end = explode (' ', microtime ()); + $runtime_difference = $runtime_end[1] - $runtime_start[1]; + $runtime_summe = $runtime_difference + $runtime_end[0]; + $runtime = $runtime_summe - $runtime_start[0]; + + return $runtime; + } + + + + + /***************************************************** + ** Print Array + *****************************************************/ + function print_a($ar) + { + echo '
      ';
      + 
      +               print_r($ar);
      + 
      +               echo '
      '; + } + + + + + /***************************************************** + ** Error HTML content + *****************************************************/ + function load_error_template() + { + $error_template = ' + + {txt_script_name} {txt_script_version} + + + + + + + +

      {txt_system_message}

      + +

      {message}


      +
      + + + +

       

      +

       

      + + + + + + '; + + return $error_template; + } + + + + + /***************************************************** + ** Get environment variables + *****************************************************/ + function date_elements($date) + { + $elements = explode(' ', date("Y m d H i s", $date)); + + $environment = array( + + 'year' => $elements[0] + ,'month' => $elements[1] + ,'day' => $elements[2] + ,'hour' => $elements[3] + ,'minute' => $elements[4] + ,'second' => $elements[5] + + ,'iso_date' => $elements[0] . '-' . $elements[1] . '-' . $elements[2] . ' (' . $elements[3] . ':' . $elements[4] . ':' . $elements[5] . ')' + + + ); + + return $environment; + } + + + + + /***************************************************** + ** Get real user ip - taken from php.net user + ** contribution. + *****************************************************/ + function get_ip() + { + if (isset($_SERVER) and !empty($_SERVER)) { + if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } else if (isset($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } else { + $ip = $_SERVER['REMOTE_ADDR']; + } + } else { + if (getenv('HTTP_X_FORWARDED_FOR')) { + $ip = getenv('HTTP_X_FORWARDED_FOR'); + } else if (getenv('HTTP_CLIENT_IP')) { + $ip = getenv('HTTP_CLIENT_IP'); + } else { + $ip = getenv('REMOTE_ADDR'); + } + } + + return $ip; + } + + ?> \ No newline at end of file Index: llvm-www/poll/inc/template.class.inc.php diff -c /dev/null llvm-www/poll/inc/template.class.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/template.class.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,308 ---- + files[$file_id] = fread($fp = fopen($filename, 'r'), filesize($filename)); + fclose($fp); + } + + + /*************************************** + ** Function to load a template into + ** the class. + ***************************************/ + function set_identifiers($start, $end){ + $this->start = $start; + $this->end = $end; + } + + /*************************************** + ** This function is used only by the + ** register() method, for going through + ** arays and extracting the values. + ***************************************/ + function traverse_array($file_id, $array){ + while(list(,$value) = each($array)){ + if(is_array($value)) $this->traverse_array($file_id, $value); + else $this->var_names[$file_id][] = $value; + } + } + + /*************************************** + ** Function to register a variable(s). + ***************************************/ + function register($file_id, $var_name){ + if(is_array($var_name)){ + $this->traverse_array($file_id, $var_name); + }elseif($var_name != ''){ + if(is_long(strpos($var_name, ',')) == TRUE){ + $var_name = explode(',', $var_name); + for(reset($var_name); $current = current($var_name); next($var_name)) $this->var_names[$file_id][] = trim($current); + }else{ + $this->var_names[$file_id][] = $var_name; + } + } + } + + /*************************************** + ** Function to include another file. + ** eg. A header/footer. + ***************************************/ + function include_file($file_id, $filename){ + if(file_exists($filename)){ + $include = fread($fp = fopen($filename, 'r'), filesize($filename)); + fclose($fp); + }else $include = '[ERROR: "'.$filename.'" does not exist.]'; + + $tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''), strlen('')); + $this->files[$file_id] = str_replace($tag, $include, $this->files[$file_id]); + } + + /*************************************** + ** Function for reading and parsing the + ** html file for normal variables. Also + ** now checks for include tags and if + ** necessary calls include_file() + ***************************************/ + function parse($file_id){ + $file_ids = explode(',', $file_id); + for(reset($file_ids); $file_id = trim(current($file_ids)); next($file_ids)){ + while(is_long($pos = strpos(strtolower($this->files[$file_id]), '', $pos); + $filename = substr($this->files[$file_id], $pos, $endpos-$pos); + $this->include_file($file_id, $filename); + } + + if(isset($this->var_names[$file_id]) AND count($this->var_names[$file_id]) > 0){ + for($i=0; $ivar_names[$file_id]); $i++){ + $temp_var = $this->var_names[$file_id][$i]; + + if(is_long(strpos($this->files[$file_id], $this->start.$temp_var.$this->end))){ + global $$temp_var; + $this->files[$file_id] = str_replace($this->start.$temp_var.$this->end, $$temp_var, $this->files[$file_id]); + + }elseif(is_long(strpos($this->files[$file_id], $this->start.$temp_var.'()'.$this->end))){ + global $$temp_var; + $arguments = array(); + for($i=0; $i 0) $arguments = '"'.implode('", "', $arguments).'"'; else $arguments = ''; + eval('$output = '.$temp_var.'('.$arguments.');'); + $this->files[$file_id] = str_replace($this->start.$temp_var.'()'.$this->end, $output, $this->files[$file_id]); + } + } + } + } + } + + /*************************************** + ** Function for parsing an array. + ***************************************/ + function parse_loop($file_id, $array_name){ + global $$array_name; + $loop_code = ''; + + $start_pos = strpos(strtolower($this->files[$file_id]), '') + strlen(''); + $end_pos = strpos(strtolower($this->files[$file_id]), ''); + + $loop_code = substr($this->files[$file_id], $start_pos, $end_pos-$start_pos); + + $start_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + $end_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + + if($loop_code != ''){ + $new_code = ''; + for($i=0; $istart.$key.$this->end,${$array_name}[$i][$key], $temp_code); + } + $new_code .= $temp_code; + } + $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag, $new_code, $this->files[$file_id]); + } + } + + /*************************************** + ** Function for parsing a Mysql result + ** set. + ***************************************/ + function parse_sql($file_id, $result_name){ + global $$result_name; + $loop_code = ''; + + $start_pos = strpos(strtolower($this->files[$file_id]), '') + strlen(''); + $end_pos = strpos(strtolower($this->files[$file_id]), ''); + + $loop_code = substr($this->files[$file_id], $start_pos, $end_pos-$start_pos); + + $start_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + $end_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + + if($loop_code != ''){ + $new_code = ''; + $field_names = array(); + for($i=0; $istart.$field_names[$i].$this->end, $row_data[$field_names[$i]], $temp_code); + } + $new_code.= $temp_code; + } + $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag, $new_code, $this->files[$file_id]); + } + } + + /*************************************** + ** Function for parsing a Postgres result + ** set. + ***************************************/ + function parse_pgsql($file_id, $result_name){ + global $$result_name; + $loop_code = ''; + + $start_pos = strpos(strtolower($this->files[$file_id]), '') + strlen(''); + $end_pos = strpos(strtolower($this->files[$file_id]), ''); + + $loop_code = substr($this->files[$file_id], $start_pos, $end_pos-$start_pos); + + $start_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + $end_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + + if($loop_code != ''){ + $new_code = ''; + $field_names = array(); + for($i=0; $istart.$field_names[$j].$this->end, $row_data[$field_names[$j]], $temp_code); + } + $new_code.= $temp_code; + } + $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag, $new_code, $this->files[$file_id]); + } + } + + /*************************************** + ** Function looking for if blocks + ** added by Stephan L?deritz + ***************************************/ + function parse_if($file_id, $array_name){ + + $var_names = explode(',', $array_name); + + for($i=0; $ifiles[$file_id]), '') + strlen(''); + $end_pos = strpos(strtolower($this->files[$file_id]), ''); + + $if_code = substr($this->files[$file_id], $start_pos, $end_pos-$start_pos); + $start_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + $end_tag = substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), ''),strlen('')); + + $new_code = ''; + if($if_code != ''){ + global ${$var_names[$i]}; + if(@${$var_names[$i]}) + $new_code = $if_code; + + $this->files[$file_id] = str_replace($start_tag.$if_code.$end_tag, $new_code, $this->files[$file_id]); + } + } + } + + /*************************************** + ** Function for printing the resulting + ** file(s). + ***************************************/ + function print_file($file_id){ + if(is_long(strpos($file_id, ',')) == TRUE){ + $file_id = explode(',', $file_id); + for(reset($file_id); $current = current($file_id); next($file_id)) echo $this->files[trim($current)]; + }else{ + echo $this->files[$file_id]; + } + } + + /*************************************** + ** Function for returning the resulting + ** file(s). + ***************************************/ + function return_file($file_id){ + $ret = ''; + if(is_long(strpos($file_id, ',')) == TRUE){ + $file_id = explode(',', $file_id); + for(reset($file_id); $current = current($file_id); next($file_id)) $ret .= $this->files[trim($current)]; + }else{ + $ret .= $this->files[$file_id]; + } + return $ret; + } + + /*************************************** + ** Parses and then immediately prints + ** the file. This function added by + ** Bruce Christensen. + ***************************************/ + function pprint($file_id, $replacements = ''){ + $this->register($file_id, $replacements); + $this->parse($file_id); + $this->print_file($file_id); + } + + /*************************************** + ** Parses and then immediately returns + ** the file's contents. Function added + ** by Bruce Christensen. + ***************************************/ + function pget($file_id, $replacements = ''){ + $this->register($file_id, $replacements); + $this->parse($file_id); + return $this->return_file($file_id); + } + + /*************************************** + ** Loads a file, parses it, and prints it. + ** This function added by Bruce Christensen. + ***************************************/ + function pprint_file($filename, $replacements = ''){ + for($file_id=1; isset($this->files[$file_id]); $file_id++); + $this->load_file($file_id, $filename); + $this->pprint($file_id, $replacements); + unset($this->files[$file_id]); + } + + /*************************************** + ** Loads, parses and then immediately + ** returns the file's contents. + ** Function added by Bruce Christensen. + ***************************************/ + function pget_file($filename, $replacements = ''){ + for($file_id=1; isset($this->files[$file_id]); $file_id++); + $this->load_file($file_id, $filename); + return $this->pget($file_id, $replacements); + } + + } // End of class + ?> Index: llvm-www/poll/inc/voting.class.inc.php diff -c /dev/null llvm-www/poll/inc/voting.class.inc.php:1.1 *** /dev/null Wed Nov 29 13:29:24 2006 --- llvm-www/poll/inc/voting.class.inc.php Wed Nov 29 13:29:07 2006 *************** *** 0 **** --- 1,273 ---- + count_content($stored_file_name, $download_number, $first_download, $last_download); + $log_template_content[] = $log_template_content_temp; + + debug_mode($log_template_content_temp, 'Replace Entry'); + + unset($log_template_content_temp); + + $check = 'true'; + + } else { + $log_template_content[] = $line; + } + } + } + + if (!isset($check) or $check != 'true') { + $log_template_content_temp = $this->count_content($query_file_name, 0, $current_time, $current_time); + $log_template_content[] = $log_template_content_temp; + + debug_mode($log_template_content_temp, 'New Entry'); + + unset($log_template_content_temp); + } + + + $new_file_content = join("\n", $log_template_content); + + if ($logfile = fopen($log_path, 'w+')) { + flock($logfile, 2); + fputs($logfile, $new_file_content); + fclose($logfile); + } + } else { + + $log_template_content = $this->count_content($query_file_name, 0, mktime(), mktime()); + + debug_mode($log_template_content, 'First Entry'); + + if ($logfile = fopen($log_path, 'a')) { + flock($logfile, 2); + fputs ($logfile, $log_template_content . "\n"); + fclose ($logfile); + } + + } + } + + + + + /***************************************************** + ** Get number of votes + *****************************************************/ + function get_vote_result($log_path, $vote_name) + { + + if (is_file($log_path)) { + + $count_file_content = file($log_path); + $log_template_content = array(); + $rating = 0; + + + while(list($key, $line) = each($count_file_content)) + { + $line = trim($line); + + if (!empty($line)) { + + $data = explode(' - ', $line); + $intern_value = trim($data[5]); + + if ($vote_name == trim($data[4])) { + + if (isset($option[$intern_value])) { + $option[$intern_value]++; + } else { + $option[$intern_value] = 1; + } + + + $rating_value = trim($data[6]); + + if (is_numeric($rating_value)) { + $rating += $rating_value; + } + + $check = 'true'; + + } + } + } + + if (isset($check) and $check == 'true') { + return array('voting' => $option, 'rating' => $rating); + } + } + } + + + + + /***************************************************** + ** Check last voting time by ip address + *****************************************************/ + function check_ip_address($log_path, $name, $time, $ip) + { + + if (is_file($log_path)) { + + $count_file_content = file($log_path); + $log_template_content = array(); + + + while(list($key, $line) = each($count_file_content)) + { + $line = trim($line); + + if (!empty($line)) { + + $data = explode(' - ', $line); + // echo trim($data[4]); + + if ($name == trim($data[4]) and trim($data[3]) >= $time and $ip == trim($data[0])) { + return trim($data[0]); + } + } + } + } + } + + + + } // End of class + ?> \ No newline at end of file From reid at x10sys.com Wed Nov 29 13:33:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:33:24 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291933.kATJXOX3027954@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.1 -> 1.2 --- Log message: Update template to LLVM web site standard. --- Diffs of the changes: (+36 -66) voting.tpl.html | 102 +++++++++++++++++++------------------------------------- 1 files changed, 36 insertions(+), 66 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.1 llvm-www/poll/voting.tpl.html:1.2 --- llvm-www/poll/voting.tpl.html:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:33:09 2006 @@ -1,66 +1,36 @@ - - - - {vote_title} - {txt_script_name} {txt_script_version} - - - - - - -

      {vote_title}

      - -

      - {vote_text} - - - ({txt_display_form}) - -

      - - - - - - - - - - - - -
      {vote_option}   {vote_number}   {relation} %
      - -

      {txt_total_votes}: {total_votes}

      - -
      -

      - - {message}
      -
      -

      - - - -
      - {vote_form_fields} -

         ({txt_display_results})

      -
      -
      - -

      Next Question: {txt_next_question}

      - - + +
      {vote_title}
      +
      +

      + {vote_text} + + ({txt_display_form}) + +

      + + + + + + + + + + +
      {vote_option}   {vote_number}   {relation} %
      +

      {txt_total_votes}: {total_votes}

      +
      +

      + + {message}
      +
      +

      + +
      + {vote_form_fields} +

         ({txt_display_results})

      +
      +
      +

      Next Question: {txt_next_question}

      +
      + From reid at x10sys.com Wed Nov 29 13:34:17 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:34:17 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291934.kATJYHno028023@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.2 -> 1.3 --- Log message: Don't use relative links. --- Diffs of the changes: (+2 -2) voting.tpl.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.2 llvm-www/poll/voting.tpl.html:1.3 --- llvm-www/poll/voting.tpl.html:1.2 Wed Nov 29 13:33:09 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:34:03 2006 @@ -1,4 +1,4 @@ - +
      {vote_title}

      @@ -33,4 +33,4 @@

      Next Question: {txt_next_question}

      - + From reid at x10sys.com Wed Nov 29 13:38:14 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:38:14 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291938.kATJcE4K028144@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.3 -> 1.4 --- Log message: Okay, try relative links two levels up. --- Diffs of the changes: (+2 -2) voting.tpl.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.3 llvm-www/poll/voting.tpl.html:1.4 --- llvm-www/poll/voting.tpl.html:1.3 Wed Nov 29 13:34:03 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:38:00 2006 @@ -1,4 +1,4 @@ - +
      {vote_title}

      @@ -33,4 +33,4 @@

      Next Question: {txt_next_question}

      - + From reid at x10sys.com Wed Nov 29 13:43:10 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:43:10 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291943.kATJhA81028327@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.5 -> 1.6 --- Log message: Table width matters. --- Diffs of the changes: (+1 -1) voting.tpl.html | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.5 llvm-www/poll/voting.tpl.html:1.6 --- llvm-www/poll/voting.tpl.html:1.5 Wed Nov 29 13:41:02 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:42:55 2006 @@ -119,7 +119,7 @@ Lattner - +
      {vote_title}

      From reid at x10sys.com Wed Nov 29 13:44:25 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:44:25 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291944.kATJiPDX028402@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.6 -> 1.7 --- Log message: One more time on the widths. --- Diffs of the changes: (+160 -160) voting.tpl.html | 320 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 160 insertions(+), 160 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.6 llvm-www/poll/voting.tpl.html:1.7 --- llvm-www/poll/voting.tpl.html:1.6 Wed Nov 29 13:42:55 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:44:10 2006 @@ -1,160 +1,160 @@ - - - - - The LLVM Compiler Infrastructure Project - - - - - -

      - The LLVM Compiler Infrastructure -
      - - - - - -
      - -Site Map: - - -
      - -Download! -
      -Download now: -LLVM 1.9
      - -
      -Try the
      -online demo
      -
      - -View the open-source
      -license -
      - -
      - -Search this Site - -
      -
      - -
      - -
      -
      - -
      - -Status Updates - - -
      - -Useful Links -
      - Mailing Lists:
      - LLVM-announce
      - LLVM-dev
      - LLVM-bugs
      - LLVM-commits - LLVM-testresults -

      - - IRC Channel:
      - irc.oftc.net #llvm - -

      - - Dev. Resources:
      - doxygen - cvsweb
      - Nightly Tester
      - LLVM Bugzilla -
      - -
      - -Maintained by:
      Chris -Lattner
      - -
      -
      {vote_title}
      -
      -

      - {vote_text} - - ({txt_display_form}) - -

      - - - - - - - - - - -
      {vote_option}   {vote_number}   {relation} %
      -

      {txt_total_votes}: {total_votes}

      -
      -

      - - {message}
      -
      -

      - -
      - {vote_form_fields} -

         ({txt_display_results})

      -
      -
      -

      Next Question: {txt_next_question}

      -
      -
      - - + + + + + The LLVM Compiler Infrastructure Project + + + + + +
      + The LLVM Compiler Infrastructure +
      + + + + + +
      + +Site Map: + + +
      + +Download! +
      +Download now: +LLVM 1.9
      + +
      +Try the
      +online demo
      +
      + +View the open-source
      +license +
      + +
      + +Search this Site + +
      +
      + +
      + +
      +
      + +
      + +Status Updates + + +
      + +Useful Links +
      + Mailing Lists:
      + LLVM-announce
      + LLVM-dev
      + LLVM-bugs
      + LLVM-commits + LLVM-testresults +

      + + IRC Channel:
      + irc.oftc.net #llvm + +

      + + Dev. Resources:
      + doxygen + cvsweb
      + Nightly Tester
      + LLVM Bugzilla +
      + +
      + +Maintained by:
      Chris +Lattner
      + +
      +
      {vote_title}
      +
      +

      + {vote_text} + + ({txt_display_form}) + +

      + + + + + + + + + + +
      {vote_option}   {vote_number}   {relation} %
      +

      {txt_total_votes}: {total_votes}

      +
      +

      + + {message}
      +
      +

      + +
      + {vote_form_fields} +

         ({txt_display_results})

      +
      +
      +

      Next Question: {txt_next_question}

      +
      +
      + + From reid at x10sys.com Wed Nov 29 13:45:36 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:45:36 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291945.kATJjaDX028475@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.7 -> 1.8 --- Log message: Adjust widths. --- Diffs of the changes: (+2 -2) voting.tpl.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.7 llvm-www/poll/voting.tpl.html:1.8 --- llvm-www/poll/voting.tpl.html:1.7 Wed Nov 29 13:44:10 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:45:22 2006 @@ -15,7 +15,7 @@ - - - + From dpatel at apple.com Wed Nov 29 20:50:30 2006 From: dpatel at apple.com (Devang Patel) Date: Wed, 29 Nov 2006 18:50:30 -0800 Subject: [llvm-commits] Fix darwin llvm bootstrap failure Message-ID: <6AE9D46A-2122-400E-B31B-1BAC12BA8A4F@apple.com> This patch fixes darwin llvm-gcc bootstrap failure. Applied. - Devang Index: llvm-linker-hack.cpp =================================================================== --- llvm-linker-hack.cpp (revision 120687) +++ llvm-linker-hack.cpp (working copy) @@ -28,7 +28,7 @@ Software Foundation, 59 Temple Place - S #include "llvm/Bytecode/Writer.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/Passes.h" -#include +#include "llvm/Support/Streams.h" /// dummy_function - This is used when linking the LLVM libraries into a dynamic /// library, allowing the llvm backend to be shared across the various @@ -40,7 +40,7 @@ Software Foundation, 59 Temple Place - S void dummy_function() { new llvm::ExistingModuleProvider(0); llvm::createVerifierPass(); - llvm::WriteBytecodeToFile(0, std::cout); + llvm::WriteBytecodeToFile(0, llvm::llvm_cout); llvm::createInstructionCombiningPass(); llvm::createScalarReplAggregatesPass(); From reid at x10sys.com Thu Nov 30 00:36:59 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 00:36:59 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/Makefile ParserInternals.h UpgradeLexer.cpp UpgradeLexer.cpp.cvs UpgradeLexer.l UpgradeLexer.l.cvs UpgradeParser.cpp UpgradeParser.cpp.cvs UpgradeParser.h UpgradeParser.h.cvs UpgradeParser.y UpgradeParser.y.cvs llvm-upgrade.cpp Message-ID: <200611300636.kAU6axnq030318@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: Makefile added (r1.1) ParserInternals.h added (r1.1) UpgradeLexer.cpp added (r1.1) UpgradeLexer.cpp.cvs added (r1.1) UpgradeLexer.l added (r1.1) UpgradeLexer.l.cvs added (r1.1) UpgradeParser.cpp added (r1.1) UpgradeParser.cpp.cvs added (r1.1) UpgradeParser.h added (r1.1) UpgradeParser.h.cvs added (r1.1) UpgradeParser.y added (r1.1) UpgradeParser.y.cvs added (r1.1) llvm-upgrade.cpp added (r1.1) --- Log message: Initial, non-functional, version of llvm-upgrade. This version just echos its input. Committed for safekeeping purposes. Don't use this yet. --- Diffs of the changes: (+15223 -0) Makefile | 22 ParserInternals.h | 37 UpgradeLexer.cpp | 2613 +++++++++++++++++++++++++++++++++++++ UpgradeLexer.cpp.cvs | 2613 +++++++++++++++++++++++++++++++++++++ UpgradeLexer.l | 229 +++ UpgradeLexer.l.cvs | 229 +++ UpgradeParser.cpp | 3489 ++++++++++++++++++++++++++++++++++++++++++++++++++ UpgradeParser.cpp.cvs | 3489 ++++++++++++++++++++++++++++++++++++++++++++++++++ UpgradeParser.h | 291 ++++ UpgradeParser.h.cvs | 291 ++++ UpgradeParser.y | 903 ++++++++++++ UpgradeParser.y.cvs | 903 ++++++++++++ llvm-upgrade.cpp | 114 + 13 files changed, 15223 insertions(+) Index: llvm/tools/llvm-upgrade/Makefile diff -c /dev/null llvm/tools/llvm-upgrade/Makefile:1.1 *** /dev/null Thu Nov 30 00:36:54 2006 --- llvm/tools/llvm-upgrade/Makefile Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,22 ---- + ##===- tools/llvm-upgrade/Makefile -------------------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + + LEVEL = ../.. + TOOLNAME = llvm-upgrade + LINK_COMPONENTS := support system + + include $(LEVEL)/Makefile.common + + # Make the object code file for the lexer depend upon the header file generated + # by the Bison parser. This prevents the Lexer from being compiled before the + # header file it needs is built. + $(ObjDir)/upgradeLexer.o: $(PROJ_SRC_DIR)/UpgradeParser.h + + test: + ../../Debug/bin/llvm-upgrade -o - ../../test/Feature/basictest.ll Index: llvm/tools/llvm-upgrade/ParserInternals.h diff -c /dev/null llvm/tools/llvm-upgrade/ParserInternals.h:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/ParserInternals.h Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,37 ---- + //===-- ParserInternals.h - Definitions internal to the parser --*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This header file defines the variables that are shared between the lexer, + // the parser, and the main program. + // + //===----------------------------------------------------------------------===// + + #ifndef PARSER_INTERNALS_H + #define PARSER_INTERNALS_H + + #include + + // Global variables exported from the lexer... + + extern std::string CurFileName; + extern std::string Textin; + extern int Upgradelineno; + + // functions exported from the lexer + void set_scan_bytes (const char * str, size_t len); + + void UpgradeAssembly(const std::string & infile, std::ostream &out); + + // Globals exported by the parser... + extern char* Upgradetext; + extern int Upgradeleng; + + int yyerror(const char *ErrorMsg) ; + + #endif Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,2613 ---- + #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 20 "UpgradeLexer.cpp" + /* A lexical scanner generated by flex*/ + + /* Scanner skeleton version: + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp,v 1.1 2006/11/30 06:36:44 reid Exp $ + */ + + #define FLEX_SCANNER + #define YY_FLEX_MAJOR_VERSION 2 + #define YY_FLEX_MINOR_VERSION 5 + + #include + #include + + + /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ + #ifdef c_plusplus + #ifndef __cplusplus + #define __cplusplus + #endif + #endif + + + #ifdef __cplusplus + + #include + + /* Use prototypes in function declarations. */ + #define YY_USE_PROTOS + + /* The "const" storage-class-modifier is valid. */ + #define YY_USE_CONST + + #else /* ! __cplusplus */ + + #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 + + /* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ + #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + /* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ + #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 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 yyrestart( yyin ) + + #define YY_END_OF_BUFFER_CHAR 0 + + /* Size of default input buffer. */ + #define YY_BUF_SIZE (16384*64) + + typedef struct yy_buffer_state *YY_BUFFER_STATE; + + 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 + + /* 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 yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + 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 ) + + /* 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). + */ + typedef unsigned int yy_size_t; + + + struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* 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 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ + #define YY_BUFFER_EOF_PENDING 2 + }; + + 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". + */ + #define YY_CURRENT_BUFFER yy_current_buffer + + + /* 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 yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; + static int yy_init = 1; /* whether we need to initialize */ + static int yy_start = 0; /* start state number */ + + /* 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 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 yy_create_buffer + + #define yy_set_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 ) \ + 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->yy_at_bol) + + + #define YY_USES_REJECT + + #define yywrap() 1 + #define YY_SKIP_YYWRAP + typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + 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 yytext. + */ + #define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + + #define YY_NUM_RULES 116 + #define YY_END_OF_BUFFER 117 + static yyconst short int yy_acclist[194] = + { 0, + 117, 115, 116, 114, 115, 116, 114, 116, 115, 116, + 115, 116, 115, 116, 115, 116, 115, 116, 115, 116, + 107, 115, 116, 107, 115, 116, 1, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 106, 104, 103, 103, 110, 108, 112, 107, 1, + 89, 38, 72, 22, 106, 103, 103, 111, 112, 19, + 112, 113, 60, 71, 36, 31, 39, 63, 3, 51, + + 62, 80, 67, 88, 84, 61, 73, 105, 112, 112, + 86, 46, 81, 82, 66, 96, 70, 97, 53, 85, + 21, 109, 65, 69, 23, 4, 58, 64, 52, 68, + 45, 11, 112, 33, 2, 5, 55, 57, 47, 75, + 79, 77, 78, 76, 74, 49, 98, 48, 54, 20, + 95, 42, 56, 27, 41, 7, 91, 30, 94, 35, + 59, 83, 90, 24, 25, 92, 50, 87, 40, 6, + 26, 34, 8, 16, 9, 10, 32, 12, 14, 13, + 29, 37, 15, 28, 93, 99, 101, 102, 43, 100, + 17, 44, 18 + + } ; + + static yyconst short int yy_accept[507] = + { 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, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + + 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, + 87, 89, 90, 91, 92, 92, 93, 94, 94, 94, + 95, 95, 95, 96, 96, 97, 97, 97, 97, 98, + 98, 98, 98, 98, 98, 98, 99, 99, 99, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 102, 102, 102, 103, 103, 104, 105, 105, 105, 105, + 105, 105, 105, 106, 106, 106, 106, 106, 106, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 108, 108, 109, 110, 110, 110, 110, 111, 111, 111, + 111, 112, 112, 113, 114, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 116, 116, 117, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 119, 120, 121, 121, 121, 122, 122, + 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, + 128, 128, 129, 130, 130, 130, 130, 130, 131, 131, + 131, 132, 132, 133, 133, 133, 134, 135, 135, 135, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 137, 137, 138, 138, 138, 138, 138, + 138, 138, 139, 139, 139, 139, 139, 139, 139, 140, + 140, 140, 141, 142, 143, 144, 145, 146, 147, 147, + 147, 148, 148, 148, 148, 149, 150, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 152, 152, 153, 153, + 153, 153, 153, 153, 153, 153, 154, 155, 155, 155, + 156, 156, 157, 157, 157, 157, 158, 158, 159, 160, + 161, 162, 162, 162, 163, 163, 163, 164, 165, 166, + 166, 167, 168, 169, 169, 169, 169, 169, 169, 169, + + 170, 170, 171, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 174, 174, 174, 174, 174, 175, + 175, 175, 175, 175, 176, 177, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 180, 181, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, + 183, 183, 183, 184, 184, 184, 184, 184, 185, 185, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 187, 187, 188, 189, 189, 190, 190, + + 191, 192, 193, 193, 194, 194 + } ; + + 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, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 5, 6, 1, 1, 1, + 1, 1, 7, 1, 8, 9, 1, 10, 11, 11, + 11, 11, 11, 12, 11, 13, 11, 14, 15, 1, + 1, 1, 1, 1, 16, 16, 16, 16, 17, 16, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 1, 1, 1, 1, 18, 1, 19, 20, 21, 22, + + 23, 24, 25, 26, 27, 5, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 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, 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, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + + 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, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3 + } ; + + static yyconst short int yy_base[511] = + { 0, + 0, 0, 1100, 1101, 1101, 1101, 1095, 1084, 36, 40, + 44, 50, 56, 62, 0, 63, 66, 81, 89, 47, + 100, 97, 76, 96, 111, 46, 48, 110, 68, 140, + 126, 171, 119, 123, 73, 125, 1093, 1101, 1082, 1101, + 0, 159, 176, 199, 204, 95, 209, 224, 229, 0, + 130, 165, 133, 120, 169, 151, 159, 31, 1081, 168, + 143, 230, 189, 191, 233, 117, 145, 187, 241, 242, + 244, 243, 246, 248, 250, 251, 253, 254, 176, 258, + 263, 255, 270, 274, 271, 278, 283, 1080, 284, 287, + 289, 290, 291, 294, 295, 296, 298, 292, 303, 309, + + 313, 316, 1079, 322, 304, 299, 325, 324, 330, 328, + 331, 332, 213, 342, 334, 262, 343, 345, 1078, 0, + 354, 362, 1077, 376, 393, 0, 1076, 356, 362, 1075, + 368, 363, 1074, 369, 1073, 381, 383, 347, 1072, 394, + 378, 388, 399, 395, 401, 1071, 405, 403, 406, 408, + 411, 407, 308, 415, 412, 413, 425, 423, 426, 427, + 424, 432, 113, 434, 437, 439, 440, 443, 444, 1070, + 447, 446, 1069, 448, 1068, 1067, 473, 451, 452, 463, + 455, 484, 1066, 467, 449, 485, 473, 487, 1065, 490, + 491, 492, 496, 498, 500, 497, 502, 505, 504, 510, + + 514, 511, 516, 512, 517, 518, 529, 525, 456, 1064, + 531, 1101, 539, 547, 554, 558, 563, 547, 565, 566, + 1063, 567, 1062, 1061, 1060, 568, 569, 570, 571, 573, + 574, 576, 579, 581, 577, 580, 585, 588, 591, 1059, + 589, 1058, 1057, 594, 599, 602, 600, 605, 606, 607, + 610, 608, 1056, 1055, 1054, 613, 614, 1053, 615, 617, + 0, 616, 1052, 619, 627, 618, 624, 635, 636, 630, + 641, 637, 1051, 643, 642, 1050, 648, 650, 1049, 1048, + 654, 1047, 1046, 655, 659, 656, 660, 1045, 662, 664, + 1044, 667, 1043, 670, 668, 675, 1042, 679, 678, 1041, + + 675, 688, 687, 691, 676, 689, 698, 699, 700, 702, + 703, 701, 1040, 704, 1039, 705, 706, 707, 710, 712, + 713, 1038, 715, 716, 724, 726, 727, 728, 1037, 730, + 734, 1036, 1035, 1034, 1033, 1032, 1031, 1030, 738, 739, + 1029, 740, 741, 742, 1028, 1027, 1026, 743, 746, 744, + 745, 747, 758, 755, 759, 1025, 761, 1024, 762, 765, + 766, 768, 769, 770, 771, 1023, 1022, 780, 773, 1021, + 781, 1020, 783, 786, 782, 1019, 793, 1018, 1017, 1016, + 1015, 790, 798, 1014, 799, 802, 1013, 1012, 1011, 801, + 1010, 1009, 1008, 803, 804, 806, 807, 805, 809, 1007, + + 810, 1006, 1005, 816, 817, 819, 821, 824, 825, 823, + 827, 829, 830, 831, 1004, 835, 841, 843, 846, 847, + 849, 851, 852, 1003, 854, 857, 858, 859, 1002, 861, + 862, 864, 866, 1001, 998, 869, 877, 865, 867, 988, + 883, 884, 885, 987, 871, 986, 984, 888, 891, 892, + 896, 895, 897, 899, 902, 903, 904, 905, 907, 983, + 908, 913, 914, 916, 910, 921, 917, 982, 923, 927, + 928, 931, 981, 935, 924, 936, 934, 977, 937, 976, + 938, 941, 945, 950, 952, 954, 956, 957, 959, 961, + 960, 962, 975, 963, 970, 775, 964, 533, 965, 454, + + 453, 261, 969, 216, 1101, 1004, 1006, 226, 1010, 76 + } ; + + static yyconst short int yy_def[511] = + { 0, + 505, 1, 505, 505, 505, 505, 506, 507, 508, 505, + 507, 507, 507, 507, 509, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 506, 505, 507, 505, + 510, 510, 505, 505, 507, 507, 507, 507, 507, 509, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 505, 510, + 510, 505, 507, 507, 507, 49, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 49, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 505, 505, 505, 505, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 177, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 505, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 0, 505, 505, 505, 505, 505 + } ; + + static yyconst short int yy_nxt[1145] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 14, 14, 4, 15, 8, 8, 8, 16, 17, + 18, 19, 20, 21, 22, 8, 23, 8, 24, 25, + 26, 27, 28, 8, 29, 30, 31, 32, 33, 34, + 35, 8, 36, 42, 40, 43, 43, 43, 43, 44, + 44, 44, 44, 45, 45, 45, 45, 40, 46, 40, + 40, 40, 136, 40, 47, 48, 48, 48, 48, 40, + 47, 48, 48, 48, 48, 40, 40, 69, 120, 40, + 87, 40, 88, 86, 51, 116, 40, 70, 56, 40, + 91, 52, 57, 53, 40, 54, 49, 58, 55, 60, + + 59, 61, 40, 123, 117, 77, 78, 64, 40, 40, + 40, 65, 62, 40, 79, 66, 63, 67, 71, 75, + 68, 72, 80, 40, 40, 76, 40, 81, 73, 83, + 40, 82, 40, 40, 74, 89, 40, 113, 40, 40, + 251, 90, 84, 40, 102, 115, 40, 118, 85, 92, + 114, 127, 131, 40, 130, 146, 40, 103, 40, 93, + 104, 94, 95, 139, 40, 96, 97, 105, 121, 121, + 121, 121, 40, 147, 98, 134, 99, 100, 40, 101, + 92, 40, 40, 135, 40, 43, 43, 43, 43, 40, + 106, 128, 107, 129, 132, 162, 137, 108, 133, 109, + + 40, 110, 40, 138, 40, 111, 112, 122, 44, 44, + 44, 44, 47, 45, 45, 45, 45, 40, 124, 124, + 124, 124, 40, 142, 148, 125, 40, 143, 41, 40, + 205, 125, 47, 48, 48, 48, 48, 40, 126, 126, + 126, 126, 40, 40, 126, 126, 40, 126, 126, 126, + 126, 126, 126, 144, 40, 40, 40, 40, 140, 40, + 141, 40, 149, 40, 40, 145, 40, 40, 40, 153, + 155, 40, 151, 209, 40, 40, 40, 154, 150, 152, + 167, 165, 157, 40, 40, 158, 156, 40, 163, 159, + 160, 40, 161, 166, 164, 169, 40, 40, 168, 170, + + 40, 172, 40, 40, 40, 40, 171, 40, 40, 40, + 173, 40, 40, 174, 187, 180, 40, 40, 175, 186, + 179, 40, 40, 181, 183, 176, 40, 184, 189, 40, + 177, 182, 178, 185, 188, 40, 195, 40, 40, 190, + 196, 40, 191, 40, 40, 40, 240, 40, 193, 200, + 192, 197, 208, 203, 198, 40, 40, 204, 40, 194, + 40, 199, 201, 121, 121, 121, 121, 202, 206, 40, + 207, 213, 213, 213, 213, 40, 40, 210, 214, 211, + 218, 40, 40, 225, 214, 124, 124, 124, 124, 40, + 220, 40, 125, 219, 40, 222, 40, 221, 125, 215, + + 216, 40, 217, 217, 217, 217, 40, 40, 40, 223, + 228, 224, 40, 227, 40, 226, 40, 229, 40, 40, + 40, 40, 234, 230, 40, 40, 40, 232, 40, 231, + 236, 233, 235, 241, 242, 244, 40, 40, 40, 40, + 40, 243, 237, 239, 245, 40, 238, 40, 247, 248, + 40, 246, 40, 40, 250, 249, 40, 40, 253, 40, + 40, 40, 40, 254, 40, 40, 40, 40, 40, 40, + 252, 256, 271, 294, 255, 258, 40, 265, 260, 259, + 40, 257, 261, 261, 261, 261, 40, 262, 261, 261, + 263, 261, 261, 261, 261, 261, 261, 40, 40, 264, + + 40, 270, 273, 40, 40, 40, 266, 272, 267, 40, + 40, 40, 268, 40, 269, 40, 277, 40, 40, 276, + 279, 274, 280, 40, 40, 40, 275, 40, 278, 40, + 40, 40, 285, 281, 284, 290, 286, 287, 40, 291, + 282, 283, 40, 289, 40, 288, 40, 292, 213, 213, + 213, 213, 293, 215, 215, 214, 296, 296, 296, 296, + 40, 214, 295, 296, 296, 296, 296, 217, 217, 217, + 217, 40, 217, 217, 217, 217, 40, 297, 40, 40, + 40, 40, 40, 40, 40, 298, 40, 40, 301, 40, + 40, 305, 40, 40, 40, 310, 299, 300, 40, 304, + + 306, 40, 40, 312, 40, 302, 303, 40, 308, 309, + 313, 314, 40, 40, 311, 40, 307, 317, 40, 40, + 40, 40, 316, 40, 318, 315, 40, 40, 40, 40, + 40, 40, 40, 321, 319, 322, 324, 40, 329, 320, + 40, 323, 326, 40, 325, 330, 333, 331, 40, 40, + 40, 332, 327, 328, 40, 40, 40, 335, 337, 340, + 334, 40, 342, 40, 339, 341, 338, 40, 40, 40, + 343, 336, 40, 40, 348, 40, 345, 40, 344, 346, + 40, 40, 347, 40, 296, 296, 296, 296, 40, 40, + 349, 40, 40, 353, 355, 358, 350, 356, 351, 357, + + 40, 40, 40, 352, 40, 354, 359, 360, 363, 361, + 362, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 369, 366, 40, 370, 40, 40, 371, 40, 40, + 364, 365, 367, 368, 372, 376, 373, 40, 378, 40, + 40, 40, 375, 40, 379, 377, 374, 40, 380, 381, + 382, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 383, 386, 390, 389, 387, 385, 391, 40, 393, + 384, 40, 40, 394, 40, 40, 395, 388, 40, 40, + 392, 40, 40, 40, 40, 400, 40, 398, 40, 397, + 402, 396, 399, 40, 40, 40, 40, 406, 407, 40, + + 412, 404, 405, 40, 403, 410, 40, 401, 411, 408, + 409, 40, 40, 413, 40, 40, 40, 40, 40, 40, + 40, 416, 40, 40, 414, 417, 418, 421, 415, 40, + 40, 419, 40, 422, 40, 423, 40, 40, 40, 420, + 40, 425, 40, 40, 40, 424, 430, 431, 40, 429, + 426, 427, 435, 432, 40, 433, 40, 434, 428, 40, + 40, 439, 40, 438, 40, 40, 436, 40, 440, 442, + 40, 40, 40, 437, 40, 40, 444, 40, 40, 40, + 40, 448, 40, 441, 40, 455, 456, 443, 452, 449, + 40, 445, 450, 446, 447, 453, 40, 40, 40, 454, + + 451, 40, 458, 457, 40, 40, 461, 460, 40, 40, + 40, 459, 40, 462, 464, 40, 40, 40, 40, 467, + 40, 40, 470, 40, 465, 472, 40, 40, 463, 40, + 40, 469, 477, 471, 40, 473, 40, 40, 468, 466, + 40, 40, 474, 478, 40, 480, 475, 40, 40, 40, + 40, 40, 476, 479, 40, 481, 482, 484, 40, 483, + 485, 490, 486, 40, 487, 40, 489, 40, 488, 40, + 40, 491, 40, 40, 40, 40, 40, 40, 40, 497, + 492, 498, 40, 40, 502, 494, 493, 503, 40, 40, + 40, 496, 495, 501, 40, 40, 40, 40, 500, 40, + + 40, 40, 499, 504, 37, 37, 37, 37, 39, 39, + 50, 40, 50, 50, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 212, 40, 40, 40, 40, 119, 40, 38, 505, + + 3, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505 + } ; + + static yyconst short int yy_chk[1145] = + { 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, 9, 58, 9, 9, 9, 9, 10, + 10, 10, 10, 11, 11, 11, 11, 11, 12, 26, + 20, 27, 58, 12, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 16, 20, 510, 17, + 27, 29, 27, 26, 16, 35, 35, 20, 17, 23, + 29, 16, 17, 16, 18, 16, 13, 17, 16, 18, + + 17, 18, 19, 46, 35, 23, 23, 19, 46, 24, + 22, 19, 18, 21, 24, 19, 18, 19, 21, 22, + 19, 21, 24, 28, 25, 22, 163, 24, 21, 25, + 66, 24, 33, 54, 21, 28, 34, 33, 36, 31, + 163, 28, 25, 51, 31, 34, 53, 36, 25, 30, + 33, 51, 54, 30, 53, 66, 61, 31, 67, 30, + 31, 30, 30, 61, 56, 30, 30, 31, 42, 42, + 42, 42, 57, 67, 30, 56, 30, 30, 52, 30, + 32, 60, 55, 57, 32, 43, 43, 43, 43, 79, + 32, 52, 32, 52, 55, 79, 60, 32, 55, 32, + + 68, 32, 63, 60, 64, 32, 32, 44, 44, 44, + 44, 44, 45, 45, 45, 45, 45, 45, 47, 47, + 47, 47, 47, 63, 68, 47, 113, 64, 508, 504, + 113, 47, 48, 48, 48, 48, 48, 48, 49, 49, + 49, 49, 49, 62, 49, 49, 65, 49, 49, 49, + 49, 49, 49, 65, 69, 70, 72, 71, 62, 73, + 62, 74, 69, 75, 76, 65, 77, 78, 82, 72, + 74, 80, 71, 116, 502, 116, 81, 73, 70, 71, + 82, 81, 76, 83, 85, 77, 75, 84, 80, 78, + 78, 86, 78, 81, 80, 84, 87, 89, 83, 85, + + 90, 87, 91, 92, 93, 98, 86, 94, 95, 96, + 89, 97, 106, 90, 98, 95, 99, 105, 91, 97, + 94, 153, 100, 95, 96, 91, 101, 96, 100, 102, + 92, 95, 93, 96, 99, 104, 105, 108, 107, 101, + 106, 110, 102, 109, 111, 112, 153, 115, 104, 110, + 102, 107, 115, 111, 108, 114, 117, 112, 118, 104, + 138, 109, 110, 121, 121, 121, 121, 110, 114, 128, + 114, 122, 122, 122, 122, 129, 132, 117, 122, 118, + 128, 131, 134, 138, 122, 124, 124, 124, 124, 124, + 131, 141, 124, 129, 136, 134, 137, 132, 124, 125, + + 125, 142, 125, 125, 125, 125, 125, 140, 144, 136, + 142, 137, 143, 141, 145, 140, 148, 143, 147, 149, + 152, 150, 148, 144, 151, 155, 156, 147, 154, 145, + 150, 147, 149, 154, 155, 156, 158, 161, 157, 159, + 160, 155, 150, 152, 157, 162, 151, 164, 159, 160, + 165, 158, 166, 167, 162, 161, 168, 169, 165, 172, + 171, 174, 185, 166, 178, 179, 501, 500, 181, 209, + 164, 168, 185, 209, 167, 171, 180, 181, 174, 172, + 184, 169, 177, 177, 177, 177, 187, 178, 177, 177, + 179, 177, 177, 177, 177, 177, 177, 182, 186, 180, + + 188, 184, 187, 190, 191, 192, 182, 186, 182, 193, + 196, 194, 182, 195, 182, 197, 192, 199, 198, 191, + 194, 188, 195, 200, 202, 204, 190, 201, 193, 203, + 205, 206, 200, 196, 199, 205, 201, 202, 208, 206, + 197, 198, 207, 204, 211, 203, 498, 207, 213, 213, + 213, 213, 208, 214, 214, 213, 214, 214, 214, 214, + 218, 213, 211, 215, 215, 215, 215, 216, 216, 216, + 216, 216, 217, 217, 217, 217, 217, 218, 219, 220, + 222, 226, 227, 228, 229, 219, 230, 231, 226, 232, + 235, 230, 233, 236, 234, 235, 220, 222, 237, 229, + + 231, 238, 241, 237, 239, 227, 228, 244, 233, 234, + 238, 239, 245, 247, 236, 246, 232, 245, 248, 249, + 250, 252, 244, 251, 246, 241, 256, 257, 259, 262, + 260, 266, 264, 249, 247, 250, 252, 267, 262, 248, + 265, 251, 257, 270, 256, 264, 267, 265, 268, 269, + 272, 266, 259, 260, 271, 275, 274, 268, 269, 272, + 267, 277, 275, 278, 271, 274, 270, 281, 284, 286, + 277, 268, 285, 287, 286, 289, 281, 290, 278, 284, + 292, 295, 285, 294, 296, 296, 296, 296, 301, 305, + 287, 299, 298, 294, 295, 301, 289, 298, 290, 299, + + 303, 302, 306, 292, 304, 294, 302, 303, 306, 304, + 305, 307, 308, 309, 312, 310, 311, 314, 316, 317, + 318, 312, 309, 319, 314, 320, 321, 316, 323, 324, + 307, 308, 310, 311, 317, 321, 318, 325, 324, 326, + 327, 328, 320, 330, 325, 323, 319, 331, 326, 327, + 328, 339, 340, 342, 343, 344, 348, 350, 351, 349, + 352, 330, 340, 348, 344, 342, 339, 349, 354, 351, + 331, 353, 355, 352, 357, 359, 353, 343, 360, 361, + 350, 362, 363, 364, 365, 360, 369, 357, 496, 355, + 362, 354, 359, 368, 371, 375, 373, 368, 368, 374, + + 375, 364, 365, 382, 363, 373, 377, 361, 374, 369, + 371, 383, 385, 377, 390, 386, 394, 395, 398, 396, + 397, 385, 399, 401, 382, 386, 390, 396, 383, 404, + 405, 394, 406, 397, 407, 398, 410, 408, 409, 395, + 411, 401, 412, 413, 414, 399, 408, 409, 416, 407, + 404, 405, 413, 410, 417, 411, 418, 412, 406, 419, + 420, 418, 421, 417, 422, 423, 414, 425, 419, 421, + 426, 427, 428, 416, 430, 431, 423, 432, 438, 433, + 439, 428, 436, 420, 445, 438, 439, 422, 433, 430, + 437, 425, 431, 426, 427, 436, 441, 442, 443, 437, + + 432, 448, 442, 441, 449, 450, 448, 445, 452, 451, + 453, 443, 454, 449, 451, 455, 456, 457, 458, 454, + 459, 461, 457, 465, 452, 459, 462, 463, 450, 464, + 467, 456, 465, 458, 466, 461, 469, 475, 455, 453, + 470, 471, 462, 466, 472, 469, 463, 477, 474, 476, + 479, 481, 464, 467, 482, 470, 471, 474, 483, 472, + 475, 482, 476, 484, 477, 485, 481, 486, 479, 487, + 488, 483, 489, 491, 490, 492, 494, 497, 499, 489, + 484, 490, 503, 495, 497, 486, 485, 499, 493, 480, + 478, 488, 487, 494, 473, 468, 460, 447, 492, 446, + + 444, 440, 491, 503, 506, 506, 506, 506, 507, 507, + 509, 435, 509, 509, 434, 429, 424, 415, 403, 402, + 400, 393, 392, 391, 389, 388, 387, 384, 381, 380, + 379, 378, 376, 372, 370, 367, 366, 358, 356, 347, + 346, 345, 341, 338, 337, 336, 335, 334, 333, 332, + 329, 322, 315, 313, 300, 297, 293, 291, 288, 283, + 282, 280, 279, 276, 273, 263, 258, 255, 254, 253, + 243, 242, 240, 225, 224, 223, 221, 210, 189, 183, + 176, 175, 173, 170, 146, 139, 135, 133, 130, 127, + 123, 119, 103, 88, 59, 39, 37, 8, 7, 3, + + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505 + } ; + + 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 *yytext; + #line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + #define INITIAL 0 + /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the flex scanner for LLVM assembly languages files. + // + //===----------------------------------------------------------------------===*/ + #define YY_NEVER_INTERACTIVE 1 + #line 28 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + + #include "ParserInternals.h" + #define YYSTYPE std::string* + #include "UpgradeParser.h" + #include + #include + + void set_scan_bytes (const char * str, size_t len) { + Upgrade_scan_bytes (str, len); + } + + static void trim(std::string& str) { + size_t startpos = str.find_first_not_of(" \t\n\r",0); + if (startpos != std::string::npos) + str.erase(0,startpos); + } + + // Construct a token value for a non-obsolete token + #define RET_TOK(sym) \ + Upgradelval = new std::string(yytext); \ + trim(*Upgradelval); \ + return sym + + #define YY_NEVER_INTERACTIVE 1 + /* Comments start with a ; and go till end of line */ + /* Variable(Value) identifiers start with a % sign */ + /* Label identifiers end with a colon */ + /* Quoted names can contain any character except " and \ */ + /* [PN]Integer: match positive and negative literal integer values that + * are preceeded by a '%' character. These represent unnamed variable slots. + */ + /* E[PN]Integer: match positive and negative literal integer values */ + /* FPConstant - A Floating point constant. + */ + /* HexFPConstant - Floating point constant represented in IEEE format as a + * hexadecimal number for when exponential notation is not precise enough. + */ + /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing + * it to deal with 64 bit numbers. + */ + #line 900 "UpgradeLexer.cpp" + + /* Macros after this point can all be overridden by user definitions in + * section 1. + */ + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus + extern "C" int yywrap YY_PROTO(( void )); + #else + extern int yywrap YY_PROTO(( void )); + #endif + #endif + + #ifndef YY_NO_UNPUT + static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); + #endif + + #ifndef yytext_ptr + static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen YY_PROTO(( yyconst char * )); + #endif + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + 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 + #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. */ + #ifndef YY_READ_BUF_SIZE + #define YY_READ_BUF_SIZE 8192 + #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( yytext, yyleng, 1, yyout ) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ + #ifndef YY_INPUT + #define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + 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();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ + #ifndef yyterminate + #define yyterminate() return YY_NULL + #endif + + /* Number of entries by which start-condition stack grows. */ + #ifndef YY_START_STACK_INCR + #define YY_START_STACK_INCR 25 + #endif + + /* Report a fatal error. */ + #ifndef YY_FATAL_ERROR + #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) + #endif + + /* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ + #ifndef YY_DECL + #define YY_DECL int yylex YY_PROTO(( void )) + #endif + + /* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ + #ifndef YY_USER_ACTION + #define YY_USER_ACTION + #endif + + /* Code executed at the end of each rule. */ + #ifndef YY_BREAK + #define YY_BREAK break; + #endif + + #define YY_RULE_SETUP \ + YY_USER_ACTION + + YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + + #line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + + + #line 1054 "UpgradeLexer.cpp" + + if ( yy_init ) + { + yy_init = 0; + + #ifdef YY_USER_INIT + YY_USER_INIT; + #endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* 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_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)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + 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 != 505 ); + + yy_find_action: + 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 ) + { + int yyl; + 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 1: + YY_RULE_SETUP + #line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { /* Ignore comments for now */ } + YY_BREAK + case 2: + YY_RULE_SETUP + #line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BEGINTOK); } + YY_BREAK + case 3: + YY_RULE_SETUP + #line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ENDTOK); } + YY_BREAK + case 4: + YY_RULE_SETUP + #line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRUETOK); } + YY_BREAK + case 5: + YY_RULE_SETUP + #line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FALSETOK); } + YY_BREAK + case 6: + YY_RULE_SETUP + #line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DECLARE); } + YY_BREAK + case 7: + YY_RULE_SETUP + #line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( GLOBAL); } + YY_BREAK + case 8: + YY_RULE_SETUP + #line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CONSTANT); } + YY_BREAK + case 9: + YY_RULE_SETUP + #line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INTERNAL); } + YY_BREAK + case 10: + YY_RULE_SETUP + #line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LINKONCE); } + YY_BREAK + case 11: + YY_RULE_SETUP + #line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( WEAK); } + YY_BREAK + case 12: + YY_RULE_SETUP + #line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( APPENDING); } + YY_BREAK + case 13: + YY_RULE_SETUP + #line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DLLIMPORT); } + YY_BREAK + case 14: + YY_RULE_SETUP + #line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DLLEXPORT); } + YY_BREAK + case 15: + YY_RULE_SETUP + #line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTERN_WEAK); } + YY_BREAK + case 16: + YY_RULE_SETUP + #line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTERNAL); } + YY_BREAK + case 17: + YY_RULE_SETUP + #line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( IMPLEMENTATION); } + YY_BREAK + case 18: + YY_RULE_SETUP + #line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ZEROINITIALIZER); } + YY_BREAK + case 19: + YY_RULE_SETUP + #line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DOTDOTDOT); } + YY_BREAK + case 20: + YY_RULE_SETUP + #line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNDEF); } + YY_BREAK + case 21: + YY_RULE_SETUP + #line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( NULL_TOK); } + YY_BREAK + case 22: + YY_RULE_SETUP + #line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TO); } + YY_BREAK + case 23: + YY_RULE_SETUP + #line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TAIL); } + YY_BREAK + case 24: + YY_RULE_SETUP + #line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TARGET); } + YY_BREAK + case 25: + YY_RULE_SETUP + #line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRIPLE); } + YY_BREAK + case 26: + YY_RULE_SETUP + #line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DEPLIBS); } + YY_BREAK + case 27: + YY_RULE_SETUP + #line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ENDIAN); } + YY_BREAK + case 28: + YY_RULE_SETUP + #line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( POINTERSIZE); } + YY_BREAK + case 29: + YY_RULE_SETUP + #line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DATALAYOUT); } + YY_BREAK + case 30: + YY_RULE_SETUP + #line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LITTLE); } + YY_BREAK + case 31: + YY_RULE_SETUP + #line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BIG); } + YY_BREAK + case 32: + YY_RULE_SETUP + #line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VOLATILE); } + YY_BREAK + case 33: + YY_RULE_SETUP + #line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ALIGN); } + YY_BREAK + case 34: + YY_RULE_SETUP + #line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SECTION); } + YY_BREAK + case 35: + YY_RULE_SETUP + #line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MODULE); } + YY_BREAK + case 36: + YY_RULE_SETUP + #line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ASM_TOK); } + YY_BREAK + case 37: + YY_RULE_SETUP + #line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SIDEEFFECT); } + YY_BREAK + case 38: + YY_RULE_SETUP + #line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CC_TOK); } + YY_BREAK + case 39: + YY_RULE_SETUP + #line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CCC_TOK); } + YY_BREAK + case 40: + YY_RULE_SETUP + #line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CSRETCC_TOK); } + YY_BREAK + case 41: + YY_RULE_SETUP + #line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FASTCC_TOK); } + YY_BREAK + case 42: + YY_RULE_SETUP + #line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( COLDCC_TOK); } + YY_BREAK + case 43: + YY_RULE_SETUP + #line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( X86_STDCALLCC_TOK); } + YY_BREAK + case 44: + YY_RULE_SETUP + #line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( X86_FASTCALLCC_TOK); } + YY_BREAK + case 45: + YY_RULE_SETUP + #line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VOID); } + YY_BREAK + case 46: + YY_RULE_SETUP + #line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BOOL); } + YY_BREAK + case 47: + YY_RULE_SETUP + #line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SBYTE); } + YY_BREAK + case 48: + YY_RULE_SETUP + #line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UBYTE); } + YY_BREAK + case 49: + YY_RULE_SETUP + #line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHORT); } + YY_BREAK + case 50: + YY_RULE_SETUP + #line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( USHORT); } + YY_BREAK + case 51: + YY_RULE_SETUP + #line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INT); } + YY_BREAK + case 52: + YY_RULE_SETUP + #line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UINT); } + YY_BREAK + case 53: + YY_RULE_SETUP + #line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LONG); } + YY_BREAK + case 54: + YY_RULE_SETUP + #line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ULONG); } + YY_BREAK + case 55: + YY_RULE_SETUP + #line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FLOAT); } + YY_BREAK + case 56: + YY_RULE_SETUP + #line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DOUBLE); } + YY_BREAK + case 57: + YY_RULE_SETUP + #line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABEL); } + YY_BREAK + case 58: + YY_RULE_SETUP + #line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TYPE); } + YY_BREAK + case 59: + YY_RULE_SETUP + #line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( OPAQUE); } + YY_BREAK + case 60: + YY_RULE_SETUP + #line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ADD); } + YY_BREAK + case 61: + YY_RULE_SETUP + #line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SUB); } + YY_BREAK + case 62: + YY_RULE_SETUP + #line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MUL); } + YY_BREAK + case 63: + YY_RULE_SETUP + #line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UDIV); } + YY_BREAK + case 64: + YY_RULE_SETUP + #line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UDIV); } + YY_BREAK + case 65: + YY_RULE_SETUP + #line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SDIV); } + YY_BREAK + case 66: + YY_RULE_SETUP + #line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FDIV); } + YY_BREAK + case 67: + YY_RULE_SETUP + #line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UREM); } + YY_BREAK + case 68: + YY_RULE_SETUP + #line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UREM); } + YY_BREAK + case 69: + YY_RULE_SETUP + #line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SREM); } + YY_BREAK + case 70: + YY_RULE_SETUP + #line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FREM); } + YY_BREAK + case 71: + YY_RULE_SETUP + #line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( AND); } + YY_BREAK + case 72: + YY_RULE_SETUP + #line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( OR); } + YY_BREAK + case 73: + YY_RULE_SETUP + #line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( XOR); } + YY_BREAK + case 74: + YY_RULE_SETUP + #line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETNE); } + YY_BREAK + case 75: + YY_RULE_SETUP + #line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETEQ); } + YY_BREAK + case 76: + YY_RULE_SETUP + #line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETLT); } + YY_BREAK + case 77: + YY_RULE_SETUP + #line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETGT); } + YY_BREAK + case 78: + YY_RULE_SETUP + #line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETLE); } + YY_BREAK + case 79: + YY_RULE_SETUP + #line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETGE); } + YY_BREAK + case 80: + YY_RULE_SETUP + #line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( PHI_TOK); } + YY_BREAK + case 81: + YY_RULE_SETUP + #line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CALL); } + YY_BREAK + case 82: + YY_RULE_SETUP + #line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRUNC); } + YY_BREAK + case 83: + YY_RULE_SETUP + #line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SELECT); } + YY_BREAK + case 84: + YY_RULE_SETUP + #line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHL); } + YY_BREAK + case 85: + YY_RULE_SETUP + #line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LSHR); } + YY_BREAK + case 86: + YY_RULE_SETUP + #line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ASHR); } + YY_BREAK + case 87: + YY_RULE_SETUP + #line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VAARG); } + YY_BREAK + case 88: + YY_RULE_SETUP + #line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( RET); } + YY_BREAK + case 89: + YY_RULE_SETUP + #line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BR); } + YY_BREAK + case 90: + YY_RULE_SETUP + #line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SWITCH); } + YY_BREAK + case 91: + YY_RULE_SETUP + #line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INVOKE); } + YY_BREAK + case 92: + YY_RULE_SETUP + #line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNWIND); } + YY_BREAK + case 93: + YY_RULE_SETUP + #line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNREACHABLE); } + YY_BREAK + case 94: + YY_RULE_SETUP + #line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MALLOC); } + YY_BREAK + case 95: + YY_RULE_SETUP + #line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ALLOCA); } + YY_BREAK + case 96: + YY_RULE_SETUP + #line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FREE); } + YY_BREAK + case 97: + YY_RULE_SETUP + #line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LOAD); } + YY_BREAK + case 98: + YY_RULE_SETUP + #line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( STORE); } + YY_BREAK + case 99: + YY_RULE_SETUP + #line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( GETELEMENTPTR); } + YY_BREAK + case 100: + YY_RULE_SETUP + #line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTRACTELEMENT); } + YY_BREAK + case 101: + YY_RULE_SETUP + #line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INSERTELEMENT); } + YY_BREAK + case 102: + YY_RULE_SETUP + #line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHUFFLEVECTOR); } + YY_BREAK + case 103: + YY_RULE_SETUP + #line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VAR_ID); } + YY_BREAK + case 104: + YY_RULE_SETUP + #line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABELSTR); } + YY_BREAK + case 105: + YY_RULE_SETUP + #line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABELSTR); } + YY_BREAK + case 106: + YY_RULE_SETUP + #line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( STRINGCONSTANT ); } + YY_BREAK + case 107: + YY_RULE_SETUP + #line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EUINT64VAL ); } + YY_BREAK + case 108: + YY_RULE_SETUP + #line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ESINT64VAL ); } + YY_BREAK + case 109: + YY_RULE_SETUP + #line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } + YY_BREAK + case 110: + YY_RULE_SETUP + #line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UINTVAL); } + YY_BREAK + case 111: + YY_RULE_SETUP + #line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SINTVAL); } + YY_BREAK + case 112: + YY_RULE_SETUP + #line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FPVAL); } + YY_BREAK + case 113: + YY_RULE_SETUP + #line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FPVAL); } + YY_BREAK + case YY_STATE_EOF(INITIAL): + #line 218 "/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! + */ + yy_delete_buffer(YY_CURRENT_BUFFER); + return EOF; + } + YY_BREAK + case 114: + YY_RULE_SETUP + #line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { /* Ignore whitespace */ } + YY_BREAK + case 115: + YY_RULE_SETUP + #line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { return yytext[0]; } + YY_BREAK + case 116: + YY_RULE_SETUP + #line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK + #line 1735 "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; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + 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 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->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 + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + 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_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have 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_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + 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_current_state = yy_get_previous_state(); + + 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->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + + /* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + + 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->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + 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 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + 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->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->yy_n_chars = yy_n_chars = 0; + + else + { + 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; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + 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->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + 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->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() + { + register yy_state_type yy_current_state; + register char *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); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + 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 ); + */ + + #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 YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 505); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + + #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->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->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + 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' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } + #endif /* ifndef YY_NO_UNPUT */ + + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + static int yyinput() + #else + 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 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->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + #ifdef __cplusplus + return yyinput(); + #else + return input(); + #endif + } + + case EOB_ACT_CONTINUE_SCAN: + 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 yytext */ + yy_hold_char = *++yy_c_buf_p; + + if ( c == '\n' ) + ++yylineno; + + return c; + } + #endif /* YY_NO_INPUT */ + + #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(); + } + + + #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 ) + { + /* Flush out information for old buffer. */ + *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 = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * 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; + } + + + #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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + 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 *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return 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 ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) 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 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 + } + + + #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; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + + #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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + 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; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } + #endif + + + #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 = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + 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. + */ + b->yy_is_our_buffer = 1; + + return b; + } + #endif + + + #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; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } + #endif + + + #ifndef YY_NO_POP_STATE + static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } + #endif + + + #ifndef YY_NO_TOP_STATE + static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } + #endif + + #ifndef YY_EXIT_FAILURE + #define YY_EXIT_FAILURE 2 + #endif + + #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 ); + } + + + + /* Redefine yyless() so it works in section 3 code. */ + + #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 ) + + + /* Internal utility routines. */ + + #ifndef yytext_ptr + #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 + #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 + + + #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 ); + } + + #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 + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + + #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 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,2613 ---- + #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 20 "UpgradeLexer.cpp" + /* A lexical scanner generated by flex*/ + + /* Scanner skeleton version: + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.1 2006/11/30 06:36:44 reid Exp $ + */ + + #define FLEX_SCANNER + #define YY_FLEX_MAJOR_VERSION 2 + #define YY_FLEX_MINOR_VERSION 5 + + #include + #include + + + /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ + #ifdef c_plusplus + #ifndef __cplusplus + #define __cplusplus + #endif + #endif + + + #ifdef __cplusplus + + #include + + /* Use prototypes in function declarations. */ + #define YY_USE_PROTOS + + /* The "const" storage-class-modifier is valid. */ + #define YY_USE_CONST + + #else /* ! __cplusplus */ + + #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 + + /* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ + #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + /* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ + #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 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 yyrestart( yyin ) + + #define YY_END_OF_BUFFER_CHAR 0 + + /* Size of default input buffer. */ + #define YY_BUF_SIZE (16384*64) + + typedef struct yy_buffer_state *YY_BUFFER_STATE; + + 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 + + /* 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 yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + 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 ) + + /* 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). + */ + typedef unsigned int yy_size_t; + + + struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* 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 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ + #define YY_BUFFER_EOF_PENDING 2 + }; + + 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". + */ + #define YY_CURRENT_BUFFER yy_current_buffer + + + /* 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 yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; + static int yy_init = 1; /* whether we need to initialize */ + static int yy_start = 0; /* start state number */ + + /* 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 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 yy_create_buffer + + #define yy_set_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 ) \ + 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->yy_at_bol) + + + #define YY_USES_REJECT + + #define yywrap() 1 + #define YY_SKIP_YYWRAP + typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + 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 yytext. + */ + #define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + + #define YY_NUM_RULES 116 + #define YY_END_OF_BUFFER 117 + static yyconst short int yy_acclist[194] = + { 0, + 117, 115, 116, 114, 115, 116, 114, 116, 115, 116, + 115, 116, 115, 116, 115, 116, 115, 116, 115, 116, + 107, 115, 116, 107, 115, 116, 1, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 106, 104, 103, 103, 110, 108, 112, 107, 1, + 89, 38, 72, 22, 106, 103, 103, 111, 112, 19, + 112, 113, 60, 71, 36, 31, 39, 63, 3, 51, + + 62, 80, 67, 88, 84, 61, 73, 105, 112, 112, + 86, 46, 81, 82, 66, 96, 70, 97, 53, 85, + 21, 109, 65, 69, 23, 4, 58, 64, 52, 68, + 45, 11, 112, 33, 2, 5, 55, 57, 47, 75, + 79, 77, 78, 76, 74, 49, 98, 48, 54, 20, + 95, 42, 56, 27, 41, 7, 91, 30, 94, 35, + 59, 83, 90, 24, 25, 92, 50, 87, 40, 6, + 26, 34, 8, 16, 9, 10, 32, 12, 14, 13, + 29, 37, 15, 28, 93, 99, 101, 102, 43, 100, + 17, 44, 18 + + } ; + + static yyconst short int yy_accept[507] = + { 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, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + + 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, + 87, 89, 90, 91, 92, 92, 93, 94, 94, 94, + 95, 95, 95, 96, 96, 97, 97, 97, 97, 98, + 98, 98, 98, 98, 98, 98, 99, 99, 99, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 102, 102, 102, 103, 103, 104, 105, 105, 105, 105, + 105, 105, 105, 106, 106, 106, 106, 106, 106, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 108, 108, 109, 110, 110, 110, 110, 111, 111, 111, + 111, 112, 112, 113, 114, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 116, 116, 117, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 119, 120, 121, 121, 121, 122, 122, + 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, + 128, 128, 129, 130, 130, 130, 130, 130, 131, 131, + 131, 132, 132, 133, 133, 133, 134, 135, 135, 135, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 137, 137, 138, 138, 138, 138, 138, + 138, 138, 139, 139, 139, 139, 139, 139, 139, 140, + 140, 140, 141, 142, 143, 144, 145, 146, 147, 147, + 147, 148, 148, 148, 148, 149, 150, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 152, 152, 153, 153, + 153, 153, 153, 153, 153, 153, 154, 155, 155, 155, + 156, 156, 157, 157, 157, 157, 158, 158, 159, 160, + 161, 162, 162, 162, 163, 163, 163, 164, 165, 166, + 166, 167, 168, 169, 169, 169, 169, 169, 169, 169, + + 170, 170, 171, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 174, 174, 174, 174, 174, 175, + 175, 175, 175, 175, 176, 177, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 180, 181, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, + 183, 183, 183, 184, 184, 184, 184, 184, 185, 185, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 187, 187, 188, 189, 189, 190, 190, + + 191, 192, 193, 193, 194, 194 + } ; + + 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, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 5, 6, 1, 1, 1, + 1, 1, 7, 1, 8, 9, 1, 10, 11, 11, + 11, 11, 11, 12, 11, 13, 11, 14, 15, 1, + 1, 1, 1, 1, 16, 16, 16, 16, 17, 16, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 1, 1, 1, 1, 18, 1, 19, 20, 21, 22, + + 23, 24, 25, 26, 27, 5, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 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, 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, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + + 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, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3 + } ; + + static yyconst short int yy_base[511] = + { 0, + 0, 0, 1100, 1101, 1101, 1101, 1095, 1084, 36, 40, + 44, 50, 56, 62, 0, 63, 66, 81, 89, 47, + 100, 97, 76, 96, 111, 46, 48, 110, 68, 140, + 126, 171, 119, 123, 73, 125, 1093, 1101, 1082, 1101, + 0, 159, 176, 199, 204, 95, 209, 224, 229, 0, + 130, 165, 133, 120, 169, 151, 159, 31, 1081, 168, + 143, 230, 189, 191, 233, 117, 145, 187, 241, 242, + 244, 243, 246, 248, 250, 251, 253, 254, 176, 258, + 263, 255, 270, 274, 271, 278, 283, 1080, 284, 287, + 289, 290, 291, 294, 295, 296, 298, 292, 303, 309, + + 313, 316, 1079, 322, 304, 299, 325, 324, 330, 328, + 331, 332, 213, 342, 334, 262, 343, 345, 1078, 0, + 354, 362, 1077, 376, 393, 0, 1076, 356, 362, 1075, + 368, 363, 1074, 369, 1073, 381, 383, 347, 1072, 394, + 378, 388, 399, 395, 401, 1071, 405, 403, 406, 408, + 411, 407, 308, 415, 412, 413, 425, 423, 426, 427, + 424, 432, 113, 434, 437, 439, 440, 443, 444, 1070, + 447, 446, 1069, 448, 1068, 1067, 473, 451, 452, 463, + 455, 484, 1066, 467, 449, 485, 473, 487, 1065, 490, + 491, 492, 496, 498, 500, 497, 502, 505, 504, 510, + + 514, 511, 516, 512, 517, 518, 529, 525, 456, 1064, + 531, 1101, 539, 547, 554, 558, 563, 547, 565, 566, + 1063, 567, 1062, 1061, 1060, 568, 569, 570, 571, 573, + 574, 576, 579, 581, 577, 580, 585, 588, 591, 1059, + 589, 1058, 1057, 594, 599, 602, 600, 605, 606, 607, + 610, 608, 1056, 1055, 1054, 613, 614, 1053, 615, 617, + 0, 616, 1052, 619, 627, 618, 624, 635, 636, 630, + 641, 637, 1051, 643, 642, 1050, 648, 650, 1049, 1048, + 654, 1047, 1046, 655, 659, 656, 660, 1045, 662, 664, + 1044, 667, 1043, 670, 668, 675, 1042, 679, 678, 1041, + + 675, 688, 687, 691, 676, 689, 698, 699, 700, 702, + 703, 701, 1040, 704, 1039, 705, 706, 707, 710, 712, + 713, 1038, 715, 716, 724, 726, 727, 728, 1037, 730, + 734, 1036, 1035, 1034, 1033, 1032, 1031, 1030, 738, 739, + 1029, 740, 741, 742, 1028, 1027, 1026, 743, 746, 744, + 745, 747, 758, 755, 759, 1025, 761, 1024, 762, 765, + 766, 768, 769, 770, 771, 1023, 1022, 780, 773, 1021, + 781, 1020, 783, 786, 782, 1019, 793, 1018, 1017, 1016, + 1015, 790, 798, 1014, 799, 802, 1013, 1012, 1011, 801, + 1010, 1009, 1008, 803, 804, 806, 807, 805, 809, 1007, + + 810, 1006, 1005, 816, 817, 819, 821, 824, 825, 823, + 827, 829, 830, 831, 1004, 835, 841, 843, 846, 847, + 849, 851, 852, 1003, 854, 857, 858, 859, 1002, 861, + 862, 864, 866, 1001, 998, 869, 877, 865, 867, 988, + 883, 884, 885, 987, 871, 986, 984, 888, 891, 892, + 896, 895, 897, 899, 902, 903, 904, 905, 907, 983, + 908, 913, 914, 916, 910, 921, 917, 982, 923, 927, + 928, 931, 981, 935, 924, 936, 934, 977, 937, 976, + 938, 941, 945, 950, 952, 954, 956, 957, 959, 961, + 960, 962, 975, 963, 970, 775, 964, 533, 965, 454, + + 453, 261, 969, 216, 1101, 1004, 1006, 226, 1010, 76 + } ; + + static yyconst short int yy_def[511] = + { 0, + 505, 1, 505, 505, 505, 505, 506, 507, 508, 505, + 507, 507, 507, 507, 509, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 506, 505, 507, 505, + 510, 510, 505, 505, 507, 507, 507, 507, 507, 509, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 505, 510, + 510, 505, 507, 507, 507, 49, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 49, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 505, 505, 505, 505, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 177, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 505, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, 507, 507, 507, 0, 505, 505, 505, 505, 505 + } ; + + static yyconst short int yy_nxt[1145] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 14, 14, 4, 15, 8, 8, 8, 16, 17, + 18, 19, 20, 21, 22, 8, 23, 8, 24, 25, + 26, 27, 28, 8, 29, 30, 31, 32, 33, 34, + 35, 8, 36, 42, 40, 43, 43, 43, 43, 44, + 44, 44, 44, 45, 45, 45, 45, 40, 46, 40, + 40, 40, 136, 40, 47, 48, 48, 48, 48, 40, + 47, 48, 48, 48, 48, 40, 40, 69, 120, 40, + 87, 40, 88, 86, 51, 116, 40, 70, 56, 40, + 91, 52, 57, 53, 40, 54, 49, 58, 55, 60, + + 59, 61, 40, 123, 117, 77, 78, 64, 40, 40, + 40, 65, 62, 40, 79, 66, 63, 67, 71, 75, + 68, 72, 80, 40, 40, 76, 40, 81, 73, 83, + 40, 82, 40, 40, 74, 89, 40, 113, 40, 40, + 251, 90, 84, 40, 102, 115, 40, 118, 85, 92, + 114, 127, 131, 40, 130, 146, 40, 103, 40, 93, + 104, 94, 95, 139, 40, 96, 97, 105, 121, 121, + 121, 121, 40, 147, 98, 134, 99, 100, 40, 101, + 92, 40, 40, 135, 40, 43, 43, 43, 43, 40, + 106, 128, 107, 129, 132, 162, 137, 108, 133, 109, + + 40, 110, 40, 138, 40, 111, 112, 122, 44, 44, + 44, 44, 47, 45, 45, 45, 45, 40, 124, 124, + 124, 124, 40, 142, 148, 125, 40, 143, 41, 40, + 205, 125, 47, 48, 48, 48, 48, 40, 126, 126, + 126, 126, 40, 40, 126, 126, 40, 126, 126, 126, + 126, 126, 126, 144, 40, 40, 40, 40, 140, 40, + 141, 40, 149, 40, 40, 145, 40, 40, 40, 153, + 155, 40, 151, 209, 40, 40, 40, 154, 150, 152, + 167, 165, 157, 40, 40, 158, 156, 40, 163, 159, + 160, 40, 161, 166, 164, 169, 40, 40, 168, 170, + + 40, 172, 40, 40, 40, 40, 171, 40, 40, 40, + 173, 40, 40, 174, 187, 180, 40, 40, 175, 186, + 179, 40, 40, 181, 183, 176, 40, 184, 189, 40, + 177, 182, 178, 185, 188, 40, 195, 40, 40, 190, + 196, 40, 191, 40, 40, 40, 240, 40, 193, 200, + 192, 197, 208, 203, 198, 40, 40, 204, 40, 194, + 40, 199, 201, 121, 121, 121, 121, 202, 206, 40, + 207, 213, 213, 213, 213, 40, 40, 210, 214, 211, + 218, 40, 40, 225, 214, 124, 124, 124, 124, 40, + 220, 40, 125, 219, 40, 222, 40, 221, 125, 215, + + 216, 40, 217, 217, 217, 217, 40, 40, 40, 223, + 228, 224, 40, 227, 40, 226, 40, 229, 40, 40, + 40, 40, 234, 230, 40, 40, 40, 232, 40, 231, + 236, 233, 235, 241, 242, 244, 40, 40, 40, 40, + 40, 243, 237, 239, 245, 40, 238, 40, 247, 248, + 40, 246, 40, 40, 250, 249, 40, 40, 253, 40, + 40, 40, 40, 254, 40, 40, 40, 40, 40, 40, + 252, 256, 271, 294, 255, 258, 40, 265, 260, 259, + 40, 257, 261, 261, 261, 261, 40, 262, 261, 261, + 263, 261, 261, 261, 261, 261, 261, 40, 40, 264, + + 40, 270, 273, 40, 40, 40, 266, 272, 267, 40, + 40, 40, 268, 40, 269, 40, 277, 40, 40, 276, + 279, 274, 280, 40, 40, 40, 275, 40, 278, 40, + 40, 40, 285, 281, 284, 290, 286, 287, 40, 291, + 282, 283, 40, 289, 40, 288, 40, 292, 213, 213, + 213, 213, 293, 215, 215, 214, 296, 296, 296, 296, + 40, 214, 295, 296, 296, 296, 296, 217, 217, 217, + 217, 40, 217, 217, 217, 217, 40, 297, 40, 40, + 40, 40, 40, 40, 40, 298, 40, 40, 301, 40, + 40, 305, 40, 40, 40, 310, 299, 300, 40, 304, + + 306, 40, 40, 312, 40, 302, 303, 40, 308, 309, + 313, 314, 40, 40, 311, 40, 307, 317, 40, 40, + 40, 40, 316, 40, 318, 315, 40, 40, 40, 40, + 40, 40, 40, 321, 319, 322, 324, 40, 329, 320, + 40, 323, 326, 40, 325, 330, 333, 331, 40, 40, + 40, 332, 327, 328, 40, 40, 40, 335, 337, 340, + 334, 40, 342, 40, 339, 341, 338, 40, 40, 40, + 343, 336, 40, 40, 348, 40, 345, 40, 344, 346, + 40, 40, 347, 40, 296, 296, 296, 296, 40, 40, + 349, 40, 40, 353, 355, 358, 350, 356, 351, 357, + + 40, 40, 40, 352, 40, 354, 359, 360, 363, 361, + 362, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 369, 366, 40, 370, 40, 40, 371, 40, 40, + 364, 365, 367, 368, 372, 376, 373, 40, 378, 40, + 40, 40, 375, 40, 379, 377, 374, 40, 380, 381, + 382, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 383, 386, 390, 389, 387, 385, 391, 40, 393, + 384, 40, 40, 394, 40, 40, 395, 388, 40, 40, + 392, 40, 40, 40, 40, 400, 40, 398, 40, 397, + 402, 396, 399, 40, 40, 40, 40, 406, 407, 40, + + 412, 404, 405, 40, 403, 410, 40, 401, 411, 408, + 409, 40, 40, 413, 40, 40, 40, 40, 40, 40, + 40, 416, 40, 40, 414, 417, 418, 421, 415, 40, + 40, 419, 40, 422, 40, 423, 40, 40, 40, 420, + 40, 425, 40, 40, 40, 424, 430, 431, 40, 429, + 426, 427, 435, 432, 40, 433, 40, 434, 428, 40, + 40, 439, 40, 438, 40, 40, 436, 40, 440, 442, + 40, 40, 40, 437, 40, 40, 444, 40, 40, 40, + 40, 448, 40, 441, 40, 455, 456, 443, 452, 449, + 40, 445, 450, 446, 447, 453, 40, 40, 40, 454, + + 451, 40, 458, 457, 40, 40, 461, 460, 40, 40, + 40, 459, 40, 462, 464, 40, 40, 40, 40, 467, + 40, 40, 470, 40, 465, 472, 40, 40, 463, 40, + 40, 469, 477, 471, 40, 473, 40, 40, 468, 466, + 40, 40, 474, 478, 40, 480, 475, 40, 40, 40, + 40, 40, 476, 479, 40, 481, 482, 484, 40, 483, + 485, 490, 486, 40, 487, 40, 489, 40, 488, 40, + 40, 491, 40, 40, 40, 40, 40, 40, 40, 497, + 492, 498, 40, 40, 502, 494, 493, 503, 40, 40, + 40, 496, 495, 501, 40, 40, 40, 40, 500, 40, + + 40, 40, 499, 504, 37, 37, 37, 37, 39, 39, + 50, 40, 50, 50, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 212, 40, 40, 40, 40, 119, 40, 38, 505, + + 3, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505 + } ; + + static yyconst short int yy_chk[1145] = + { 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, 9, 58, 9, 9, 9, 9, 10, + 10, 10, 10, 11, 11, 11, 11, 11, 12, 26, + 20, 27, 58, 12, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 16, 20, 510, 17, + 27, 29, 27, 26, 16, 35, 35, 20, 17, 23, + 29, 16, 17, 16, 18, 16, 13, 17, 16, 18, + + 17, 18, 19, 46, 35, 23, 23, 19, 46, 24, + 22, 19, 18, 21, 24, 19, 18, 19, 21, 22, + 19, 21, 24, 28, 25, 22, 163, 24, 21, 25, + 66, 24, 33, 54, 21, 28, 34, 33, 36, 31, + 163, 28, 25, 51, 31, 34, 53, 36, 25, 30, + 33, 51, 54, 30, 53, 66, 61, 31, 67, 30, + 31, 30, 30, 61, 56, 30, 30, 31, 42, 42, + 42, 42, 57, 67, 30, 56, 30, 30, 52, 30, + 32, 60, 55, 57, 32, 43, 43, 43, 43, 79, + 32, 52, 32, 52, 55, 79, 60, 32, 55, 32, + + 68, 32, 63, 60, 64, 32, 32, 44, 44, 44, + 44, 44, 45, 45, 45, 45, 45, 45, 47, 47, + 47, 47, 47, 63, 68, 47, 113, 64, 508, 504, + 113, 47, 48, 48, 48, 48, 48, 48, 49, 49, + 49, 49, 49, 62, 49, 49, 65, 49, 49, 49, + 49, 49, 49, 65, 69, 70, 72, 71, 62, 73, + 62, 74, 69, 75, 76, 65, 77, 78, 82, 72, + 74, 80, 71, 116, 502, 116, 81, 73, 70, 71, + 82, 81, 76, 83, 85, 77, 75, 84, 80, 78, + 78, 86, 78, 81, 80, 84, 87, 89, 83, 85, + + 90, 87, 91, 92, 93, 98, 86, 94, 95, 96, + 89, 97, 106, 90, 98, 95, 99, 105, 91, 97, + 94, 153, 100, 95, 96, 91, 101, 96, 100, 102, + 92, 95, 93, 96, 99, 104, 105, 108, 107, 101, + 106, 110, 102, 109, 111, 112, 153, 115, 104, 110, + 102, 107, 115, 111, 108, 114, 117, 112, 118, 104, + 138, 109, 110, 121, 121, 121, 121, 110, 114, 128, + 114, 122, 122, 122, 122, 129, 132, 117, 122, 118, + 128, 131, 134, 138, 122, 124, 124, 124, 124, 124, + 131, 141, 124, 129, 136, 134, 137, 132, 124, 125, + + 125, 142, 125, 125, 125, 125, 125, 140, 144, 136, + 142, 137, 143, 141, 145, 140, 148, 143, 147, 149, + 152, 150, 148, 144, 151, 155, 156, 147, 154, 145, + 150, 147, 149, 154, 155, 156, 158, 161, 157, 159, + 160, 155, 150, 152, 157, 162, 151, 164, 159, 160, + 165, 158, 166, 167, 162, 161, 168, 169, 165, 172, + 171, 174, 185, 166, 178, 179, 501, 500, 181, 209, + 164, 168, 185, 209, 167, 171, 180, 181, 174, 172, + 184, 169, 177, 177, 177, 177, 187, 178, 177, 177, + 179, 177, 177, 177, 177, 177, 177, 182, 186, 180, + + 188, 184, 187, 190, 191, 192, 182, 186, 182, 193, + 196, 194, 182, 195, 182, 197, 192, 199, 198, 191, + 194, 188, 195, 200, 202, 204, 190, 201, 193, 203, + 205, 206, 200, 196, 199, 205, 201, 202, 208, 206, + 197, 198, 207, 204, 211, 203, 498, 207, 213, 213, + 213, 213, 208, 214, 214, 213, 214, 214, 214, 214, + 218, 213, 211, 215, 215, 215, 215, 216, 216, 216, + 216, 216, 217, 217, 217, 217, 217, 218, 219, 220, + 222, 226, 227, 228, 229, 219, 230, 231, 226, 232, + 235, 230, 233, 236, 234, 235, 220, 222, 237, 229, + + 231, 238, 241, 237, 239, 227, 228, 244, 233, 234, + 238, 239, 245, 247, 236, 246, 232, 245, 248, 249, + 250, 252, 244, 251, 246, 241, 256, 257, 259, 262, + 260, 266, 264, 249, 247, 250, 252, 267, 262, 248, + 265, 251, 257, 270, 256, 264, 267, 265, 268, 269, + 272, 266, 259, 260, 271, 275, 274, 268, 269, 272, + 267, 277, 275, 278, 271, 274, 270, 281, 284, 286, + 277, 268, 285, 287, 286, 289, 281, 290, 278, 284, + 292, 295, 285, 294, 296, 296, 296, 296, 301, 305, + 287, 299, 298, 294, 295, 301, 289, 298, 290, 299, + + 303, 302, 306, 292, 304, 294, 302, 303, 306, 304, + 305, 307, 308, 309, 312, 310, 311, 314, 316, 317, + 318, 312, 309, 319, 314, 320, 321, 316, 323, 324, + 307, 308, 310, 311, 317, 321, 318, 325, 324, 326, + 327, 328, 320, 330, 325, 323, 319, 331, 326, 327, + 328, 339, 340, 342, 343, 344, 348, 350, 351, 349, + 352, 330, 340, 348, 344, 342, 339, 349, 354, 351, + 331, 353, 355, 352, 357, 359, 353, 343, 360, 361, + 350, 362, 363, 364, 365, 360, 369, 357, 496, 355, + 362, 354, 359, 368, 371, 375, 373, 368, 368, 374, + + 375, 364, 365, 382, 363, 373, 377, 361, 374, 369, + 371, 383, 385, 377, 390, 386, 394, 395, 398, 396, + 397, 385, 399, 401, 382, 386, 390, 396, 383, 404, + 405, 394, 406, 397, 407, 398, 410, 408, 409, 395, + 411, 401, 412, 413, 414, 399, 408, 409, 416, 407, + 404, 405, 413, 410, 417, 411, 418, 412, 406, 419, + 420, 418, 421, 417, 422, 423, 414, 425, 419, 421, + 426, 427, 428, 416, 430, 431, 423, 432, 438, 433, + 439, 428, 436, 420, 445, 438, 439, 422, 433, 430, + 437, 425, 431, 426, 427, 436, 441, 442, 443, 437, + + 432, 448, 442, 441, 449, 450, 448, 445, 452, 451, + 453, 443, 454, 449, 451, 455, 456, 457, 458, 454, + 459, 461, 457, 465, 452, 459, 462, 463, 450, 464, + 467, 456, 465, 458, 466, 461, 469, 475, 455, 453, + 470, 471, 462, 466, 472, 469, 463, 477, 474, 476, + 479, 481, 464, 467, 482, 470, 471, 474, 483, 472, + 475, 482, 476, 484, 477, 485, 481, 486, 479, 487, + 488, 483, 489, 491, 490, 492, 494, 497, 499, 489, + 484, 490, 503, 495, 497, 486, 485, 499, 493, 480, + 478, 488, 487, 494, 473, 468, 460, 447, 492, 446, + + 444, 440, 491, 503, 506, 506, 506, 506, 507, 507, + 509, 435, 509, 509, 434, 429, 424, 415, 403, 402, + 400, 393, 392, 391, 389, 388, 387, 384, 381, 380, + 379, 378, 376, 372, 370, 367, 366, 358, 356, 347, + 346, 345, 341, 338, 337, 336, 335, 334, 333, 332, + 329, 322, 315, 313, 300, 297, 293, 291, 288, 283, + 282, 280, 279, 276, 273, 263, 258, 255, 254, 253, + 243, 242, 240, 225, 224, 223, 221, 210, 189, 183, + 176, 175, 173, 170, 146, 139, 135, 133, 130, 127, + 123, 119, 103, 88, 59, 39, 37, 8, 7, 3, + + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505 + } ; + + 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 *yytext; + #line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + #define INITIAL 0 + /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the flex scanner for LLVM assembly languages files. + // + //===----------------------------------------------------------------------===*/ + #define YY_NEVER_INTERACTIVE 1 + #line 28 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + + #include "ParserInternals.h" + #define YYSTYPE std::string* + #include "UpgradeParser.h" + #include + #include + + void set_scan_bytes (const char * str, size_t len) { + Upgrade_scan_bytes (str, len); + } + + static void trim(std::string& str) { + size_t startpos = str.find_first_not_of(" \t\n\r",0); + if (startpos != std::string::npos) + str.erase(0,startpos); + } + + // Construct a token value for a non-obsolete token + #define RET_TOK(sym) \ + Upgradelval = new std::string(yytext); \ + trim(*Upgradelval); \ + return sym + + #define YY_NEVER_INTERACTIVE 1 + /* Comments start with a ; and go till end of line */ + /* Variable(Value) identifiers start with a % sign */ + /* Label identifiers end with a colon */ + /* Quoted names can contain any character except " and \ */ + /* [PN]Integer: match positive and negative literal integer values that + * are preceeded by a '%' character. These represent unnamed variable slots. + */ + /* E[PN]Integer: match positive and negative literal integer values */ + /* FPConstant - A Floating point constant. + */ + /* HexFPConstant - Floating point constant represented in IEEE format as a + * hexadecimal number for when exponential notation is not precise enough. + */ + /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing + * it to deal with 64 bit numbers. + */ + #line 900 "UpgradeLexer.cpp" + + /* Macros after this point can all be overridden by user definitions in + * section 1. + */ + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus + extern "C" int yywrap YY_PROTO(( void )); + #else + extern int yywrap YY_PROTO(( void )); + #endif + #endif + + #ifndef YY_NO_UNPUT + static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); + #endif + + #ifndef yytext_ptr + static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen YY_PROTO(( yyconst char * )); + #endif + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + 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 + #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. */ + #ifndef YY_READ_BUF_SIZE + #define YY_READ_BUF_SIZE 8192 + #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( yytext, yyleng, 1, yyout ) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ + #ifndef YY_INPUT + #define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + 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();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ + #ifndef yyterminate + #define yyterminate() return YY_NULL + #endif + + /* Number of entries by which start-condition stack grows. */ + #ifndef YY_START_STACK_INCR + #define YY_START_STACK_INCR 25 + #endif + + /* Report a fatal error. */ + #ifndef YY_FATAL_ERROR + #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) + #endif + + /* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ + #ifndef YY_DECL + #define YY_DECL int yylex YY_PROTO(( void )) + #endif + + /* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ + #ifndef YY_USER_ACTION + #define YY_USER_ACTION + #endif + + /* Code executed at the end of each rule. */ + #ifndef YY_BREAK + #define YY_BREAK break; + #endif + + #define YY_RULE_SETUP \ + YY_USER_ACTION + + YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + + #line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + + + #line 1054 "UpgradeLexer.cpp" + + if ( yy_init ) + { + yy_init = 0; + + #ifdef YY_USER_INIT + YY_USER_INIT; + #endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* 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_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)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + 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 != 505 ); + + yy_find_action: + 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 ) + { + int yyl; + 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 1: + YY_RULE_SETUP + #line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { /* Ignore comments for now */ } + YY_BREAK + case 2: + YY_RULE_SETUP + #line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BEGINTOK); } + YY_BREAK + case 3: + YY_RULE_SETUP + #line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ENDTOK); } + YY_BREAK + case 4: + YY_RULE_SETUP + #line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRUETOK); } + YY_BREAK + case 5: + YY_RULE_SETUP + #line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FALSETOK); } + YY_BREAK + case 6: + YY_RULE_SETUP + #line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DECLARE); } + YY_BREAK + case 7: + YY_RULE_SETUP + #line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( GLOBAL); } + YY_BREAK + case 8: + YY_RULE_SETUP + #line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CONSTANT); } + YY_BREAK + case 9: + YY_RULE_SETUP + #line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INTERNAL); } + YY_BREAK + case 10: + YY_RULE_SETUP + #line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LINKONCE); } + YY_BREAK + case 11: + YY_RULE_SETUP + #line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( WEAK); } + YY_BREAK + case 12: + YY_RULE_SETUP + #line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( APPENDING); } + YY_BREAK + case 13: + YY_RULE_SETUP + #line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DLLIMPORT); } + YY_BREAK + case 14: + YY_RULE_SETUP + #line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DLLEXPORT); } + YY_BREAK + case 15: + YY_RULE_SETUP + #line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTERN_WEAK); } + YY_BREAK + case 16: + YY_RULE_SETUP + #line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTERNAL); } + YY_BREAK + case 17: + YY_RULE_SETUP + #line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( IMPLEMENTATION); } + YY_BREAK + case 18: + YY_RULE_SETUP + #line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ZEROINITIALIZER); } + YY_BREAK + case 19: + YY_RULE_SETUP + #line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DOTDOTDOT); } + YY_BREAK + case 20: + YY_RULE_SETUP + #line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNDEF); } + YY_BREAK + case 21: + YY_RULE_SETUP + #line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( NULL_TOK); } + YY_BREAK + case 22: + YY_RULE_SETUP + #line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TO); } + YY_BREAK + case 23: + YY_RULE_SETUP + #line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TAIL); } + YY_BREAK + case 24: + YY_RULE_SETUP + #line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TARGET); } + YY_BREAK + case 25: + YY_RULE_SETUP + #line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRIPLE); } + YY_BREAK + case 26: + YY_RULE_SETUP + #line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DEPLIBS); } + YY_BREAK + case 27: + YY_RULE_SETUP + #line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ENDIAN); } + YY_BREAK + case 28: + YY_RULE_SETUP + #line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( POINTERSIZE); } + YY_BREAK + case 29: + YY_RULE_SETUP + #line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DATALAYOUT); } + YY_BREAK + case 30: + YY_RULE_SETUP + #line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LITTLE); } + YY_BREAK + case 31: + YY_RULE_SETUP + #line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BIG); } + YY_BREAK + case 32: + YY_RULE_SETUP + #line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VOLATILE); } + YY_BREAK + case 33: + YY_RULE_SETUP + #line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ALIGN); } + YY_BREAK + case 34: + YY_RULE_SETUP + #line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SECTION); } + YY_BREAK + case 35: + YY_RULE_SETUP + #line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MODULE); } + YY_BREAK + case 36: + YY_RULE_SETUP + #line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ASM_TOK); } + YY_BREAK + case 37: + YY_RULE_SETUP + #line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SIDEEFFECT); } + YY_BREAK + case 38: + YY_RULE_SETUP + #line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CC_TOK); } + YY_BREAK + case 39: + YY_RULE_SETUP + #line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CCC_TOK); } + YY_BREAK + case 40: + YY_RULE_SETUP + #line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CSRETCC_TOK); } + YY_BREAK + case 41: + YY_RULE_SETUP + #line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FASTCC_TOK); } + YY_BREAK + case 42: + YY_RULE_SETUP + #line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( COLDCC_TOK); } + YY_BREAK + case 43: + YY_RULE_SETUP + #line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( X86_STDCALLCC_TOK); } + YY_BREAK + case 44: + YY_RULE_SETUP + #line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( X86_FASTCALLCC_TOK); } + YY_BREAK + case 45: + YY_RULE_SETUP + #line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VOID); } + YY_BREAK + case 46: + YY_RULE_SETUP + #line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BOOL); } + YY_BREAK + case 47: + YY_RULE_SETUP + #line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SBYTE); } + YY_BREAK + case 48: + YY_RULE_SETUP + #line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UBYTE); } + YY_BREAK + case 49: + YY_RULE_SETUP + #line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHORT); } + YY_BREAK + case 50: + YY_RULE_SETUP + #line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( USHORT); } + YY_BREAK + case 51: + YY_RULE_SETUP + #line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INT); } + YY_BREAK + case 52: + YY_RULE_SETUP + #line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UINT); } + YY_BREAK + case 53: + YY_RULE_SETUP + #line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LONG); } + YY_BREAK + case 54: + YY_RULE_SETUP + #line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ULONG); } + YY_BREAK + case 55: + YY_RULE_SETUP + #line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FLOAT); } + YY_BREAK + case 56: + YY_RULE_SETUP + #line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( DOUBLE); } + YY_BREAK + case 57: + YY_RULE_SETUP + #line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABEL); } + YY_BREAK + case 58: + YY_RULE_SETUP + #line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TYPE); } + YY_BREAK + case 59: + YY_RULE_SETUP + #line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( OPAQUE); } + YY_BREAK + case 60: + YY_RULE_SETUP + #line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ADD); } + YY_BREAK + case 61: + YY_RULE_SETUP + #line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SUB); } + YY_BREAK + case 62: + YY_RULE_SETUP + #line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MUL); } + YY_BREAK + case 63: + YY_RULE_SETUP + #line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UDIV); } + YY_BREAK + case 64: + YY_RULE_SETUP + #line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UDIV); } + YY_BREAK + case 65: + YY_RULE_SETUP + #line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SDIV); } + YY_BREAK + case 66: + YY_RULE_SETUP + #line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FDIV); } + YY_BREAK + case 67: + YY_RULE_SETUP + #line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UREM); } + YY_BREAK + case 68: + YY_RULE_SETUP + #line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UREM); } + YY_BREAK + case 69: + YY_RULE_SETUP + #line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SREM); } + YY_BREAK + case 70: + YY_RULE_SETUP + #line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FREM); } + YY_BREAK + case 71: + YY_RULE_SETUP + #line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( AND); } + YY_BREAK + case 72: + YY_RULE_SETUP + #line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( OR); } + YY_BREAK + case 73: + YY_RULE_SETUP + #line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( XOR); } + YY_BREAK + case 74: + YY_RULE_SETUP + #line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETNE); } + YY_BREAK + case 75: + YY_RULE_SETUP + #line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETEQ); } + YY_BREAK + case 76: + YY_RULE_SETUP + #line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETLT); } + YY_BREAK + case 77: + YY_RULE_SETUP + #line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETGT); } + YY_BREAK + case 78: + YY_RULE_SETUP + #line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETLE); } + YY_BREAK + case 79: + YY_RULE_SETUP + #line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SETGE); } + YY_BREAK + case 80: + YY_RULE_SETUP + #line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( PHI_TOK); } + YY_BREAK + case 81: + YY_RULE_SETUP + #line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( CALL); } + YY_BREAK + case 82: + YY_RULE_SETUP + #line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( TRUNC); } + YY_BREAK + case 83: + YY_RULE_SETUP + #line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SELECT); } + YY_BREAK + case 84: + YY_RULE_SETUP + #line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHL); } + YY_BREAK + case 85: + YY_RULE_SETUP + #line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LSHR); } + YY_BREAK + case 86: + YY_RULE_SETUP + #line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ASHR); } + YY_BREAK + case 87: + YY_RULE_SETUP + #line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VAARG); } + YY_BREAK + case 88: + YY_RULE_SETUP + #line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( RET); } + YY_BREAK + case 89: + YY_RULE_SETUP + #line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( BR); } + YY_BREAK + case 90: + YY_RULE_SETUP + #line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SWITCH); } + YY_BREAK + case 91: + YY_RULE_SETUP + #line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INVOKE); } + YY_BREAK + case 92: + YY_RULE_SETUP + #line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNWIND); } + YY_BREAK + case 93: + YY_RULE_SETUP + #line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UNREACHABLE); } + YY_BREAK + case 94: + YY_RULE_SETUP + #line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( MALLOC); } + YY_BREAK + case 95: + YY_RULE_SETUP + #line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ALLOCA); } + YY_BREAK + case 96: + YY_RULE_SETUP + #line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FREE); } + YY_BREAK + case 97: + YY_RULE_SETUP + #line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LOAD); } + YY_BREAK + case 98: + YY_RULE_SETUP + #line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( STORE); } + YY_BREAK + case 99: + YY_RULE_SETUP + #line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( GETELEMENTPTR); } + YY_BREAK + case 100: + YY_RULE_SETUP + #line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EXTRACTELEMENT); } + YY_BREAK + case 101: + YY_RULE_SETUP + #line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( INSERTELEMENT); } + YY_BREAK + case 102: + YY_RULE_SETUP + #line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SHUFFLEVECTOR); } + YY_BREAK + case 103: + YY_RULE_SETUP + #line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( VAR_ID); } + YY_BREAK + case 104: + YY_RULE_SETUP + #line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABELSTR); } + YY_BREAK + case 105: + YY_RULE_SETUP + #line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( LABELSTR); } + YY_BREAK + case 106: + YY_RULE_SETUP + #line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( STRINGCONSTANT ); } + YY_BREAK + case 107: + YY_RULE_SETUP + #line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( EUINT64VAL ); } + YY_BREAK + case 108: + YY_RULE_SETUP + #line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( ESINT64VAL ); } + YY_BREAK + case 109: + YY_RULE_SETUP + #line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } + YY_BREAK + case 110: + YY_RULE_SETUP + #line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( UINTVAL); } + YY_BREAK + case 111: + YY_RULE_SETUP + #line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( SINTVAL); } + YY_BREAK + case 112: + YY_RULE_SETUP + #line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FPVAL); } + YY_BREAK + case 113: + YY_RULE_SETUP + #line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { RET_TOK( FPVAL); } + YY_BREAK + case YY_STATE_EOF(INITIAL): + #line 218 "/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! + */ + yy_delete_buffer(YY_CURRENT_BUFFER); + return EOF; + } + YY_BREAK + case 114: + YY_RULE_SETUP + #line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { /* Ignore whitespace */ } + YY_BREAK + case 115: + YY_RULE_SETUP + #line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + { return yytext[0]; } + YY_BREAK + case 116: + YY_RULE_SETUP + #line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK + #line 1735 "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; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + 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 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->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 + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + 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_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have 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_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + 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_current_state = yy_get_previous_state(); + + 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->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + + /* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + + 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->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + 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 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + 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->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->yy_n_chars = yy_n_chars = 0; + + else + { + 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; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + 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->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + 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->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() + { + register yy_state_type yy_current_state; + register char *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); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + 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 ); + */ + + #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 YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 506 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 505); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + + #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->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->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + 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' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } + #endif /* ifndef YY_NO_UNPUT */ + + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + static int yyinput() + #else + 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 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->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + #ifdef __cplusplus + return yyinput(); + #else + return input(); + #endif + } + + case EOB_ACT_CONTINUE_SCAN: + 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 yytext */ + yy_hold_char = *++yy_c_buf_p; + + if ( c == '\n' ) + ++yylineno; + + return c; + } + #endif /* YY_NO_INPUT */ + + #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(); + } + + + #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 ) + { + /* Flush out information for old buffer. */ + *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 = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * 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; + } + + + #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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + 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 *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return 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 ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) 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 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 + } + + + #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; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + + #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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + 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; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } + #endif + + + #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 = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + 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. + */ + b->yy_is_our_buffer = 1; + + return b; + } + #endif + + + #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; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } + #endif + + + #ifndef YY_NO_POP_STATE + static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } + #endif + + + #ifndef YY_NO_TOP_STATE + static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } + #endif + + #ifndef YY_EXIT_FAILURE + #define YY_EXIT_FAILURE 2 + #endif + + #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 ); + } + + + + /* Redefine yyless() so it works in section 3 code. */ + + #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 ) + + + /* Internal utility routines. */ + + #ifndef yytext_ptr + #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 + #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 + + + #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 ); + } + + #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 + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + + #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 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" + Index: llvm/tools/llvm-upgrade/UpgradeLexer.l diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeLexer.l:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeLexer.l Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,229 ---- + /*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the flex scanner for LLVM 1.9 assembly languages files. + // + //===----------------------------------------------------------------------===*/ + + %option prefix="Upgrade" + %option yylineno + %option nostdinit + %option never-interactive + %option batch + %option noyywrap + %option nodefault + %option 8bit + %option outfile="UpgradeLexer.cpp" + %option ecs + %option noreject + %option noyymore + + %{ + + #include "ParserInternals.h" + #define YYSTYPE std::string* + #include "UpgradeParser.h" + #include + #include + + void set_scan_bytes (const char * str, size_t len) { + Upgrade_scan_bytes (str, len); + } + + static void trim(std::string& str) { + size_t startpos = str.find_first_not_of(" \t\n\r",0); + if (startpos != std::string::npos) + str.erase(0,startpos); + } + + // Construct a token value for a non-obsolete token + #define RET_TOK(sym) \ + Upgradelval = new std::string(yytext); \ + trim(*Upgradelval); \ + return sym + + #define YY_NEVER_INTERACTIVE 1 + %} + + + + /* Comments start with a ; and go till end of line */ + Comment ;.* + + /* Variable(Value) identifiers start with a % sign */ + VarID %[-a-zA-Z$._][-a-zA-Z$._0-9]* + + /* Label identifiers end with a colon */ + Label [-a-zA-Z$._0-9]+: + QuoteLabel \"[^\"]+\": + + /* Quoted names can contain any character except " and \ */ + StringConstant \"[^\"]*\" + + + /* [PN]Integer: match positive and negative literal integer values that + * are preceeded by a '%' character. These represent unnamed variable slots. + */ + EPInteger %[0-9]+ + ENInteger %-[0-9]+ + + + /* E[PN]Integer: match positive and negative literal integer values */ + PInteger [0-9]+ + NInteger -[0-9]+ + + /* FPConstant - A Floating point constant. + */ + FPConstant [-+]?[0-9]+[.][0-9]*([eE][-+]?[0-9]+)? + + /* HexFPConstant - Floating point constant represented in IEEE format as a + * hexadecimal number for when exponential notation is not precise enough. + */ + HexFPConstant 0x[0-9A-Fa-f]+ + + /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing + * it to deal with 64 bit numbers. + */ + HexIntConstant [us]0x[0-9A-Fa-f]+ + %% + + {Comment} { /* Ignore comments for now */ } + + begin { RET_TOK( BEGINTOK); } + end { RET_TOK( ENDTOK); } + true { RET_TOK( TRUETOK); } + false { RET_TOK( FALSETOK); } + declare { RET_TOK( DECLARE); } + global { RET_TOK( GLOBAL); } + constant { RET_TOK( CONSTANT); } + internal { RET_TOK( INTERNAL); } + linkonce { RET_TOK( LINKONCE); } + weak { RET_TOK( WEAK); } + appending { RET_TOK( APPENDING); } + dllimport { RET_TOK( DLLIMPORT); } + dllexport { RET_TOK( DLLEXPORT); } + extern_weak { RET_TOK( EXTERN_WEAK); } + external { RET_TOK( EXTERNAL); } + implementation { RET_TOK( IMPLEMENTATION); } + zeroinitializer { RET_TOK( ZEROINITIALIZER); } + \.\.\. { RET_TOK( DOTDOTDOT); } + undef { RET_TOK( UNDEF); } + null { RET_TOK( NULL_TOK); } + to { RET_TOK( TO); } + tail { RET_TOK( TAIL); } + target { RET_TOK( TARGET); } + triple { RET_TOK( TRIPLE); } + deplibs { RET_TOK( DEPLIBS); } + endian { RET_TOK( ENDIAN); } + pointersize { RET_TOK( POINTERSIZE); } + datalayout { RET_TOK( DATALAYOUT); } + little { RET_TOK( LITTLE); } + big { RET_TOK( BIG); } + volatile { RET_TOK( VOLATILE); } + align { RET_TOK( ALIGN); } + section { RET_TOK( SECTION); } + module { RET_TOK( MODULE); } + asm { RET_TOK( ASM_TOK); } + sideeffect { RET_TOK( SIDEEFFECT); } + + cc { RET_TOK( CC_TOK); } + ccc { RET_TOK( CCC_TOK); } + csretcc { RET_TOK( CSRETCC_TOK); } + fastcc { RET_TOK( FASTCC_TOK); } + coldcc { RET_TOK( COLDCC_TOK); } + x86_stdcallcc { RET_TOK( X86_STDCALLCC_TOK); } + x86_fastcallcc { RET_TOK( X86_FASTCALLCC_TOK); } + + void { RET_TOK( VOID); } + bool { RET_TOK( BOOL); } + sbyte { RET_TOK( SBYTE); } + ubyte { RET_TOK( UBYTE); } + short { RET_TOK( SHORT); } + ushort { RET_TOK( USHORT); } + int { RET_TOK( INT); } + uint { RET_TOK( UINT); } + long { RET_TOK( LONG); } + ulong { RET_TOK( ULONG); } + float { RET_TOK( FLOAT); } + double { RET_TOK( DOUBLE); } + label { RET_TOK( LABEL); } + type { RET_TOK( TYPE); } + opaque { RET_TOK( OPAQUE); } + + add { RET_TOK( ADD); } + sub { RET_TOK( SUB); } + mul { RET_TOK( MUL); } + div { RET_TOK( UDIV); } + udiv { RET_TOK( UDIV); } + sdiv { RET_TOK( SDIV); } + fdiv { RET_TOK( FDIV); } + rem { RET_TOK( UREM); } + urem { RET_TOK( UREM); } + srem { RET_TOK( SREM); } + frem { RET_TOK( FREM); } + and { RET_TOK( AND); } + or { RET_TOK( OR); } + xor { RET_TOK( XOR); } + setne { RET_TOK( SETNE); } + seteq { RET_TOK( SETEQ); } + setlt { RET_TOK( SETLT); } + setgt { RET_TOK( SETGT); } + setle { RET_TOK( SETLE); } + setge { RET_TOK( SETGE); } + + phi { RET_TOK( PHI_TOK); } + call { RET_TOK( CALL); } + cast { RET_TOK( TRUNC); } + select { RET_TOK( SELECT); } + shl { RET_TOK( SHL); } + lshr { RET_TOK( LSHR); } + ashr { RET_TOK( ASHR); } + va_arg { RET_TOK( VAARG); } + ret { RET_TOK( RET); } + br { RET_TOK( BR); } + switch { RET_TOK( SWITCH); } + invoke { RET_TOK( INVOKE); } + unwind { RET_TOK( UNWIND); } + unreachable { RET_TOK( UNREACHABLE); } + + malloc { RET_TOK( MALLOC); } + alloca { RET_TOK( ALLOCA); } + free { RET_TOK( FREE); } + load { RET_TOK( LOAD); } + store { RET_TOK( STORE); } + getelementptr { RET_TOK( GETELEMENTPTR); } + + extractelement { RET_TOK( EXTRACTELEMENT); } + insertelement { RET_TOK( INSERTELEMENT); } + shufflevector { RET_TOK( SHUFFLEVECTOR); } + + + {VarID} { RET_TOK( VAR_ID); } + {Label} { RET_TOK( LABELSTR); } + {QuoteLabel} { RET_TOK( LABELSTR); } + {StringConstant} { RET_TOK( STRINGCONSTANT ); } + {PInteger} { RET_TOK( EUINT64VAL ); } + {NInteger} { RET_TOK( ESINT64VAL ); } + {HexIntConstant} { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } + {EPInteger} { RET_TOK( UINTVAL); } + {ENInteger} { RET_TOK( SINTVAL); } + {FPConstant} { RET_TOK( FPVAL); } + {HexFPConstant} { RET_TOK( FPVAL); } + <> { + /* Make sure to free the internal buffers for flex when we are + * done reading our input! + */ + yy_delete_buffer(YY_CURRENT_BUFFER); + return EOF; + } + + [ \r\t\n] { /* Ignore whitespace */ } + . { return yytext[0]; } + + %% Index: llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,229 ---- + /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the flex scanner for LLVM assembly languages files. + // + //===----------------------------------------------------------------------===*/ + + %option prefix="Upgrade" + %option yylineno + %option nostdinit + %option never-interactive + %option batch + %option noyywrap + %option nodefault + %option 8bit + %option outfile="UpgradeLexer.cpp" + %option ecs + %option noreject + %option noyymore + + %{ + + #include "ParserInternals.h" + #define YYSTYPE std::string* + #include "UpgradeParser.h" + #include + #include + + void set_scan_bytes (const char * str, size_t len) { + Upgrade_scan_bytes (str, len); + } + + static void trim(std::string& str) { + size_t startpos = str.find_first_not_of(" \t\n\r",0); + if (startpos != std::string::npos) + str.erase(0,startpos); + } + + // Construct a token value for a non-obsolete token + #define RET_TOK(sym) \ + Upgradelval = new std::string(yytext); \ + trim(*Upgradelval); \ + return sym + + #define YY_NEVER_INTERACTIVE 1 + %} + + + + /* Comments start with a ; and go till end of line */ + Comment ;.* + + /* Variable(Value) identifiers start with a % sign */ + VarID %[-a-zA-Z$._][-a-zA-Z$._0-9]* + + /* Label identifiers end with a colon */ + Label [-a-zA-Z$._0-9]+: + QuoteLabel \"[^\"]+\": + + /* Quoted names can contain any character except " and \ */ + StringConstant \"[^\"]*\" + + + /* [PN]Integer: match positive and negative literal integer values that + * are preceeded by a '%' character. These represent unnamed variable slots. + */ + EPInteger %[0-9]+ + ENInteger %-[0-9]+ + + + /* E[PN]Integer: match positive and negative literal integer values */ + PInteger [0-9]+ + NInteger -[0-9]+ + + /* FPConstant - A Floating point constant. + */ + FPConstant [-+]?[0-9]+[.][0-9]*([eE][-+]?[0-9]+)? + + /* HexFPConstant - Floating point constant represented in IEEE format as a + * hexadecimal number for when exponential notation is not precise enough. + */ + HexFPConstant 0x[0-9A-Fa-f]+ + + /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing + * it to deal with 64 bit numbers. + */ + HexIntConstant [us]0x[0-9A-Fa-f]+ + %% + + {Comment} { /* Ignore comments for now */ } + + begin { RET_TOK( BEGINTOK); } + end { RET_TOK( ENDTOK); } + true { RET_TOK( TRUETOK); } + false { RET_TOK( FALSETOK); } + declare { RET_TOK( DECLARE); } + global { RET_TOK( GLOBAL); } + constant { RET_TOK( CONSTANT); } + internal { RET_TOK( INTERNAL); } + linkonce { RET_TOK( LINKONCE); } + weak { RET_TOK( WEAK); } + appending { RET_TOK( APPENDING); } + dllimport { RET_TOK( DLLIMPORT); } + dllexport { RET_TOK( DLLEXPORT); } + extern_weak { RET_TOK( EXTERN_WEAK); } + external { RET_TOK( EXTERNAL); } + implementation { RET_TOK( IMPLEMENTATION); } + zeroinitializer { RET_TOK( ZEROINITIALIZER); } + \.\.\. { RET_TOK( DOTDOTDOT); } + undef { RET_TOK( UNDEF); } + null { RET_TOK( NULL_TOK); } + to { RET_TOK( TO); } + tail { RET_TOK( TAIL); } + target { RET_TOK( TARGET); } + triple { RET_TOK( TRIPLE); } + deplibs { RET_TOK( DEPLIBS); } + endian { RET_TOK( ENDIAN); } + pointersize { RET_TOK( POINTERSIZE); } + datalayout { RET_TOK( DATALAYOUT); } + little { RET_TOK( LITTLE); } + big { RET_TOK( BIG); } + volatile { RET_TOK( VOLATILE); } + align { RET_TOK( ALIGN); } + section { RET_TOK( SECTION); } + module { RET_TOK( MODULE); } + asm { RET_TOK( ASM_TOK); } + sideeffect { RET_TOK( SIDEEFFECT); } + + cc { RET_TOK( CC_TOK); } + ccc { RET_TOK( CCC_TOK); } + csretcc { RET_TOK( CSRETCC_TOK); } + fastcc { RET_TOK( FASTCC_TOK); } + coldcc { RET_TOK( COLDCC_TOK); } + x86_stdcallcc { RET_TOK( X86_STDCALLCC_TOK); } + x86_fastcallcc { RET_TOK( X86_FASTCALLCC_TOK); } + + void { RET_TOK( VOID); } + bool { RET_TOK( BOOL); } + sbyte { RET_TOK( SBYTE); } + ubyte { RET_TOK( UBYTE); } + short { RET_TOK( SHORT); } + ushort { RET_TOK( USHORT); } + int { RET_TOK( INT); } + uint { RET_TOK( UINT); } + long { RET_TOK( LONG); } + ulong { RET_TOK( ULONG); } + float { RET_TOK( FLOAT); } + double { RET_TOK( DOUBLE); } + label { RET_TOK( LABEL); } + type { RET_TOK( TYPE); } + opaque { RET_TOK( OPAQUE); } + + add { RET_TOK( ADD); } + sub { RET_TOK( SUB); } + mul { RET_TOK( MUL); } + div { RET_TOK( UDIV); } + udiv { RET_TOK( UDIV); } + sdiv { RET_TOK( SDIV); } + fdiv { RET_TOK( FDIV); } + rem { RET_TOK( UREM); } + urem { RET_TOK( UREM); } + srem { RET_TOK( SREM); } + frem { RET_TOK( FREM); } + and { RET_TOK( AND); } + or { RET_TOK( OR); } + xor { RET_TOK( XOR); } + setne { RET_TOK( SETNE); } + seteq { RET_TOK( SETEQ); } + setlt { RET_TOK( SETLT); } + setgt { RET_TOK( SETGT); } + setle { RET_TOK( SETLE); } + setge { RET_TOK( SETGE); } + + phi { RET_TOK( PHI_TOK); } + call { RET_TOK( CALL); } + cast { RET_TOK( TRUNC); } + select { RET_TOK( SELECT); } + shl { RET_TOK( SHL); } + lshr { RET_TOK( LSHR); } + ashr { RET_TOK( ASHR); } + va_arg { RET_TOK( VAARG); } + ret { RET_TOK( RET); } + br { RET_TOK( BR); } + switch { RET_TOK( SWITCH); } + invoke { RET_TOK( INVOKE); } + unwind { RET_TOK( UNWIND); } + unreachable { RET_TOK( UNREACHABLE); } + + malloc { RET_TOK( MALLOC); } + alloca { RET_TOK( ALLOCA); } + free { RET_TOK( FREE); } + load { RET_TOK( LOAD); } + store { RET_TOK( STORE); } + getelementptr { RET_TOK( GETELEMENTPTR); } + + extractelement { RET_TOK( EXTRACTELEMENT); } + insertelement { RET_TOK( INSERTELEMENT); } + shufflevector { RET_TOK( SHUFFLEVECTOR); } + + + {VarID} { RET_TOK( VAR_ID); } + {Label} { RET_TOK( LABELSTR); } + {QuoteLabel} { RET_TOK( LABELSTR); } + {StringConstant} { RET_TOK( STRINGCONSTANT ); } + {PInteger} { RET_TOK( EUINT64VAL ); } + {NInteger} { RET_TOK( ESINT64VAL ); } + {HexIntConstant} { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } + {EPInteger} { RET_TOK( UINTVAL); } + {ENInteger} { RET_TOK( SINTVAL); } + {FPConstant} { RET_TOK( FPVAL); } + {HexFPConstant} { RET_TOK( FPVAL); } + <> { + /* Make sure to free the internal buffers for flex when we are + * done reading our input! + */ + yy_delete_buffer(YY_CURRENT_BUFFER); + return EOF; + } + + [ \r\t\n] { /* Ignore whitespace */ } + . { return yytext[0]; } + + %% Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,3489 ---- + /* 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. */ + + /* 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 Upgradeparse + #define yylex Upgradelex + #define yyerror Upgradeerror + #define yylval Upgradelval + #define yychar Upgradechar + #define yydebug Upgradedebug + #define yynerrs Upgradenerrs + + + /* 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, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNWIND = 331, + UNREACHABLE = 332, + ADD = 333, + SUB = 334, + MUL = 335, + UDIV = 336, + SDIV = 337, + FDIV = 338, + UREM = 339, + SREM = 340, + FREM = 341, + AND = 342, + OR = 343, + XOR = 344, + SETLE = 345, + SETGE = 346, + SETLT = 347, + SETGT = 348, + SETEQ = 349, + SETNE = 350, + MALLOC = 351, + ALLOCA = 352, + FREE = 353, + LOAD = 354, + STORE = 355, + GETELEMENTPTR = 356, + TRUNC = 357, + ZEXT = 358, + SEXT = 359, + FPTRUNC = 360, + FPEXT = 361, + BITCAST = 362, + UITOFP = 363, + SITOFP = 364, + FPTOUI = 365, + FPTOSI = 366, + INTTOPTR = 367, + PTRTOINT = 368, + PHI_TOK = 369, + SELECT = 370, + SHL = 371, + LSHR = 372, + ASHR = 373, + VAARG = 374, + EXTRACTELEMENT = 375, + INSERTELEMENT = 376, + SHUFFLEVECTOR = 377, + CAST = 378 + }; + #endif + /* Tokens. */ + #define ESINT64VAL 258 + #define EUINT64VAL 259 + #define SINTVAL 260 + #define UINTVAL 261 + #define FPVAL 262 + #define VOID 263 + #define BOOL 264 + #define SBYTE 265 + #define UBYTE 266 + #define SHORT 267 + #define USHORT 268 + #define INT 269 + #define UINT 270 + #define LONG 271 + #define ULONG 272 + #define FLOAT 273 + #define DOUBLE 274 + #define TYPE 275 + #define LABEL 276 + #define VAR_ID 277 + #define LABELSTR 278 + #define STRINGCONSTANT 279 + #define IMPLEMENTATION 280 + #define ZEROINITIALIZER 281 + #define TRUETOK 282 + #define FALSETOK 283 + #define BEGINTOK 284 + #define ENDTOK 285 + #define DECLARE 286 + #define GLOBAL 287 + #define CONSTANT 288 + #define SECTION 289 + #define VOLATILE 290 + #define TO 291 + #define DOTDOTDOT 292 + #define NULL_TOK 293 + #define UNDEF 294 + #define CONST 295 + #define INTERNAL 296 + #define LINKONCE 297 + #define WEAK 298 + #define APPENDING 299 + #define DLLIMPORT 300 + #define DLLEXPORT 301 + #define EXTERN_WEAK 302 + #define OPAQUE 303 + #define NOT 304 + #define EXTERNAL 305 + #define TARGET 306 + #define TRIPLE 307 + #define ENDIAN 308 + #define POINTERSIZE 309 + #define LITTLE 310 + #define BIG 311 + #define ALIGN 312 + #define DEPLIBS 313 + #define CALL 314 + #define TAIL 315 + #define ASM_TOK 316 + #define MODULE 317 + #define SIDEEFFECT 318 + #define CC_TOK 319 + #define CCC_TOK 320 + #define CSRETCC_TOK 321 + #define FASTCC_TOK 322 + #define COLDCC_TOK 323 + #define X86_STDCALLCC_TOK 324 + #define X86_FASTCALLCC_TOK 325 + #define DATALAYOUT 326 + #define RET 327 + #define BR 328 + #define SWITCH 329 + #define INVOKE 330 + #define UNWIND 331 + #define UNREACHABLE 332 + #define ADD 333 + #define SUB 334 + #define MUL 335 + #define UDIV 336 + #define SDIV 337 + #define FDIV 338 + #define UREM 339 + #define SREM 340 + #define FREM 341 + #define AND 342 + #define OR 343 + #define XOR 344 + #define SETLE 345 + #define SETGE 346 + #define SETLT 347 + #define SETGT 348 + #define SETEQ 349 + #define SETNE 350 + #define MALLOC 351 + #define ALLOCA 352 + #define FREE 353 + #define LOAD 354 + #define STORE 355 + #define GETELEMENTPTR 356 + #define TRUNC 357 + #define ZEXT 358 + #define SEXT 359 + #define FPTRUNC 360 + #define FPEXT 361 + #define BITCAST 362 + #define UITOFP 363 + #define SITOFP 364 + #define FPTOUI 365 + #define FPTOSI 366 + #define INTTOPTR 367 + #define PTRTOINT 368 + #define PHI_TOK 369 + #define SELECT 370 + #define SHL 371 + #define LSHR 372 + #define ASHR 373 + #define VAARG 374 + #define EXTRACTELEMENT 375 + #define INSERTELEMENT 376 + #define SHUFFLEVECTOR 377 + #define CAST 378 + + + + + /* Copy the first part of user declarations. */ + #line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + + #define YYERROR_VERBOSE 1 + #define YYSTYPE std::string* + + #include "ParserInternals.h" + #include + #include + #include + #include + #include + #include + + + int yylex(); // declaration" of xxx warnings. + int yyparse(); + + static std::string CurFilename; + + static std::ostream *O = 0; + + void UpgradeAssembly(const std::string &infile, std::ostream &out) + { + Upgradelineno = 1; + CurFilename = infile; + llvm::sys::Path p(infile); + llvm::sys::MappedFile mf; + mf.open(p); + mf.map(); + const char* base = mf.charBase(); + size_t sz = mf.size(); + + set_scan_bytes(base, sz); + + O = &out; + + if (yyparse()) { + std::cerr << "Parse failed.\n"; + exit(1); + } + } + + + + /* 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) + typedef int YYSTYPE; + # 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 393 "UpgradeParser.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 */ + + + #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) + + /* 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) + + #endif + + #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 4 + /* YYLAST -- Last index in YYTABLE. */ + #define YYLAST 1246 + + /* YYNTOKENS -- Number of terminals. */ + #define YYNTOKENS 138 + /* YYNNTS -- Number of nonterminals. */ + #define YYNNTS 71 + /* YYNRULES -- Number of rules. */ + #define YYNRULES 251 + /* YYNRULES -- Number of states. */ + #define YYNSTATES 510 + + /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ + #define YYUNDEFTOK 2 + #define YYMAXUTOK 378 + + #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, + 127, 128, 136, 2, 125, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 132, 124, 133, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 129, 126, 131, 2, 2, 2, 2, 2, 137, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 130, 2, 2, 134, 2, 135, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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 + }; + + #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, 82, 83, 85, 87, 89, 91, 93, 95, 97, + 98, 100, 102, 104, 106, 108, 110, 113, 114, 115, + 118, 119, 123, 126, 127, 129, 130, 134, 136, 139, + 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, + 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, + 181, 184, 189, 195, 201, 205, 208, 211, 213, 217, + 219, 223, 225, 226, 231, 235, 239, 244, 249, 253, + 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, + 290, 296, 305, 312, 319, 326, 333, 340, 349, 358, + 362, 364, 366, 368, 370, 373, 376, 381, 384, 386, + 391, 394, 399, 406, 413, 420, 427, 431, 436, 437, + 439, 441, 443, 447, 451, 455, 459, 463, 467, 469, + 470, 472, 474, 476, 477, 480, 484, 486, 488, 492, + 494, 495, 504, 506, 508, 512, 514, 516, 520, 521, + 523, 525, 529, 530, 532, 534, 536, 538, 540, 542, + 544, 546, 548, 552, 554, 560, 562, 564, 566, 568, + 571, 574, 576, 580, 583, 584, 586, 589, 592, 596, + 606, 616, 625, 639, 641, 643, 650, 656, 659, 666, + 674, 676, 680, 682, 683, 686, 688, 694, 700, 706, + 709, 714, 719, 726, 731, 736, 743, 750, 753, 761, + 763, 766, 767, 769, 770, 774, 781, 785, 792, 795, + 800, 807 + }; + + /* YYRHS -- A `-1'-separated list of the rules' RHS. */ + static const short int yyrhs[] = + { + 170, 0, -1, 5, -1, 6, -1, 3, -1, 4, + -1, 78, -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, 123, -1, 116, + -1, 117, -1, 118, -1, 16, -1, 14, -1, 12, + -1, 10, -1, 17, -1, 15, -1, 13, -1, 11, + -1, 146, -1, 147, -1, 18, -1, 19, -1, 178, + 124, -1, -1, 41, -1, 42, -1, 43, -1, 44, + -1, 45, -1, 46, -1, 47, -1, -1, 65, -1, + 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, + 64, 4, -1, -1, -1, 57, 4, -1, -1, 125, + 57, 4, -1, 34, 24, -1, -1, 155, -1, -1, + 125, 158, 157, -1, 155, -1, 57, 4, -1, 161, + -1, 8, -1, 163, -1, 8, -1, 163, -1, 9, + -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, + -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, + -1, 20, -1, 21, -1, 48, -1, 162, -1, 192, + -1, 126, 4, -1, 160, 127, 165, 128, -1, 129, + 4, 130, 163, 131, -1, 132, 4, 130, 163, 133, + -1, 134, 164, 135, -1, 134, 135, -1, 163, 136, + -1, 163, -1, 164, 125, 163, -1, 164, -1, 164, + 125, 37, -1, 37, -1, -1, 161, 129, 168, 131, + -1, 161, 129, 131, -1, 161, 137, 24, -1, 161, + 132, 168, 133, -1, 161, 134, 168, 135, -1, 161, + 134, 135, -1, 161, 38, -1, 161, 39, -1, 161, + 192, -1, 161, 167, -1, 161, 26, -1, 146, 140, + -1, 147, 4, -1, 9, 27, -1, 9, 28, -1, + 149, 7, -1, 144, 127, 166, 36, 161, 128, -1, + 101, 127, 166, 206, 128, -1, 115, 127, 166, 125, + 166, 125, 166, 128, -1, 141, 127, 166, 125, 166, + 128, -1, 142, 127, 166, 125, 166, 128, -1, 143, + 127, 166, 125, 166, 128, -1, 145, 127, 166, 125, + 166, 128, -1, 120, 127, 166, 125, 166, 128, -1, + 121, 127, 166, 125, 166, 125, 166, 128, -1, 122, + 127, 166, 125, 166, 125, 166, 128, -1, 168, 125, + 166, -1, 166, -1, 32, -1, 33, -1, 171, -1, + 171, 187, -1, 171, 189, -1, 171, 62, 61, 173, + -1, 171, 25, -1, 172, -1, 172, 150, 20, 159, + -1, 172, 189, -1, 172, 62, 61, 173, -1, 172, + 150, 151, 169, 166, 157, -1, 172, 150, 50, 169, + 161, 157, -1, 172, 150, 45, 169, 161, 157, -1, + 172, 150, 47, 169, 161, 157, -1, 172, 51, 175, + -1, 172, 58, 124, 176, -1, -1, 24, -1, 56, + -1, 55, -1, 53, 124, 174, -1, 54, 124, 4, + -1, 52, 124, 24, -1, 71, 124, 24, -1, 129, + 177, 131, -1, 177, 125, 24, -1, 24, -1, -1, + 22, -1, 24, -1, 178, -1, -1, 161, 179, -1, + 181, 125, 180, -1, 180, -1, 181, -1, 181, 125, + 37, -1, 37, -1, -1, 152, 159, 178, 127, 182, + 128, 156, 153, -1, 29, -1, 134, -1, 151, 183, + 184, -1, 30, -1, 135, -1, 185, 195, 186, -1, + -1, 45, -1, 47, -1, 31, 188, 183, -1, -1, + 63, -1, 3, -1, 4, -1, 7, -1, 27, -1, + 28, -1, 38, -1, 39, -1, 26, -1, 132, 168, + 133, -1, 167, -1, 61, 190, 24, 125, 24, -1, + 139, -1, 178, -1, 192, -1, 191, -1, 161, 193, + -1, 195, 196, -1, 196, -1, 197, 150, 198, -1, + 197, 200, -1, -1, 23, -1, 72, 194, -1, 72, + 8, -1, 73, 21, 193, -1, 73, 9, 193, 125, + 21, 193, 125, 21, 193, -1, 74, 148, 193, 125, + 21, 193, 129, 199, 131, -1, 74, 148, 193, 125, + 21, 193, 129, 131, -1, 75, 152, 159, 193, 127, + 203, 128, 36, 21, 193, 76, 21, 193, -1, 76, + -1, 77, -1, 199, 148, 191, 125, 21, 193, -1, + 148, 191, 125, 21, 193, -1, 150, 205, -1, 161, + 129, 193, 125, 193, 131, -1, 201, 125, 129, 193, + 125, 193, 131, -1, 194, -1, 202, 125, 194, -1, + 202, -1, -1, 60, 59, -1, 59, -1, 141, 161, + 193, 125, 193, -1, 142, 161, 193, 125, 193, -1, + 143, 161, 193, 125, 193, -1, 49, 194, -1, 145, + 194, 125, 194, -1, 144, 194, 36, 161, -1, 115, + 194, 125, 194, 125, 194, -1, 119, 194, 125, 161, + -1, 120, 194, 125, 194, -1, 121, 194, 125, 194, + 125, 194, -1, 122, 194, 125, 194, 125, 194, -1, + 114, 201, -1, 204, 152, 159, 193, 127, 203, 128, + -1, 208, -1, 125, 202, -1, -1, 35, -1, -1, + 96, 161, 154, -1, 96, 161, 125, 15, 193, 154, + -1, 97, 161, 154, -1, 97, 161, 125, 15, 193, + 154, -1, 98, 194, -1, 207, 99, 161, 193, -1, + 207, 100, 194, 125, 161, 193, -1, 101, 161, 193, + 206, -1 + }; + + /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + static const unsigned short int yyrline[] = + { + 0, 89, 89, 89, 90, 90, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 95, 95, 95, 96, 96, + 96, 96, 96, 96, 97, 98, 98, 98, 102, 102, + 102, 102, 103, 103, 103, 103, 104, 104, 105, 105, + 108, 112, 117, 117, 117, 117, 117, 117, 118, 119, + 122, 122, 122, 122, 122, 123, 123, 124, 129, 130, + 133, 134, 142, 148, 149, 152, 153, 162, 163, 176, + 176, 177, 177, 178, 182, 182, 182, 182, 182, 182, + 182, 183, 183, 183, 183, 183, 183, 184, 184, 184, + 188, 192, 197, 203, 209, 214, 217, 225, 225, 232, + 233, 238, 241, 251, 256, 259, 264, 269, 274, 277, + 282, 287, 292, 297, 303, 308, 313, 318, 323, 330, + 335, 337, 339, 341, 343, 345, 347, 349, 351, 356, + 358, 363, 363, 373, 378, 381, 386, 389, 392, 396, + 401, 406, 411, 416, 421, 426, 431, 436, 441, 446, + 448, 448, 451, 456, 461, 466, 473, 480, 485, 486, + 494, 494, 495, 495, 497, 503, 506, 510, 513, 517, + 520, 524, 539, 542, 546, 555, 556, 558, 564, 565, + 566, 570, 580, 582, 585, 585, 585, 585, 585, 586, + 586, 586, 587, 592, 593, 602, 602, 605, 605, 611, + 617, 619, 626, 630, 635, 638, 644, 649, 654, 659, + 665, 671, 677, 686, 691, 697, 702, 709, 716, 721, + 729, 730, 738, 739, 743, 748, 751, 756, 761, 766, + 771, 776, 781, 786, 791, 796, 801, 806, 811, 820, + 825, 829, 833, 834, 837, 844, 851, 858, 865, 870, + 877, 884 + }; + #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", "SINTVAL", + "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", + "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", + "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", + "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", + "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_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", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "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", + "CAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", + "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", + "ArithmeticOps", "LogicalOps", "SetCondOps", "CastOps", "ShiftOps", + "SIntType", "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", + "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", + "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", + "ConstExpr", "ConstVector", "GlobalType", "Module", "DefinitionList", + "ConstPool", "AsmBlock", "BigOrLittle", "TargetDefinition", + "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", + "END", "Function", "FnDeclareLinkage", "FunctionProto", "OptSideEffect", + "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", + "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", + "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE", + "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0 + }; + #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, 61, 44, 92, 40, 41, 91, + 120, 93, 60, 62, 123, 125, 42, 99 + }; + # endif + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ + static const unsigned char yyr1[] = + { + 0, 138, 139, 139, 140, 140, 141, 141, 141, 141, + 141, 141, 141, 141, 141, 142, 142, 142, 143, 143, + 143, 143, 143, 143, 144, 145, 145, 145, 146, 146, + 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, + 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, + 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, + 154, 154, 155, 156, 156, 157, 157, 158, 158, 159, + 159, 160, 160, 161, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, + 163, 163, 163, 163, 163, 163, 163, 164, 164, 165, + 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, + 168, 169, 169, 170, 171, 171, 171, 171, 171, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, + 174, 174, 175, 175, 175, 175, 176, 177, 177, 177, + 178, 178, 179, 179, 180, 181, 181, 182, 182, 182, + 182, 183, 184, 184, 185, 186, 186, 187, 188, 188, + 188, 189, 190, 190, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 192, 192, 193, 193, 194, + 195, 195, 196, 197, 197, 197, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 199, 199, 200, 201, 201, + 202, 202, 203, 203, 204, 204, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, + 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, + 208, 208 + }; + + /* 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, + 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 2, 0, 0, 2, + 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 4, 5, 5, 3, 2, 2, 1, 3, 1, + 3, 1, 0, 4, 3, 3, 4, 4, 3, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, + 5, 8, 6, 6, 6, 6, 6, 8, 8, 3, + 1, 1, 1, 1, 2, 2, 4, 2, 1, 4, + 2, 4, 6, 6, 6, 6, 3, 4, 0, 1, + 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, + 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, + 0, 8, 1, 1, 3, 1, 1, 3, 0, 1, + 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, + 2, 1, 3, 2, 0, 1, 2, 2, 3, 9, + 9, 8, 13, 1, 1, 6, 5, 2, 6, 7, + 1, 3, 1, 0, 2, 1, 5, 5, 5, 2, + 4, 4, 6, 4, 4, 6, 6, 2, 7, 1, + 2, 0, 1, 0, 3, 6, 3, 6, 2, 4, + 6, 4 + }; + + /* 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 char yydefact[] = + { + 148, 0, 49, 138, 1, 137, 178, 42, 43, 44, + 45, 46, 47, 48, 0, 57, 204, 134, 135, 160, + 161, 0, 0, 0, 49, 0, 140, 179, 180, 57, + 0, 0, 50, 51, 52, 53, 54, 55, 0, 0, + 205, 204, 201, 41, 0, 0, 0, 0, 146, 0, + 0, 0, 0, 0, 0, 0, 40, 181, 149, 136, + 56, 2, 3, 70, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 0, 0, + 0, 0, 195, 0, 0, 69, 88, 73, 196, 89, + 172, 173, 174, 175, 176, 177, 200, 243, 203, 0, + 0, 0, 0, 159, 147, 141, 139, 131, 132, 0, + 0, 0, 0, 90, 0, 0, 72, 95, 97, 0, + 0, 102, 96, 242, 0, 225, 0, 0, 0, 0, + 57, 213, 214, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 0, 0, 0, 0, 0, 0, 25, 26, 27, + 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, + 202, 57, 217, 0, 239, 154, 151, 150, 152, 153, + 155, 158, 0, 65, 65, 65, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 0, 0, 0, + 0, 65, 0, 0, 0, 94, 170, 101, 99, 0, + 0, 229, 224, 207, 206, 0, 0, 31, 35, 30, + 34, 29, 33, 28, 32, 36, 37, 0, 0, 60, + 60, 248, 0, 0, 237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, + 0, 144, 145, 143, 116, 117, 4, 5, 114, 115, + 118, 113, 109, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 112, 111, + 142, 71, 71, 98, 169, 163, 166, 167, 0, 0, + 91, 184, 185, 186, 191, 187, 188, 189, 190, 182, + 0, 193, 198, 197, 199, 0, 208, 0, 0, 0, + 244, 0, 246, 241, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 0, 0, 67, 65, 0, 0, 0, 0, 0, 104, + 130, 0, 0, 108, 0, 105, 0, 0, 0, 0, + 0, 92, 93, 162, 164, 0, 63, 100, 183, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 251, 0, + 0, 0, 233, 234, 0, 0, 0, 0, 0, 231, + 230, 0, 249, 0, 62, 68, 66, 241, 0, 0, + 0, 0, 0, 103, 106, 107, 0, 0, 0, 0, + 0, 168, 165, 64, 58, 0, 192, 0, 0, 223, + 60, 61, 60, 220, 240, 0, 0, 0, 0, 0, + 226, 227, 228, 223, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 0, 0, 0, 171, 0, 0, + 0, 222, 0, 0, 245, 247, 0, 0, 0, 232, + 235, 236, 0, 250, 120, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 59, 194, 0, 0, 0, 221, + 218, 0, 238, 0, 126, 0, 0, 122, 123, 124, + 119, 125, 0, 211, 0, 0, 0, 219, 0, 0, + 0, 209, 0, 210, 0, 0, 121, 127, 128, 0, + 0, 0, 0, 0, 0, 216, 0, 0, 215, 212 + }; + + /* YYDEFGOTO[NTERM-NUM]. */ + static const short int yydefgoto[] = + { + -1, 82, 258, 273, 274, 275, 276, 277, 197, 198, + 227, 199, 24, 15, 38, 437, 310, 332, 404, 251, + 333, 83, 84, 200, 86, 87, 119, 209, 340, 301, + 341, 109, 1, 2, 3, 59, 178, 48, 104, 182, + 88, 354, 286, 287, 288, 39, 92, 16, 95, 17, + 29, 18, 359, 302, 89, 304, 413, 41, 42, 43, + 170, 485, 98, 234, 441, 442, 171, 172, 368, 173, + 174 + }; + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ + #define YYPACT_NINF -451 + static const short int yypact[] = + { + -451, 18, 670, 213, -451, -451, 63, -451, -451, -451, + -451, -451, -451, -451, -39, 308, 33, -451, -451, -451, + -451, 14, -36, 31, 150, -12, -451, -451, -451, 308, + 96, 136, -451, -451, -451, -451, -451, -451, 971, -13, + -451, -9, -451, 119, 10, 20, 37, 56, -451, 40, + 96, 971, 45, 45, 45, 45, -451, -451, -451, -451, + -451, -451, -451, 52, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, 177, 179, + 180, 85, -451, 119, 58, -451, -451, -52, -451, -451, + -451, -451, -451, -451, -451, -451, -451, 1123, -451, 163, + 97, 185, 174, 178, -451, -451, -451, -451, -451, 1019, + 1019, 1019, 1060, -451, 76, 82, -451, -451, -52, -85, + 86, 786, -451, -451, 1019, -451, 157, 1101, 30, 278, + 308, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, 1019, 1019, 1019, 1019, 1019, 1019, -451, -451, -451, + 1019, 1019, 1019, 1019, -451, 1019, 1019, 1019, 1019, 1019, + -451, 308, -451, 55, -451, -451, -451, -451, -451, -451, + -451, -451, -49, 90, 90, 90, 130, 156, 214, 160, + 217, 162, 218, 168, 220, 224, 225, 170, 221, 227, + 387, 90, 1019, 1019, 1019, -451, 827, -451, 111, 122, + 560, -451, -451, 52, -451, 560, 560, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, 560, 971, 123, + 126, -451, 560, 118, 127, 128, 140, 141, 142, 143, + 560, 560, 560, 233, 145, 971, 1019, 1019, 248, -451, + -23, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, 146, 147, 149, 169, 171, 868, + 1060, 537, 253, 173, 181, 182, 183, 187, -451, -451, + -451, -94, 6, -52, -451, 119, -451, 158, 188, 889, + -451, -451, -451, -451, -451, -451, -451, -451, -451, 234, + 1060, -451, -451, -451, -451, 190, -451, 197, 560, -5, + -451, 8, -451, 201, 560, 199, 1019, 1019, 1019, 1019, + 1019, 205, 207, 208, 1019, 1019, 560, 560, 209, -451, + 282, 303, -451, 90, 1060, 1060, 1060, 1060, 1060, -451, + -451, -44, -89, -451, -56, -451, 1060, 1060, 1060, 1060, + 1060, -451, -451, -451, -451, 930, 304, -451, -451, 313, + -14, 320, 323, 219, 560, 344, 560, 1019, -451, 226, + 560, 228, -451, -451, 229, 230, 560, 560, 560, -451, + -451, 222, -451, 1019, -451, -451, -451, 201, 231, 238, + 239, 241, 1060, -451, -451, -451, 244, 245, 257, 348, + 261, -451, -451, -451, 330, 263, -451, 560, 560, 1019, + 264, -451, 264, -451, 265, 560, 266, 1019, 1019, 1019, + -451, -451, -451, 1019, 560, 267, 1060, 1060, 1060, 1060, + -451, 1060, 1060, 1060, 1019, 1060, 390, -451, 373, 273, + 270, 265, 272, 345, -451, -451, 1019, 274, 560, -451, + -451, -451, 275, -451, -451, 276, 279, 281, 285, 284, + 286, 287, 288, 290, -451, -451, 383, 15, 384, -451, + -451, 291, -451, 1060, -451, 1060, 1060, -451, -451, -451, + -451, -451, 560, -451, 661, 47, 398, -451, 293, 295, + 296, -451, 302, -451, 661, 560, -451, -451, -451, 408, + 306, 356, 560, 412, 414, -451, 560, 560, -451, -451 + }; + + /* YYPGOTO[NTERM-NUM]. */ + static const short int yypgoto[] = + { + -451, -451, -451, 339, 341, 342, 343, 346, -128, -127, + -450, -451, 401, 421, -97, -451, -224, 92, -451, -177, + -451, -46, -451, -38, -451, -66, 328, -451, -108, 250, + -251, 94, -451, -451, -451, 402, -451, -451, -451, -451, + 0, -451, 98, -451, -451, 422, -451, -451, -451, -451, + -451, 451, -451, -414, -65, 120, -115, -451, 415, -451, + -451, -451, -451, -451, 88, 34, -451, -451, 71, -451, + -451 + }; + + /* 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 -134 + static const short int yytable[] = + { + 85, 225, 226, 25, 201, 106, 312, 252, 253, 211, + 364, 330, 214, 85, 40, 118, 90, 484, 4, 342, + 344, 93, 30, 366, 280, 217, 218, 219, 220, 221, + 222, 223, 224, 228, 331, 494, 392, 351, 231, 215, + 204, 235, 122, 25, 394, 236, 237, 238, 239, 360, + 205, 216, 365, 243, 244, 118, 40, 217, 218, 219, + 220, 221, 222, 223, 224, 365, 44, 45, 46, 392, + 492, 183, 184, 185, 245, -71, 248, 107, 108, 395, + 500, 392, 249, 120, 122, 47, 210, 393, 49, 210, + 61, 62, 50, 116, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 19, 27, 20, + 28, 392, 56, 229, 230, 210, 232, 233, 210, 406, + 58, 91, 210, 210, 210, 210, 94, 240, 241, 242, + 210, 210, 328, 77, 99, 279, 281, 282, 283, 352, + 60, 19, 122, 20, 100, 303, 483, 110, 111, 112, + 303, 303, 176, 177, 246, 247, 386, 254, 255, -31, + -31, 101, 303, -30, -30, -29, -29, 303, 285, 103, + 51, -28, -28, 256, 257, 303, 303, 303, 493, -72, + 102, 113, 308, 114, 115, 121, 444, 175, 445, 179, + 85, 7, 8, 9, 10, 52, 12, 53, 180, 326, + 54, 371, 181, 373, 374, 375, 202, 85, 327, 210, + 380, 78, 203, 206, 79, 250, 212, 80, -35, 81, + 117, -34, -33, 283, -32, 259, 387, 388, 389, 390, + 391, -38, -39, -41, 260, 19, 289, 20, 396, 397, + 398, 399, 400, 303, 6, -41, -41, 314, 309, 303, + 290, 311, 315, 316, -41, -41, -41, -41, -41, -41, + -41, 303, 303, -41, 21, 317, 318, 319, 320, 324, + 325, 22, 329, 334, 335, 23, 336, 345, 210, 372, + 210, 210, 210, 355, 430, 353, 379, 210, 217, 218, + 219, 220, 221, 222, 223, 224, 337, 358, 338, 303, + 346, 303, 449, 450, 451, 303, 384, 385, 347, 348, + 349, 303, 303, 303, 350, 361, 356, 285, 455, 456, + 457, 458, 362, 459, 460, 461, 367, 463, 370, 210, + 376, 469, 377, 378, 383, 305, 306, 405, 330, 225, + 226, 407, 303, 303, 408, 424, 409, 307, 411, 423, + 303, 415, 313, 417, 418, 419, 426, 225, 226, 303, + 321, 322, 323, 427, 428, 488, 429, 489, 490, 431, + 432, 210, 31, 32, 33, 34, 35, 36, 37, 210, + 210, 210, 433, 303, 434, 210, 435, 436, 438, 443, + 446, 448, 61, 62, 464, 454, 462, 465, 466, 467, + 468, 473, 365, 472, 482, 470, 475, 474, 210, 19, + 476, 20, 477, 261, 478, 479, 480, 303, 481, 495, + 486, 496, 487, 497, 498, 262, 263, 499, 363, 502, + 303, 503, 504, 506, 369, 507, 165, 303, 166, 167, + 168, 303, 303, 169, 97, 55, 381, 382, 403, 208, + 278, 57, 105, 402, 26, 414, 96, 452, 425, 0, + 0, 0, 0, 0, 0, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 0, 410, 0, 412, 0, 264, 0, + 416, 0, 0, 0, 0, 0, 420, 421, 422, 0, + 0, 0, 265, 157, 158, 159, 0, 266, 267, 268, + 164, 0, 0, 0, 0, 0, 269, 0, 0, 270, + 0, 271, 0, 0, 272, 0, 0, 439, 440, 0, + 0, 0, 0, 0, 0, 447, 0, 0, 0, 0, + 0, 0, 61, 62, 453, 116, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 75, 76, 19, + 0, 20, 0, 291, 292, 61, 62, 293, 471, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 19, 0, 20, 77, 294, 295, 296, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 297, 298, + 0, 0, 491, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, + 0, 299, 505, 0, 0, 0, 508, 509, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 0, 0, 0, 0, + 0, 264, 0, 78, 291, 292, 79, 0, 293, 80, + -133, 81, 343, 0, 0, 265, 157, 158, 159, 0, + 266, 267, 268, 164, 0, 0, 0, 294, 295, 296, + 0, 0, 300, 0, 0, 5, 0, 0, 0, 297, + 298, 6, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 8, 9, 10, 11, 12, 13, 0, 0, + 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 0, 0, 0, + 0, 0, 264, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 265, 157, 158, 159, + 0, 266, 267, 268, 164, 0, 0, 0, 0, 0, + 0, 61, 62, 300, 116, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 19, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, + 0, 0, 61, 62, 77, 116, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 19, + 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 284, 0, 0, 0, 0, 0, + 0, 0, 0, 61, 62, 77, 116, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 75, 76, + 19, 0, 20, 0, 61, 62, 0, 116, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 19, 78, 20, 0, 79, 77, 0, 80, 0, + 81, 0, 0, 0, 0, 0, 357, 0, 0, 0, + 0, 0, 0, 0, 0, 61, 62, 77, 116, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 19, 78, 20, 0, 79, 0, 0, 80, + 0, 81, 0, 0, 0, 0, 0, 401, 0, 0, + 0, 0, 0, 0, 0, 0, 61, 62, 77, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 19, 78, 20, 0, 79, 0, 339, + 80, 0, 81, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, + 0, 80, 0, 81, 61, 62, 0, 116, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 19, 0, 20, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 78, 0, 0, 79, + 0, 0, 80, 0, 81, 61, 62, 77, 116, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 75, 76, 19, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 79, 0, 0, 80, 0, 81, 61, 62, 77, 213, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 19, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, + 0, 80, 0, 81, 0, 0, 0, 0, 123, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 125, 126, 0, 0, 78, 0, 0, 79, + 0, 0, 80, 0, 81, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 0, 0, 154, 0, 0, 78, 0, 0, + 79, 0, 0, 80, 0, 81, 0, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164 + }; + + static const short int yycheck[] = + { + 38, 129, 129, 3, 112, 51, 230, 184, 185, 124, + 15, 34, 127, 51, 23, 81, 29, 467, 0, 270, + 271, 30, 61, 15, 201, 10, 11, 12, 13, 14, + 15, 16, 17, 130, 57, 485, 125, 131, 153, 9, + 125, 156, 136, 43, 133, 160, 161, 162, 163, 300, + 135, 21, 57, 168, 169, 121, 23, 10, 11, 12, + 13, 14, 15, 16, 17, 57, 52, 53, 54, 125, + 484, 109, 110, 111, 171, 127, 125, 32, 33, 135, + 494, 125, 131, 83, 136, 71, 124, 131, 124, 127, + 5, 6, 61, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 45, 24, + 47, 125, 124, 151, 152, 153, 154, 155, 156, 133, + 24, 134, 160, 161, 162, 163, 135, 165, 166, 167, + 168, 169, 247, 48, 124, 200, 202, 203, 204, 133, + 4, 22, 136, 24, 124, 210, 131, 53, 54, 55, + 215, 216, 55, 56, 99, 100, 333, 27, 28, 3, + 4, 124, 227, 3, 4, 3, 4, 232, 206, 129, + 20, 3, 4, 3, 4, 240, 241, 242, 131, 127, + 124, 4, 228, 4, 4, 127, 410, 24, 412, 4, + 228, 41, 42, 43, 44, 45, 46, 47, 24, 245, + 50, 316, 24, 318, 319, 320, 130, 245, 246, 247, + 325, 126, 130, 127, 129, 125, 59, 132, 4, 134, + 135, 4, 4, 289, 4, 4, 334, 335, 336, 337, + 338, 7, 7, 20, 7, 22, 125, 24, 346, 347, + 348, 349, 350, 308, 31, 32, 33, 129, 125, 314, + 128, 125, 125, 125, 41, 42, 43, 44, 45, 46, + 47, 326, 327, 50, 51, 125, 125, 125, 125, 36, + 125, 58, 24, 127, 127, 62, 127, 24, 316, 317, + 318, 319, 320, 125, 392, 285, 324, 325, 10, 11, + 12, 13, 14, 15, 16, 17, 127, 63, 127, 364, + 127, 366, 417, 418, 419, 370, 24, 4, 127, 127, + 127, 376, 377, 378, 127, 125, 128, 355, 426, 427, + 428, 429, 125, 431, 432, 433, 125, 435, 129, 367, + 125, 446, 125, 125, 125, 215, 216, 24, 34, 467, + 467, 21, 407, 408, 21, 383, 127, 227, 4, 127, + 415, 125, 232, 125, 125, 125, 125, 485, 485, 424, + 240, 241, 242, 125, 125, 473, 125, 475, 476, 125, + 125, 409, 64, 65, 66, 67, 68, 69, 70, 417, + 418, 419, 125, 448, 36, 423, 125, 57, 125, 125, + 125, 125, 5, 6, 4, 128, 434, 24, 125, 129, + 128, 125, 57, 128, 21, 131, 125, 128, 446, 22, + 125, 24, 128, 26, 128, 128, 128, 482, 128, 21, + 36, 128, 131, 128, 128, 38, 39, 125, 308, 21, + 495, 125, 76, 21, 314, 21, 97, 502, 97, 97, + 97, 506, 507, 97, 43, 24, 326, 327, 356, 121, + 200, 29, 50, 355, 3, 367, 41, 423, 387, -1, + -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, -1, 364, -1, 366, -1, 101, -1, + 370, -1, -1, -1, -1, -1, 376, 377, 378, -1, + -1, -1, 115, 116, 117, 118, -1, 120, 121, 122, + 123, -1, -1, -1, -1, -1, 129, -1, -1, 132, + -1, 134, -1, -1, 137, -1, -1, 407, 408, -1, + -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, + -1, -1, 5, 6, 424, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + -1, 24, -1, 3, 4, 5, 6, 7, 448, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, 24, 48, 26, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 38, 39, + -1, -1, 482, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 495, -1, -1, -1, -1, + -1, 61, 502, -1, -1, -1, 506, 507, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, -1, -1, -1, -1, + -1, 101, -1, 126, 3, 4, 129, -1, 7, 132, + 0, 134, 135, -1, -1, 115, 116, 117, 118, -1, + 120, 121, 122, 123, -1, -1, -1, 26, 27, 28, + -1, -1, 132, -1, -1, 25, -1, -1, -1, 38, + 39, 31, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 62, -1, -1, -1, -1, -1, -1, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, + -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 115, 116, 117, 118, + -1, 120, 121, 122, 123, -1, -1, -1, -1, -1, + -1, 5, 6, 132, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 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, 20, 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, 20, 21, + 22, -1, 24, -1, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 126, 24, -1, 129, 48, -1, 132, -1, + 134, -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, + 20, 21, 22, 126, 24, -1, 129, -1, -1, 132, + -1, 134, -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, 20, 21, 22, 126, 24, -1, 129, -1, 131, + 132, -1, 134, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, + -1, 132, -1, 134, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 126, -1, -1, 129, + -1, -1, 132, -1, 134, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, + 129, -1, -1, 132, -1, 134, 5, 6, 48, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, + -1, 132, -1, 134, -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, 126, -1, -1, 129, + -1, -1, 132, -1, 134, 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, -1, -1, 101, -1, -1, 126, -1, -1, + 129, -1, -1, 132, -1, 134, -1, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123 + }; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ + static const unsigned char yystos[] = + { + 0, 170, 171, 172, 0, 25, 31, 41, 42, 43, + 44, 45, 46, 47, 62, 151, 185, 187, 189, 22, + 24, 51, 58, 62, 150, 178, 189, 45, 47, 188, + 61, 64, 65, 66, 67, 68, 69, 70, 152, 183, + 23, 195, 196, 197, 52, 53, 54, 71, 175, 124, + 61, 20, 45, 47, 50, 151, 124, 183, 24, 173, + 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 48, 126, 129, + 132, 134, 139, 159, 160, 161, 162, 163, 178, 192, + 29, 134, 184, 30, 135, 186, 196, 150, 200, 124, + 124, 124, 124, 129, 176, 173, 159, 32, 33, 169, + 169, 169, 169, 4, 4, 4, 8, 135, 163, 164, + 178, 127, 136, 35, 49, 59, 60, 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, 101, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 141, 142, 143, 144, 145, + 198, 204, 205, 207, 208, 24, 55, 56, 174, 4, + 24, 24, 177, 161, 161, 161, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 146, 147, 149, + 161, 166, 130, 130, 125, 135, 127, 37, 164, 165, + 161, 194, 59, 8, 194, 9, 21, 10, 11, 12, + 13, 14, 15, 16, 17, 146, 147, 148, 152, 161, + 161, 194, 161, 161, 201, 194, 194, 194, 194, 194, + 161, 161, 161, 194, 194, 152, 99, 100, 125, 131, + 125, 157, 157, 157, 27, 28, 3, 4, 140, 4, + 7, 26, 38, 39, 101, 115, 120, 121, 122, 129, + 132, 134, 137, 141, 142, 143, 144, 145, 167, 192, + 157, 163, 163, 163, 37, 161, 180, 181, 182, 125, + 128, 3, 4, 7, 26, 27, 28, 38, 39, 61, + 132, 167, 191, 192, 193, 193, 193, 193, 159, 125, + 154, 125, 154, 193, 129, 125, 125, 125, 125, 125, + 125, 193, 193, 193, 36, 125, 159, 161, 194, 24, + 34, 57, 155, 158, 127, 127, 127, 127, 127, 131, + 166, 168, 168, 135, 168, 24, 127, 127, 127, 127, + 127, 131, 133, 178, 179, 125, 128, 37, 63, 190, + 168, 125, 125, 193, 15, 57, 15, 125, 206, 193, + 129, 194, 161, 194, 194, 194, 125, 125, 125, 161, + 194, 193, 193, 125, 24, 4, 157, 166, 166, 166, + 166, 166, 125, 131, 133, 135, 166, 166, 166, 166, + 166, 37, 180, 155, 156, 24, 133, 21, 21, 127, + 193, 4, 193, 194, 202, 125, 193, 125, 125, 125, + 193, 193, 193, 127, 161, 206, 125, 125, 125, 125, + 166, 125, 125, 125, 36, 125, 57, 153, 125, 193, + 193, 202, 203, 125, 154, 154, 125, 193, 125, 194, + 194, 194, 203, 193, 128, 166, 166, 166, 166, 166, + 166, 166, 161, 166, 4, 24, 125, 129, 128, 194, + 131, 193, 128, 125, 128, 125, 125, 128, 128, 128, + 128, 128, 21, 131, 148, 199, 36, 131, 166, 166, + 166, 193, 191, 131, 148, 21, 128, 128, 128, 125, + 191, 193, 21, 125, 76, 193, 21, 21, 193, 193 + }; + + #define yyerrok (yyerrstatus = 0) + #define yyclearin (yychar = YYEMPTY) + #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. + Once GCC version 2 has supplanted version 1, this can go. */ + + #define YYFAIL goto yyerrlab + + #define YYRECOVERING() (!!yyerrstatus) + + #define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("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) + #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 + #endif + + + /* YYLEX -- calling `yylex' with the right arguments. */ + + #ifdef YYLEX_PARAM + # define YYLEX yylex (YYLEX_PARAM) + #else + # define YYLEX yylex () + #endif + + /* Enable debugging if requested. */ + #if YYDEBUG + + # 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) + + /*------------------------------------------------------------------. + | yy_stack_print -- Print the state stack from its BOTTOM up to its | + | TOP (included). | + `------------------------------------------------------------------*/ + + #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) + + + /*------------------------------------------------. + | 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]]); + } + + # 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 + #endif + + /* YYMAXDEPTH -- 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. */ + + #ifndef YYMAXDEPTH + # define YYMAXDEPTH 10000 + #endif + + + + #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) + { + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + 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; + } + } + + + /* Prevent warnings from -Wmissing-prototypes. */ + + #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 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) + #else + int + yyparse () + + #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; + + + + #define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + 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. */ + YYSIZE_T yysize = 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); + + yyss = yyss1; + yyvs = yyvs1; + } + #else /* no yyoverflow */ + # ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; + # else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + 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 + #endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto 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. */ + /* yyresume: */ + + /* First try to decide what to do without reference to look-ahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* 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) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* 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]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* 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; + + + /* 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. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* 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) + { + case 40: + #line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->append(" = "); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 41: + #line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(""); + ;} + break; + + case 49: + #line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(""); ;} + break; + + case 57: + #line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(""); ;} + break; + + case 58: + #line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 59: + #line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); (yyval) = (yyvsp[-1]); ;} + break; + + case 60: + #line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 61: + #line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, ", "); + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 62: + #line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 63: + #line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 65: + #line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 66: + #line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, ", "); + if (!(yyvsp[0])->empty()) + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 68: + #line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 90: + #line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Type UpReference + (yyvsp[0])->insert(0, "\\"); + (yyval) = (yyvsp[0]); + ;} + break; + + case 91: + #line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Function derived type? + *(yyvsp[-3]) += "( " + *(yyvsp[-1]) + " )"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 92: + #line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Sized array type? + (yyvsp[-3])->insert(0,"[ "); + *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " ]"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 93: + #line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Packed array type? + (yyvsp[-3])->insert(0,"< "); + *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " >"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 94: + #line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Structure type? + (yyvsp[-1])->insert(0, "{ "); + *(yyvsp[-1]) += " }"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 95: + #line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Empty structure type? + (yyval) = new std::string("{ }"); + ;} + break; + + case 96: + #line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Pointer type? + *(yyvsp[-1]) += '*'; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 98: + #line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 100: + #line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", ..."; + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 101: + #line 238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 102: + #line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 103: + #line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + *(yyvsp[-3]) += " [ " + *(yyvsp[-1]) + " ]"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 104: + #line 256 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("[ ]"); + ;} + break; + + case 105: + #line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " c" + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 106: + #line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + *(yyvsp[-3]) += " < " + *(yyvsp[-1]) + " >"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 107: + #line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " { " + *(yyvsp[-1]) + " }"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 108: + #line 274 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("[ ]"); + ;} + break; + + case 109: + #line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 110: + #line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 111: + #line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 112: + #line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 113: + #line 297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 114: + #line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 115: + #line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 116: + #line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 117: + #line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 118: + #line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Float & Double constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 119: + #line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " (" + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ")"; + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 120: + #line 335 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 121: + #line 337 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 122: + #line 339 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 123: + #line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 124: + #line 343 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 125: + #line 345 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 126: + #line 347 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 127: + #line 349 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 128: + #line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 129: + #line 356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 130: + #line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 131: + #line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { ;} + break; + + case 132: + #line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { ;} + break; + + case 133: + #line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 134: + #line 378 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 135: + #line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 136: + #line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << "module asm " << " " << *(yyvsp[0]) << "\n"; + ;} + break; + + case 137: + #line 389 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << "implementation\n"; + ;} + break; + + case 138: + #line 392 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 139: + #line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 140: + #line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Function prototypes can be in const pool + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 141: + #line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Asm blocks can be in the const pool + *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 142: + #line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 143: + #line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 144: + #line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 145: + #line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 146: + #line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 147: + #line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-2]) << " = " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 148: + #line 441 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 152: + #line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 153: + #line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 154: + #line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 155: + #line 466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 156: + #line 473 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, "[ "); + *(yyvsp[-1]) += " ]"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 157: + #line 480 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 159: + #line 486 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 163: + #line 495 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 164: + #line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyval) += " " + *(yyvsp[0]); + ;} + break; + + case 165: + #line 503 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + ;} + break; + + case 166: + #line 506 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 167: + #line 510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 168: + #line 513 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", ..."; + (yyval) = (yyvsp[-2]); + ;} + break; + + case 169: + #line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 170: + #line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 171: + #line 525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-7])->empty()) { + (yyvsp[-6])->insert(0, *(yyvsp[-7]) + " "); + } + *(yyvsp[-6]) += " " + *(yyvsp[-5]) + "( " + *(yyvsp[-3]) + " )"; + if (!(yyvsp[-1])->empty()) { + *(yyvsp[-6]) += " " + *(yyvsp[-1]); + } + if (!(yyvsp[0])->empty()) { + *(yyvsp[-6]) += " " + *(yyvsp[0]); + } + (yyval) = (yyvsp[-6]); + ;} + break; + + case 172: + #line 539 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("begin"); + ;} + break; + + case 173: + #line 542 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string ("{"); + ;} + break; + + case 174: + #line 546 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-2])->empty()) { + *O << *(yyvsp[-2]) << " "; + } + *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 175: + #line 555 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string("end"); ;} + break; + + case 176: + #line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string("}"); ;} + break; + + case 177: + #line 558 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[-1])) + *O << *(yyvsp[-1]); + *O << '\n' << *(yyvsp[0]) << "\n"; + ;} + break; + + case 181: + #line 570 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 182: + #line 580 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 183: + #line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 192: + #line 587 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, "<"); + *(yyvsp[-1]) += ">"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 194: + #line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-3])->empty()) { + *(yyvsp[-4]) += " " + *(yyvsp[-3]); + } + *(yyvsp[-4]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[-1]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 199: + #line 611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 200: + #line 617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 201: + #line 619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Do not allow functions with 0 basic blocks + ;} + break; + + case 202: + #line 626 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-1]) ; + ;} + break; + + case 203: + #line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 204: + #line 635 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 205: + #line 638 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 206: + #line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with a result... + *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 207: + #line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with no result... + *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 208: + #line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Unconditional Branch... + *O << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 209: + #line 659 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " + << *(yyvsp[-3]) << ", " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 210: + #line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " + << *(yyvsp[-3]) << " [" << *(yyvsp[-1]) << " ]\n"; + delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = 0; + ;} + break; + + case 211: + #line 671 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << " " << *(yyvsp[-5]) << ", " << *(yyvsp[-3]) << " " + << *(yyvsp[-2]) << "[]\n"; + delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-5]); delete (yyvsp[-3]); delete (yyvsp[-2]); + (yyval) = 0; + ;} + break; + + case 212: + #line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-12]) << " " << *(yyvsp[-11]) << " " << *(yyvsp[-10]) << " " << *(yyvsp[-9]) << " (" + << *(yyvsp[-7]) << ") " << *(yyvsp[-5]) << " " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " + << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-12]); delete (yyvsp[-11]); delete (yyvsp[-10]); delete (yyvsp[-9]); delete (yyvsp[-7]); delete (yyvsp[-5]); delete (yyvsp[-4]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 213: + #line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 214: + #line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 215: + #line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 216: + #line 702 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 217: + #line 709 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 218: + #line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Used for PHI nodes + *(yyvsp[-5]) += " [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; + delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 219: + #line 721 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-6]) += ", [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; + delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-6]); + ;} + break; + + case 221: + #line 730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 223: + #line 739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 224: + #line 743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 226: + #line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 227: + #line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 228: + #line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 229: + #line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 230: + #line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 231: + #line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 232: + #line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 233: + #line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 234: + #line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 235: + #line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 236: + #line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 237: + #line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 238: + #line 811 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-5])->empty()) + *(yyvsp[-6]) += " " + *(yyvsp[-5]); + if (!(yyvsp[-6])->empty()) + *(yyvsp[-6]) += " "; + *(yyvsp[-6]) += *(yyvsp[-4]) += " " + *(yyvsp[-3]) + "(" + *(yyvsp[-2]) + ")"; + delete (yyvsp[-5]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-6]); + ;} + break; + + case 240: + #line 825 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[0])->insert(0, ", "); + (yyval) = (yyvsp[0]); + ;} + break; + + case 241: + #line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 243: + #line 834 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 244: + #line 837 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-2]) += " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 245: + #line 844 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-5]) += " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 246: + #line 851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-2]) += " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 247: + #line 858 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-5]) += " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 248: + #line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 249: + #line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-3])->empty()) + *(yyvsp[-3]) += " "; + *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 250: + #line 877 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-5])->empty()) + *(yyvsp[-5]) += " "; + *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 251: + #line 884 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + + default: break; + } + + /* Line 1126 of yacc.c. */ + #line 3207 "UpgradeParser.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* 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 = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ + yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + #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) + { + 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) + { + /* 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; + } + } + else + #endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead 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; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + + /*---------------------------------------------------. + | 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; + + yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + + /*-------------------------------------. + | 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); + #endif + return yyresult; + } + + + #line 890 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + + + int yyerror(const char *ErrorMsg) { + std::string where + = std::string((CurFilename == "-") ? std::string("") : CurFilename) + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; + std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading "; + if (yychar == YYEMPTY || yychar == 0) + errMsg += "end-of-file."; + else + errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'"; + std::cerr << errMsg << '\n'; + exit(1); + } + Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,3489 ---- + /* 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. */ + + /* 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 Upgradeparse + #define yylex Upgradelex + #define yyerror Upgradeerror + #define yylval Upgradelval + #define yychar Upgradechar + #define yydebug Upgradedebug + #define yynerrs Upgradenerrs + + + /* 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, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNWIND = 331, + UNREACHABLE = 332, + ADD = 333, + SUB = 334, + MUL = 335, + UDIV = 336, + SDIV = 337, + FDIV = 338, + UREM = 339, + SREM = 340, + FREM = 341, + AND = 342, + OR = 343, + XOR = 344, + SETLE = 345, + SETGE = 346, + SETLT = 347, + SETGT = 348, + SETEQ = 349, + SETNE = 350, + MALLOC = 351, + ALLOCA = 352, + FREE = 353, + LOAD = 354, + STORE = 355, + GETELEMENTPTR = 356, + TRUNC = 357, + ZEXT = 358, + SEXT = 359, + FPTRUNC = 360, + FPEXT = 361, + BITCAST = 362, + UITOFP = 363, + SITOFP = 364, + FPTOUI = 365, + FPTOSI = 366, + INTTOPTR = 367, + PTRTOINT = 368, + PHI_TOK = 369, + SELECT = 370, + SHL = 371, + LSHR = 372, + ASHR = 373, + VAARG = 374, + EXTRACTELEMENT = 375, + INSERTELEMENT = 376, + SHUFFLEVECTOR = 377, + CAST = 378 + }; + #endif + /* Tokens. */ + #define ESINT64VAL 258 + #define EUINT64VAL 259 + #define SINTVAL 260 + #define UINTVAL 261 + #define FPVAL 262 + #define VOID 263 + #define BOOL 264 + #define SBYTE 265 + #define UBYTE 266 + #define SHORT 267 + #define USHORT 268 + #define INT 269 + #define UINT 270 + #define LONG 271 + #define ULONG 272 + #define FLOAT 273 + #define DOUBLE 274 + #define TYPE 275 + #define LABEL 276 + #define VAR_ID 277 + #define LABELSTR 278 + #define STRINGCONSTANT 279 + #define IMPLEMENTATION 280 + #define ZEROINITIALIZER 281 + #define TRUETOK 282 + #define FALSETOK 283 + #define BEGINTOK 284 + #define ENDTOK 285 + #define DECLARE 286 + #define GLOBAL 287 + #define CONSTANT 288 + #define SECTION 289 + #define VOLATILE 290 + #define TO 291 + #define DOTDOTDOT 292 + #define NULL_TOK 293 + #define UNDEF 294 + #define CONST 295 + #define INTERNAL 296 + #define LINKONCE 297 + #define WEAK 298 + #define APPENDING 299 + #define DLLIMPORT 300 + #define DLLEXPORT 301 + #define EXTERN_WEAK 302 + #define OPAQUE 303 + #define NOT 304 + #define EXTERNAL 305 + #define TARGET 306 + #define TRIPLE 307 + #define ENDIAN 308 + #define POINTERSIZE 309 + #define LITTLE 310 + #define BIG 311 + #define ALIGN 312 + #define DEPLIBS 313 + #define CALL 314 + #define TAIL 315 + #define ASM_TOK 316 + #define MODULE 317 + #define SIDEEFFECT 318 + #define CC_TOK 319 + #define CCC_TOK 320 + #define CSRETCC_TOK 321 + #define FASTCC_TOK 322 + #define COLDCC_TOK 323 + #define X86_STDCALLCC_TOK 324 + #define X86_FASTCALLCC_TOK 325 + #define DATALAYOUT 326 + #define RET 327 + #define BR 328 + #define SWITCH 329 + #define INVOKE 330 + #define UNWIND 331 + #define UNREACHABLE 332 + #define ADD 333 + #define SUB 334 + #define MUL 335 + #define UDIV 336 + #define SDIV 337 + #define FDIV 338 + #define UREM 339 + #define SREM 340 + #define FREM 341 + #define AND 342 + #define OR 343 + #define XOR 344 + #define SETLE 345 + #define SETGE 346 + #define SETLT 347 + #define SETGT 348 + #define SETEQ 349 + #define SETNE 350 + #define MALLOC 351 + #define ALLOCA 352 + #define FREE 353 + #define LOAD 354 + #define STORE 355 + #define GETELEMENTPTR 356 + #define TRUNC 357 + #define ZEXT 358 + #define SEXT 359 + #define FPTRUNC 360 + #define FPEXT 361 + #define BITCAST 362 + #define UITOFP 363 + #define SITOFP 364 + #define FPTOUI 365 + #define FPTOSI 366 + #define INTTOPTR 367 + #define PTRTOINT 368 + #define PHI_TOK 369 + #define SELECT 370 + #define SHL 371 + #define LSHR 372 + #define ASHR 373 + #define VAARG 374 + #define EXTRACTELEMENT 375 + #define INSERTELEMENT 376 + #define SHUFFLEVECTOR 377 + #define CAST 378 + + + + + /* Copy the first part of user declarations. */ + #line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + + #define YYERROR_VERBOSE 1 + #define YYSTYPE std::string* + + #include "ParserInternals.h" + #include + #include + #include + #include + #include + #include + + + int yylex(); // declaration" of xxx warnings. + int yyparse(); + + static std::string CurFilename; + + static std::ostream *O = 0; + + void UpgradeAssembly(const std::string &infile, std::ostream &out) + { + Upgradelineno = 1; + CurFilename = infile; + llvm::sys::Path p(infile); + llvm::sys::MappedFile mf; + mf.open(p); + mf.map(); + const char* base = mf.charBase(); + size_t sz = mf.size(); + + set_scan_bytes(base, sz); + + O = &out; + + if (yyparse()) { + std::cerr << "Parse failed.\n"; + exit(1); + } + } + + + + /* 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) + typedef int YYSTYPE; + # 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 393 "UpgradeParser.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 */ + + + #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) + + /* 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) + + #endif + + #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 4 + /* YYLAST -- Last index in YYTABLE. */ + #define YYLAST 1246 + + /* YYNTOKENS -- Number of terminals. */ + #define YYNTOKENS 138 + /* YYNNTS -- Number of nonterminals. */ + #define YYNNTS 71 + /* YYNRULES -- Number of rules. */ + #define YYNRULES 251 + /* YYNRULES -- Number of states. */ + #define YYNSTATES 510 + + /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ + #define YYUNDEFTOK 2 + #define YYMAXUTOK 378 + + #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, + 127, 128, 136, 2, 125, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 132, 124, 133, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 129, 126, 131, 2, 2, 2, 2, 2, 137, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 130, 2, 2, 134, 2, 135, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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 + }; + + #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, 82, 83, 85, 87, 89, 91, 93, 95, 97, + 98, 100, 102, 104, 106, 108, 110, 113, 114, 115, + 118, 119, 123, 126, 127, 129, 130, 134, 136, 139, + 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, + 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, + 181, 184, 189, 195, 201, 205, 208, 211, 213, 217, + 219, 223, 225, 226, 231, 235, 239, 244, 249, 253, + 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, + 290, 296, 305, 312, 319, 326, 333, 340, 349, 358, + 362, 364, 366, 368, 370, 373, 376, 381, 384, 386, + 391, 394, 399, 406, 413, 420, 427, 431, 436, 437, + 439, 441, 443, 447, 451, 455, 459, 463, 467, 469, + 470, 472, 474, 476, 477, 480, 484, 486, 488, 492, + 494, 495, 504, 506, 508, 512, 514, 516, 520, 521, + 523, 525, 529, 530, 532, 534, 536, 538, 540, 542, + 544, 546, 548, 552, 554, 560, 562, 564, 566, 568, + 571, 574, 576, 580, 583, 584, 586, 589, 592, 596, + 606, 616, 625, 639, 641, 643, 650, 656, 659, 666, + 674, 676, 680, 682, 683, 686, 688, 694, 700, 706, + 709, 714, 719, 726, 731, 736, 743, 750, 753, 761, + 763, 766, 767, 769, 770, 774, 781, 785, 792, 795, + 800, 807 + }; + + /* YYRHS -- A `-1'-separated list of the rules' RHS. */ + static const short int yyrhs[] = + { + 170, 0, -1, 5, -1, 6, -1, 3, -1, 4, + -1, 78, -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, 123, -1, 116, + -1, 117, -1, 118, -1, 16, -1, 14, -1, 12, + -1, 10, -1, 17, -1, 15, -1, 13, -1, 11, + -1, 146, -1, 147, -1, 18, -1, 19, -1, 178, + 124, -1, -1, 41, -1, 42, -1, 43, -1, 44, + -1, 45, -1, 46, -1, 47, -1, -1, 65, -1, + 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, + 64, 4, -1, -1, -1, 57, 4, -1, -1, 125, + 57, 4, -1, 34, 24, -1, -1, 155, -1, -1, + 125, 158, 157, -1, 155, -1, 57, 4, -1, 161, + -1, 8, -1, 163, -1, 8, -1, 163, -1, 9, + -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, + -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, + -1, 20, -1, 21, -1, 48, -1, 162, -1, 192, + -1, 126, 4, -1, 160, 127, 165, 128, -1, 129, + 4, 130, 163, 131, -1, 132, 4, 130, 163, 133, + -1, 134, 164, 135, -1, 134, 135, -1, 163, 136, + -1, 163, -1, 164, 125, 163, -1, 164, -1, 164, + 125, 37, -1, 37, -1, -1, 161, 129, 168, 131, + -1, 161, 129, 131, -1, 161, 137, 24, -1, 161, + 132, 168, 133, -1, 161, 134, 168, 135, -1, 161, + 134, 135, -1, 161, 38, -1, 161, 39, -1, 161, + 192, -1, 161, 167, -1, 161, 26, -1, 146, 140, + -1, 147, 4, -1, 9, 27, -1, 9, 28, -1, + 149, 7, -1, 144, 127, 166, 36, 161, 128, -1, + 101, 127, 166, 206, 128, -1, 115, 127, 166, 125, + 166, 125, 166, 128, -1, 141, 127, 166, 125, 166, + 128, -1, 142, 127, 166, 125, 166, 128, -1, 143, + 127, 166, 125, 166, 128, -1, 145, 127, 166, 125, + 166, 128, -1, 120, 127, 166, 125, 166, 128, -1, + 121, 127, 166, 125, 166, 125, 166, 128, -1, 122, + 127, 166, 125, 166, 125, 166, 128, -1, 168, 125, + 166, -1, 166, -1, 32, -1, 33, -1, 171, -1, + 171, 187, -1, 171, 189, -1, 171, 62, 61, 173, + -1, 171, 25, -1, 172, -1, 172, 150, 20, 159, + -1, 172, 189, -1, 172, 62, 61, 173, -1, 172, + 150, 151, 169, 166, 157, -1, 172, 150, 50, 169, + 161, 157, -1, 172, 150, 45, 169, 161, 157, -1, + 172, 150, 47, 169, 161, 157, -1, 172, 51, 175, + -1, 172, 58, 124, 176, -1, -1, 24, -1, 56, + -1, 55, -1, 53, 124, 174, -1, 54, 124, 4, + -1, 52, 124, 24, -1, 71, 124, 24, -1, 129, + 177, 131, -1, 177, 125, 24, -1, 24, -1, -1, + 22, -1, 24, -1, 178, -1, -1, 161, 179, -1, + 181, 125, 180, -1, 180, -1, 181, -1, 181, 125, + 37, -1, 37, -1, -1, 152, 159, 178, 127, 182, + 128, 156, 153, -1, 29, -1, 134, -1, 151, 183, + 184, -1, 30, -1, 135, -1, 185, 195, 186, -1, + -1, 45, -1, 47, -1, 31, 188, 183, -1, -1, + 63, -1, 3, -1, 4, -1, 7, -1, 27, -1, + 28, -1, 38, -1, 39, -1, 26, -1, 132, 168, + 133, -1, 167, -1, 61, 190, 24, 125, 24, -1, + 139, -1, 178, -1, 192, -1, 191, -1, 161, 193, + -1, 195, 196, -1, 196, -1, 197, 150, 198, -1, + 197, 200, -1, -1, 23, -1, 72, 194, -1, 72, + 8, -1, 73, 21, 193, -1, 73, 9, 193, 125, + 21, 193, 125, 21, 193, -1, 74, 148, 193, 125, + 21, 193, 129, 199, 131, -1, 74, 148, 193, 125, + 21, 193, 129, 131, -1, 75, 152, 159, 193, 127, + 203, 128, 36, 21, 193, 76, 21, 193, -1, 76, + -1, 77, -1, 199, 148, 191, 125, 21, 193, -1, + 148, 191, 125, 21, 193, -1, 150, 205, -1, 161, + 129, 193, 125, 193, 131, -1, 201, 125, 129, 193, + 125, 193, 131, -1, 194, -1, 202, 125, 194, -1, + 202, -1, -1, 60, 59, -1, 59, -1, 141, 161, + 193, 125, 193, -1, 142, 161, 193, 125, 193, -1, + 143, 161, 193, 125, 193, -1, 49, 194, -1, 145, + 194, 125, 194, -1, 144, 194, 36, 161, -1, 115, + 194, 125, 194, 125, 194, -1, 119, 194, 125, 161, + -1, 120, 194, 125, 194, -1, 121, 194, 125, 194, + 125, 194, -1, 122, 194, 125, 194, 125, 194, -1, + 114, 201, -1, 204, 152, 159, 193, 127, 203, 128, + -1, 208, -1, 125, 202, -1, -1, 35, -1, -1, + 96, 161, 154, -1, 96, 161, 125, 15, 193, 154, + -1, 97, 161, 154, -1, 97, 161, 125, 15, 193, + 154, -1, 98, 194, -1, 207, 99, 161, 193, -1, + 207, 100, 194, 125, 161, 193, -1, 101, 161, 193, + 206, -1 + }; + + /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + static const unsigned short int yyrline[] = + { + 0, 89, 89, 89, 90, 90, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 95, 95, 95, 96, 96, + 96, 96, 96, 96, 97, 98, 98, 98, 102, 102, + 102, 102, 103, 103, 103, 103, 104, 104, 105, 105, + 108, 112, 117, 117, 117, 117, 117, 117, 118, 119, + 122, 122, 122, 122, 122, 123, 123, 124, 129, 130, + 133, 134, 142, 148, 149, 152, 153, 162, 163, 176, + 176, 177, 177, 178, 182, 182, 182, 182, 182, 182, + 182, 183, 183, 183, 183, 183, 183, 184, 184, 184, + 188, 192, 197, 203, 209, 214, 217, 225, 225, 232, + 233, 238, 241, 251, 256, 259, 264, 269, 274, 277, + 282, 287, 292, 297, 303, 308, 313, 318, 323, 330, + 335, 337, 339, 341, 343, 345, 347, 349, 351, 356, + 358, 363, 363, 373, 378, 381, 386, 389, 392, 396, + 401, 406, 411, 416, 421, 426, 431, 436, 441, 446, + 448, 448, 451, 456, 461, 466, 473, 480, 485, 486, + 494, 494, 495, 495, 497, 503, 506, 510, 513, 517, + 520, 524, 539, 542, 546, 555, 556, 558, 564, 565, + 566, 570, 580, 582, 585, 585, 585, 585, 585, 586, + 586, 586, 587, 592, 593, 602, 602, 605, 605, 611, + 617, 619, 626, 630, 635, 638, 644, 649, 654, 659, + 665, 671, 677, 686, 691, 697, 702, 709, 716, 721, + 729, 730, 738, 739, 743, 748, 751, 756, 761, 766, + 771, 776, 781, 786, 791, 796, 801, 806, 811, 820, + 825, 829, 833, 834, 837, 844, 851, 858, 865, 870, + 877, 884 + }; + #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", "SINTVAL", + "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", + "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", + "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", + "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", + "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_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", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "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", + "CAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", + "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", + "ArithmeticOps", "LogicalOps", "SetCondOps", "CastOps", "ShiftOps", + "SIntType", "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", + "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", + "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", + "ConstExpr", "ConstVector", "GlobalType", "Module", "DefinitionList", + "ConstPool", "AsmBlock", "BigOrLittle", "TargetDefinition", + "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", + "END", "Function", "FnDeclareLinkage", "FunctionProto", "OptSideEffect", + "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", + "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", + "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE", + "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0 + }; + #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, 61, 44, 92, 40, 41, 91, + 120, 93, 60, 62, 123, 125, 42, 99 + }; + # endif + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ + static const unsigned char yyr1[] = + { + 0, 138, 139, 139, 140, 140, 141, 141, 141, 141, + 141, 141, 141, 141, 141, 142, 142, 142, 143, 143, + 143, 143, 143, 143, 144, 145, 145, 145, 146, 146, + 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, + 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, + 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, + 154, 154, 155, 156, 156, 157, 157, 158, 158, 159, + 159, 160, 160, 161, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, + 163, 163, 163, 163, 163, 163, 163, 164, 164, 165, + 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, + 168, 169, 169, 170, 171, 171, 171, 171, 171, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, + 174, 174, 175, 175, 175, 175, 176, 177, 177, 177, + 178, 178, 179, 179, 180, 181, 181, 182, 182, 182, + 182, 183, 184, 184, 185, 186, 186, 187, 188, 188, + 188, 189, 190, 190, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 192, 192, 193, 193, 194, + 195, 195, 196, 197, 197, 197, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 199, 199, 200, 201, 201, + 202, 202, 203, 203, 204, 204, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, + 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, + 208, 208 + }; + + /* 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, + 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 2, 0, 0, 2, + 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 4, 5, 5, 3, 2, 2, 1, 3, 1, + 3, 1, 0, 4, 3, 3, 4, 4, 3, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, + 5, 8, 6, 6, 6, 6, 6, 8, 8, 3, + 1, 1, 1, 1, 2, 2, 4, 2, 1, 4, + 2, 4, 6, 6, 6, 6, 3, 4, 0, 1, + 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, + 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, + 0, 8, 1, 1, 3, 1, 1, 3, 0, 1, + 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, + 2, 1, 3, 2, 0, 1, 2, 2, 3, 9, + 9, 8, 13, 1, 1, 6, 5, 2, 6, 7, + 1, 3, 1, 0, 2, 1, 5, 5, 5, 2, + 4, 4, 6, 4, 4, 6, 6, 2, 7, 1, + 2, 0, 1, 0, 3, 6, 3, 6, 2, 4, + 6, 4 + }; + + /* 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 char yydefact[] = + { + 148, 0, 49, 138, 1, 137, 178, 42, 43, 44, + 45, 46, 47, 48, 0, 57, 204, 134, 135, 160, + 161, 0, 0, 0, 49, 0, 140, 179, 180, 57, + 0, 0, 50, 51, 52, 53, 54, 55, 0, 0, + 205, 204, 201, 41, 0, 0, 0, 0, 146, 0, + 0, 0, 0, 0, 0, 0, 40, 181, 149, 136, + 56, 2, 3, 70, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 0, 0, + 0, 0, 195, 0, 0, 69, 88, 73, 196, 89, + 172, 173, 174, 175, 176, 177, 200, 243, 203, 0, + 0, 0, 0, 159, 147, 141, 139, 131, 132, 0, + 0, 0, 0, 90, 0, 0, 72, 95, 97, 0, + 0, 102, 96, 242, 0, 225, 0, 0, 0, 0, + 57, 213, 214, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 0, 0, 0, 0, 0, 0, 25, 26, 27, + 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, + 202, 57, 217, 0, 239, 154, 151, 150, 152, 153, + 155, 158, 0, 65, 65, 65, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 0, 0, 0, + 0, 65, 0, 0, 0, 94, 170, 101, 99, 0, + 0, 229, 224, 207, 206, 0, 0, 31, 35, 30, + 34, 29, 33, 28, 32, 36, 37, 0, 0, 60, + 60, 248, 0, 0, 237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, + 0, 144, 145, 143, 116, 117, 4, 5, 114, 115, + 118, 113, 109, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 112, 111, + 142, 71, 71, 98, 169, 163, 166, 167, 0, 0, + 91, 184, 185, 186, 191, 187, 188, 189, 190, 182, + 0, 193, 198, 197, 199, 0, 208, 0, 0, 0, + 244, 0, 246, 241, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 0, 0, 67, 65, 0, 0, 0, 0, 0, 104, + 130, 0, 0, 108, 0, 105, 0, 0, 0, 0, + 0, 92, 93, 162, 164, 0, 63, 100, 183, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 251, 0, + 0, 0, 233, 234, 0, 0, 0, 0, 0, 231, + 230, 0, 249, 0, 62, 68, 66, 241, 0, 0, + 0, 0, 0, 103, 106, 107, 0, 0, 0, 0, + 0, 168, 165, 64, 58, 0, 192, 0, 0, 223, + 60, 61, 60, 220, 240, 0, 0, 0, 0, 0, + 226, 227, 228, 223, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 0, 0, 0, 171, 0, 0, + 0, 222, 0, 0, 245, 247, 0, 0, 0, 232, + 235, 236, 0, 250, 120, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 59, 194, 0, 0, 0, 221, + 218, 0, 238, 0, 126, 0, 0, 122, 123, 124, + 119, 125, 0, 211, 0, 0, 0, 219, 0, 0, + 0, 209, 0, 210, 0, 0, 121, 127, 128, 0, + 0, 0, 0, 0, 0, 216, 0, 0, 215, 212 + }; + + /* YYDEFGOTO[NTERM-NUM]. */ + static const short int yydefgoto[] = + { + -1, 82, 258, 273, 274, 275, 276, 277, 197, 198, + 227, 199, 24, 15, 38, 437, 310, 332, 404, 251, + 333, 83, 84, 200, 86, 87, 119, 209, 340, 301, + 341, 109, 1, 2, 3, 59, 178, 48, 104, 182, + 88, 354, 286, 287, 288, 39, 92, 16, 95, 17, + 29, 18, 359, 302, 89, 304, 413, 41, 42, 43, + 170, 485, 98, 234, 441, 442, 171, 172, 368, 173, + 174 + }; + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ + #define YYPACT_NINF -451 + static const short int yypact[] = + { + -451, 18, 670, 213, -451, -451, 63, -451, -451, -451, + -451, -451, -451, -451, -39, 308, 33, -451, -451, -451, + -451, 14, -36, 31, 150, -12, -451, -451, -451, 308, + 96, 136, -451, -451, -451, -451, -451, -451, 971, -13, + -451, -9, -451, 119, 10, 20, 37, 56, -451, 40, + 96, 971, 45, 45, 45, 45, -451, -451, -451, -451, + -451, -451, -451, 52, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, 177, 179, + 180, 85, -451, 119, 58, -451, -451, -52, -451, -451, + -451, -451, -451, -451, -451, -451, -451, 1123, -451, 163, + 97, 185, 174, 178, -451, -451, -451, -451, -451, 1019, + 1019, 1019, 1060, -451, 76, 82, -451, -451, -52, -85, + 86, 786, -451, -451, 1019, -451, 157, 1101, 30, 278, + 308, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, 1019, 1019, 1019, 1019, 1019, 1019, -451, -451, -451, + 1019, 1019, 1019, 1019, -451, 1019, 1019, 1019, 1019, 1019, + -451, 308, -451, 55, -451, -451, -451, -451, -451, -451, + -451, -451, -49, 90, 90, 90, 130, 156, 214, 160, + 217, 162, 218, 168, 220, 224, 225, 170, 221, 227, + 387, 90, 1019, 1019, 1019, -451, 827, -451, 111, 122, + 560, -451, -451, 52, -451, 560, 560, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, 560, 971, 123, + 126, -451, 560, 118, 127, 128, 140, 141, 142, 143, + 560, 560, 560, 233, 145, 971, 1019, 1019, 248, -451, + -23, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, 146, 147, 149, 169, 171, 868, + 1060, 537, 253, 173, 181, 182, 183, 187, -451, -451, + -451, -94, 6, -52, -451, 119, -451, 158, 188, 889, + -451, -451, -451, -451, -451, -451, -451, -451, -451, 234, + 1060, -451, -451, -451, -451, 190, -451, 197, 560, -5, + -451, 8, -451, 201, 560, 199, 1019, 1019, 1019, 1019, + 1019, 205, 207, 208, 1019, 1019, 560, 560, 209, -451, + 282, 303, -451, 90, 1060, 1060, 1060, 1060, 1060, -451, + -451, -44, -89, -451, -56, -451, 1060, 1060, 1060, 1060, + 1060, -451, -451, -451, -451, 930, 304, -451, -451, 313, + -14, 320, 323, 219, 560, 344, 560, 1019, -451, 226, + 560, 228, -451, -451, 229, 230, 560, 560, 560, -451, + -451, 222, -451, 1019, -451, -451, -451, 201, 231, 238, + 239, 241, 1060, -451, -451, -451, 244, 245, 257, 348, + 261, -451, -451, -451, 330, 263, -451, 560, 560, 1019, + 264, -451, 264, -451, 265, 560, 266, 1019, 1019, 1019, + -451, -451, -451, 1019, 560, 267, 1060, 1060, 1060, 1060, + -451, 1060, 1060, 1060, 1019, 1060, 390, -451, 373, 273, + 270, 265, 272, 345, -451, -451, 1019, 274, 560, -451, + -451, -451, 275, -451, -451, 276, 279, 281, 285, 284, + 286, 287, 288, 290, -451, -451, 383, 15, 384, -451, + -451, 291, -451, 1060, -451, 1060, 1060, -451, -451, -451, + -451, -451, 560, -451, 661, 47, 398, -451, 293, 295, + 296, -451, 302, -451, 661, 560, -451, -451, -451, 408, + 306, 356, 560, 412, 414, -451, 560, 560, -451, -451 + }; + + /* YYPGOTO[NTERM-NUM]. */ + static const short int yypgoto[] = + { + -451, -451, -451, 339, 341, 342, 343, 346, -128, -127, + -450, -451, 401, 421, -97, -451, -224, 92, -451, -177, + -451, -46, -451, -38, -451, -66, 328, -451, -108, 250, + -251, 94, -451, -451, -451, 402, -451, -451, -451, -451, + 0, -451, 98, -451, -451, 422, -451, -451, -451, -451, + -451, 451, -451, -414, -65, 120, -115, -451, 415, -451, + -451, -451, -451, -451, 88, 34, -451, -451, 71, -451, + -451 + }; + + /* 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 -134 + static const short int yytable[] = + { + 85, 225, 226, 25, 201, 106, 312, 252, 253, 211, + 364, 330, 214, 85, 40, 118, 90, 484, 4, 342, + 344, 93, 30, 366, 280, 217, 218, 219, 220, 221, + 222, 223, 224, 228, 331, 494, 392, 351, 231, 215, + 204, 235, 122, 25, 394, 236, 237, 238, 239, 360, + 205, 216, 365, 243, 244, 118, 40, 217, 218, 219, + 220, 221, 222, 223, 224, 365, 44, 45, 46, 392, + 492, 183, 184, 185, 245, -71, 248, 107, 108, 395, + 500, 392, 249, 120, 122, 47, 210, 393, 49, 210, + 61, 62, 50, 116, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 19, 27, 20, + 28, 392, 56, 229, 230, 210, 232, 233, 210, 406, + 58, 91, 210, 210, 210, 210, 94, 240, 241, 242, + 210, 210, 328, 77, 99, 279, 281, 282, 283, 352, + 60, 19, 122, 20, 100, 303, 483, 110, 111, 112, + 303, 303, 176, 177, 246, 247, 386, 254, 255, -31, + -31, 101, 303, -30, -30, -29, -29, 303, 285, 103, + 51, -28, -28, 256, 257, 303, 303, 303, 493, -72, + 102, 113, 308, 114, 115, 121, 444, 175, 445, 179, + 85, 7, 8, 9, 10, 52, 12, 53, 180, 326, + 54, 371, 181, 373, 374, 375, 202, 85, 327, 210, + 380, 78, 203, 206, 79, 250, 212, 80, -35, 81, + 117, -34, -33, 283, -32, 259, 387, 388, 389, 390, + 391, -38, -39, -41, 260, 19, 289, 20, 396, 397, + 398, 399, 400, 303, 6, -41, -41, 314, 309, 303, + 290, 311, 315, 316, -41, -41, -41, -41, -41, -41, + -41, 303, 303, -41, 21, 317, 318, 319, 320, 324, + 325, 22, 329, 334, 335, 23, 336, 345, 210, 372, + 210, 210, 210, 355, 430, 353, 379, 210, 217, 218, + 219, 220, 221, 222, 223, 224, 337, 358, 338, 303, + 346, 303, 449, 450, 451, 303, 384, 385, 347, 348, + 349, 303, 303, 303, 350, 361, 356, 285, 455, 456, + 457, 458, 362, 459, 460, 461, 367, 463, 370, 210, + 376, 469, 377, 378, 383, 305, 306, 405, 330, 225, + 226, 407, 303, 303, 408, 424, 409, 307, 411, 423, + 303, 415, 313, 417, 418, 419, 426, 225, 226, 303, + 321, 322, 323, 427, 428, 488, 429, 489, 490, 431, + 432, 210, 31, 32, 33, 34, 35, 36, 37, 210, + 210, 210, 433, 303, 434, 210, 435, 436, 438, 443, + 446, 448, 61, 62, 464, 454, 462, 465, 466, 467, + 468, 473, 365, 472, 482, 470, 475, 474, 210, 19, + 476, 20, 477, 261, 478, 479, 480, 303, 481, 495, + 486, 496, 487, 497, 498, 262, 263, 499, 363, 502, + 303, 503, 504, 506, 369, 507, 165, 303, 166, 167, + 168, 303, 303, 169, 97, 55, 381, 382, 403, 208, + 278, 57, 105, 402, 26, 414, 96, 452, 425, 0, + 0, 0, 0, 0, 0, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 0, 410, 0, 412, 0, 264, 0, + 416, 0, 0, 0, 0, 0, 420, 421, 422, 0, + 0, 0, 265, 157, 158, 159, 0, 266, 267, 268, + 164, 0, 0, 0, 0, 0, 269, 0, 0, 270, + 0, 271, 0, 0, 272, 0, 0, 439, 440, 0, + 0, 0, 0, 0, 0, 447, 0, 0, 0, 0, + 0, 0, 61, 62, 453, 116, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 75, 76, 19, + 0, 20, 0, 291, 292, 61, 62, 293, 471, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 19, 0, 20, 77, 294, 295, 296, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 297, 298, + 0, 0, 491, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, + 0, 299, 505, 0, 0, 0, 508, 509, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 0, 0, 0, 0, + 0, 264, 0, 78, 291, 292, 79, 0, 293, 80, + -133, 81, 343, 0, 0, 265, 157, 158, 159, 0, + 266, 267, 268, 164, 0, 0, 0, 294, 295, 296, + 0, 0, 300, 0, 0, 5, 0, 0, 0, 297, + 298, 6, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 8, 9, 10, 11, 12, 13, 0, 0, + 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 0, 0, 0, + 0, 0, 264, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 265, 157, 158, 159, + 0, 266, 267, 268, 164, 0, 0, 0, 0, 0, + 0, 61, 62, 300, 116, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 19, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, + 0, 0, 61, 62, 77, 116, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 19, + 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 284, 0, 0, 0, 0, 0, + 0, 0, 0, 61, 62, 77, 116, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 75, 76, + 19, 0, 20, 0, 61, 62, 0, 116, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 19, 78, 20, 0, 79, 77, 0, 80, 0, + 81, 0, 0, 0, 0, 0, 357, 0, 0, 0, + 0, 0, 0, 0, 0, 61, 62, 77, 116, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 19, 78, 20, 0, 79, 0, 0, 80, + 0, 81, 0, 0, 0, 0, 0, 401, 0, 0, + 0, 0, 0, 0, 0, 0, 61, 62, 77, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 19, 78, 20, 0, 79, 0, 339, + 80, 0, 81, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, + 0, 80, 0, 81, 61, 62, 0, 116, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 19, 0, 20, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 78, 0, 0, 79, + 0, 0, 80, 0, 81, 61, 62, 77, 116, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 75, 76, 19, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 79, 0, 0, 80, 0, 81, 61, 62, 77, 213, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 19, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, + 0, 80, 0, 81, 0, 0, 0, 0, 123, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 125, 126, 0, 0, 78, 0, 0, 79, + 0, 0, 80, 0, 81, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 0, 0, 154, 0, 0, 78, 0, 0, + 79, 0, 0, 80, 0, 81, 0, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164 + }; + + static const short int yycheck[] = + { + 38, 129, 129, 3, 112, 51, 230, 184, 185, 124, + 15, 34, 127, 51, 23, 81, 29, 467, 0, 270, + 271, 30, 61, 15, 201, 10, 11, 12, 13, 14, + 15, 16, 17, 130, 57, 485, 125, 131, 153, 9, + 125, 156, 136, 43, 133, 160, 161, 162, 163, 300, + 135, 21, 57, 168, 169, 121, 23, 10, 11, 12, + 13, 14, 15, 16, 17, 57, 52, 53, 54, 125, + 484, 109, 110, 111, 171, 127, 125, 32, 33, 135, + 494, 125, 131, 83, 136, 71, 124, 131, 124, 127, + 5, 6, 61, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 45, 24, + 47, 125, 124, 151, 152, 153, 154, 155, 156, 133, + 24, 134, 160, 161, 162, 163, 135, 165, 166, 167, + 168, 169, 247, 48, 124, 200, 202, 203, 204, 133, + 4, 22, 136, 24, 124, 210, 131, 53, 54, 55, + 215, 216, 55, 56, 99, 100, 333, 27, 28, 3, + 4, 124, 227, 3, 4, 3, 4, 232, 206, 129, + 20, 3, 4, 3, 4, 240, 241, 242, 131, 127, + 124, 4, 228, 4, 4, 127, 410, 24, 412, 4, + 228, 41, 42, 43, 44, 45, 46, 47, 24, 245, + 50, 316, 24, 318, 319, 320, 130, 245, 246, 247, + 325, 126, 130, 127, 129, 125, 59, 132, 4, 134, + 135, 4, 4, 289, 4, 4, 334, 335, 336, 337, + 338, 7, 7, 20, 7, 22, 125, 24, 346, 347, + 348, 349, 350, 308, 31, 32, 33, 129, 125, 314, + 128, 125, 125, 125, 41, 42, 43, 44, 45, 46, + 47, 326, 327, 50, 51, 125, 125, 125, 125, 36, + 125, 58, 24, 127, 127, 62, 127, 24, 316, 317, + 318, 319, 320, 125, 392, 285, 324, 325, 10, 11, + 12, 13, 14, 15, 16, 17, 127, 63, 127, 364, + 127, 366, 417, 418, 419, 370, 24, 4, 127, 127, + 127, 376, 377, 378, 127, 125, 128, 355, 426, 427, + 428, 429, 125, 431, 432, 433, 125, 435, 129, 367, + 125, 446, 125, 125, 125, 215, 216, 24, 34, 467, + 467, 21, 407, 408, 21, 383, 127, 227, 4, 127, + 415, 125, 232, 125, 125, 125, 125, 485, 485, 424, + 240, 241, 242, 125, 125, 473, 125, 475, 476, 125, + 125, 409, 64, 65, 66, 67, 68, 69, 70, 417, + 418, 419, 125, 448, 36, 423, 125, 57, 125, 125, + 125, 125, 5, 6, 4, 128, 434, 24, 125, 129, + 128, 125, 57, 128, 21, 131, 125, 128, 446, 22, + 125, 24, 128, 26, 128, 128, 128, 482, 128, 21, + 36, 128, 131, 128, 128, 38, 39, 125, 308, 21, + 495, 125, 76, 21, 314, 21, 97, 502, 97, 97, + 97, 506, 507, 97, 43, 24, 326, 327, 356, 121, + 200, 29, 50, 355, 3, 367, 41, 423, 387, -1, + -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, -1, 364, -1, 366, -1, 101, -1, + 370, -1, -1, -1, -1, -1, 376, 377, 378, -1, + -1, -1, 115, 116, 117, 118, -1, 120, 121, 122, + 123, -1, -1, -1, -1, -1, 129, -1, -1, 132, + -1, 134, -1, -1, 137, -1, -1, 407, 408, -1, + -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, + -1, -1, 5, 6, 424, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + -1, 24, -1, 3, 4, 5, 6, 7, 448, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, 24, 48, 26, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 38, 39, + -1, -1, 482, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 495, -1, -1, -1, -1, + -1, 61, 502, -1, -1, -1, 506, 507, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, -1, -1, -1, -1, + -1, 101, -1, 126, 3, 4, 129, -1, 7, 132, + 0, 134, 135, -1, -1, 115, 116, 117, 118, -1, + 120, 121, 122, 123, -1, -1, -1, 26, 27, 28, + -1, -1, 132, -1, -1, 25, -1, -1, -1, 38, + 39, 31, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 62, -1, -1, -1, -1, -1, -1, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, + -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 115, 116, 117, 118, + -1, 120, 121, 122, 123, -1, -1, -1, -1, -1, + -1, 5, 6, 132, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 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, 20, 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, 20, 21, + 22, -1, 24, -1, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 126, 24, -1, 129, 48, -1, 132, -1, + 134, -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, + 20, 21, 22, 126, 24, -1, 129, -1, -1, 132, + -1, 134, -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, 20, 21, 22, 126, 24, -1, 129, -1, 131, + 132, -1, 134, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, + -1, 132, -1, 134, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 126, -1, -1, 129, + -1, -1, 132, -1, 134, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, + 129, -1, -1, 132, -1, 134, 5, 6, 48, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, + -1, 132, -1, 134, -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, 126, -1, -1, 129, + -1, -1, 132, -1, 134, 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, -1, -1, 101, -1, -1, 126, -1, -1, + 129, -1, -1, 132, -1, 134, -1, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123 + }; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ + static const unsigned char yystos[] = + { + 0, 170, 171, 172, 0, 25, 31, 41, 42, 43, + 44, 45, 46, 47, 62, 151, 185, 187, 189, 22, + 24, 51, 58, 62, 150, 178, 189, 45, 47, 188, + 61, 64, 65, 66, 67, 68, 69, 70, 152, 183, + 23, 195, 196, 197, 52, 53, 54, 71, 175, 124, + 61, 20, 45, 47, 50, 151, 124, 183, 24, 173, + 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 48, 126, 129, + 132, 134, 139, 159, 160, 161, 162, 163, 178, 192, + 29, 134, 184, 30, 135, 186, 196, 150, 200, 124, + 124, 124, 124, 129, 176, 173, 159, 32, 33, 169, + 169, 169, 169, 4, 4, 4, 8, 135, 163, 164, + 178, 127, 136, 35, 49, 59, 60, 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, 101, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 141, 142, 143, 144, 145, + 198, 204, 205, 207, 208, 24, 55, 56, 174, 4, + 24, 24, 177, 161, 161, 161, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 146, 147, 149, + 161, 166, 130, 130, 125, 135, 127, 37, 164, 165, + 161, 194, 59, 8, 194, 9, 21, 10, 11, 12, + 13, 14, 15, 16, 17, 146, 147, 148, 152, 161, + 161, 194, 161, 161, 201, 194, 194, 194, 194, 194, + 161, 161, 161, 194, 194, 152, 99, 100, 125, 131, + 125, 157, 157, 157, 27, 28, 3, 4, 140, 4, + 7, 26, 38, 39, 101, 115, 120, 121, 122, 129, + 132, 134, 137, 141, 142, 143, 144, 145, 167, 192, + 157, 163, 163, 163, 37, 161, 180, 181, 182, 125, + 128, 3, 4, 7, 26, 27, 28, 38, 39, 61, + 132, 167, 191, 192, 193, 193, 193, 193, 159, 125, + 154, 125, 154, 193, 129, 125, 125, 125, 125, 125, + 125, 193, 193, 193, 36, 125, 159, 161, 194, 24, + 34, 57, 155, 158, 127, 127, 127, 127, 127, 131, + 166, 168, 168, 135, 168, 24, 127, 127, 127, 127, + 127, 131, 133, 178, 179, 125, 128, 37, 63, 190, + 168, 125, 125, 193, 15, 57, 15, 125, 206, 193, + 129, 194, 161, 194, 194, 194, 125, 125, 125, 161, + 194, 193, 193, 125, 24, 4, 157, 166, 166, 166, + 166, 166, 125, 131, 133, 135, 166, 166, 166, 166, + 166, 37, 180, 155, 156, 24, 133, 21, 21, 127, + 193, 4, 193, 194, 202, 125, 193, 125, 125, 125, + 193, 193, 193, 127, 161, 206, 125, 125, 125, 125, + 166, 125, 125, 125, 36, 125, 57, 153, 125, 193, + 193, 202, 203, 125, 154, 154, 125, 193, 125, 194, + 194, 194, 203, 193, 128, 166, 166, 166, 166, 166, + 166, 166, 161, 166, 4, 24, 125, 129, 128, 194, + 131, 193, 128, 125, 128, 125, 125, 128, 128, 128, + 128, 128, 21, 131, 148, 199, 36, 131, 166, 166, + 166, 193, 191, 131, 148, 21, 128, 128, 128, 125, + 191, 193, 21, 125, 76, 193, 21, 21, 193, 193 + }; + + #define yyerrok (yyerrstatus = 0) + #define yyclearin (yychar = YYEMPTY) + #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. + Once GCC version 2 has supplanted version 1, this can go. */ + + #define YYFAIL goto yyerrlab + + #define YYRECOVERING() (!!yyerrstatus) + + #define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("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) + #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 + #endif + + + /* YYLEX -- calling `yylex' with the right arguments. */ + + #ifdef YYLEX_PARAM + # define YYLEX yylex (YYLEX_PARAM) + #else + # define YYLEX yylex () + #endif + + /* Enable debugging if requested. */ + #if YYDEBUG + + # 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) + + /*------------------------------------------------------------------. + | yy_stack_print -- Print the state stack from its BOTTOM up to its | + | TOP (included). | + `------------------------------------------------------------------*/ + + #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) + + + /*------------------------------------------------. + | 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]]); + } + + # 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 + #endif + + /* YYMAXDEPTH -- 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. */ + + #ifndef YYMAXDEPTH + # define YYMAXDEPTH 10000 + #endif + + + + #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) + { + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + 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; + } + } + + + /* Prevent warnings from -Wmissing-prototypes. */ + + #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 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) + #else + int + yyparse () + + #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; + + + + #define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + 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. */ + YYSIZE_T yysize = 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); + + yyss = yyss1; + yyvs = yyvs1; + } + #else /* no yyoverflow */ + # ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; + # else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + 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 + #endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto 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. */ + /* yyresume: */ + + /* First try to decide what to do without reference to look-ahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* 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) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* 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]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* 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; + + + /* 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. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* 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) + { + case 40: + #line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->append(" = "); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 41: + #line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(""); + ;} + break; + + case 49: + #line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(""); ;} + break; + + case 57: + #line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(""); ;} + break; + + case 58: + #line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 59: + #line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); (yyval) = (yyvsp[-1]); ;} + break; + + case 60: + #line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 61: + #line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, ", "); + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 62: + #line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 63: + #line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 65: + #line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 66: + #line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, ", "); + if (!(yyvsp[0])->empty()) + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 68: + #line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 90: + #line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Type UpReference + (yyvsp[0])->insert(0, "\\"); + (yyval) = (yyvsp[0]); + ;} + break; + + case 91: + #line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Function derived type? + *(yyvsp[-3]) += "( " + *(yyvsp[-1]) + " )"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 92: + #line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Sized array type? + (yyvsp[-3])->insert(0,"[ "); + *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " ]"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 93: + #line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Packed array type? + (yyvsp[-3])->insert(0,"< "); + *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " >"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 94: + #line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Structure type? + (yyvsp[-1])->insert(0, "{ "); + *(yyvsp[-1]) += " }"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 95: + #line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Empty structure type? + (yyval) = new std::string("{ }"); + ;} + break; + + case 96: + #line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Pointer type? + *(yyvsp[-1]) += '*'; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 98: + #line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 100: + #line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", ..."; + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 101: + #line 238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 102: + #line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 103: + #line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + *(yyvsp[-3]) += " [ " + *(yyvsp[-1]) + " ]"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 104: + #line 256 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("[ ]"); + ;} + break; + + case 105: + #line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " c" + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 106: + #line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + *(yyvsp[-3]) += " < " + *(yyvsp[-1]) + " >"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 107: + #line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " { " + *(yyvsp[-1]) + " }"; + delete (yyvsp[-1]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 108: + #line 274 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("[ ]"); + ;} + break; + + case 109: + #line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 110: + #line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 111: + #line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 112: + #line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 113: + #line 297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 114: + #line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 115: + #line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 116: + #line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 117: + #line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 118: + #line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Float & Double constants + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 119: + #line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " (" + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ")"; + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 120: + #line 335 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 121: + #line 337 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 122: + #line 339 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 123: + #line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 124: + #line 343 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 125: + #line 345 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 126: + #line 347 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 127: + #line 349 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 128: + #line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 129: + #line 356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 130: + #line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 131: + #line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { ;} + break; + + case 132: + #line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { ;} + break; + + case 133: + #line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 134: + #line 378 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 135: + #line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 136: + #line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << "module asm " << " " << *(yyvsp[0]) << "\n"; + ;} + break; + + case 137: + #line 389 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << "implementation\n"; + ;} + break; + + case 138: + #line 392 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 139: + #line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 140: + #line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Function prototypes can be in const pool + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 141: + #line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Asm blocks can be in the const pool + *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 142: + #line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 143: + #line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 144: + #line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 145: + #line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 146: + #line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 147: + #line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-2]) << " = " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 148: + #line 441 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 152: + #line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 153: + #line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 154: + #line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 155: + #line 466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " = " + *(yyvsp[-1]); + delete (yyvsp[-1]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 156: + #line 473 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, "[ "); + *(yyvsp[-1]) += " ]"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 157: + #line 480 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 159: + #line 486 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 163: + #line 495 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 164: + #line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyval) += " " + *(yyvsp[0]); + ;} + break; + + case 165: + #line 503 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + ;} + break; + + case 166: + #line 506 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 167: + #line 510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 168: + #line 513 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", ..."; + (yyval) = (yyvsp[-2]); + ;} + break; + + case 169: + #line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = (yyvsp[0]); + ;} + break; + + case 170: + #line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string(); + ;} + break; + + case 171: + #line 525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-7])->empty()) { + (yyvsp[-6])->insert(0, *(yyvsp[-7]) + " "); + } + *(yyvsp[-6]) += " " + *(yyvsp[-5]) + "( " + *(yyvsp[-3]) + " )"; + if (!(yyvsp[-1])->empty()) { + *(yyvsp[-6]) += " " + *(yyvsp[-1]); + } + if (!(yyvsp[0])->empty()) { + *(yyvsp[-6]) += " " + *(yyvsp[0]); + } + (yyval) = (yyvsp[-6]); + ;} + break; + + case 172: + #line 539 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string("begin"); + ;} + break; + + case 173: + #line 542 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = new std::string ("{"); + ;} + break; + + case 174: + #line 546 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-2])->empty()) { + *O << *(yyvsp[-2]) << " "; + } + *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 175: + #line 555 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string("end"); ;} + break; + + case 176: + #line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string("}"); ;} + break; + + case 177: + #line 558 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[-1])) + *O << *(yyvsp[-1]); + *O << '\n' << *(yyvsp[0]) << "\n"; + ;} + break; + + case 181: + #line 570 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 182: + #line 580 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 183: + #line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 192: + #line 587 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1])->insert(0, "<"); + *(yyvsp[-1]) += ">"; + (yyval) = (yyvsp[-1]); + ;} + break; + + case 194: + #line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-3])->empty()) { + *(yyvsp[-4]) += " " + *(yyvsp[-3]); + } + *(yyvsp[-4]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[-1]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 199: + #line 611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 200: + #line 617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 201: + #line 619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Do not allow functions with 0 basic blocks + ;} + break; + + case 202: + #line 626 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-1]) ; + ;} + break; + + case 203: + #line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 204: + #line 635 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval) = 0; + ;} + break; + + case 205: + #line 638 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 206: + #line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with a result... + *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 207: + #line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with no result... + *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 208: + #line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Unconditional Branch... + *O << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 209: + #line 659 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " + << *(yyvsp[-3]) << ", " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 210: + #line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " + << *(yyvsp[-3]) << " [" << *(yyvsp[-1]) << " ]\n"; + delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = 0; + ;} + break; + + case 211: + #line 671 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << " " << *(yyvsp[-5]) << ", " << *(yyvsp[-3]) << " " + << *(yyvsp[-2]) << "[]\n"; + delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-5]); delete (yyvsp[-3]); delete (yyvsp[-2]); + (yyval) = 0; + ;} + break; + + case 212: + #line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-12]) << " " << *(yyvsp[-11]) << " " << *(yyvsp[-10]) << " " << *(yyvsp[-9]) << " (" + << *(yyvsp[-7]) << ") " << *(yyvsp[-5]) << " " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " + << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[-12]); delete (yyvsp[-11]); delete (yyvsp[-10]); delete (yyvsp[-9]); delete (yyvsp[-7]); delete (yyvsp[-5]); delete (yyvsp[-4]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 213: + #line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 214: + #line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0]) << "\n"; + delete (yyvsp[0]); + (yyval) = 0; + ;} + break; + + case 215: + #line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 216: + #line 702 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 217: + #line 709 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 218: + #line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Used for PHI nodes + *(yyvsp[-5]) += " [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; + delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 219: + #line 721 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-6]) += ", [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; + delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-6]); + ;} + break; + + case 221: + #line 730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += ", " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 223: + #line 739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 224: + #line 743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 226: + #line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 227: + #line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 228: + #line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-4]); + ;} + break; + + case 229: + #line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 230: + #line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 231: + #line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 232: + #line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 233: + #line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 234: + #line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 235: + #line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 236: + #line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 237: + #line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 238: + #line 811 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-5])->empty()) + *(yyvsp[-6]) += " " + *(yyvsp[-5]); + if (!(yyvsp[-6])->empty()) + *(yyvsp[-6]) += " "; + *(yyvsp[-6]) += *(yyvsp[-4]) += " " + *(yyvsp[-3]) + "(" + *(yyvsp[-2]) + ")"; + delete (yyvsp[-5]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); + (yyval) = (yyvsp[-6]); + ;} + break; + + case 240: + #line 825 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[0])->insert(0, ", "); + (yyval) = (yyvsp[0]); + ;} + break; + + case 241: + #line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 243: + #line 834 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval) = new std::string(); ;} + break; + + case 244: + #line 837 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-2]) += " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 245: + #line 844 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-5]) += " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 246: + #line 851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2]) += " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-2]) += " " + *(yyvsp[0]); + delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-2]); + ;} + break; + + case 247: + #line 858 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); + if (!(yyvsp[0])->empty()) + *(yyvsp[-5]) += " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 248: + #line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-1]) += " " + *(yyvsp[0]); + delete (yyvsp[0]); + (yyval) = (yyvsp[-1]); + ;} + break; + + case 249: + #line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-3])->empty()) + *(yyvsp[-3]) += " "; + *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + case 250: + #line 877 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-5])->empty()) + *(yyvsp[-5]) += " "; + *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-5]); + ;} + break; + + case 251: + #line 884 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); + delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); + (yyval) = (yyvsp[-3]); + ;} + break; + + + default: break; + } + + /* Line 1126 of yacc.c. */ + #line 3207 "UpgradeParser.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* 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 = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ + yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + #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) + { + 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) + { + /* 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; + } + } + else + #endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead 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; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + + /*---------------------------------------------------. + | 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; + + yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + + /*-------------------------------------. + | 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); + #endif + return yyresult; + } + + + #line 890 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + + + int yyerror(const char *ErrorMsg) { + std::string where + = std::string((CurFilename == "-") ? std::string("") : CurFilename) + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; + std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading "; + if (yychar == YYEMPTY || yychar == 0) + errMsg += "end-of-file."; + else + errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'"; + std::cerr << errMsg << '\n'; + exit(1); + } + Index: llvm/tools/llvm-upgrade/UpgradeParser.h diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.h:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.h Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,291 ---- + /* 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, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNWIND = 331, + UNREACHABLE = 332, + ADD = 333, + SUB = 334, + MUL = 335, + UDIV = 336, + SDIV = 337, + FDIV = 338, + UREM = 339, + SREM = 340, + FREM = 341, + AND = 342, + OR = 343, + XOR = 344, + SETLE = 345, + SETGE = 346, + SETLT = 347, + SETGT = 348, + SETEQ = 349, + SETNE = 350, + MALLOC = 351, + ALLOCA = 352, + FREE = 353, + LOAD = 354, + STORE = 355, + GETELEMENTPTR = 356, + TRUNC = 357, + ZEXT = 358, + SEXT = 359, + FPTRUNC = 360, + FPEXT = 361, + BITCAST = 362, + UITOFP = 363, + SITOFP = 364, + FPTOUI = 365, + FPTOSI = 366, + INTTOPTR = 367, + PTRTOINT = 368, + PHI_TOK = 369, + SELECT = 370, + SHL = 371, + LSHR = 372, + ASHR = 373, + VAARG = 374, + EXTRACTELEMENT = 375, + INSERTELEMENT = 376, + SHUFFLEVECTOR = 377, + CAST = 378 + }; + #endif + /* Tokens. */ + #define ESINT64VAL 258 + #define EUINT64VAL 259 + #define SINTVAL 260 + #define UINTVAL 261 + #define FPVAL 262 + #define VOID 263 + #define BOOL 264 + #define SBYTE 265 + #define UBYTE 266 + #define SHORT 267 + #define USHORT 268 + #define INT 269 + #define UINT 270 + #define LONG 271 + #define ULONG 272 + #define FLOAT 273 + #define DOUBLE 274 + #define TYPE 275 + #define LABEL 276 + #define VAR_ID 277 + #define LABELSTR 278 + #define STRINGCONSTANT 279 + #define IMPLEMENTATION 280 + #define ZEROINITIALIZER 281 + #define TRUETOK 282 + #define FALSETOK 283 + #define BEGINTOK 284 + #define ENDTOK 285 + #define DECLARE 286 + #define GLOBAL 287 + #define CONSTANT 288 + #define SECTION 289 + #define VOLATILE 290 + #define TO 291 + #define DOTDOTDOT 292 + #define NULL_TOK 293 + #define UNDEF 294 + #define CONST 295 + #define INTERNAL 296 + #define LINKONCE 297 + #define WEAK 298 + #define APPENDING 299 + #define DLLIMPORT 300 + #define DLLEXPORT 301 + #define EXTERN_WEAK 302 + #define OPAQUE 303 + #define NOT 304 + #define EXTERNAL 305 + #define TARGET 306 + #define TRIPLE 307 + #define ENDIAN 308 + #define POINTERSIZE 309 + #define LITTLE 310 + #define BIG 311 + #define ALIGN 312 + #define DEPLIBS 313 + #define CALL 314 + #define TAIL 315 + #define ASM_TOK 316 + #define MODULE 317 + #define SIDEEFFECT 318 + #define CC_TOK 319 + #define CCC_TOK 320 + #define CSRETCC_TOK 321 + #define FASTCC_TOK 322 + #define COLDCC_TOK 323 + #define X86_STDCALLCC_TOK 324 + #define X86_FASTCALLCC_TOK 325 + #define DATALAYOUT 326 + #define RET 327 + #define BR 328 + #define SWITCH 329 + #define INVOKE 330 + #define UNWIND 331 + #define UNREACHABLE 332 + #define ADD 333 + #define SUB 334 + #define MUL 335 + #define UDIV 336 + #define SDIV 337 + #define FDIV 338 + #define UREM 339 + #define SREM 340 + #define FREM 341 + #define AND 342 + #define OR 343 + #define XOR 344 + #define SETLE 345 + #define SETGE 346 + #define SETLT 347 + #define SETGT 348 + #define SETEQ 349 + #define SETNE 350 + #define MALLOC 351 + #define ALLOCA 352 + #define FREE 353 + #define LOAD 354 + #define STORE 355 + #define GETELEMENTPTR 356 + #define TRUNC 357 + #define ZEXT 358 + #define SEXT 359 + #define FPTRUNC 360 + #define FPEXT 361 + #define BITCAST 362 + #define UITOFP 363 + #define SITOFP 364 + #define FPTOUI 365 + #define FPTOSI 366 + #define INTTOPTR 367 + #define PTRTOINT 368 + #define PHI_TOK 369 + #define SELECT 370 + #define SHL 371 + #define LSHR 372 + #define ASHR 373 + #define VAARG 374 + #define EXTRACTELEMENT 375 + #define INSERTELEMENT 376 + #define SHUFFLEVECTOR 377 + #define CAST 378 + + + + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + typedef int YYSTYPE; + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + extern YYSTYPE Upgradelval; + + + Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,291 ---- + /* 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, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNWIND = 331, + UNREACHABLE = 332, + ADD = 333, + SUB = 334, + MUL = 335, + UDIV = 336, + SDIV = 337, + FDIV = 338, + UREM = 339, + SREM = 340, + FREM = 341, + AND = 342, + OR = 343, + XOR = 344, + SETLE = 345, + SETGE = 346, + SETLT = 347, + SETGT = 348, + SETEQ = 349, + SETNE = 350, + MALLOC = 351, + ALLOCA = 352, + FREE = 353, + LOAD = 354, + STORE = 355, + GETELEMENTPTR = 356, + TRUNC = 357, + ZEXT = 358, + SEXT = 359, + FPTRUNC = 360, + FPEXT = 361, + BITCAST = 362, + UITOFP = 363, + SITOFP = 364, + FPTOUI = 365, + FPTOSI = 366, + INTTOPTR = 367, + PTRTOINT = 368, + PHI_TOK = 369, + SELECT = 370, + SHL = 371, + LSHR = 372, + ASHR = 373, + VAARG = 374, + EXTRACTELEMENT = 375, + INSERTELEMENT = 376, + SHUFFLEVECTOR = 377, + CAST = 378 + }; + #endif + /* Tokens. */ + #define ESINT64VAL 258 + #define EUINT64VAL 259 + #define SINTVAL 260 + #define UINTVAL 261 + #define FPVAL 262 + #define VOID 263 + #define BOOL 264 + #define SBYTE 265 + #define UBYTE 266 + #define SHORT 267 + #define USHORT 268 + #define INT 269 + #define UINT 270 + #define LONG 271 + #define ULONG 272 + #define FLOAT 273 + #define DOUBLE 274 + #define TYPE 275 + #define LABEL 276 + #define VAR_ID 277 + #define LABELSTR 278 + #define STRINGCONSTANT 279 + #define IMPLEMENTATION 280 + #define ZEROINITIALIZER 281 + #define TRUETOK 282 + #define FALSETOK 283 + #define BEGINTOK 284 + #define ENDTOK 285 + #define DECLARE 286 + #define GLOBAL 287 + #define CONSTANT 288 + #define SECTION 289 + #define VOLATILE 290 + #define TO 291 + #define DOTDOTDOT 292 + #define NULL_TOK 293 + #define UNDEF 294 + #define CONST 295 + #define INTERNAL 296 + #define LINKONCE 297 + #define WEAK 298 + #define APPENDING 299 + #define DLLIMPORT 300 + #define DLLEXPORT 301 + #define EXTERN_WEAK 302 + #define OPAQUE 303 + #define NOT 304 + #define EXTERNAL 305 + #define TARGET 306 + #define TRIPLE 307 + #define ENDIAN 308 + #define POINTERSIZE 309 + #define LITTLE 310 + #define BIG 311 + #define ALIGN 312 + #define DEPLIBS 313 + #define CALL 314 + #define TAIL 315 + #define ASM_TOK 316 + #define MODULE 317 + #define SIDEEFFECT 318 + #define CC_TOK 319 + #define CCC_TOK 320 + #define CSRETCC_TOK 321 + #define FASTCC_TOK 322 + #define COLDCC_TOK 323 + #define X86_STDCALLCC_TOK 324 + #define X86_FASTCALLCC_TOK 325 + #define DATALAYOUT 326 + #define RET 327 + #define BR 328 + #define SWITCH 329 + #define INVOKE 330 + #define UNWIND 331 + #define UNREACHABLE 332 + #define ADD 333 + #define SUB 334 + #define MUL 335 + #define UDIV 336 + #define SDIV 337 + #define FDIV 338 + #define UREM 339 + #define SREM 340 + #define FREM 341 + #define AND 342 + #define OR 343 + #define XOR 344 + #define SETLE 345 + #define SETGE 346 + #define SETLT 347 + #define SETGT 348 + #define SETEQ 349 + #define SETNE 350 + #define MALLOC 351 + #define ALLOCA 352 + #define FREE 353 + #define LOAD 354 + #define STORE 355 + #define GETELEMENTPTR 356 + #define TRUNC 357 + #define ZEXT 358 + #define SEXT 359 + #define FPTRUNC 360 + #define FPEXT 361 + #define BITCAST 362 + #define UITOFP 363 + #define SITOFP 364 + #define FPTOUI 365 + #define FPTOSI 366 + #define INTTOPTR 367 + #define PTRTOINT 368 + #define PHI_TOK 369 + #define SELECT 370 + #define SHL 371 + #define LSHR 372 + #define ASHR 373 + #define VAARG 374 + #define EXTRACTELEMENT 375 + #define INSERTELEMENT 376 + #define SHUFFLEVECTOR 377 + #define CAST 378 + + + + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + typedef int YYSTYPE; + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + extern YYSTYPE Upgradelval; + + + Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.y:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.y Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,903 ---- + //===-- UpgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the bison parser for LLVM 1.9 assembly language. + // + //===----------------------------------------------------------------------===// + + %{ + #define YYERROR_VERBOSE 1 + #define YYSTYPE std::string* + + #include "ParserInternals.h" + #include + #include + #include + #include + #include + #include + + + int yylex(); // declaration" of xxx warnings. + int yyparse(); + + static std::string CurFilename; + + static std::ostream *O = 0; + + void UpgradeAssembly(const std::string &infile, std::ostream &out) + { + Upgradelineno = 1; + CurFilename = infile; + llvm::sys::Path p(infile); + llvm::sys::MappedFile mf; + mf.open(p); + mf.map(); + const char* base = mf.charBase(); + size_t sz = mf.size(); + + set_scan_bytes(base, sz); + + O = &out; + + if (yyparse()) { + std::cerr << "Parse failed.\n"; + exit(1); + } + } + + %} + + %token ESINT64VAL + %token EUINT64VAL + %token SINTVAL // Signed 32 bit ints... + %token UINTVAL // Unsigned 32 bit ints... + %token FPVAL // Float or Double constant + %token VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG + %token FLOAT DOUBLE TYPE LABEL + %token VAR_ID LABELSTR STRINGCONSTANT + %token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK + %token DECLARE GLOBAL CONSTANT SECTION VOLATILE + %token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING + %token DLLIMPORT DLLEXPORT EXTERN_WEAK + %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG ALIGN + %token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT + %token CC_TOK CCC_TOK CSRETCC_TOK FASTCC_TOK COLDCC_TOK + %token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK + %token DATALAYOUT + %token RET BR SWITCH INVOKE UNWIND UNREACHABLE + %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR + %token SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators + %token MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR + %token TRUNC ZEXT SEXT FPTRUNC FPEXT BITCAST + %token UITOFP SITOFP FPTOUI FPTOSI INTTOPTR PTRTOINT + %token PHI_TOK SELECT SHL LSHR ASHR VAARG + %token EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR + %token CAST + + %start Module + + %% + + // Handle constant integer size restriction and conversion... + INTVAL : SINTVAL | UINTVAL + EINT64VAL : ESINT64VAL | EUINT64VAL; + + // Operations that are notably excluded from this list include: + // RET, BR, & SWITCH because they end basic blocks and are treated specially. + ArithmeticOps: ADD | SUB | MUL | UDIV | SDIV | FDIV | UREM | SREM | FREM; + LogicalOps : AND | OR | XOR; + SetCondOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE; + CastOps : CAST; + ShiftOps : SHL | LSHR | ASHR; + + // These are some types that allow classification if we only want a particular + // thing... for example, only a signed, unsigned, or integral type. + SIntType : LONG | INT | SHORT | SBYTE; + UIntType : ULONG | UINT | USHORT | UBYTE; + IntType : SIntType | UIntType; + FPType : FLOAT | DOUBLE; + + // OptAssign - Value producing statements have an optional assignment component + OptAssign : Name '=' { + $1->append(" = "); + $$ = $1; + } + | /*empty*/ { + $$ = new std::string(""); + }; + + OptLinkage + : INTERNAL | LINKONCE | WEAK | APPENDING | DLLIMPORT | DLLEXPORT + | EXTERN_WEAK + | /*empty*/ { $$ = new std::string(""); } ; + + OptCallingConv + : CCC_TOK | CSRETCC_TOK | FASTCC_TOK | COLDCC_TOK | X86_STDCALLCC_TOK + | X86_FASTCALLCC_TOK | CC_TOK EUINT64VAL + | /*empty*/ { $$ = new std::string(""); } ; + + // OptAlign/OptCAlign - An optional alignment, and an optional alignment with + // a comma before it. + OptAlign + : /*empty*/ { $$ = new std::string(); } + | ALIGN EUINT64VAL { *$1 += " " + *$2; delete $2; $$ = $1; }; + ; + OptCAlign + : /*empty*/ { $$ = new std::string(); } + | ',' ALIGN EUINT64VAL { + $2->insert(0, ", "); + *$2 += " " + *$3; + delete $3; + $$ = $2; + }; + + SectionString + : SECTION STRINGCONSTANT { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + OptSection : /*empty*/ { $$ = new std::string(); } + | SectionString; + + GlobalVarAttributes + : /* empty */ { $$ = new std::string(); } + | ',' GlobalVarAttribute GlobalVarAttributes { + $2->insert(0, ", "); + if (!$3->empty()) + *$2 += " " + *$3; + delete $3; + $$ = $2; + }; + + GlobalVarAttribute + : SectionString + | ALIGN EUINT64VAL { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + //===----------------------------------------------------------------------===// + // Types includes all predefined types... except void, because it can only be + // used in specific contexts (function returning void for example). To have + // access to it, a user must explicitly use TypesV. + // + + // TypesV includes all of 'Types', but it also includes the void type. + TypesV : Types | VOID ; + UpRTypesV : UpRTypes | VOID ; + Types : UpRTypes ; + + // Derived types are added later... + // + PrimType : BOOL | SBYTE | UBYTE | SHORT | USHORT | INT | UINT ; + PrimType : LONG | ULONG | FLOAT | DOUBLE | TYPE | LABEL; + UpRTypes : OPAQUE | PrimType | SymbolicValueRef ; + + // Include derived types in the Types production. + // + UpRTypes : '\\' EUINT64VAL { // Type UpReference + $2->insert(0, "\\"); + $$ = $2; + } + | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? + *$1 += "( " + *$3 + " )"; + delete $3; + $$ = $1; + } + | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? + $2->insert(0,"[ "); + *$2 += " x " + *$4 + " ]"; + delete $4; + $$ = $2; + } + | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? + $2->insert(0,"< "); + *$2 += " x " + *$4 + " >"; + delete $4; + $$ = $2; + } + | '{' TypeListI '}' { // Structure type? + $2->insert(0, "{ "); + *$2 += " }"; + $$ = $2; + } + | '{' '}' { // Empty structure type? + $$ = new std::string("{ }"); + } + | UpRTypes '*' { // Pointer type? + *$1 += '*'; + $$ = $1; + }; + + // TypeList - Used for struct declarations and as a basis for function type + // declaration type lists + // + TypeListI : UpRTypes | TypeListI ',' UpRTypes { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + }; + + // ArgTypeList - List of types for a function type declaration... + ArgTypeListI : TypeListI + | TypeListI ',' DOTDOTDOT { + *$1 += ", ..."; + delete $3; + $$ = $1; + } + | DOTDOTDOT { + $$ = $1; + } + | /*empty*/ { + $$ = new std::string(); + }; + + // ConstVal - The various declarations that go into the constant pool. This + // production is used ONLY to represent constants that show up AFTER a 'const', + // 'constant' or 'global' token at global scope. Constants that can be inlined + // into other expressions (such as integers and constexprs) are handled by the + // ResolvedVal, ValueRef and ConstValueRef productions. + // + ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr + *$1 += " [ " + *$3 + " ]"; + delete $3; + $$ = $1; + } + | Types '[' ']' { + $$ = new std::string("[ ]"); + } + | Types 'c' STRINGCONSTANT { + *$1 += " c" + *$3; + delete $3; + $$ = $1; + } + | Types '<' ConstVector '>' { // Nonempty unsized arr + *$1 += " < " + *$3 + " >"; + delete $3; + $$ = $1; + } + | Types '{' ConstVector '}' { + *$1 += " { " + *$3 + " }"; + delete $3; + $$ = $1; + } + | Types '{' '}' { + $$ = new std::string("[ ]"); + } + | Types NULL_TOK { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types UNDEF { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types SymbolicValueRef { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types ConstExpr { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types ZEROINITIALIZER { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + ConstVal : SIntType EINT64VAL { // integral constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | UIntType EUINT64VAL { // integral constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | BOOL TRUETOK { // Boolean constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | BOOL FALSETOK { // Boolean constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | FPType FPVAL { // Float & Double constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + + ConstExpr: CastOps '(' ConstVal TO Types ')' { + *$1 += " (" + *$3 + " " + *$4 + " " + *$5 + ")"; + delete $3; delete $4; delete $5; + $$ = $1; + } + | GETELEMENTPTR '(' ConstVal IndexList ')' { + } + | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { + } + | ArithmeticOps '(' ConstVal ',' ConstVal ')' { + } + | LogicalOps '(' ConstVal ',' ConstVal ')' { + } + | SetCondOps '(' ConstVal ',' ConstVal ')' { + } + | ShiftOps '(' ConstVal ',' ConstVal ')' { + } + | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { + } + | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { + } + | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { + }; + + + // ConstVector - A list of comma separated constants. + ConstVector : ConstVector ',' ConstVal { + } + | ConstVal { + }; + + + // GlobalType - Match either GLOBAL or CONSTANT for global declarations... + GlobalType : GLOBAL { } | CONSTANT { }; + + + //===----------------------------------------------------------------------===// + // Rules to match Modules + //===----------------------------------------------------------------------===// + + // Module rule: Capture the result of parsing the whole file into a result + // variable... + // + Module : DefinitionList { + }; + + // DefinitionList - Top level definitions + // + DefinitionList : DefinitionList Function { + $$ = 0; + } + | DefinitionList FunctionProto { + *O << *$2 << "\n"; + delete $2; + $$ = 0; + } + | DefinitionList MODULE ASM_TOK AsmBlock { + *O << "module asm " << " " << *$4 << "\n"; + } + | DefinitionList IMPLEMENTATION { + *O << "implementation\n"; + } + | ConstPool { + }; + + // ConstPool - Constants with optional names assigned to them. + ConstPool : ConstPool OptAssign TYPE TypesV { + *O << *$2 << " " << *$3 << " " << *$4 << "\n"; + delete $2; delete $3; delete $4; + $$ = 0; + } + | ConstPool FunctionProto { // Function prototypes can be in const pool + *O << *$2 << "\n"; + delete $2; + $$ = 0; + } + | ConstPool MODULE ASM_TOK AsmBlock { // Asm blocks can be in the const pool + *O << *$2 << " " << *$3 << " " << *$4 << "\n"; + delete $2; delete $3; delete $4; + $$ = 0; + } + | ConstPool OptAssign OptLinkage GlobalType ConstVal GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign EXTERNAL GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign DLLIMPORT GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign EXTERN_WEAK GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool TARGET TargetDefinition { + *O << *$2 << " " << *$3 << "\n"; + delete $2; delete $3; + $$ = 0; + } + | ConstPool DEPLIBS '=' LibrariesDefinition { + *O << *$2 << " = " << *$4 << "\n"; + delete $2; delete $4; + $$ = 0; + } + | /* empty: end of list */ { + $$ = 0; + }; + + + AsmBlock : STRINGCONSTANT ; + + BigOrLittle : BIG | LITTLE + + TargetDefinition + : ENDIAN '=' BigOrLittle { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | POINTERSIZE '=' EUINT64VAL { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | TRIPLE '=' STRINGCONSTANT { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | DATALAYOUT '=' STRINGCONSTANT { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + }; + + LibrariesDefinition + : '[' LibList ']' { + $2->insert(0, "[ "); + *$2 += " ]"; + $$ = $2; + }; + + LibList + : LibList ',' STRINGCONSTANT { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + } + | STRINGCONSTANT + | /* empty: end of list */ { + $$ = new std::string(); + }; + + //===----------------------------------------------------------------------===// + // Rules to match Function Headers + //===----------------------------------------------------------------------===// + + Name : VAR_ID | STRINGCONSTANT; + OptName : Name | /*empty*/ { $$ = new std::string(); }; + + ArgVal : Types OptName { + $$ = $1; + if (!$2->empty()) + *$$ += " " + *$2; + }; + + ArgListH : ArgListH ',' ArgVal { + *$1 += ", " + *$3; + } + | ArgVal { + $$ = $1; + }; + + ArgList : ArgListH { + $$ = $1; + } + | ArgListH ',' DOTDOTDOT { + *$1 += ", ..."; + $$ = $1; + } + | DOTDOTDOT { + $$ = $1; + } + | /* empty */ { + $$ = new std::string(); + }; + + FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' + OptSection OptAlign { + if (!$1->empty()) { + $2->insert(0, *$1 + " "); + } + *$2 += " " + *$3 + "( " + *$5 + " )"; + if (!$7->empty()) { + *$2 += " " + *$7; + } + if (!$8->empty()) { + *$2 += " " + *$8; + } + $$ = $2; + }; + + BEGIN : BEGINTOK { + $$ = new std::string("begin"); + } + | '{' { + $$ = new std::string ("{"); + } + + FunctionHeader : OptLinkage FunctionHeaderH BEGIN { + if (!$1->empty()) { + *O << *$1 << " "; + } + *O << *$2 << " " << *$3 << "\n"; + delete $1; delete $2; delete $3; + $$ = 0; + }; + + END : ENDTOK { $$ = new std::string("end"); } + | '}' { $$ = new std::string("}"); }; + + Function : FunctionHeader BasicBlockList END { + if ($2) + *O << *$2; + *O << '\n' << *$3 << "\n"; + }; + + FnDeclareLinkage: /*default*/ + | DLLIMPORT + | EXTERN_WEAK + ; + + FunctionProto + : DECLARE FnDeclareLinkage FunctionHeaderH { + *$1 += " " + *$2 + " " + *$3; + delete $2; delete $3; + $$ = $1; + }; + + //===----------------------------------------------------------------------===// + // Rules to match Basic Blocks + //===----------------------------------------------------------------------===// + + OptSideEffect : /* empty */ { + } + | SIDEEFFECT { + }; + + ConstValueRef : ESINT64VAL | EUINT64VAL | FPVAL | TRUETOK | FALSETOK + | NULL_TOK | UNDEF | ZEROINITIALIZER + | '<' ConstVector '>' { + $2->insert(0, "<"); + *$2 += ">"; + $$ = $2; + } + | ConstExpr + | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { + if (!$2->empty()) { + *$1 += " " + *$2; + } + *$1 += " " + *$3 + ", " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + }; + + SymbolicValueRef : INTVAL | Name ; + + // ValueRef - A reference to a definition... either constant or symbolic + ValueRef : SymbolicValueRef | ConstValueRef; + + + // ResolvedVal - a pair. This is used only in cases where the + // type immediately preceeds the value reference, and allows complex constant + // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') + ResolvedVal : Types ValueRef { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + BasicBlockList : BasicBlockList BasicBlock { + } + | BasicBlock { // Do not allow functions with 0 basic blocks + }; + + + // Basic blocks are terminated by branching instructions: + // br, br/cc, switch, ret + // + BasicBlock : InstructionList OptAssign BBTerminatorInst { + *O << *$2 ; + }; + + InstructionList : InstructionList Inst { + *O << " " << *$2 << "\n"; + delete $2; + $$ = 0; + } + | /* empty */ { + $$ = 0; + } + | LABELSTR { + *O << *$1 << "\n"; + delete $1; + $$ = 0; + }; + + BBTerminatorInst : RET ResolvedVal { // Return with a result... + *O << " " << *$1 << " " << *$2 << "\n"; + delete $1; delete $2; + $$ = 0; + } + | RET VOID { // Return with no result... + *O << " " << *$1 << " " << *$2 << "\n"; + delete $1; delete $2; + $$ = 0; + } + | BR LABEL ValueRef { // Unconditional Branch... + *O << " " << *$1 << " " << *$2 << " " << *$3 << "\n"; + delete $1; delete $2; delete $3; + $$ = 0; + } // Conditional Branch... + | BR BOOL ValueRef ',' LABEL ValueRef ',' LABEL ValueRef { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << ", " << *$8 << " " << *$9 << "\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; delete $8; delete $9; + $$ = 0; + } + | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << " [" << *$8 << " ]\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; delete $8; + $$ = 0; + } + | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << "[]\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; + $$ = 0; + } + | INVOKE OptCallingConv TypesV ValueRef '(' ValueRefListE ')' + TO LABEL ValueRef UNWIND LABEL ValueRef { + *O << " " << *$1 << " " << *$2 << " " << *$3 << " " << *$4 << " (" + << *$6 << ") " << *$8 << " " << *$9 << " " << *$10 << " " << *$11 << " " + << *$12 << " " << *$13 << "\n"; + delete $1; delete $2; delete $3; delete $4; delete $6; delete $8; delete $9; + delete $10; delete $11; delete $12; delete $13; + $$ = 0; + } + | UNWIND { + *O << " " << *$1 << "\n"; + delete $1; + $$ = 0; + } + | UNREACHABLE { + *O << " " << *$1 << "\n"; + delete $1; + $$ = 0; + }; + + JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef { + *$1 += *$2 + " " + *$3 + ", " + *$5 + " " + *$6; + delete $2; delete $3; delete $5; delete $6; + $$ = $1; + } + | IntType ConstValueRef ',' LABEL ValueRef { + *$1 += *$2 + ", " + *$4 + " " + *$5; + delete $2; delete $4; delete $5; + $$ = $1; + }; + + Inst + : OptAssign InstVal { + *$1 += *$2; + delete $2; + $$ = $1; + }; + + PHIList + : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes + *$1 += " [" + *$3 + "," + *$5 + "]"; + delete $3; delete $5; + $$ = $1; + } + | PHIList ',' '[' ValueRef ',' ValueRef ']' { + *$1 += ", [" + *$4 + "," + *$6 + "]"; + delete $4; delete $6; + $$ = $1; + }; + + + ValueRefList + : ResolvedVal + | ValueRefList ',' ResolvedVal { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + }; + + // ValueRefListE - Just like ValueRefList, except that it may also be empty! + ValueRefListE + : ValueRefList + | /*empty*/ { $$ = new std::string(); } + ; + + OptTailCall + : TAIL CALL { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | CALL + ; + + InstVal : ArithmeticOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | LogicalOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | SetCondOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | NOT ResolvedVal { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | ShiftOps ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | CastOps ResolvedVal TO Types { + *$1 += " " + *$2 + " " + *$3 + ", " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + } + | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | VAARG ResolvedVal ',' Types { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | PHI_TOK PHIList { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { + if (!$2->empty()) + *$1 += " " + *$2; + if (!$1->empty()) + *$1 += " "; + *$1 += *$3 += " " + *$4 + "(" + *$5 + ")"; + delete $2; delete $3; delete $4; delete $6; + $$ = $1; + } + | MemoryInst ; + + + // IndexList - List of indices for GEP based instructions... + IndexList + : ',' ValueRefList { + $2->insert(0, ", "); + $$ = $2; + } + | /* empty */ { $$ = new std::string(); } + ; + + OptVolatile + : VOLATILE + | /* empty */ { $$ = new std::string(); } + ; + + MemoryInst : MALLOC Types OptCAlign { + *$1 += " " + *$2; + if (!$3->empty()) + *$1 += " " + *$3; + delete $2; delete $3; + $$ = $1; + } + | MALLOC Types ',' UINT ValueRef OptCAlign { + *$1 += " " + *$2 + ", " + *$4 + " " + *$5; + if (!$6->empty()) + *$1 += " " + *$6; + delete $2; delete $4; delete $5; delete $6; + $$ = $1; + } + | ALLOCA Types OptCAlign { + *$1 += " " + *$2; + if (!$3->empty()) + *$1 += " " + *$3; + delete $2; delete $3; + $$ = $1; + } + | ALLOCA Types ',' UINT ValueRef OptCAlign { + *$1 += " " + *$2 + ", " + *$4 + " " + *$5; + if (!$6->empty()) + *$1 += " " + *$6; + delete $2; delete $4; delete $5; delete $6; + $$ = $1; + } + | FREE ResolvedVal { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | OptVolatile LOAD Types ValueRef { + if (!$1->empty()) + *$1 += " "; + *$1 += *$2 + " " + *$3 + " " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + } + | OptVolatile STORE ResolvedVal ',' Types ValueRef { + if (!$1->empty()) + *$1 += " "; + *$1 += *$2 + " " + *$3 + ", " + *$5 + " " + *$6; + delete $2; delete $3; delete $5; delete $6; + $$ = $1; + } + | GETELEMENTPTR Types ValueRef IndexList { + *$1 += *$2 + " " + *$3 + " " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + }; + + %% + + int yyerror(const char *ErrorMsg) { + std::string where + = std::string((CurFilename == "-") ? std::string("") : CurFilename) + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; + std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading "; + if (yychar == YYEMPTY || yychar == 0) + errMsg += "end-of-file."; + else + errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'"; + std::cerr << errMsg << '\n'; + exit(1); + } Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,903 ---- + //===-- upgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the bison parser for LLVM assembly language upgrade. + // + //===----------------------------------------------------------------------===// + + %{ + #define YYERROR_VERBOSE 1 + #define YYSTYPE std::string* + + #include "ParserInternals.h" + #include + #include + #include + #include + #include + #include + + + int yylex(); // declaration" of xxx warnings. + int yyparse(); + + static std::string CurFilename; + + static std::ostream *O = 0; + + void UpgradeAssembly(const std::string &infile, std::ostream &out) + { + Upgradelineno = 1; + CurFilename = infile; + llvm::sys::Path p(infile); + llvm::sys::MappedFile mf; + mf.open(p); + mf.map(); + const char* base = mf.charBase(); + size_t sz = mf.size(); + + set_scan_bytes(base, sz); + + O = &out; + + if (yyparse()) { + std::cerr << "Parse failed.\n"; + exit(1); + } + } + + %} + + %token ESINT64VAL + %token EUINT64VAL + %token SINTVAL // Signed 32 bit ints... + %token UINTVAL // Unsigned 32 bit ints... + %token FPVAL // Float or Double constant + %token VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG + %token FLOAT DOUBLE TYPE LABEL + %token VAR_ID LABELSTR STRINGCONSTANT + %token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK + %token DECLARE GLOBAL CONSTANT SECTION VOLATILE + %token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING + %token DLLIMPORT DLLEXPORT EXTERN_WEAK + %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG ALIGN + %token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT + %token CC_TOK CCC_TOK CSRETCC_TOK FASTCC_TOK COLDCC_TOK + %token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK + %token DATALAYOUT + %token RET BR SWITCH INVOKE UNWIND UNREACHABLE + %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR + %token SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators + %token MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR + %token TRUNC ZEXT SEXT FPTRUNC FPEXT BITCAST + %token UITOFP SITOFP FPTOUI FPTOSI INTTOPTR PTRTOINT + %token PHI_TOK SELECT SHL LSHR ASHR VAARG + %token EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR + %token CAST + + %start Module + + %% + + // Handle constant integer size restriction and conversion... + INTVAL : SINTVAL | UINTVAL + EINT64VAL : ESINT64VAL | EUINT64VAL; + + // Operations that are notably excluded from this list include: + // RET, BR, & SWITCH because they end basic blocks and are treated specially. + ArithmeticOps: ADD | SUB | MUL | UDIV | SDIV | FDIV | UREM | SREM | FREM; + LogicalOps : AND | OR | XOR; + SetCondOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE; + CastOps : CAST; + ShiftOps : SHL | LSHR | ASHR; + + // These are some types that allow classification if we only want a particular + // thing... for example, only a signed, unsigned, or integral type. + SIntType : LONG | INT | SHORT | SBYTE; + UIntType : ULONG | UINT | USHORT | UBYTE; + IntType : SIntType | UIntType; + FPType : FLOAT | DOUBLE; + + // OptAssign - Value producing statements have an optional assignment component + OptAssign : Name '=' { + $1->append(" = "); + $$ = $1; + } + | /*empty*/ { + $$ = new std::string(""); + }; + + OptLinkage + : INTERNAL | LINKONCE | WEAK | APPENDING | DLLIMPORT | DLLEXPORT + | EXTERN_WEAK + | /*empty*/ { $$ = new std::string(""); } ; + + OptCallingConv + : CCC_TOK | CSRETCC_TOK | FASTCC_TOK | COLDCC_TOK | X86_STDCALLCC_TOK + | X86_FASTCALLCC_TOK | CC_TOK EUINT64VAL + | /*empty*/ { $$ = new std::string(""); } ; + + // OptAlign/OptCAlign - An optional alignment, and an optional alignment with + // a comma before it. + OptAlign + : /*empty*/ { $$ = new std::string(); } + | ALIGN EUINT64VAL { *$1 += " " + *$2; delete $2; $$ = $1; }; + ; + OptCAlign + : /*empty*/ { $$ = new std::string(); } + | ',' ALIGN EUINT64VAL { + $2->insert(0, ", "); + *$2 += " " + *$3; + delete $3; + $$ = $2; + }; + + SectionString + : SECTION STRINGCONSTANT { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + OptSection : /*empty*/ { $$ = new std::string(); } + | SectionString; + + GlobalVarAttributes + : /* empty */ { $$ = new std::string(); } + | ',' GlobalVarAttribute GlobalVarAttributes { + $2->insert(0, ", "); + if (!$3->empty()) + *$2 += " " + *$3; + delete $3; + $$ = $2; + }; + + GlobalVarAttribute + : SectionString + | ALIGN EUINT64VAL { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + //===----------------------------------------------------------------------===// + // Types includes all predefined types... except void, because it can only be + // used in specific contexts (function returning void for example). To have + // access to it, a user must explicitly use TypesV. + // + + // TypesV includes all of 'Types', but it also includes the void type. + TypesV : Types | VOID ; + UpRTypesV : UpRTypes | VOID ; + Types : UpRTypes ; + + // Derived types are added later... + // + PrimType : BOOL | SBYTE | UBYTE | SHORT | USHORT | INT | UINT ; + PrimType : LONG | ULONG | FLOAT | DOUBLE | TYPE | LABEL; + UpRTypes : OPAQUE | PrimType | SymbolicValueRef ; + + // Include derived types in the Types production. + // + UpRTypes : '\\' EUINT64VAL { // Type UpReference + $2->insert(0, "\\"); + $$ = $2; + } + | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? + *$1 += "( " + *$3 + " )"; + delete $3; + $$ = $1; + } + | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? + $2->insert(0,"[ "); + *$2 += " x " + *$4 + " ]"; + delete $4; + $$ = $2; + } + | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? + $2->insert(0,"< "); + *$2 += " x " + *$4 + " >"; + delete $4; + $$ = $2; + } + | '{' TypeListI '}' { // Structure type? + $2->insert(0, "{ "); + *$2 += " }"; + $$ = $2; + } + | '{' '}' { // Empty structure type? + $$ = new std::string("{ }"); + } + | UpRTypes '*' { // Pointer type? + *$1 += '*'; + $$ = $1; + }; + + // TypeList - Used for struct declarations and as a basis for function type + // declaration type lists + // + TypeListI : UpRTypes | TypeListI ',' UpRTypes { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + }; + + // ArgTypeList - List of types for a function type declaration... + ArgTypeListI : TypeListI + | TypeListI ',' DOTDOTDOT { + *$1 += ", ..."; + delete $3; + $$ = $1; + } + | DOTDOTDOT { + $$ = $1; + } + | /*empty*/ { + $$ = new std::string(); + }; + + // ConstVal - The various declarations that go into the constant pool. This + // production is used ONLY to represent constants that show up AFTER a 'const', + // 'constant' or 'global' token at global scope. Constants that can be inlined + // into other expressions (such as integers and constexprs) are handled by the + // ResolvedVal, ValueRef and ConstValueRef productions. + // + ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr + *$1 += " [ " + *$3 + " ]"; + delete $3; + $$ = $1; + } + | Types '[' ']' { + $$ = new std::string("[ ]"); + } + | Types 'c' STRINGCONSTANT { + *$1 += " c" + *$3; + delete $3; + $$ = $1; + } + | Types '<' ConstVector '>' { // Nonempty unsized arr + *$1 += " < " + *$3 + " >"; + delete $3; + $$ = $1; + } + | Types '{' ConstVector '}' { + *$1 += " { " + *$3 + " }"; + delete $3; + $$ = $1; + } + | Types '{' '}' { + $$ = new std::string("[ ]"); + } + | Types NULL_TOK { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types UNDEF { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types SymbolicValueRef { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types ConstExpr { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | Types ZEROINITIALIZER { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + ConstVal : SIntType EINT64VAL { // integral constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | UIntType EUINT64VAL { // integral constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | BOOL TRUETOK { // Boolean constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | BOOL FALSETOK { // Boolean constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | FPType FPVAL { // Float & Double constants + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + + ConstExpr: CastOps '(' ConstVal TO Types ')' { + *$1 += " (" + *$3 + " " + *$4 + " " + *$5 + ")"; + delete $3; delete $4; delete $5; + $$ = $1; + } + | GETELEMENTPTR '(' ConstVal IndexList ')' { + } + | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { + } + | ArithmeticOps '(' ConstVal ',' ConstVal ')' { + } + | LogicalOps '(' ConstVal ',' ConstVal ')' { + } + | SetCondOps '(' ConstVal ',' ConstVal ')' { + } + | ShiftOps '(' ConstVal ',' ConstVal ')' { + } + | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { + } + | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { + } + | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { + }; + + + // ConstVector - A list of comma separated constants. + ConstVector : ConstVector ',' ConstVal { + } + | ConstVal { + }; + + + // GlobalType - Match either GLOBAL or CONSTANT for global declarations... + GlobalType : GLOBAL { } | CONSTANT { }; + + + //===----------------------------------------------------------------------===// + // Rules to match Modules + //===----------------------------------------------------------------------===// + + // Module rule: Capture the result of parsing the whole file into a result + // variable... + // + Module : DefinitionList { + }; + + // DefinitionList - Top level definitions + // + DefinitionList : DefinitionList Function { + $$ = 0; + } + | DefinitionList FunctionProto { + *O << *$2 << "\n"; + delete $2; + $$ = 0; + } + | DefinitionList MODULE ASM_TOK AsmBlock { + *O << "module asm " << " " << *$4 << "\n"; + } + | DefinitionList IMPLEMENTATION { + *O << "implementation\n"; + } + | ConstPool { + }; + + // ConstPool - Constants with optional names assigned to them. + ConstPool : ConstPool OptAssign TYPE TypesV { + *O << *$2 << " " << *$3 << " " << *$4 << "\n"; + delete $2; delete $3; delete $4; + $$ = 0; + } + | ConstPool FunctionProto { // Function prototypes can be in const pool + *O << *$2 << "\n"; + delete $2; + $$ = 0; + } + | ConstPool MODULE ASM_TOK AsmBlock { // Asm blocks can be in the const pool + *O << *$2 << " " << *$3 << " " << *$4 << "\n"; + delete $2; delete $3; delete $4; + $$ = 0; + } + | ConstPool OptAssign OptLinkage GlobalType ConstVal GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign EXTERNAL GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign DLLIMPORT GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool OptAssign EXTERN_WEAK GlobalType Types GlobalVarAttributes { + *O << *$2 << " " << *$3 << " " << *$4 << " " << *$5 << " " << *$6 << "\n"; + delete $2; delete $3; delete $4; delete $5; delete $6; + $$ = 0; + } + | ConstPool TARGET TargetDefinition { + *O << *$2 << " " << *$3 << "\n"; + delete $2; delete $3; + $$ = 0; + } + | ConstPool DEPLIBS '=' LibrariesDefinition { + *O << *$2 << " = " << *$4 << "\n"; + delete $2; delete $4; + $$ = 0; + } + | /* empty: end of list */ { + $$ = 0; + }; + + + AsmBlock : STRINGCONSTANT ; + + BigOrLittle : BIG | LITTLE + + TargetDefinition + : ENDIAN '=' BigOrLittle { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | POINTERSIZE '=' EUINT64VAL { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | TRIPLE '=' STRINGCONSTANT { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + } + | DATALAYOUT '=' STRINGCONSTANT { + *$1 += " = " + *$2; + delete $2; + $$ = $1; + }; + + LibrariesDefinition + : '[' LibList ']' { + $2->insert(0, "[ "); + *$2 += " ]"; + $$ = $2; + }; + + LibList + : LibList ',' STRINGCONSTANT { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + } + | STRINGCONSTANT + | /* empty: end of list */ { + $$ = new std::string(); + }; + + //===----------------------------------------------------------------------===// + // Rules to match Function Headers + //===----------------------------------------------------------------------===// + + Name : VAR_ID | STRINGCONSTANT; + OptName : Name | /*empty*/ { $$ = new std::string(); }; + + ArgVal : Types OptName { + $$ = $1; + if (!$2->empty()) + *$$ += " " + *$2; + }; + + ArgListH : ArgListH ',' ArgVal { + *$1 += ", " + *$3; + } + | ArgVal { + $$ = $1; + }; + + ArgList : ArgListH { + $$ = $1; + } + | ArgListH ',' DOTDOTDOT { + *$1 += ", ..."; + $$ = $1; + } + | DOTDOTDOT { + $$ = $1; + } + | /* empty */ { + $$ = new std::string(); + }; + + FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' + OptSection OptAlign { + if (!$1->empty()) { + $2->insert(0, *$1 + " "); + } + *$2 += " " + *$3 + "( " + *$5 + " )"; + if (!$7->empty()) { + *$2 += " " + *$7; + } + if (!$8->empty()) { + *$2 += " " + *$8; + } + $$ = $2; + }; + + BEGIN : BEGINTOK { + $$ = new std::string("begin"); + } + | '{' { + $$ = new std::string ("{"); + } + + FunctionHeader : OptLinkage FunctionHeaderH BEGIN { + if (!$1->empty()) { + *O << *$1 << " "; + } + *O << *$2 << " " << *$3 << "\n"; + delete $1; delete $2; delete $3; + $$ = 0; + }; + + END : ENDTOK { $$ = new std::string("end"); } + | '}' { $$ = new std::string("}"); }; + + Function : FunctionHeader BasicBlockList END { + if ($2) + *O << *$2; + *O << '\n' << *$3 << "\n"; + }; + + FnDeclareLinkage: /*default*/ + | DLLIMPORT + | EXTERN_WEAK + ; + + FunctionProto + : DECLARE FnDeclareLinkage FunctionHeaderH { + *$1 += " " + *$2 + " " + *$3; + delete $2; delete $3; + $$ = $1; + }; + + //===----------------------------------------------------------------------===// + // Rules to match Basic Blocks + //===----------------------------------------------------------------------===// + + OptSideEffect : /* empty */ { + } + | SIDEEFFECT { + }; + + ConstValueRef : ESINT64VAL | EUINT64VAL | FPVAL | TRUETOK | FALSETOK + | NULL_TOK | UNDEF | ZEROINITIALIZER + | '<' ConstVector '>' { + $2->insert(0, "<"); + *$2 += ">"; + $$ = $2; + } + | ConstExpr + | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { + if (!$2->empty()) { + *$1 += " " + *$2; + } + *$1 += " " + *$3 + ", " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + }; + + SymbolicValueRef : INTVAL | Name ; + + // ValueRef - A reference to a definition... either constant or symbolic + ValueRef : SymbolicValueRef | ConstValueRef; + + + // ResolvedVal - a pair. This is used only in cases where the + // type immediately preceeds the value reference, and allows complex constant + // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') + ResolvedVal : Types ValueRef { + *$1 += " " + *$2; + delete $2; + $$ = $1; + }; + + BasicBlockList : BasicBlockList BasicBlock { + } + | BasicBlock { // Do not allow functions with 0 basic blocks + }; + + + // Basic blocks are terminated by branching instructions: + // br, br/cc, switch, ret + // + BasicBlock : InstructionList OptAssign BBTerminatorInst { + *O << *$2 ; + }; + + InstructionList : InstructionList Inst { + *O << " " << *$2 << "\n"; + delete $2; + $$ = 0; + } + | /* empty */ { + $$ = 0; + } + | LABELSTR { + *O << *$1 << "\n"; + delete $1; + $$ = 0; + }; + + BBTerminatorInst : RET ResolvedVal { // Return with a result... + *O << " " << *$1 << " " << *$2 << "\n"; + delete $1; delete $2; + $$ = 0; + } + | RET VOID { // Return with no result... + *O << " " << *$1 << " " << *$2 << "\n"; + delete $1; delete $2; + $$ = 0; + } + | BR LABEL ValueRef { // Unconditional Branch... + *O << " " << *$1 << " " << *$2 << " " << *$3 << "\n"; + delete $1; delete $2; delete $3; + $$ = 0; + } // Conditional Branch... + | BR BOOL ValueRef ',' LABEL ValueRef ',' LABEL ValueRef { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << ", " << *$8 << " " << *$9 << "\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; delete $8; delete $9; + $$ = 0; + } + | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << " [" << *$8 << " ]\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; delete $8; + $$ = 0; + } + | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' { + *O << " " << *$1 << " " << *$2 << " " << *$3 << ", " << *$5 << " " + << *$6 << "[]\n"; + delete $1; delete $2; delete $3; delete $5; delete $6; + $$ = 0; + } + | INVOKE OptCallingConv TypesV ValueRef '(' ValueRefListE ')' + TO LABEL ValueRef UNWIND LABEL ValueRef { + *O << " " << *$1 << " " << *$2 << " " << *$3 << " " << *$4 << " (" + << *$6 << ") " << *$8 << " " << *$9 << " " << *$10 << " " << *$11 << " " + << *$12 << " " << *$13 << "\n"; + delete $1; delete $2; delete $3; delete $4; delete $6; delete $8; delete $9; + delete $10; delete $11; delete $12; delete $13; + $$ = 0; + } + | UNWIND { + *O << " " << *$1 << "\n"; + delete $1; + $$ = 0; + } + | UNREACHABLE { + *O << " " << *$1 << "\n"; + delete $1; + $$ = 0; + }; + + JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef { + *$1 += *$2 + " " + *$3 + ", " + *$5 + " " + *$6; + delete $2; delete $3; delete $5; delete $6; + $$ = $1; + } + | IntType ConstValueRef ',' LABEL ValueRef { + *$1 += *$2 + ", " + *$4 + " " + *$5; + delete $2; delete $4; delete $5; + $$ = $1; + }; + + Inst + : OptAssign InstVal { + *$1 += *$2; + delete $2; + $$ = $1; + }; + + PHIList + : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes + *$1 += " [" + *$3 + "," + *$5 + "]"; + delete $3; delete $5; + $$ = $1; + } + | PHIList ',' '[' ValueRef ',' ValueRef ']' { + *$1 += ", [" + *$4 + "," + *$6 + "]"; + delete $4; delete $6; + $$ = $1; + }; + + + ValueRefList + : ResolvedVal + | ValueRefList ',' ResolvedVal { + *$1 += ", " + *$3; + delete $3; + $$ = $1; + }; + + // ValueRefListE - Just like ValueRefList, except that it may also be empty! + ValueRefListE + : ValueRefList + | /*empty*/ { $$ = new std::string(); } + ; + + OptTailCall + : TAIL CALL { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | CALL + ; + + InstVal : ArithmeticOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | LogicalOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | SetCondOps Types ValueRef ',' ValueRef { + *$1 += " " + *$2 + " " + *$3 + ", " + *$5; + delete $2; delete $3; delete $5; + $$ = $1; + } + | NOT ResolvedVal { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | ShiftOps ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | CastOps ResolvedVal TO Types { + *$1 += " " + *$2 + " " + *$3 + ", " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + } + | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | VAARG ResolvedVal ',' Types { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4; + delete $2; delete $4; + $$ = $1; + } + | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { + *$1 += " " + *$2 + ", " + *$4 + ", " + *$6; + delete $2; delete $4; delete $6; + $$ = $1; + } + | PHI_TOK PHIList { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { + if (!$2->empty()) + *$1 += " " + *$2; + if (!$1->empty()) + *$1 += " "; + *$1 += *$3 += " " + *$4 + "(" + *$5 + ")"; + delete $2; delete $3; delete $4; delete $6; + $$ = $1; + } + | MemoryInst ; + + + // IndexList - List of indices for GEP based instructions... + IndexList + : ',' ValueRefList { + $2->insert(0, ", "); + $$ = $2; + } + | /* empty */ { $$ = new std::string(); } + ; + + OptVolatile + : VOLATILE + | /* empty */ { $$ = new std::string(); } + ; + + MemoryInst : MALLOC Types OptCAlign { + *$1 += " " + *$2; + if (!$3->empty()) + *$1 += " " + *$3; + delete $2; delete $3; + $$ = $1; + } + | MALLOC Types ',' UINT ValueRef OptCAlign { + *$1 += " " + *$2 + ", " + *$4 + " " + *$5; + if (!$6->empty()) + *$1 += " " + *$6; + delete $2; delete $4; delete $5; delete $6; + $$ = $1; + } + | ALLOCA Types OptCAlign { + *$1 += " " + *$2; + if (!$3->empty()) + *$1 += " " + *$3; + delete $2; delete $3; + $$ = $1; + } + | ALLOCA Types ',' UINT ValueRef OptCAlign { + *$1 += " " + *$2 + ", " + *$4 + " " + *$5; + if (!$6->empty()) + *$1 += " " + *$6; + delete $2; delete $4; delete $5; delete $6; + $$ = $1; + } + | FREE ResolvedVal { + *$1 += " " + *$2; + delete $2; + $$ = $1; + } + | OptVolatile LOAD Types ValueRef { + if (!$1->empty()) + *$1 += " "; + *$1 += *$2 + " " + *$3 + " " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + } + | OptVolatile STORE ResolvedVal ',' Types ValueRef { + if (!$1->empty()) + *$1 += " "; + *$1 += *$2 + " " + *$3 + ", " + *$5 + " " + *$6; + delete $2; delete $3; delete $5; delete $6; + $$ = $1; + } + | GETELEMENTPTR Types ValueRef IndexList { + *$1 += *$2 + " " + *$3 + " " + *$4; + delete $2; delete $3; delete $4; + $$ = $1; + }; + + %% + + int yyerror(const char *ErrorMsg) { + std::string where + = std::string((CurFilename == "-") ? std::string("") : CurFilename) + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; + std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading "; + if (yychar == YYEMPTY || yychar == 0) + errMsg += "end-of-file."; + else + errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'"; + std::cerr << errMsg << '\n'; + exit(1); + } Index: llvm/tools/llvm-upgrade/llvm-upgrade.cpp diff -c /dev/null llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.1 *** /dev/null Thu Nov 30 00:36:59 2006 --- llvm/tools/llvm-upgrade/llvm-upgrade.cpp Thu Nov 30 00:36:44 2006 *************** *** 0 **** --- 1,114 ---- + //===--- llvm-upgrade.cpp - The LLVM Assembly Upgrader --------------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This utility will upgrade LLVM 1.9 Assembly to 2.0 format. It may be + // invoked as a filter, like this: + // llvm-1.9/bin/llvm-dis < 1.9.bc | llvm-upgrade | llvm-as > 2.0.bc + // + // or, you can directly upgrade, like this: + // llvm-upgrade -o 2.0.ll < 1.9.ll + // + // llvm-upgrade won't overwrite files by default. Use -f to force it to + // overwrite the output file. + // + //===----------------------------------------------------------------------===// + + #include "ParserInternals.h" + #include "llvm/Support/CommandLine.h" + #include "llvm/Support/Streams.h" + #include "llvm/Support/SystemUtils.h" + #include "llvm/System/Signals.h" + #include + #include + #include + using namespace llvm; + + static cl::opt + InputFilename(cl::Positional, cl::desc(""), cl::init("-")); + + static cl::opt + OutputFilename("o", cl::desc("Override output filename"), + cl::value_desc("filename")); + + static cl::opt + Force("f", cl::desc("Overwrite output files")); + + int main(int argc, char **argv) { + cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); + sys::PrintStackTraceOnErrorSignal(); + + int exitCode = 0; + std::ostream *Out = 0; + try { + if (OutputFilename != "") { // Specified an output filename? + if (OutputFilename != "-") { // Not stdout? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + llvm_cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str(), std::ios::out | + std::ios::trunc); + } else { // Specified stdout + Out = &std::cout; + } + } else { + if (InputFilename == "-") { + OutputFilename = "-"; + Out = &std::cout; + } else { + std::string IFN = InputFilename; + int Len = IFN.length(); + if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') { + // Source ends in .ll + OutputFilename = std::string(IFN.begin(), IFN.end()-3); + } else { + OutputFilename = IFN; // Append to it + } + OutputFilename += ".llu"; + + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + llvm_cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + + Out = new std::ofstream(OutputFilename.c_str(), std::ios::out | + std::ios::trunc | std::ios::binary); + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + } + } + + if (!Out->good()) { + llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + return 1; + } + + UpgradeAssembly(InputFilename, *Out); + + /* + } catch (const std::string& caught_message) { + llvm_cerr << argv[0] << ": " << caught_message << "\n"; + exitCode = 1; + */ + } catch (...) { + llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + exitCode = 1; + } + + if (Out != &std::cout) delete Out; + return exitCode; + } + From reid at x10sys.com Thu Nov 30 00:37:57 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 00:37:57 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/.cvsignore Message-ID: <200611300637.kAU6bvOA030348@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: .cvsignore added (r1.1) --- Log message: Ignore generated files. --- Diffs of the changes: (+4 -0) .cvsignore | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/tools/llvm-upgrade/.cvsignore diff -c /dev/null llvm/tools/llvm-upgrade/.cvsignore:1.1 *** /dev/null Thu Nov 30 00:37:53 2006 --- llvm/tools/llvm-upgrade/.cvsignore Thu Nov 30 00:37:43 2006 *************** *** 0 **** --- 1,4 ---- + UpgradeParser.output + UpgradeLexer.cpp + UpgradeParser.cpp + UpgradeParser.h From evan.cheng at apple.com Thu Nov 30 01:07:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:07:40 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h Message-ID: <200611300707.kAU77eZU031095@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.202 -> 1.203 --- Log message: - MachineInstr now keeps a ptr to TargetInstrDescriptor instead of Opcode. - Remove the ugly TargetInstrDescriptors hack. --- Diffs of the changes: (+11 -6) MachineInstr.h | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.202 llvm/include/llvm/CodeGen/MachineInstr.h:1.203 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.202 Tue Nov 28 16:21:29 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.h Thu Nov 30 01:07:25 2006 @@ -299,7 +299,7 @@ /// MachineInstr - Representation of each machine instruction. /// class MachineInstr { - short Opcode; // the opcode + const TargetInstrDescriptor *TID; // Instruction descriptor. unsigned short NumImplicitOps; // Number of implicit operands (which // are determined at construction time). @@ -319,7 +319,7 @@ public: /// MachineInstr ctor - This constructor creates a dummy MachineInstr with - /// opcode 0 and no operands. + /// TID NULL and no operands. MachineInstr(); /// MachineInstr ctor - This constructor create a MachineInstr and add the @@ -337,10 +337,14 @@ const MachineBasicBlock* getParent() const { return parent; } MachineBasicBlock* getParent() { return parent; } + + /// getInstrDescriptor - Returns the target instruction descriptor of this + /// MachineInstr. + const TargetInstrDescriptor *getInstrDescriptor() const { return TID; } /// getOpcode - Returns the opcode of this MachineInstr. /// - const int getOpcode() const { return Opcode; } + const int getOpcode() const; /// Access to explicit operands of the instruction. /// @@ -500,9 +504,10 @@ // Accessors used to modify instructions in place. // - /// setOpcode - Replace the opcode of the current instruction with a new one. + /// setInstrDescriptor - Replace the instruction descriptor (thus opcode) of + /// the current instruction with a new one. /// - void setOpcode(unsigned Op) { Opcode = Op; } + void setInstrDescriptor(const TargetInstrDescriptor &tid) { TID = &tid; } /// RemoveOperand - Erase an operand from an instruction, leaving it with one /// fewer operand than it started with. @@ -525,7 +530,7 @@ /// addImplicitDefUseOperands - Add all implicit def and use operands to /// this instruction. - void addImplicitDefUseOperands(const TargetInstrDescriptor &TID); + void addImplicitDefUseOperands(); }; //===----------------------------------------------------------------------===// From evan.cheng at apple.com Thu Nov 30 01:08:59 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:08:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp Message-ID: <200611300708.kAU78xHw031130@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.135 -> 1.136 --- Log message: - MachineInstr now keeps a ptr to TargetInstrDescriptor instead of Opcode. - Remove the ugly TargetInstrDescriptors hack. --- Diffs of the changes: (+35 -42) MachineInstr.cpp | 77 +++++++++++++++++++++++++------------------------------ 1 files changed, 35 insertions(+), 42 deletions(-) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.135 llvm/lib/CodeGen/MachineInstr.cpp:1.136 --- llvm/lib/CodeGen/MachineInstr.cpp:1.135 Tue Nov 28 16:48:48 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Thu Nov 30 01:08:44 2006 @@ -21,28 +21,17 @@ #include using namespace llvm; -// Global variable holding an array of descriptors for machine instructions. -// The actual object needs to be created separately for each target machine. -// This variable is initialized and reset by class TargetInstrInfo. -// -// FIXME: This should be a property of the target so that more than one target -// at a time can be active... -// -namespace llvm { - extern const TargetInstrDescriptor *TargetInstrDescriptors; -} - /// MachineInstr ctor - This constructor creates a dummy MachineInstr with -/// opcode 0 and no operands. +/// TID NULL and no operands. MachineInstr::MachineInstr() - : Opcode(0), NumImplicitOps(0), parent(0) { + : TID(0), NumImplicitOps(0), parent(0) { // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); } -void MachineInstr::addImplicitDefUseOperands(const TargetInstrDescriptor &TID) { - if (TID.ImplicitDefs) - for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) { +void MachineInstr::addImplicitDefUseOperands() { + if (TID->ImplicitDefs) + for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) { MachineOperand Op; Op.opType = MachineOperand::MO_Register; Op.IsDef = true; @@ -53,8 +42,8 @@ Op.offset = 0; Operands.push_back(Op); } - if (TID.ImplicitUses) - for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) { + if (TID->ImplicitUses) + for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) { MachineOperand Op; Op.opType = MachineOperand::MO_Register; Op.IsDef = false; @@ -71,16 +60,16 @@ /// implicit operands. It reserves space for number of operands specified by /// TargetInstrDescriptor or the numOperands if it is not zero. (for /// instructions with variable number of operands). -MachineInstr::MachineInstr(const TargetInstrDescriptor &TID) - : Opcode(TID.Opcode), NumImplicitOps(0), parent(0) { - if (TID.ImplicitDefs) - for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) +MachineInstr::MachineInstr(const TargetInstrDescriptor &tid) + : TID(&tid), NumImplicitOps(0), parent(0) { + if (TID->ImplicitDefs) + for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) NumImplicitOps++; - if (TID.ImplicitUses) - for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) + if (TID->ImplicitUses) + for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) NumImplicitOps++; - Operands.reserve(NumImplicitOps + TID.numOperands); - addImplicitDefUseOperands(TID); + Operands.reserve(NumImplicitOps + TID->numOperands); + addImplicitDefUseOperands(); // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); } @@ -89,17 +78,17 @@ /// MachineInstr is created and added to the end of the specified basic block. /// MachineInstr::MachineInstr(MachineBasicBlock *MBB, - const TargetInstrDescriptor &TID) - : Opcode(TID.Opcode), NumImplicitOps(0), parent(0) { + const TargetInstrDescriptor &tid) + : TID(&tid), NumImplicitOps(0), parent(0) { assert(MBB && "Cannot use inserting ctor with null basic block!"); - if (TID.ImplicitDefs) - for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) + if (TID->ImplicitDefs) + for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) NumImplicitOps++; - if (TID.ImplicitUses) - for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) + if (TID->ImplicitUses) + for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) NumImplicitOps++; - Operands.reserve(NumImplicitOps + TID.numOperands); - addImplicitDefUseOperands(TID); + Operands.reserve(NumImplicitOps + TID->numOperands); + addImplicitDefUseOperands(); // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); MBB->push_back(this); // Add instruction to end of basic block! @@ -108,7 +97,7 @@ /// MachineInstr ctor - Copies MachineInstr arg exactly /// MachineInstr::MachineInstr(const MachineInstr &MI) { - Opcode = MI.getOpcode(); + TID = MI.getInstrDescriptor(); NumImplicitOps = MI.NumImplicitOps; Operands.reserve(MI.getNumOperands()); @@ -127,6 +116,12 @@ LeakDetector::removeGarbageObject(this); } +/// getOpcode - Returns the opcode of this MachineInstr. +/// +const int MachineInstr::getOpcode() const { + return TID->Opcode; +} + /// removeFromParent - This method unlinks 'this' from the containing basic /// block, and returns it, but does not delete it. MachineInstr *MachineInstr::removeFromParent() { @@ -139,8 +134,8 @@ /// OperandComplete - Return true if it's illegal to add a new operand /// bool MachineInstr::OperandsComplete() const { - unsigned short NumOperands = TargetInstrDescriptors[Opcode].numOperands; - if ((TargetInstrDescriptors[Opcode].Flags & M_VARIABLE_OPS) == 0 && + unsigned short NumOperands = TID->numOperands; + if ((TID->Flags & M_VARIABLE_OPS) == 0 && getNumOperands()-NumImplicitOps >= NumOperands) return true; // Broken: we have all the operands of this instruction! return false; @@ -241,10 +236,8 @@ ++StartOp; // Don't print this operand again! } - // Must check if Target machine is not null because machine BB could not - // be attached to a Machine function yet - if (TM) - OS << TM->getInstrInfo()->getName(getOpcode()); + if (TID) + OS << TID->Name; for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) { const MachineOperand& mop = getOperand(i); @@ -294,7 +287,7 @@ // Otherwise, print it out in the "raw" format without symbolic register names // and such. - os << TargetInstrDescriptors[MI.getOpcode()].Name; + os << MI.getInstrDescriptor()->Name; for (unsigned i = 0, N = MI.getNumOperands(); i < N; i++) { os << "\t" << MI.getOperand(i); From evan.cheng at apple.com Thu Nov 30 01:10:57 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:10:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetInstrInfo.cpp Message-ID: <200611300710.kAU7Av6v031175@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetInstrInfo.cpp updated: 1.22 -> 1.23 --- Log message: Remove the ugly SPARCV9 TargetInstrDescriptors hack. --- Diffs of the changes: (+0 -13) TargetInstrInfo.cpp | 13 ------------- 1 files changed, 13 deletions(-) Index: llvm/lib/Target/TargetInstrInfo.cpp diff -u llvm/lib/Target/TargetInstrInfo.cpp:1.22 llvm/lib/Target/TargetInstrInfo.cpp:1.23 --- llvm/lib/Target/TargetInstrInfo.cpp:1.22 Wed Nov 15 14:56:03 2006 +++ llvm/lib/Target/TargetInstrInfo.cpp Thu Nov 30 01:10:43 2006 @@ -17,25 +17,12 @@ #include "llvm/DerivedTypes.h" using namespace llvm; -namespace llvm { - // External object describing the machine instructions Initialized only when - // the TargetMachine class is created and reset when that class is destroyed. - // - // FIXME: UGLY SPARCV9 HACK! - const TargetInstrDescriptor* TargetInstrDescriptors = 0; -} - TargetInstrInfo::TargetInstrInfo(const TargetInstrDescriptor* Desc, unsigned numOpcodes) : desc(Desc), NumOpcodes(numOpcodes) { - // FIXME: TargetInstrDescriptors should not be global - assert(TargetInstrDescriptors == NULL && desc != NULL - && "TargetMachine data structure corrupt; maybe you tried to create another TargetMachine? (only one may exist in a program)"); - TargetInstrDescriptors = desc; // initialize global variable } TargetInstrInfo::~TargetInstrInfo() { - TargetInstrDescriptors = NULL; // reset global variable } /// findTiedToSrcOperand - Returns the operand that is tied to the specified From evan.cheng at apple.com Thu Nov 30 01:12:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:12:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp Message-ID: <200611300712.kAU7CKsQ031226@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaBranchSelector.cpp updated: 1.1 -> 1.2 --- Log message: MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor --- Diffs of the changes: (+2 -1) AlphaBranchSelector.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp diff -u llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.1 llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.2 --- llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.1 Tue Oct 31 10:49:55 2006 +++ llvm/lib/Target/Alpha/AlphaBranchSelector.cpp Thu Nov 30 01:12:03 2006 @@ -53,7 +53,8 @@ // 0. bc opcode // 1. reg // 2. target MBB - MBBI->setOpcode(MBBI->getOperand(0).getImm()); + const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo(); + MBBI->setInstrDescriptor(TII->get(MBBI->getOperand(0).getImm())); } } } From evan.cheng at apple.com Thu Nov 30 01:12:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:12:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86FloatingPoint.cpp Message-ID: <200611300712.kAU7CMSA031236@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86FloatingPoint.cpp updated: 1.61 -> 1.62 --- Log message: MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor --- Diffs of the changes: (+33 -31) X86FloatingPoint.cpp | 64 ++++++++++++++++++++++++++------------------------- 1 files changed, 33 insertions(+), 31 deletions(-) Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.61 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.62 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.61 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Thu Nov 30 01:12:03 2006 @@ -108,7 +108,7 @@ void moveToTop(unsigned RegNo, MachineBasicBlock::iterator &I) { if (!isAtTop(RegNo)) { MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); unsigned STReg = getSTReg(RegNo); unsigned RegOnTop = getStackEntry(0); @@ -121,18 +121,18 @@ std::swap(Stack[RegMap[RegOnTop]], Stack[StackTop-1]); // Emit an fxch to update the runtime processors version of the state - BuildMI(*MBB, I, TII.get(X86::FXCH)).addReg(STReg); + BuildMI(*MBB, I, TII->get(X86::FXCH)).addReg(STReg); NumFXCH++; } } void duplicateToTop(unsigned RegNo, unsigned AsReg, MachineInstr *I) { MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); unsigned STReg = getSTReg(RegNo); pushReg(AsReg); // New register on top of stack - BuildMI(*MBB, I, TII.get(X86::FLDrr)).addReg(STReg); + BuildMI(*MBB, I, TII->get(X86::FLDrr)).addReg(STReg); } // popStackAfter - Pop the current value off of the top of the FP stack @@ -200,13 +200,12 @@ /// transforming FP instructions into their stack form. /// bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) { - const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); bool Changed = false; MBB = &BB; for (MachineBasicBlock::iterator I = BB.begin(); I != BB.end(); ++I) { MachineInstr *MI = I; - unsigned Flags = TII.get(MI->getOpcode()).TSFlags; + unsigned Flags = MI->getInstrDescriptor()->TSFlags; if ((Flags & X86II::FPTypeMask) == X86II::NotFP) continue; // Efficiently ignore non-fp insts! @@ -432,17 +431,16 @@ assert(StackTop > 0 && "Cannot pop empty stack!"); RegMap[Stack[--StackTop]] = ~0; // Update state + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Check to see if there is a popping version of this instruction... int Opcode = Lookup(PopTable, ARRAY_SIZE(PopTable), I->getOpcode()); if (Opcode != -1) { - I->setOpcode(Opcode); + I->setInstrDescriptor(TII->get(Opcode)); if (Opcode == X86::FUCOMPPr) I->RemoveOperand(0); - } else { // Insert an explicit pop - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - I = BuildMI(*MBB, ++I, TII.get(X86::FSTPrr)).addReg(X86::ST0); + I = BuildMI(*MBB, ++I, TII->get(X86::FSTPrr)).addReg(X86::ST0); } } @@ -467,8 +465,8 @@ RegMap[FPRegNo] = ~0; Stack[--StackTop] = ~0; MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - I = BuildMI(*MBB, ++I, TII.get(X86::FSTPrr)).addReg(STReg); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); + I = BuildMI(*MBB, ++I, TII->get(X86::FSTPrr)).addReg(STReg); } @@ -488,11 +486,13 @@ /// void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; + MachineFunction *MF = MI->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); unsigned DestReg = getFPReg(MI->getOperand(0)); // Change from the pseudo instruction to the concrete instruction. MI->RemoveOperand(0); // Remove the explicit ST(0) operand - MI->setOpcode(getConcreteOpcode(MI->getOpcode())); + MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); // Result gets pushed on the stack. pushReg(DestReg); @@ -502,9 +502,7 @@ /// void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - unsigned NumOps = TII.getNumOperands(MI->getOpcode()); + unsigned NumOps = MI->getInstrDescriptor()->numOperands; assert((NumOps == 5 || NumOps == 1) && "Can only handle fst* & ftst instructions!"); @@ -530,7 +528,9 @@ // Convert from the pseudo instruction to the concrete instruction. MI->RemoveOperand(NumOps-1); // Remove explicit ST(0) operand - MI->setOpcode(getConcreteOpcode(MI->getOpcode())); + MachineFunction *MF = MI->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); + MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); if (MI->getOpcode() == X86::FISTP64m || MI->getOpcode() == X86::FISTTP16m || @@ -554,9 +554,7 @@ /// void FPS::handleOneArgFPRW(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - unsigned NumOps = TII.getNumOperands(MI->getOpcode()); + unsigned NumOps = MI->getInstrDescriptor()->numOperands; assert(NumOps >= 2 && "FPRW instructions must have 2 ops!!"); // Is this the last use of the source register? @@ -577,9 +575,11 @@ } // Change from the pseudo instruction to the concrete instruction. + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); MI->RemoveOperand(1); // Drop the source operand. MI->RemoveOperand(0); // Drop the destination operand. - MI->setOpcode(getConcreteOpcode(MI->getOpcode())); + MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); } @@ -633,9 +633,7 @@ ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable); MachineInstr *MI = I; - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - unsigned NumOperands = TII.getNumOperands(MI->getOpcode()); + unsigned NumOperands = MI->getInstrDescriptor()->numOperands; assert(NumOperands == 3 && "Illegal TwoArgFP instruction!"); unsigned Dest = getFPReg(MI->getOperand(0)); unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2)); @@ -706,7 +704,9 @@ // Replace the old instruction with a new instruction MBB->remove(I++); - I = BuildMI(*MBB, I, TII.get(Opcode)).addReg(getSTReg(NotTOS)); + MachineFunction *MF = MI->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); + I = BuildMI(*MBB, I, TII->get(Opcode)).addReg(getSTReg(NotTOS)); // If both operands are killed, pop one off of the stack in addition to // overwriting the other one. @@ -732,9 +732,7 @@ ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable); MachineInstr *MI = I; - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); - unsigned NumOperands = TII.getNumOperands(MI->getOpcode()); + unsigned NumOperands = MI->getInstrDescriptor()->numOperands; assert(NumOperands == 2 && "Illegal FUCOM* instruction!"); unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2)); unsigned Op1 = getFPReg(MI->getOperand(NumOperands-1)); @@ -745,10 +743,12 @@ // anywhere. moveToTop(Op0, I); + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Change from the pseudo instruction to the concrete instruction. MI->getOperand(0).setReg(getSTReg(Op1)); MI->RemoveOperand(1); - MI->setOpcode(getConcreteOpcode(MI->getOpcode())); + MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); // If any of the operands are killed by this instruction, free them. if (KillsOp0) freeStackSlotAfter(I, Op0); @@ -769,12 +769,14 @@ // The first operand *must* be on the top of the stack. moveToTop(Op0, I); + MachineFunction *MF = I->getParent()->getParent(); + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Change the second operand to the stack register that the operand is in. // Change from the pseudo instruction to the concrete instruction. MI->RemoveOperand(0); MI->RemoveOperand(1); MI->getOperand(0).setReg(getSTReg(Op1)); - MI->setOpcode(getConcreteOpcode(MI->getOpcode())); + MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); // If we kill the second operand, make sure to pop it from the stack. if (Op0 != Op1 && KillsOp1) { From evan.cheng at apple.com Thu Nov 30 01:12:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:12:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/FPMover.cpp Message-ID: <200611300712.kAU7CK01031221@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: FPMover.cpp updated: 1.14 -> 1.15 --- Log message: MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor --- Diffs of the changes: (+4 -3) FPMover.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Target/Sparc/FPMover.cpp diff -u llvm/lib/Target/Sparc/FPMover.cpp:1.14 llvm/lib/Target/Sparc/FPMover.cpp:1.15 --- llvm/lib/Target/Sparc/FPMover.cpp:1.14 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/Sparc/FPMover.cpp Thu Nov 30 01:12:03 2006 @@ -96,12 +96,13 @@ getDoubleRegPair(DestDReg, EvenDestReg, OddDestReg); getDoubleRegPair(SrcDReg, EvenSrcReg, OddSrcReg); + const TargetInstrInfo *TII = TM.getInstrInfo(); if (MI->getOpcode() == SP::FpMOVD) - MI->setOpcode(SP::FMOVS); + MI->setInstrDescriptor(TII->get(SP::FMOVS)); else if (MI->getOpcode() == SP::FpNEGD) - MI->setOpcode(SP::FNEGS); + MI->setInstrDescriptor(TII->get(SP::FNEGS)); else if (MI->getOpcode() == SP::FpABSD) - MI->setOpcode(SP::FABSS); + MI->setInstrDescriptor(TII->get(SP::FABSS)); else assert(0 && "Unknown opcode!"); From evan.cheng at apple.com Thu Nov 30 01:12:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 01:12:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200611300712.kAU7CKqj031231@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.90 -> 1.91 --- Log message: MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor --- Diffs of the changes: (+1 -1) PPCRegisterInfo.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.90 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.91 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.90 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Nov 30 01:12:03 2006 @@ -576,7 +576,7 @@ assert(ImmToIdxMap.count(OpC) && "No indexed form of load or store available!"); unsigned NewOpcode = ImmToIdxMap.find(OpC)->second; - MI.setOpcode(NewOpcode); + MI.setInstrDescriptor(TII.get(NewOpcode)); MI.getOperand(1).ChangeToRegister(MI.getOperand(i).getReg(), false); MI.getOperand(2).ChangeToRegister(PPC::R0, false); } else { From jlaskey at apple.com Thu Nov 30 05:09:57 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 05:09:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200611301109.kAUB9vVq013271@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.103 -> 1.104 --- Log message: Temp fix to deal gdb issue. --- Diffs of the changes: (+6 -1) DwarfWriter.cpp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.103 llvm/lib/CodeGen/DwarfWriter.cpp:1.104 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.103 Wed Nov 29 10:55:57 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Nov 30 05:09:42 2006 @@ -2198,7 +2198,8 @@ unsigned ContentSize = Die->getSize() + sizeof(int16_t) + // DWARF version number sizeof(int32_t) + // Offset Into Abbrev. Section - sizeof(int8_t); // Pointer Size (in bytes) + sizeof(int8_t) + // Pointer Size (in bytes) + sizeof(int32_t); // FIXME - extra pad for gdb bug. EmitInt32(ContentSize); EOL("Length of Compilation Unit Info"); EmitInt16(DWARF_VERSION); EOL("DWARF version number"); @@ -2207,6 +2208,10 @@ EmitInt8(TAI->getAddressSize()); EOL("Address Size (in bytes)"); EmitDIE(Die); + EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. + EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. + EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. + EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. EmitLabel("info_end", Unit->getID()); O << "\n"; From jlaskey at apple.com Thu Nov 30 08:36:01 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 08:36:01 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h Message-ID: <200611301436.kAUEa1K1016715@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineDebugInfo.h updated: 1.46 -> 1.47 --- Log message: Change global descriptor names to provide name, full name and linkage name. --- Diffs of the changes: (+8 -7) MachineDebugInfo.h | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.46 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.47 --- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.46 Wed Nov 8 08:16:39 2006 +++ llvm/include/llvm/CodeGen/MachineDebugInfo.h Thu Nov 30 08:35:45 2006 @@ -53,7 +53,8 @@ // Debug info constants. enum { - LLVMDebugVersion = (5 << 16), // Current version of debug information. + LLVMDebugVersion = (6 << 16), // Current version of debug information. + LLVMDebugVersion5 = (5 << 16), // Constant for version 5. LLVMDebugVersion4 = (4 << 16), // Constant for version 4. LLVMDebugVersionMask = 0xffff0000 // Mask for version number. }; @@ -582,7 +583,8 @@ private: DebugInfoDesc *Context; // Context debug descriptor. std::string Name; // Global name. - std::string DisplayName; // C++ unmangled name. + std::string FullName; // Fully qualified name. + std::string LinkageName; // Name for binding to MIPS linkage. DebugInfoDesc *File; // Defined compile unit (may be NULL.) unsigned Line; // Defined line# (may be zero.) DebugInfoDesc *TyDesc; // Type debug descriptor. @@ -596,7 +598,8 @@ // Accessors DebugInfoDesc *getContext() const { return Context; } const std::string &getName() const { return Name; } - const std::string &getDisplayName() const { return DisplayName; } + const std::string &getFullName() const { return FullName; } + const std::string &getLinkageName() const { return LinkageName; } CompileUnitDesc *getFile() const { return static_cast(File); } @@ -608,7 +611,8 @@ bool isDefinition() const { return IsDefinition; } void setContext(DebugInfoDesc *C) { Context = C; } void setName(const std::string &N) { Name = N; } - void setDisplayName(const std::string &N) { DisplayName = N; } + void setFullName(const std::string &N) { FullName = N; } + void setLinkageName(const std::string &N) { LinkageName = N; } void setFile(CompileUnitDesc *U) { File = static_cast(U); } @@ -618,9 +622,6 @@ } void setIsStatic(bool IS) { IsStatic = IS; } void setIsDefinition(bool ID) { IsDefinition = ID; } - bool hasMangledName() const { - return !DisplayName.empty(); - } /// ApplyToFields - Target the visitor to the fields of the GlobalDesc. /// From jlaskey at apple.com Thu Nov 30 08:36:02 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 08:36:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp DwarfWriter.cpp Message-ID: <200611301436.kAUEa24B016722@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineDebugInfo.cpp updated: 1.60 -> 1.61 DwarfWriter.cpp updated: 1.104 -> 1.105 --- Log message: Change global descriptor names to provide name, full name and linkage name. --- Diffs of the changes: (+35 -36) DwarfWriter.cpp | 59 +++++++++++++++++++++++---------------------------- MachineDebugInfo.cpp | 12 ++++++---- 2 files changed, 35 insertions(+), 36 deletions(-) Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.60 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.61 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.60 Sun Nov 26 19:05:09 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Thu Nov 30 08:35:45 2006 @@ -1048,7 +1048,8 @@ : AnchoredDesc(T) , Context(0) , Name("") -, DisplayName("") +, FullName("") +, LinkageName("") , File(NULL) , Line(0) , TyDesc(NULL) @@ -1063,7 +1064,8 @@ Visitor->Apply(Context); Visitor->Apply(Name); - if (getVersion() > LLVMDebugVersion4) Visitor->Apply(DisplayName); + Visitor->Apply(FullName); + Visitor->Apply(LinkageName); Visitor->Apply(File); Visitor->Apply(Line); Visitor->Apply(TyDesc); @@ -1117,7 +1119,8 @@ << "Tag(" << getTag() << "), " << "Anchor(" << getAnchor() << "), " << "Name(\"" << getName() << "\"), " - << "DisplayName(\"" << getDisplayName() << "\"), " + << "FullName(\"" << getFullName() << "\"), " + << "LinkageName(\"" << getLinkageName() << "\"), " << "File(" << getFile() << ")," << "Line(" << getLine() << ")," << "Type(" << getType() << "), " @@ -1170,7 +1173,8 @@ << "Tag(" << getTag() << "), " << "Anchor(" << getAnchor() << "), " << "Name(\"" << getName() << "\"), " - << "DisplayName(\"" << getDisplayName() << "\"), " + << "FullName(\"" << getFullName() << "\"), " + << "LinkageName(\"" << getLinkageName() << "\"), " << "File(" << getFile() << ")," << "Line(" << getLine() << ")," << "Type(" << getType() << "), " Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.104 llvm/lib/CodeGen/DwarfWriter.cpp:1.105 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.104 Thu Nov 30 05:09:42 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Nov 30 08:35:45 2006 @@ -1587,11 +1587,13 @@ DIE *Static = new DIE(DW_TAG_variable); // Add name and mangled name. - const std::string &Name = StaticDesc->getDisplayName(); - const std::string &MangledName = StaticDesc->getName(); + const std::string &Name = StaticDesc->getName(); + const std::string &LinkageName = StaticDesc->getLinkageName(); AddString(Static, DW_AT_name, DW_FORM_string, Name); - AddString(Static, DW_AT_MIPS_linkage_name, DW_FORM_string, - MangledName); + if (!LinkageName.empty()) { + AddString(Static, DW_AT_MIPS_linkage_name, DW_FORM_string, + LinkageName); + } // Add location. AddSourceLine(Static, StaticDesc->getFile(), StaticDesc->getLine()); @@ -1613,17 +1615,15 @@ DIE *Method = new DIE(DW_TAG_subprogram); // Add name and mangled name. - const std::string &Name = MethodDesc->getDisplayName(); - const std::string &MangledName = MethodDesc->getName(); - bool IsCTor = false; + const std::string &Name = MethodDesc->getName(); + const std::string &LinkageName = MethodDesc->getLinkageName(); + + AddString(Method, DW_AT_name, DW_FORM_string, Name); + bool IsCTor = TyDesc->getName() == Name; - if (Name.empty()) { - AddString(Method, DW_AT_name, DW_FORM_string, MangledName); - IsCTor = TyDesc->getName() == MangledName; - } else { - AddString(Method, DW_AT_name, DW_FORM_string, Name); + if (!LinkageName.empty()) { AddString(Method, DW_AT_MIPS_linkage_name, DW_FORM_string, - MangledName); + LinkageName); } // Add location. @@ -1752,16 +1752,15 @@ // Get the global variable itself. GlobalVariable *GV = GVD->getGlobalVariable(); - const std::string &Name = GVD->hasMangledName() ? GVD->getDisplayName() - : GVD->getName(); - const std::string &MangledName = GVD->hasMangledName() ? GVD->getName() - : ""; + const std::string &Name = GVD->getName(); + const std::string &FullName = GVD->getFullName(); + const std::string &LinkageName = GVD->getLinkageName(); // Create the global's variable DIE. DIE *VariableDie = new DIE(DW_TAG_variable); AddString(VariableDie, DW_AT_name, DW_FORM_string, Name); - if (!MangledName.empty()) { + if (!LinkageName.empty()) { AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string, - MangledName); + LinkageName); } AddType(VariableDie, GVD->getType(), Unit); AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1); @@ -1769,14 +1768,11 @@ // Add source line info if available. AddSourceLine(VariableDie, UnitDesc, GVD->getLine()); - // Work up linkage name. - const std::string LinkageName = Asm->getGlobalLinkName(GV); - // Add address. DIEBlock *Block = new DIEBlock(); AddUInt(Block, 0, DW_FORM_data1, DW_OP_addr); - AddObjectLabel(Block, 0, DW_FORM_udata, LinkageName); - AddBlock(VariableDie, DW_AT_location, 0, Block); + AddObjectLabel(Block, 0, DW_FORM_udata, Asm->getGlobalLinkName(GV)); + AddBlock(VariableDie, DW_AT_location, 0, Block); // Add to map. Slot = VariableDie; @@ -1786,7 +1782,7 @@ // Expose as global. // FIXME - need to check external flag. - Unit->AddGlobal(Name, VariableDie); + Unit->AddGlobal(FullName, VariableDie); return VariableDie; } @@ -1804,17 +1800,16 @@ if (Slot) return Slot; // Gather the details (simplify add attribute code.) - const std::string &Name = SPD->hasMangledName() ? SPD->getDisplayName() - : SPD->getName(); - const std::string &MangledName = SPD->hasMangledName() ? SPD->getName() - : ""; + const std::string &Name = SPD->getName(); + const std::string &FullName = SPD->getFullName(); + const std::string &LinkageName = SPD->getLinkageName(); unsigned IsExternal = SPD->isStatic() ? 0 : 1; DIE *SubprogramDie = new DIE(DW_TAG_subprogram); AddString(SubprogramDie, DW_AT_name, DW_FORM_string, Name); - if (!MangledName.empty()) { + if (!LinkageName.empty()) { AddString(SubprogramDie, DW_AT_MIPS_linkage_name, DW_FORM_string, - MangledName); + LinkageName); } if (SPD->getType()) AddType(SubprogramDie, SPD->getType(), Unit); AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, IsExternal); @@ -1830,7 +1825,7 @@ Unit->getDie()->AddChild(SubprogramDie); // Expose as global. - Unit->AddGlobal(Name, SubprogramDie); + Unit->AddGlobal(FullName, SubprogramDie); return SubprogramDie; } From jlaskey at apple.com Thu Nov 30 08:36:36 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 08:36:36 -0600 Subject: [llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html Message-ID: <200611301436.kAUEaarj016786@zion.cs.uiuc.edu> Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.25 -> 1.26 --- Log message: Update docs --- Diffs of the changes: (+5 -3) SourceLevelDebugging.html | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.25 llvm/docs/SourceLevelDebugging.html:1.26 --- llvm/docs/SourceLevelDebugging.html:1.25 Mon Aug 21 17:57:31 2006 +++ llvm/docs/SourceLevelDebugging.html Thu Nov 30 08:36:22 2006 @@ -389,7 +389,8 @@ { }*, ;; Global variable anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name - sbyte*, ;; Display name (unmangled name if Name is the C++ mangled name) + sbyte*, ;; Display name (fully qualified C++ name) + sbyte*, ;; MIPS linkage name (for C++) { }*, ;; Reference to compile unit where defined uint, ;; Line number where defined { }*, ;; Reference to type descriptor @@ -417,7 +418,8 @@ { }*, ;; Subprogram anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name - sbyte*, ;; Display name (unmangled name if Name is the C++ mangled name) + sbyte*, ;; Display name (fully qualified C++ name) + sbyte*, ;; MIPS linkage name (for C++) { }*, ;; Reference to compile unit where defined uint, ;; Line number where defined { }*, ;; Reference to type descriptor @@ -1773,7 +1775,7 @@ Chris Lattner
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/21 22:57:31 $ + Last modified: $Date: 2006/11/30 14:36:22 $ From jlaskey at apple.com Thu Nov 30 08:42:10 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 10:42:10 -0400 Subject: [llvm-commits] [llvm-gcc4] gcc/llvm-debug.cpp Message-ID: <669AB0BF-8725-4E50-AD64-0B20C910E966@apple.com> Index: gcc/llvm-debug.cpp =================================================================== --- gcc/llvm-debug.cpp (revision 120721) +++ gcc/llvm-debug.cpp (working copy) @@ -182,18 +182,19 @@ return Location; } -/// GetGlobalName - Returns the name and mangled name of a global item (function -/// or global variable.) -static void GetGlobalName(tree Node, const char *&name, const char *&asmname) { +/// GetGlobalNames - Sets the names for a global descriptor. +/// +static void GetGlobalNames(tree Node, GlobalDesc *Global) { tree decl_name = DECL_NAME(Node); if (decl_name != NULL && IDENTIFIER_POINTER (decl_name) != NULL) { - name = lang_hooks.decl_printable_name (Node, 0); - - if (TREE_PUBLIC(Node) && - DECL_ASSEMBLER_NAME(Node) != DECL_NAME(Node) && - !DECL_ABSTRACT(Node)) { - asmname = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(Node)); - } + Global->setName(lang_hooks.decl_printable_name (Node, 0)); + Global->setFullName(lang_hooks.decl_printable_name (Node, 1)); + + if (TREE_PUBLIC(Node) && + DECL_ASSEMBLER_NAME(Node) != DECL_NAME(Node) && + !DECL_ABSTRACT(Node)) { + Global->setLinkageName(IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME (Node))); + } } } @@ -255,9 +256,7 @@ } // Get name information. - const char *name = ""; - const char *asmname = ""; - GetGlobalName(FnDecl, name, asmname); + GetGlobalNames(FnDecl, Subprogram); // Gather location information. CompileUnitDesc *Unit = getOrCreateCompileUnit(CurFullPath); @@ -267,12 +266,6 @@ Subprogram->setAnchor(SubprogramAnchor); Subprogram->setContext(Unit); - if (*asmname != '\0') { - Subprogram->setName(asmname); - Subprogram->setDisplayName(name); - } else { - Subprogram->setName(name); - } Subprogram->setFile(Unit); Subprogram->setLine(CurLineNo); Subprogram->setType(SPTy); @@ -411,9 +404,7 @@ } // Get name information. - const char *name = ""; - const char *asmname = ""; - GetGlobalName(decl, name, asmname); + GetGlobalNames(decl, Global); // Gather location information. expanded_location location = expand_location(DECL_SOURCE_LOCATION (decl)); @@ -424,12 +415,6 @@ // Fill in the blanks. Global->setAnchor(GlobalVariableAnchor); Global->setContext(Unit); - if (*asmname != '\0') { - Global->setName(asmname); - Global->setDisplayName(name); - } else { - Global->setName(name); - } Global->setFile(Unit); Global->setLine(location.line); Global->setType(TyD); @@ -726,20 +711,12 @@ GlobalVariableDesc *Static = new GlobalVariableDesc(); // Get name information. - const char *Name = ""; - const char *ASMName = ""; - GetGlobalName(Member, Name, ASMName); + GetGlobalNames(Member, Static); TypeDesc *TyD = getOrCreateType(TREE_TYPE(Member), Unit); // Fill in the blanks. Static->setContext(Unit); - if (*ASMName != '\0') { - Static->setName(ASMName); - Static->setDisplayName(Name); - } else { - Static->setName(Name); - } Static->setFile(MemFile); Static->setLine(MemLoc.line); Static->setType(TyD); @@ -760,9 +737,7 @@ Subprogram = new SubprogramDesc(); // Get name information. - const char *name = ""; - const char *asmname = ""; - GetGlobalName(Member, name, asmname); + GetGlobalNames(Member, Subprogram); // Get function type. TypeDesc *SPTy = getOrCreateType(TREE_TYPE(Member), Unit); @@ -774,12 +749,6 @@ } Subprogram->setContext(Unit); - if (*asmname != '\0') { - Subprogram->setName(asmname); - Subprogram->setDisplayName(name); - } else { - Subprogram->setName(name); - } Subprogram->setFile(Unit); Subprogram->setLine(CurLineNo); Subprogram->setType(SPTy); -------------- 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/20061130/65c8cca8/attachment.bin From jlaskey at apple.com Thu Nov 30 09:26:13 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 09:26:13 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp Message-ID: <200611301526.kAUFQDco017552@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/DebugInfo: 2006-11-30-Pubnames.cpp added (r1.1) --- Log message: Pubnames test --- Diffs of the changes: (+19 -0) 2006-11-30-Pubnames.cpp | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+) Index: llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp diff -c /dev/null llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.1 *** /dev/null Thu Nov 30 09:26:09 2006 --- llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp Thu Nov 30 09:25:59 2006 *************** *** 0 **** --- 1,19 ---- + // This is a regression test on debug info to make sure that we can get a + // meaningful stack trace from a C++ program. + // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o Output/Pubnames.s -f + // RUN: as Output/Pubnames.s -o Output/Pubnames.o + // RUN: g++ Output/Pubnames.o -o Output/Pubnames.exe + // RUN: ( echo "break main"; echo "run" ; echo "p Pubnames::pubname" ) > Output/Pubnames.gdbin + // RUN: gdb -q -batch -n -x Output/Pubnames.gdbin Output/Pubnames.exe | tee Output/Pubnames.out | grep '10' + // XFAIL: i[1-9]86|alpha|ia64|arm + + struct Pubnames { + static int pubname; + }; + + int Pubnames::pubname = 10; + + int main (int argc, char** argv) { + Pubnames p; + return 0; + } From jlaskey at apple.com Thu Nov 30 09:32:04 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 09:32:04 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp Message-ID: <200611301532.kAUFW4qG017717@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/DebugInfo: 2006-11-30-Pubnames.cpp updated: 1.1 -> 1.2 --- Log message: Correct comment --- Diffs of the changes: (+2 -2) 2006-11-30-Pubnames.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp diff -u llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.1 llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.2 --- llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.1 Thu Nov 30 09:25:59 2006 +++ llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp Thu Nov 30 09:31:49 2006 @@ -1,5 +1,5 @@ -// This is a regression test on debug info to make sure that we can get a -// meaningful stack trace from a C++ program. +// This is a regression test on debug info to make sure that we can access +// qualified global names. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o Output/Pubnames.s -f // RUN: as Output/Pubnames.s -o Output/Pubnames.o // RUN: g++ Output/Pubnames.o -o Output/Pubnames.exe From jlaskey at apple.com Thu Nov 30 09:36:58 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 09:36:58 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp Message-ID: <200611301536.kAUFawZm017803@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/DebugInfo: 2006-11-30-NoCompileUnit.cpp added (r1.1) --- Log message: Add compile unit size test --- Diffs of the changes: (+58 -0) 2006-11-30-NoCompileUnit.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+) Index: llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp diff -c /dev/null llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp:1.1 *** /dev/null Thu Nov 30 09:36:54 2006 --- llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp Thu Nov 30 09:36:44 2006 *************** *** 0 **** --- 1,58 ---- + // This is a regression test on debug info to make sure we don't hit a compile unit size + // issue with gdb. + // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o Output/NoCompileUnit.s -f + // RUN: as Output/NoCompileUnit.s -o Output/NoCompileUnit.o + // RUN: g++ Output/NoCompileUnit.o -o Output/NoCompileUnit.exe + // RUN: ( echo "break main"; echo "run" ; echo "p NoCompileUnit::pubname" ) > Output/NoCompileUnit.gdbin + // RUN: gdb -q -batch -n -x Output/NoCompileUnit.gdbin Output/NoCompileUnit.exe | tee Output/NoCompileUnit.out | not grep '"low == high"' + // XFAIL: i[1-9]86|alpha|ia64|arm + + + class MamaDebugTest { + private: + int N; + + protected: + MamaDebugTest(int n) : N(n) {} + + int getN() const { return N; } + + }; + + class BabyDebugTest : public MamaDebugTest { + private: + + public: + BabyDebugTest(int n) : MamaDebugTest(n) {} + + static int doh; + + int doit() { + int N = getN(); + int Table[N]; + + int sum = 0; + + for (int i = 0; i < N; ++i) { + int j = i; + Table[i] = j; + } + for (int i = 0; i < N; ++i) { + int j = Table[i]; + sum += j; + } + + return sum; + } + + }; + + int BabyDebugTest::doh; + + + int main(int argc, const char *argv[]) { + BabyDebugTest BDT(20); + return BDT.doit(); + } + + From reid at x10sys.com Thu Nov 30 10:50:41 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 10:50:41 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/Makefile ParserInternals.h UpgradeLexer.cpp UpgradeLexer.cpp.cvs UpgradeLexer.l UpgradeLexer.l.cvs UpgradeParser.cpp UpgradeParser.cpp.cvs UpgradeParser.y UpgradeParser.y.cvs llvm-upgrade.cpp Message-ID: <200611301650.kAUGofhr019126@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: Makefile updated: 1.1 -> 1.2 ParserInternals.h updated: 1.1 -> 1.2 UpgradeLexer.cpp updated: 1.1 -> 1.2 UpgradeLexer.cpp.cvs updated: 1.1 -> 1.2 UpgradeLexer.l updated: 1.1 -> 1.2 UpgradeLexer.l.cvs updated: 1.1 -> 1.2 UpgradeParser.cpp updated: 1.1 -> 1.2 UpgradeParser.cpp.cvs updated: 1.1 -> 1.2 UpgradeParser.y updated: 1.1 -> 1.2 UpgradeParser.y.cvs updated: 1.1 -> 1.2 llvm-upgrade.cpp updated: 1.1 -> 1.2 --- Log message: Allow llvm-upgrade to read from stdin. Configure the lexer for reading from C++ std::istream. --- Diffs of the changes: (+696 -676) Makefile | 1 ParserInternals.h | 6 UpgradeLexer.cpp | 269 ++++++++++++++++++------------------ UpgradeLexer.cpp.cvs | 269 ++++++++++++++++++------------------ UpgradeLexer.l | 15 +- UpgradeLexer.l.cvs | 23 ++- UpgradeParser.cpp | 365 ++++++++++++++++++++++++-------------------------- UpgradeParser.cpp.cvs | 365 ++++++++++++++++++++++++-------------------------- UpgradeParser.y | 17 -- UpgradeParser.y.cvs | 21 +- llvm-upgrade.cpp | 21 ++ 11 files changed, 696 insertions(+), 676 deletions(-) Index: llvm/tools/llvm-upgrade/Makefile diff -u llvm/tools/llvm-upgrade/Makefile:1.1 llvm/tools/llvm-upgrade/Makefile:1.2 --- llvm/tools/llvm-upgrade/Makefile:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/Makefile Thu Nov 30 10:50:26 2006 @@ -10,6 +10,7 @@ LEVEL = ../.. TOOLNAME = llvm-upgrade LINK_COMPONENTS := support system +REQUIRES_EH := 1 include $(LEVEL)/Makefile.common Index: llvm/tools/llvm-upgrade/ParserInternals.h diff -u llvm/tools/llvm-upgrade/ParserInternals.h:1.1 llvm/tools/llvm-upgrade/ParserInternals.h:1.2 --- llvm/tools/llvm-upgrade/ParserInternals.h:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/ParserInternals.h Thu Nov 30 10:50:26 2006 @@ -16,17 +16,17 @@ #define PARSER_INTERNALS_H #include +#include // Global variables exported from the lexer... extern std::string CurFileName; extern std::string Textin; extern int Upgradelineno; +extern std::istream* LexInput; -// functions exported from the lexer -void set_scan_bytes (const char * str, size_t len); -void UpgradeAssembly(const std::string & infile, std::ostream &out); +void UpgradeAssembly(const std::string & infile, std::istream& in, std::ostream &out); // Globals exported by the parser... extern char* Upgradetext; Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp diff -u llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.1 llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.2 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.cpp Thu Nov 30 10:50:26 2006 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp,v 1.1 2006/11/30 06:36:44 reid Exp $ + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp,v 1.2 2006/11/30 16:50:26 reid Exp $ */ #define FLEX_SCANNER @@ -842,16 +842,16 @@ char *yytext; #line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" #define INITIAL 0 -/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// +/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===// // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file implements the flex scanner for LLVM assembly languages files. +// This file implements the flex scanner for LLVM 1.9 assembly languages files. // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 @@ -863,16 +863,23 @@ #include #include -void set_scan_bytes (const char * str, size_t len) { - Upgrade_scan_bytes (str, len); -} - static void trim(std::string& str) { size_t startpos = str.find_first_not_of(" \t\n\r",0); if (startpos != std::string::npos) str.erase(0,startpos); } +#define YY_INPUT(buf,result,max_size) \ +{ \ + if (LexInput->good() && !LexInput->eof()) { \ + LexInput->read(buf,max_size); \ + result = LexInput->gcount(); \ + } else {\ + result = YY_NULL; \ + } \ +} + + // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ Upgradelval = new std::string(yytext); \ @@ -896,7 +903,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 900 "UpgradeLexer.cpp" +#line 907 "UpgradeLexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1047,10 +1054,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -#line 1054 "UpgradeLexer.cpp" +#line 1061 "UpgradeLexer.cpp" if ( yy_init ) { @@ -1143,571 +1150,571 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BEGINTOK); } YY_BREAK case 3: YY_RULE_SETUP -#line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDTOK); } YY_BREAK case 4: YY_RULE_SETUP -#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUETOK); } YY_BREAK case 5: YY_RULE_SETUP -#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FALSETOK); } YY_BREAK case 6: YY_RULE_SETUP -#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DECLARE); } YY_BREAK case 7: YY_RULE_SETUP -#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GLOBAL); } YY_BREAK case 8: YY_RULE_SETUP -#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CONSTANT); } YY_BREAK case 9: YY_RULE_SETUP -#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INTERNAL); } YY_BREAK case 10: YY_RULE_SETUP -#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LINKONCE); } YY_BREAK case 11: YY_RULE_SETUP -#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( WEAK); } YY_BREAK case 12: YY_RULE_SETUP -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( APPENDING); } YY_BREAK case 13: YY_RULE_SETUP -#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLIMPORT); } YY_BREAK case 14: YY_RULE_SETUP -#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLEXPORT); } YY_BREAK case 15: YY_RULE_SETUP -#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERN_WEAK); } YY_BREAK case 16: YY_RULE_SETUP -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERNAL); } YY_BREAK case 17: YY_RULE_SETUP -#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( IMPLEMENTATION); } YY_BREAK case 18: YY_RULE_SETUP -#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ZEROINITIALIZER); } YY_BREAK case 19: YY_RULE_SETUP -#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOTDOTDOT); } YY_BREAK case 20: YY_RULE_SETUP -#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNDEF); } YY_BREAK case 21: YY_RULE_SETUP -#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( NULL_TOK); } YY_BREAK case 22: YY_RULE_SETUP -#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TO); } YY_BREAK case 23: YY_RULE_SETUP -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TAIL); } YY_BREAK case 24: YY_RULE_SETUP -#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TARGET); } YY_BREAK case 25: YY_RULE_SETUP -#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRIPLE); } YY_BREAK case 26: YY_RULE_SETUP -#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DEPLIBS); } YY_BREAK case 27: YY_RULE_SETUP -#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDIAN); } YY_BREAK case 28: YY_RULE_SETUP -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( POINTERSIZE); } YY_BREAK case 29: YY_RULE_SETUP -#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DATALAYOUT); } YY_BREAK case 30: YY_RULE_SETUP -#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LITTLE); } YY_BREAK case 31: YY_RULE_SETUP -#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BIG); } YY_BREAK case 32: YY_RULE_SETUP -#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOLATILE); } YY_BREAK case 33: YY_RULE_SETUP -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALIGN); } YY_BREAK case 34: YY_RULE_SETUP -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SECTION); } YY_BREAK case 35: YY_RULE_SETUP -#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MODULE); } YY_BREAK case 36: YY_RULE_SETUP -#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASM_TOK); } YY_BREAK case 37: YY_RULE_SETUP -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SIDEEFFECT); } YY_BREAK case 38: YY_RULE_SETUP -#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CC_TOK); } YY_BREAK case 39: YY_RULE_SETUP -#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CCC_TOK); } YY_BREAK case 40: YY_RULE_SETUP -#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CSRETCC_TOK); } YY_BREAK case 41: YY_RULE_SETUP -#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FASTCC_TOK); } YY_BREAK case 42: YY_RULE_SETUP -#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( COLDCC_TOK); } YY_BREAK case 43: YY_RULE_SETUP -#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_STDCALLCC_TOK); } YY_BREAK case 44: YY_RULE_SETUP -#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_FASTCALLCC_TOK); } YY_BREAK case 45: YY_RULE_SETUP -#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOID); } YY_BREAK case 46: YY_RULE_SETUP -#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BOOL); } YY_BREAK case 47: YY_RULE_SETUP -#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SBYTE); } YY_BREAK case 48: YY_RULE_SETUP -#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UBYTE); } YY_BREAK case 49: YY_RULE_SETUP -#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHORT); } YY_BREAK case 50: YY_RULE_SETUP -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( USHORT); } YY_BREAK case 51: YY_RULE_SETUP -#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INT); } YY_BREAK case 52: YY_RULE_SETUP -#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINT); } YY_BREAK case 53: YY_RULE_SETUP -#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LONG); } YY_BREAK case 54: YY_RULE_SETUP -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ULONG); } YY_BREAK case 55: YY_RULE_SETUP -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FLOAT); } YY_BREAK case 56: YY_RULE_SETUP -#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOUBLE); } YY_BREAK case 57: YY_RULE_SETUP -#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABEL); } YY_BREAK case 58: YY_RULE_SETUP -#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TYPE); } YY_BREAK case 59: YY_RULE_SETUP -#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OPAQUE); } YY_BREAK case 60: YY_RULE_SETUP -#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ADD); } YY_BREAK case 61: YY_RULE_SETUP -#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SUB); } YY_BREAK case 62: YY_RULE_SETUP -#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MUL); } YY_BREAK case 63: YY_RULE_SETUP -#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 64: YY_RULE_SETUP -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 65: YY_RULE_SETUP -#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SDIV); } YY_BREAK case 66: YY_RULE_SETUP -#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FDIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 68: YY_RULE_SETUP -#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 69: YY_RULE_SETUP -#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SREM); } YY_BREAK case 70: YY_RULE_SETUP -#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREM); } YY_BREAK case 71: YY_RULE_SETUP -#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( AND); } YY_BREAK case 72: YY_RULE_SETUP -#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OR); } YY_BREAK case 73: YY_RULE_SETUP -#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( XOR); } YY_BREAK case 74: YY_RULE_SETUP -#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETNE); } YY_BREAK case 75: YY_RULE_SETUP -#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETEQ); } YY_BREAK case 76: YY_RULE_SETUP -#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLT); } YY_BREAK case 77: YY_RULE_SETUP -#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGT); } YY_BREAK case 78: YY_RULE_SETUP -#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLE); } YY_BREAK case 79: YY_RULE_SETUP -#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGE); } YY_BREAK case 80: YY_RULE_SETUP -#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( PHI_TOK); } YY_BREAK case 81: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CALL); } YY_BREAK case 82: YY_RULE_SETUP -#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUNC); } YY_BREAK case 83: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SELECT); } YY_BREAK case 84: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHL); } YY_BREAK case 85: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LSHR); } YY_BREAK case 86: YY_RULE_SETUP -#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASHR); } YY_BREAK case 87: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAARG); } YY_BREAK case 88: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( RET); } YY_BREAK case 89: YY_RULE_SETUP -#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BR); } YY_BREAK case 90: YY_RULE_SETUP -#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SWITCH); } YY_BREAK case 91: YY_RULE_SETUP -#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INVOKE); } YY_BREAK case 92: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNWIND); } YY_BREAK case 93: YY_RULE_SETUP -#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNREACHABLE); } YY_BREAK case 94: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MALLOC); } YY_BREAK case 95: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALLOCA); } YY_BREAK case 96: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREE); } YY_BREAK case 97: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LOAD); } YY_BREAK case 98: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STORE); } YY_BREAK case 99: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GETELEMENTPTR); } YY_BREAK case 100: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTRACTELEMENT); } YY_BREAK case 101: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INSERTELEMENT); } YY_BREAK case 102: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHUFFLEVECTOR); } YY_BREAK case 103: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAR_ID); } YY_BREAK case 104: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 105: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 106: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STRINGCONSTANT ); } YY_BREAK case 107: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EUINT64VAL ); } YY_BREAK case 108: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ESINT64VAL ); } YY_BREAK case 109: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } YY_BREAK case 110: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINTVAL); } YY_BREAK case 111: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SINTVAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case 113: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 225 "/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! @@ -1718,20 +1725,20 @@ YY_BREAK case 114: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore whitespace */ } YY_BREAK case 115: YY_RULE_SETUP -#line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return yytext[0]; } YY_BREAK case 116: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1735 "UpgradeLexer.cpp" +#line 1742 "UpgradeLexer.cpp" case YY_END_OF_BUFFER: { @@ -2609,5 +2616,5 @@ return 0; } #endif -#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.1 llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.2 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs Thu Nov 30 10:50:26 2006 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.1 2006/11/30 06:36:44 reid Exp $ + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.2 2006/11/30 16:50:26 reid Exp $ */ #define FLEX_SCANNER @@ -842,16 +842,16 @@ char *yytext; #line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" #define INITIAL 0 -/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// +/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===// // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file implements the flex scanner for LLVM assembly languages files. +// This file implements the flex scanner for LLVM 1.9 assembly languages files. // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 @@ -863,16 +863,23 @@ #include #include -void set_scan_bytes (const char * str, size_t len) { - Upgrade_scan_bytes (str, len); -} - static void trim(std::string& str) { size_t startpos = str.find_first_not_of(" \t\n\r",0); if (startpos != std::string::npos) str.erase(0,startpos); } +#define YY_INPUT(buf,result,max_size) \ +{ \ + if (LexInput->good() && !LexInput->eof()) { \ + LexInput->read(buf,max_size); \ + result = LexInput->gcount(); \ + } else {\ + result = YY_NULL; \ + } \ +} + + // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ Upgradelval = new std::string(yytext); \ @@ -896,7 +903,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 900 "UpgradeLexer.cpp" +#line 907 "UpgradeLexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1047,10 +1054,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -#line 1054 "UpgradeLexer.cpp" +#line 1061 "UpgradeLexer.cpp" if ( yy_init ) { @@ -1143,571 +1150,571 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BEGINTOK); } YY_BREAK case 3: YY_RULE_SETUP -#line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDTOK); } YY_BREAK case 4: YY_RULE_SETUP -#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUETOK); } YY_BREAK case 5: YY_RULE_SETUP -#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FALSETOK); } YY_BREAK case 6: YY_RULE_SETUP -#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DECLARE); } YY_BREAK case 7: YY_RULE_SETUP -#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GLOBAL); } YY_BREAK case 8: YY_RULE_SETUP -#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CONSTANT); } YY_BREAK case 9: YY_RULE_SETUP -#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INTERNAL); } YY_BREAK case 10: YY_RULE_SETUP -#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LINKONCE); } YY_BREAK case 11: YY_RULE_SETUP -#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( WEAK); } YY_BREAK case 12: YY_RULE_SETUP -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( APPENDING); } YY_BREAK case 13: YY_RULE_SETUP -#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLIMPORT); } YY_BREAK case 14: YY_RULE_SETUP -#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLEXPORT); } YY_BREAK case 15: YY_RULE_SETUP -#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERN_WEAK); } YY_BREAK case 16: YY_RULE_SETUP -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERNAL); } YY_BREAK case 17: YY_RULE_SETUP -#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( IMPLEMENTATION); } YY_BREAK case 18: YY_RULE_SETUP -#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ZEROINITIALIZER); } YY_BREAK case 19: YY_RULE_SETUP -#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOTDOTDOT); } YY_BREAK case 20: YY_RULE_SETUP -#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNDEF); } YY_BREAK case 21: YY_RULE_SETUP -#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( NULL_TOK); } YY_BREAK case 22: YY_RULE_SETUP -#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TO); } YY_BREAK case 23: YY_RULE_SETUP -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TAIL); } YY_BREAK case 24: YY_RULE_SETUP -#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TARGET); } YY_BREAK case 25: YY_RULE_SETUP -#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRIPLE); } YY_BREAK case 26: YY_RULE_SETUP -#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DEPLIBS); } YY_BREAK case 27: YY_RULE_SETUP -#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDIAN); } YY_BREAK case 28: YY_RULE_SETUP -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( POINTERSIZE); } YY_BREAK case 29: YY_RULE_SETUP -#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DATALAYOUT); } YY_BREAK case 30: YY_RULE_SETUP -#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LITTLE); } YY_BREAK case 31: YY_RULE_SETUP -#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BIG); } YY_BREAK case 32: YY_RULE_SETUP -#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOLATILE); } YY_BREAK case 33: YY_RULE_SETUP -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALIGN); } YY_BREAK case 34: YY_RULE_SETUP -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SECTION); } YY_BREAK case 35: YY_RULE_SETUP -#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MODULE); } YY_BREAK case 36: YY_RULE_SETUP -#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASM_TOK); } YY_BREAK case 37: YY_RULE_SETUP -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SIDEEFFECT); } YY_BREAK case 38: YY_RULE_SETUP -#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CC_TOK); } YY_BREAK case 39: YY_RULE_SETUP -#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CCC_TOK); } YY_BREAK case 40: YY_RULE_SETUP -#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CSRETCC_TOK); } YY_BREAK case 41: YY_RULE_SETUP -#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FASTCC_TOK); } YY_BREAK case 42: YY_RULE_SETUP -#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( COLDCC_TOK); } YY_BREAK case 43: YY_RULE_SETUP -#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_STDCALLCC_TOK); } YY_BREAK case 44: YY_RULE_SETUP -#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_FASTCALLCC_TOK); } YY_BREAK case 45: YY_RULE_SETUP -#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOID); } YY_BREAK case 46: YY_RULE_SETUP -#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BOOL); } YY_BREAK case 47: YY_RULE_SETUP -#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SBYTE); } YY_BREAK case 48: YY_RULE_SETUP -#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UBYTE); } YY_BREAK case 49: YY_RULE_SETUP -#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHORT); } YY_BREAK case 50: YY_RULE_SETUP -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( USHORT); } YY_BREAK case 51: YY_RULE_SETUP -#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INT); } YY_BREAK case 52: YY_RULE_SETUP -#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINT); } YY_BREAK case 53: YY_RULE_SETUP -#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LONG); } YY_BREAK case 54: YY_RULE_SETUP -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ULONG); } YY_BREAK case 55: YY_RULE_SETUP -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FLOAT); } YY_BREAK case 56: YY_RULE_SETUP -#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOUBLE); } YY_BREAK case 57: YY_RULE_SETUP -#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABEL); } YY_BREAK case 58: YY_RULE_SETUP -#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TYPE); } YY_BREAK case 59: YY_RULE_SETUP -#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OPAQUE); } YY_BREAK case 60: YY_RULE_SETUP -#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ADD); } YY_BREAK case 61: YY_RULE_SETUP -#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SUB); } YY_BREAK case 62: YY_RULE_SETUP -#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MUL); } YY_BREAK case 63: YY_RULE_SETUP -#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 64: YY_RULE_SETUP -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 65: YY_RULE_SETUP -#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SDIV); } YY_BREAK case 66: YY_RULE_SETUP -#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FDIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 68: YY_RULE_SETUP -#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 69: YY_RULE_SETUP -#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SREM); } YY_BREAK case 70: YY_RULE_SETUP -#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREM); } YY_BREAK case 71: YY_RULE_SETUP -#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( AND); } YY_BREAK case 72: YY_RULE_SETUP -#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OR); } YY_BREAK case 73: YY_RULE_SETUP -#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( XOR); } YY_BREAK case 74: YY_RULE_SETUP -#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETNE); } YY_BREAK case 75: YY_RULE_SETUP -#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETEQ); } YY_BREAK case 76: YY_RULE_SETUP -#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLT); } YY_BREAK case 77: YY_RULE_SETUP -#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGT); } YY_BREAK case 78: YY_RULE_SETUP -#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLE); } YY_BREAK case 79: YY_RULE_SETUP -#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGE); } YY_BREAK case 80: YY_RULE_SETUP -#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( PHI_TOK); } YY_BREAK case 81: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CALL); } YY_BREAK case 82: YY_RULE_SETUP -#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUNC); } YY_BREAK case 83: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SELECT); } YY_BREAK case 84: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHL); } YY_BREAK case 85: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LSHR); } YY_BREAK case 86: YY_RULE_SETUP -#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASHR); } YY_BREAK case 87: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAARG); } YY_BREAK case 88: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( RET); } YY_BREAK case 89: YY_RULE_SETUP -#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BR); } YY_BREAK case 90: YY_RULE_SETUP -#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SWITCH); } YY_BREAK case 91: YY_RULE_SETUP -#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INVOKE); } YY_BREAK case 92: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNWIND); } YY_BREAK case 93: YY_RULE_SETUP -#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNREACHABLE); } YY_BREAK case 94: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MALLOC); } YY_BREAK case 95: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALLOCA); } YY_BREAK case 96: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREE); } YY_BREAK case 97: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LOAD); } YY_BREAK case 98: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STORE); } YY_BREAK case 99: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GETELEMENTPTR); } YY_BREAK case 100: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTRACTELEMENT); } YY_BREAK case 101: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INSERTELEMENT); } YY_BREAK case 102: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHUFFLEVECTOR); } YY_BREAK case 103: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAR_ID); } YY_BREAK case 104: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 105: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 106: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STRINGCONSTANT ); } YY_BREAK case 107: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EUINT64VAL ); } YY_BREAK case 108: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ESINT64VAL ); } YY_BREAK case 109: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } YY_BREAK case 110: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINTVAL); } YY_BREAK case 111: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SINTVAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case 113: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 225 "/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! @@ -1718,20 +1725,20 @@ YY_BREAK case 114: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore whitespace */ } YY_BREAK case 115: YY_RULE_SETUP -#line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return yytext[0]; } YY_BREAK case 116: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1735 "UpgradeLexer.cpp" +#line 1742 "UpgradeLexer.cpp" case YY_END_OF_BUFFER: { @@ -2609,5 +2616,5 @@ return 0; } #endif -#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 236 "/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.1 llvm/tools/llvm-upgrade/UpgradeLexer.l:1.2 --- llvm/tools/llvm-upgrade/UpgradeLexer.l:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l Thu Nov 30 10:50:26 2006 @@ -32,16 +32,23 @@ #include #include -void set_scan_bytes (const char * str, size_t len) { - Upgrade_scan_bytes (str, len); -} - static void trim(std::string& str) { size_t startpos = str.find_first_not_of(" \t\n\r",0); if (startpos != std::string::npos) str.erase(0,startpos); } +#define YY_INPUT(buf,result,max_size) \ +{ \ + if (LexInput->good() && !LexInput->eof()) { \ + LexInput->read(buf,max_size); \ + result = LexInput->gcount(); \ + } else {\ + result = YY_NULL; \ + } \ +} + + // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ Upgradelval = new std::string(yytext); \ Index: llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.1 llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.2 --- llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs Thu Nov 30 10:50:26 2006 @@ -1,13 +1,13 @@ -/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// +/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===// // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file implements the flex scanner for LLVM assembly languages files. +// This file implements the flex scanner for LLVM 1.9 assembly languages files. // //===----------------------------------------------------------------------===*/ @@ -32,16 +32,23 @@ #include #include -void set_scan_bytes (const char * str, size_t len) { - Upgrade_scan_bytes (str, len); -} - static void trim(std::string& str) { size_t startpos = str.find_first_not_of(" \t\n\r",0); if (startpos != std::string::npos) str.erase(0,startpos); } +#define YY_INPUT(buf,result,max_size) \ +{ \ + if (LexInput->good() && !LexInput->eof()) { \ + LexInput->read(buf,max_size); \ + result = LexInput->gcount(); \ + } else {\ + result = YY_NULL; \ + } \ +} + + // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ Upgradelval = new std::string(yytext); \ Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.1 llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.2 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp Thu Nov 30 10:50:26 2006 @@ -321,12 +321,12 @@ #include "ParserInternals.h" #include -#include #include #include #include #include +#define YYINCLUDED_STDLIB_H int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -335,19 +335,14 @@ static std::ostream *O = 0; -void UpgradeAssembly(const std::string &infile, std::ostream &out) +std::istream* LexInput = 0; + +void UpgradeAssembly(const std::string &infile, std::istream& in, + std::ostream &out) { Upgradelineno = 1; CurFilename = infile; - llvm::sys::Path p(infile); - llvm::sys::MappedFile mf; - mf.open(p); - mf.map(); - const char* base = mf.charBase(); - size_t sz = mf.size(); - - set_scan_bytes(base, sz); - + LexInput = ∈ O = &out; if (yyparse()) { @@ -389,7 +384,7 @@ /* Line 219 of yacc.c. */ -#line 393 "UpgradeParser.tab.c" +#line 388 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -724,32 +719,32 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 89, 89, 89, 90, 90, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 95, 95, 95, 96, 96, - 96, 96, 96, 96, 97, 98, 98, 98, 102, 102, - 102, 102, 103, 103, 103, 103, 104, 104, 105, 105, - 108, 112, 117, 117, 117, 117, 117, 117, 118, 119, - 122, 122, 122, 122, 122, 123, 123, 124, 129, 130, - 133, 134, 142, 148, 149, 152, 153, 162, 163, 176, - 176, 177, 177, 178, 182, 182, 182, 182, 182, 182, - 182, 183, 183, 183, 183, 183, 183, 184, 184, 184, - 188, 192, 197, 203, 209, 214, 217, 225, 225, 232, - 233, 238, 241, 251, 256, 259, 264, 269, 274, 277, - 282, 287, 292, 297, 303, 308, 313, 318, 323, 330, - 335, 337, 339, 341, 343, 345, 347, 349, 351, 356, - 358, 363, 363, 373, 378, 381, 386, 389, 392, 396, - 401, 406, 411, 416, 421, 426, 431, 436, 441, 446, - 448, 448, 451, 456, 461, 466, 473, 480, 485, 486, - 494, 494, 495, 495, 497, 503, 506, 510, 513, 517, - 520, 524, 539, 542, 546, 555, 556, 558, 564, 565, - 566, 570, 580, 582, 585, 585, 585, 585, 585, 586, - 586, 586, 587, 592, 593, 602, 602, 605, 605, 611, - 617, 619, 626, 630, 635, 638, 644, 649, 654, 659, - 665, 671, 677, 686, 691, 697, 702, 709, 716, 721, - 729, 730, 738, 739, 743, 748, 751, 756, 761, 766, - 771, 776, 781, 786, 791, 796, 801, 806, 811, 820, - 825, 829, 833, 834, 837, 844, 851, 858, 865, 870, - 877, 884 + 0, 84, 84, 84, 85, 85, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 90, 90, 90, 91, 91, + 91, 91, 91, 91, 92, 93, 93, 93, 97, 97, + 97, 97, 98, 98, 98, 98, 99, 99, 100, 100, + 103, 107, 112, 112, 112, 112, 112, 112, 113, 114, + 117, 117, 117, 117, 117, 118, 118, 119, 124, 125, + 128, 129, 137, 143, 144, 147, 148, 157, 158, 171, + 171, 172, 172, 173, 177, 177, 177, 177, 177, 177, + 177, 178, 178, 178, 178, 178, 178, 179, 179, 179, + 183, 187, 192, 198, 204, 209, 212, 220, 220, 227, + 228, 233, 236, 246, 251, 254, 259, 264, 269, 272, + 277, 282, 287, 292, 298, 303, 308, 313, 318, 325, + 330, 332, 334, 336, 338, 340, 342, 344, 346, 351, + 353, 358, 358, 368, 373, 376, 381, 384, 387, 391, + 396, 401, 406, 411, 416, 421, 426, 431, 436, 441, + 443, 443, 446, 451, 456, 461, 468, 475, 480, 481, + 489, 489, 490, 490, 492, 498, 501, 505, 508, 512, + 515, 519, 534, 537, 541, 550, 551, 553, 559, 560, + 561, 565, 575, 577, 580, 580, 580, 580, 580, 581, + 581, 581, 582, 587, 588, 597, 597, 600, 600, 606, + 612, 614, 621, 625, 630, 633, 639, 644, 649, 654, + 660, 666, 672, 681, 686, 692, 697, 704, 711, 716, + 724, 725, 733, 734, 738, 743, 746, 751, 756, 761, + 766, 771, 776, 781, 786, 791, 796, 801, 806, 815, + 820, 824, 828, 829, 832, 839, 846, 853, 860, 865, + 872, 879 }; #endif @@ -2009,7 +2004,7 @@ switch (yyn) { case 40: -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->append(" = "); (yyval) = (yyvsp[-1]); @@ -2017,39 +2012,39 @@ break; case 41: -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 49: -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 57: -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 58: -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 59: -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); (yyval) = (yyvsp[-1]); ;} break; case 60: -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 61: -#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, ", "); *(yyvsp[-1]) += " " + *(yyvsp[0]); @@ -2059,7 +2054,7 @@ break; case 62: -#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2068,17 +2063,17 @@ break; case 63: -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 65: -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 66: -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, ", "); if (!(yyvsp[0])->empty()) @@ -2089,7 +2084,7 @@ break; case 68: -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2098,7 +2093,7 @@ break; case 90: -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference (yyvsp[0])->insert(0, "\\"); (yyval) = (yyvsp[0]); @@ -2106,7 +2101,7 @@ break; case 91: -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? *(yyvsp[-3]) += "( " + *(yyvsp[-1]) + " )"; delete (yyvsp[-1]); @@ -2115,7 +2110,7 @@ break; case 92: -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyvsp[-3])->insert(0,"[ "); *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " ]"; @@ -2125,7 +2120,7 @@ break; case 93: -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? (yyvsp[-3])->insert(0,"< "); *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " >"; @@ -2135,7 +2130,7 @@ break; case 94: -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? (yyvsp[-1])->insert(0, "{ "); *(yyvsp[-1]) += " }"; @@ -2144,14 +2139,14 @@ break; case 95: -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval) = new std::string("{ }"); ;} break; case 96: -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? *(yyvsp[-1]) += '*'; (yyval) = (yyvsp[-1]); @@ -2159,7 +2154,7 @@ break; case 98: -#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2168,7 +2163,7 @@ break; case 100: -#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", ..."; delete (yyvsp[0]); @@ -2177,21 +2172,21 @@ break; case 101: -#line 238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 102: -#line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 103: -#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 246 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr *(yyvsp[-3]) += " [ " + *(yyvsp[-1]) + " ]"; delete (yyvsp[-1]); @@ -2200,14 +2195,14 @@ break; case 104: -#line 256 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("[ ]"); ;} break; case 105: -#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 254 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " c" + *(yyvsp[0]); delete (yyvsp[0]); @@ -2216,7 +2211,7 @@ break; case 106: -#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr *(yyvsp[-3]) += " < " + *(yyvsp[-1]) + " >"; delete (yyvsp[-1]); @@ -2225,7 +2220,7 @@ break; case 107: -#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " { " + *(yyvsp[-1]) + " }"; delete (yyvsp[-1]); @@ -2234,14 +2229,14 @@ break; case 108: -#line 274 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("[ ]"); ;} break; case 109: -#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 272 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2250,7 +2245,7 @@ break; case 110: -#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2259,7 +2254,7 @@ break; case 111: -#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2268,7 +2263,7 @@ break; case 112: -#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2277,7 +2272,7 @@ break; case 113: -#line 297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2286,7 +2281,7 @@ break; case 114: -#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 298 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2295,7 +2290,7 @@ break; case 115: -#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2304,7 +2299,7 @@ break; case 116: -#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2313,7 +2308,7 @@ break; case 117: -#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2322,7 +2317,7 @@ break; case 118: -#line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2331,7 +2326,7 @@ break; case 119: -#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 325 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " (" + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ")"; delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); @@ -2340,96 +2335,96 @@ break; case 120: -#line 335 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 121: -#line 337 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 122: -#line 339 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 334 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 123: -#line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 124: -#line 343 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 338 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 125: -#line 345 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 126: -#line 347 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 342 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 127: -#line 349 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 344 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 128: -#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 346 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 129: -#line 356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 130: -#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 353 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 131: -#line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 132: -#line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 133: -#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 368 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 134: -#line 378 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 135: -#line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 376 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2438,27 +2433,27 @@ break; case 136: -#line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << "module asm " << " " << *(yyvsp[0]) << "\n"; ;} break; case 137: -#line 389 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 384 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << "implementation\n"; ;} break; case 138: -#line 392 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 387 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 139: -#line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 391 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2467,7 +2462,7 @@ break; case 140: -#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2476,7 +2471,7 @@ break; case 141: -#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2485,7 +2480,7 @@ break; case 142: -#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2494,7 +2489,7 @@ break; case 143: -#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2503,7 +2498,7 @@ break; case 144: -#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2512,7 +2507,7 @@ break; case 145: -#line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2521,7 +2516,7 @@ break; case 146: -#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2530,7 +2525,7 @@ break; case 147: -#line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-2]) << " = " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2539,14 +2534,14 @@ break; case 148: -#line 441 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 152: -#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 446 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2555,7 +2550,7 @@ break; case 153: -#line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2564,7 +2559,7 @@ break; case 154: -#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2573,7 +2568,7 @@ break; case 155: -#line 466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2582,7 +2577,7 @@ break; case 156: -#line 473 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 468 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, "[ "); *(yyvsp[-1]) += " ]"; @@ -2591,7 +2586,7 @@ break; case 157: -#line 480 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 475 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2600,19 +2595,19 @@ break; case 159: -#line 486 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 481 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 163: -#line 495 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 490 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 164: -#line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 492 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -2621,28 +2616,28 @@ break; case 165: -#line 503 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 498 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); ;} break; case 166: -#line 506 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 501 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 167: -#line 510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 505 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 168: -#line 513 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 508 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", ..."; (yyval) = (yyvsp[-2]); @@ -2650,21 +2645,21 @@ break; case 169: -#line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 512 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 170: -#line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 515 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 171: -#line 525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-7])->empty()) { (yyvsp[-6])->insert(0, *(yyvsp[-7]) + " "); @@ -2681,21 +2676,21 @@ break; case 172: -#line 539 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 534 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("begin"); ;} break; case 173: -#line 542 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string ("{"); ;} break; case 174: -#line 546 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 541 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-2])->empty()) { *O << *(yyvsp[-2]) << " "; @@ -2707,17 +2702,17 @@ break; case 175: -#line 555 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 550 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("end"); ;} break; case 176: -#line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 551 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("}"); ;} break; case 177: -#line 558 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 553 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1])) *O << *(yyvsp[-1]); @@ -2726,7 +2721,7 @@ break; case 181: -#line 570 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 565 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2735,19 +2730,19 @@ break; case 182: -#line 580 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 575 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 183: -#line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 577 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 192: -#line 587 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, "<"); *(yyvsp[-1]) += ">"; @@ -2756,7 +2751,7 @@ break; case 194: -#line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 588 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-3])->empty()) { *(yyvsp[-4]) += " " + *(yyvsp[-3]); @@ -2768,7 +2763,7 @@ break; case 199: -#line 611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 606 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2777,26 +2772,26 @@ break; case 200: -#line 617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 612 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 201: -#line 619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 614 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks ;} break; case 202: -#line 626 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-1]) ; ;} break; case 203: -#line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 625 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2805,14 +2800,14 @@ break; case 204: -#line 635 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 205: -#line 638 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 633 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2821,7 +2816,7 @@ break; case 206: -#line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 639 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2830,7 +2825,7 @@ break; case 207: -#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2839,7 +2834,7 @@ break; case 208: -#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... *O << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2848,7 +2843,7 @@ break; case 209: -#line 659 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << ", " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; @@ -2858,7 +2853,7 @@ break; case 210: -#line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 660 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " [" << *(yyvsp[-1]) << " ]\n"; @@ -2868,7 +2863,7 @@ break; case 211: -#line 671 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 666 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << " " << *(yyvsp[-5]) << ", " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << "[]\n"; @@ -2878,7 +2873,7 @@ break; case 212: -#line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 673 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-12]) << " " << *(yyvsp[-11]) << " " << *(yyvsp[-10]) << " " << *(yyvsp[-9]) << " (" << *(yyvsp[-7]) << ") " << *(yyvsp[-5]) << " " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " @@ -2890,7 +2885,7 @@ break; case 213: -#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 681 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2899,7 +2894,7 @@ break; case 214: -#line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2908,7 +2903,7 @@ break; case 215: -#line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 692 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2917,7 +2912,7 @@ break; case 216: -#line 702 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2926,7 +2921,7 @@ break; case 217: -#line 709 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 704 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += *(yyvsp[0]); delete (yyvsp[0]); @@ -2935,7 +2930,7 @@ break; case 218: -#line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 711 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes *(yyvsp[-5]) += " [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; delete (yyvsp[-3]); delete (yyvsp[-1]); @@ -2944,7 +2939,7 @@ break; case 219: -#line 721 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-6]) += ", [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; delete (yyvsp[-3]); delete (yyvsp[-1]); @@ -2953,7 +2948,7 @@ break; case 221: -#line 730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 725 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2962,12 +2957,12 @@ break; case 223: -#line 739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 224: -#line 743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 738 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2976,7 +2971,7 @@ break; case 226: -#line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 746 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2985,7 +2980,7 @@ break; case 227: -#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2994,7 +2989,7 @@ break; case 228: -#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3003,7 +2998,7 @@ break; case 229: -#line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3012,7 +3007,7 @@ break; case 230: -#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3021,7 +3016,7 @@ break; case 231: -#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -3030,7 +3025,7 @@ break; case 232: -#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3039,7 +3034,7 @@ break; case 233: -#line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3048,7 +3043,7 @@ break; case 234: -#line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3057,7 +3052,7 @@ break; case 235: -#line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3066,7 +3061,7 @@ break; case 236: -#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3075,7 +3070,7 @@ break; case 237: -#line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3084,7 +3079,7 @@ break; case 238: -#line 811 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5])->empty()) *(yyvsp[-6]) += " " + *(yyvsp[-5]); @@ -3097,7 +3092,7 @@ break; case 240: -#line 825 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 820 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[0])->insert(0, ", "); (yyval) = (yyvsp[0]); @@ -3105,17 +3100,17 @@ break; case 241: -#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 824 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 243: -#line 834 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 244: -#line 837 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 832 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3126,7 +3121,7 @@ break; case 245: -#line 844 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 839 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3137,7 +3132,7 @@ break; case 246: -#line 851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 846 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3148,7 +3143,7 @@ break; case 247: -#line 858 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 853 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3159,7 +3154,7 @@ break; case 248: -#line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 860 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3168,7 +3163,7 @@ break; case 249: -#line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-3])->empty()) *(yyvsp[-3]) += " "; @@ -3179,7 +3174,7 @@ break; case 250: -#line 877 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 872 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5])->empty()) *(yyvsp[-5]) += " "; @@ -3190,7 +3185,7 @@ break; case 251: -#line 884 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 879 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -3203,7 +3198,7 @@ } /* Line 1126 of yacc.c. */ -#line 3207 "UpgradeParser.tab.c" +#line 3202 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -3471,7 +3466,7 @@ } -#line 890 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 885 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.1 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.2 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Thu Nov 30 10:50:26 2006 @@ -321,12 +321,12 @@ #include "ParserInternals.h" #include -#include #include #include #include #include +#define YYINCLUDED_STDLIB_H int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -335,19 +335,14 @@ static std::ostream *O = 0; -void UpgradeAssembly(const std::string &infile, std::ostream &out) +std::istream* LexInput = 0; + +void UpgradeAssembly(const std::string &infile, std::istream& in, + std::ostream &out) { Upgradelineno = 1; CurFilename = infile; - llvm::sys::Path p(infile); - llvm::sys::MappedFile mf; - mf.open(p); - mf.map(); - const char* base = mf.charBase(); - size_t sz = mf.size(); - - set_scan_bytes(base, sz); - + LexInput = ∈ O = &out; if (yyparse()) { @@ -389,7 +384,7 @@ /* Line 219 of yacc.c. */ -#line 393 "UpgradeParser.tab.c" +#line 388 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -724,32 +719,32 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 89, 89, 89, 90, 90, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 95, 95, 95, 96, 96, - 96, 96, 96, 96, 97, 98, 98, 98, 102, 102, - 102, 102, 103, 103, 103, 103, 104, 104, 105, 105, - 108, 112, 117, 117, 117, 117, 117, 117, 118, 119, - 122, 122, 122, 122, 122, 123, 123, 124, 129, 130, - 133, 134, 142, 148, 149, 152, 153, 162, 163, 176, - 176, 177, 177, 178, 182, 182, 182, 182, 182, 182, - 182, 183, 183, 183, 183, 183, 183, 184, 184, 184, - 188, 192, 197, 203, 209, 214, 217, 225, 225, 232, - 233, 238, 241, 251, 256, 259, 264, 269, 274, 277, - 282, 287, 292, 297, 303, 308, 313, 318, 323, 330, - 335, 337, 339, 341, 343, 345, 347, 349, 351, 356, - 358, 363, 363, 373, 378, 381, 386, 389, 392, 396, - 401, 406, 411, 416, 421, 426, 431, 436, 441, 446, - 448, 448, 451, 456, 461, 466, 473, 480, 485, 486, - 494, 494, 495, 495, 497, 503, 506, 510, 513, 517, - 520, 524, 539, 542, 546, 555, 556, 558, 564, 565, - 566, 570, 580, 582, 585, 585, 585, 585, 585, 586, - 586, 586, 587, 592, 593, 602, 602, 605, 605, 611, - 617, 619, 626, 630, 635, 638, 644, 649, 654, 659, - 665, 671, 677, 686, 691, 697, 702, 709, 716, 721, - 729, 730, 738, 739, 743, 748, 751, 756, 761, 766, - 771, 776, 781, 786, 791, 796, 801, 806, 811, 820, - 825, 829, 833, 834, 837, 844, 851, 858, 865, 870, - 877, 884 + 0, 84, 84, 84, 85, 85, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 90, 90, 90, 91, 91, + 91, 91, 91, 91, 92, 93, 93, 93, 97, 97, + 97, 97, 98, 98, 98, 98, 99, 99, 100, 100, + 103, 107, 112, 112, 112, 112, 112, 112, 113, 114, + 117, 117, 117, 117, 117, 118, 118, 119, 124, 125, + 128, 129, 137, 143, 144, 147, 148, 157, 158, 171, + 171, 172, 172, 173, 177, 177, 177, 177, 177, 177, + 177, 178, 178, 178, 178, 178, 178, 179, 179, 179, + 183, 187, 192, 198, 204, 209, 212, 220, 220, 227, + 228, 233, 236, 246, 251, 254, 259, 264, 269, 272, + 277, 282, 287, 292, 298, 303, 308, 313, 318, 325, + 330, 332, 334, 336, 338, 340, 342, 344, 346, 351, + 353, 358, 358, 368, 373, 376, 381, 384, 387, 391, + 396, 401, 406, 411, 416, 421, 426, 431, 436, 441, + 443, 443, 446, 451, 456, 461, 468, 475, 480, 481, + 489, 489, 490, 490, 492, 498, 501, 505, 508, 512, + 515, 519, 534, 537, 541, 550, 551, 553, 559, 560, + 561, 565, 575, 577, 580, 580, 580, 580, 580, 581, + 581, 581, 582, 587, 588, 597, 597, 600, 600, 606, + 612, 614, 621, 625, 630, 633, 639, 644, 649, 654, + 660, 666, 672, 681, 686, 692, 697, 704, 711, 716, + 724, 725, 733, 734, 738, 743, 746, 751, 756, 761, + 766, 771, 776, 781, 786, 791, 796, 801, 806, 815, + 820, 824, 828, 829, 832, 839, 846, 853, 860, 865, + 872, 879 }; #endif @@ -2009,7 +2004,7 @@ switch (yyn) { case 40: -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->append(" = "); (yyval) = (yyvsp[-1]); @@ -2017,39 +2012,39 @@ break; case 41: -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 49: -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 57: -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(""); ;} break; case 58: -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 59: -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); (yyval) = (yyvsp[-1]); ;} break; case 60: -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 61: -#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, ", "); *(yyvsp[-1]) += " " + *(yyvsp[0]); @@ -2059,7 +2054,7 @@ break; case 62: -#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2068,17 +2063,17 @@ break; case 63: -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 65: -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 66: -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, ", "); if (!(yyvsp[0])->empty()) @@ -2089,7 +2084,7 @@ break; case 68: -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2098,7 +2093,7 @@ break; case 90: -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference (yyvsp[0])->insert(0, "\\"); (yyval) = (yyvsp[0]); @@ -2106,7 +2101,7 @@ break; case 91: -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? *(yyvsp[-3]) += "( " + *(yyvsp[-1]) + " )"; delete (yyvsp[-1]); @@ -2115,7 +2110,7 @@ break; case 92: -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyvsp[-3])->insert(0,"[ "); *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " ]"; @@ -2125,7 +2120,7 @@ break; case 93: -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? (yyvsp[-3])->insert(0,"< "); *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " >"; @@ -2135,7 +2130,7 @@ break; case 94: -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? (yyvsp[-1])->insert(0, "{ "); *(yyvsp[-1]) += " }"; @@ -2144,14 +2139,14 @@ break; case 95: -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval) = new std::string("{ }"); ;} break; case 96: -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? *(yyvsp[-1]) += '*'; (yyval) = (yyvsp[-1]); @@ -2159,7 +2154,7 @@ break; case 98: -#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2168,7 +2163,7 @@ break; case 100: -#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", ..."; delete (yyvsp[0]); @@ -2177,21 +2172,21 @@ break; case 101: -#line 238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 102: -#line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 103: -#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 246 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr *(yyvsp[-3]) += " [ " + *(yyvsp[-1]) + " ]"; delete (yyvsp[-1]); @@ -2200,14 +2195,14 @@ break; case 104: -#line 256 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("[ ]"); ;} break; case 105: -#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 254 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " c" + *(yyvsp[0]); delete (yyvsp[0]); @@ -2216,7 +2211,7 @@ break; case 106: -#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr *(yyvsp[-3]) += " < " + *(yyvsp[-1]) + " >"; delete (yyvsp[-1]); @@ -2225,7 +2220,7 @@ break; case 107: -#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " { " + *(yyvsp[-1]) + " }"; delete (yyvsp[-1]); @@ -2234,14 +2229,14 @@ break; case 108: -#line 274 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("[ ]"); ;} break; case 109: -#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 272 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2250,7 +2245,7 @@ break; case 110: -#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2259,7 +2254,7 @@ break; case 111: -#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2268,7 +2263,7 @@ break; case 112: -#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2277,7 +2272,7 @@ break; case 113: -#line 297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2286,7 +2281,7 @@ break; case 114: -#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 298 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2295,7 +2290,7 @@ break; case 115: -#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // integral constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2304,7 +2299,7 @@ break; case 116: -#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2313,7 +2308,7 @@ break; case 117: -#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2322,7 +2317,7 @@ break; case 118: -#line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2331,7 +2326,7 @@ break; case 119: -#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 325 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " (" + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ")"; delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); @@ -2340,96 +2335,96 @@ break; case 120: -#line 335 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 121: -#line 337 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 122: -#line 339 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 334 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 123: -#line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 124: -#line 343 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 338 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 125: -#line 345 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 126: -#line 347 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 342 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 127: -#line 349 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 344 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 128: -#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 346 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 129: -#line 356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 130: -#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 353 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 131: -#line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 132: -#line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 133: -#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 368 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 134: -#line 378 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 135: -#line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 376 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2438,27 +2433,27 @@ break; case 136: -#line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << "module asm " << " " << *(yyvsp[0]) << "\n"; ;} break; case 137: -#line 389 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 384 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << "implementation\n"; ;} break; case 138: -#line 392 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 387 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 139: -#line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 391 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2467,7 +2462,7 @@ break; case 140: -#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2476,7 +2471,7 @@ break; case 141: -#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2485,7 +2480,7 @@ break; case 142: -#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2494,7 +2489,7 @@ break; case 143: -#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2503,7 +2498,7 @@ break; case 144: -#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2512,7 +2507,7 @@ break; case 145: -#line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2521,7 +2516,7 @@ break; case 146: -#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2530,7 +2525,7 @@ break; case 147: -#line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-2]) << " = " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2539,14 +2534,14 @@ break; case 148: -#line 441 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 152: -#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 446 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2555,7 +2550,7 @@ break; case 153: -#line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2564,7 +2559,7 @@ break; case 154: -#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2573,7 +2568,7 @@ break; case 155: -#line 466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " = " + *(yyvsp[-1]); delete (yyvsp[-1]); @@ -2582,7 +2577,7 @@ break; case 156: -#line 473 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 468 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, "[ "); *(yyvsp[-1]) += " ]"; @@ -2591,7 +2586,7 @@ break; case 157: -#line 480 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 475 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2600,19 +2595,19 @@ break; case 159: -#line 486 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 481 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 163: -#line 495 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 490 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 164: -#line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 492 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -2621,28 +2616,28 @@ break; case 165: -#line 503 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 498 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); ;} break; case 166: -#line 506 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 501 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 167: -#line 510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 505 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 168: -#line 513 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 508 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", ..."; (yyval) = (yyvsp[-2]); @@ -2650,21 +2645,21 @@ break; case 169: -#line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 512 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = (yyvsp[0]); ;} break; case 170: -#line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 515 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 171: -#line 525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-7])->empty()) { (yyvsp[-6])->insert(0, *(yyvsp[-7]) + " "); @@ -2681,21 +2676,21 @@ break; case 172: -#line 539 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 534 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("begin"); ;} break; case 173: -#line 542 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string ("{"); ;} break; case 174: -#line 546 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 541 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-2])->empty()) { *O << *(yyvsp[-2]) << " "; @@ -2707,17 +2702,17 @@ break; case 175: -#line 555 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 550 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("end"); ;} break; case 176: -#line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 551 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string("}"); ;} break; case 177: -#line 558 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 553 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1])) *O << *(yyvsp[-1]); @@ -2726,7 +2721,7 @@ break; case 181: -#line 570 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 565 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2735,19 +2730,19 @@ break; case 182: -#line 580 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 575 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 183: -#line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 577 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 192: -#line 587 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1])->insert(0, "<"); *(yyvsp[-1]) += ">"; @@ -2756,7 +2751,7 @@ break; case 194: -#line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 588 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-3])->empty()) { *(yyvsp[-4]) += " " + *(yyvsp[-3]); @@ -2768,7 +2763,7 @@ break; case 199: -#line 611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 606 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2777,26 +2772,26 @@ break; case 200: -#line 617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 612 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 201: -#line 619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 614 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks ;} break; case 202: -#line 626 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[-1]) ; ;} break; case 203: -#line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 625 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2805,14 +2800,14 @@ break; case 204: -#line 635 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = 0; ;} break; case 205: -#line 638 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 633 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2821,7 +2816,7 @@ break; case 206: -#line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 639 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2830,7 +2825,7 @@ break; case 207: -#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2839,7 +2834,7 @@ break; case 208: -#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... *O << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2848,7 +2843,7 @@ break; case 209: -#line 659 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << ", " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; @@ -2858,7 +2853,7 @@ break; case 210: -#line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 660 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " [" << *(yyvsp[-1]) << " ]\n"; @@ -2868,7 +2863,7 @@ break; case 211: -#line 671 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 666 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << " " << *(yyvsp[-5]) << ", " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << "[]\n"; @@ -2878,7 +2873,7 @@ break; case 212: -#line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 673 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[-12]) << " " << *(yyvsp[-11]) << " " << *(yyvsp[-10]) << " " << *(yyvsp[-9]) << " (" << *(yyvsp[-7]) << ") " << *(yyvsp[-5]) << " " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " @@ -2890,7 +2885,7 @@ break; case 213: -#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 681 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2899,7 +2894,7 @@ break; case 214: -#line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *O << " " << *(yyvsp[0]) << "\n"; delete (yyvsp[0]); @@ -2908,7 +2903,7 @@ break; case 215: -#line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 692 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2917,7 +2912,7 @@ break; case 216: -#line 702 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -2926,7 +2921,7 @@ break; case 217: -#line 709 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 704 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += *(yyvsp[0]); delete (yyvsp[0]); @@ -2935,7 +2930,7 @@ break; case 218: -#line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 711 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes *(yyvsp[-5]) += " [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; delete (yyvsp[-3]); delete (yyvsp[-1]); @@ -2944,7 +2939,7 @@ break; case 219: -#line 721 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-6]) += ", [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; delete (yyvsp[-3]); delete (yyvsp[-1]); @@ -2953,7 +2948,7 @@ break; case 221: -#line 730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 725 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += ", " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2962,12 +2957,12 @@ break; case 223: -#line 739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 224: -#line 743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 738 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -2976,7 +2971,7 @@ break; case 226: -#line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 746 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2985,7 +2980,7 @@ break; case 227: -#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -2994,7 +2989,7 @@ break; case 228: -#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3003,7 +2998,7 @@ break; case 229: -#line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3012,7 +3007,7 @@ break; case 230: -#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3021,7 +3016,7 @@ break; case 231: -#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -3030,7 +3025,7 @@ break; case 232: -#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3039,7 +3034,7 @@ break; case 233: -#line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3048,7 +3043,7 @@ break; case 234: -#line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3057,7 +3052,7 @@ break; case 235: -#line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3066,7 +3061,7 @@ break; case 236: -#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); @@ -3075,7 +3070,7 @@ break; case 237: -#line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3084,7 +3079,7 @@ break; case 238: -#line 811 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5])->empty()) *(yyvsp[-6]) += " " + *(yyvsp[-5]); @@ -3097,7 +3092,7 @@ break; case 240: -#line 825 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 820 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[0])->insert(0, ", "); (yyval) = (yyvsp[0]); @@ -3105,17 +3100,17 @@ break; case 241: -#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 824 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 243: -#line 834 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { (yyval) = new std::string(); ;} break; case 244: -#line 837 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 832 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3126,7 +3121,7 @@ break; case 245: -#line 844 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 839 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3137,7 +3132,7 @@ break; case 246: -#line 851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 846 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-2]) += " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3148,7 +3143,7 @@ break; case 247: -#line 858 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 853 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); if (!(yyvsp[0])->empty()) @@ -3159,7 +3154,7 @@ break; case 248: -#line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 860 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); @@ -3168,7 +3163,7 @@ break; case 249: -#line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-3])->empty()) *(yyvsp[-3]) += " "; @@ -3179,7 +3174,7 @@ break; case 250: -#line 877 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 872 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5])->empty()) *(yyvsp[-5]) += " "; @@ -3190,7 +3185,7 @@ break; case 251: -#line 884 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 879 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); @@ -3203,7 +3198,7 @@ } /* Line 1126 of yacc.c. */ -#line 3207 "UpgradeParser.tab.c" +#line 3202 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -3471,7 +3466,7 @@ } -#line 890 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 885 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.1 llvm/tools/llvm-upgrade/UpgradeParser.y:1.2 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Thu Nov 30 10:50:26 2006 @@ -17,12 +17,12 @@ #include "ParserInternals.h" #include -#include #include #include #include #include +#define YYINCLUDED_STDLIB_H int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -31,19 +31,14 @@ static std::ostream *O = 0; -void UpgradeAssembly(const std::string &infile, std::ostream &out) +std::istream* LexInput = 0; + +void UpgradeAssembly(const std::string &infile, std::istream& in, + std::ostream &out) { Upgradelineno = 1; CurFilename = infile; - llvm::sys::Path p(infile); - llvm::sys::MappedFile mf; - mf.open(p); - mf.map(); - const char* base = mf.charBase(); - size_t sz = mf.size(); - - set_scan_bytes(base, sz); - + LexInput = ∈ O = &out; if (yyparse()) { Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.1 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.2 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Thu Nov 30 10:50:26 2006 @@ -1,4 +1,4 @@ -//===-- upgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// +//===-- UpgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements the bison parser for LLVM assembly language upgrade. +// This file implements the bison parser for LLVM 1.9 assembly language. // //===----------------------------------------------------------------------===// @@ -17,12 +17,12 @@ #include "ParserInternals.h" #include -#include #include #include #include #include +#define YYINCLUDED_STDLIB_H int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -31,19 +31,14 @@ static std::ostream *O = 0; -void UpgradeAssembly(const std::string &infile, std::ostream &out) +std::istream* LexInput = 0; + +void UpgradeAssembly(const std::string &infile, std::istream& in, + std::ostream &out) { Upgradelineno = 1; CurFilename = infile; - llvm::sys::Path p(infile); - llvm::sys::MappedFile mf; - mf.open(p); - mf.map(); - const char* base = mf.charBase(); - size_t sz = mf.size(); - - set_scan_bytes(base, sz); - + LexInput = ∈ O = &out; if (yyparse()) { Index: llvm/tools/llvm-upgrade/llvm-upgrade.cpp diff -u llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.1 llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.2 --- llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.1 Thu Nov 30 00:36:44 2006 +++ llvm/tools/llvm-upgrade/llvm-upgrade.cpp Thu Nov 30 10:50:26 2006 @@ -34,7 +34,7 @@ static cl::opt OutputFilename("o", cl::desc("Override output filename"), - cl::value_desc("filename")); + cl::value_desc("filename"), cl::init("-")); static cl::opt Force("f", cl::desc("Overwrite output files")); @@ -45,6 +45,7 @@ int exitCode = 0; std::ostream *Out = 0; + std::istream *In = 0; try { if (OutputFilename != "") { // Specified an output filename? if (OutputFilename != "-") { // Not stdout? @@ -84,25 +85,35 @@ } Out = new std::ofstream(OutputFilename.c_str(), std::ios::out | - std::ios::trunc | std::ios::binary); + std::ios::trunc); // Make sure that the Out file gets unlinked from the disk if we get a // SIGINT sys::RemoveFileOnSignal(sys::Path(OutputFilename)); } } + if (InputFilename == "-") { + In = &std::cin; + InputFilename = ""; + } else { + In = new std::ifstream(InputFilename.c_str()); + } + if (!Out->good()) { llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } - UpgradeAssembly(InputFilename, *Out); + if (!In->good()) { + llvm_cerr << argv[0] << ": error opening " << InputFilename << "!\n"; + return 1; + } + + UpgradeAssembly(InputFilename, *In, *Out); - /* } catch (const std::string& caught_message) { llvm_cerr << argv[0] << ": " << caught_message << "\n"; exitCode = 1; - */ } catch (...) { llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; exitCode = 1; From sabre at nondot.org Thu Nov 30 11:26:22 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 11:26:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200611301726.kAUHQMZW019825@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.73 -> 1.74 --- Log message: Fix a bug in globalopt due to the recent cast patch. --- 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.73 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.74 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.73 Sun Nov 26 19:05:10 2006 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Nov 30 11:26:08 2006 @@ -1713,7 +1713,8 @@ getVal(Values, SI->getOperand(0)), getVal(Values, SI->getOperand(1))); } else if (CastInst *CI = dyn_cast(CurInst)) { - InstResult = ConstantExpr::getCast(getVal(Values, CI->getOperand(0)), + InstResult = ConstantExpr::getCast(CI->getOpcode(), + getVal(Values, CI->getOperand(0)), CI->getType()); } else if (SelectInst *SI = dyn_cast(CurInst)) { InstResult = ConstantExpr::getSelect(getVal(Values, SI->getOperand(0)), From sabre at nondot.org Thu Nov 30 11:32:44 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 11:32:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200611301732.kAUHWihO019968@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.74 -> 1.75 --- Log message: One more bugfix, 3 cases of making casts explicit. --- Diffs of the changes: (+8 -5) GlobalOpt.cpp | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.74 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.75 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.74 Thu Nov 30 11:26:08 2006 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Nov 30 11:32:29 2006 @@ -572,7 +572,8 @@ } } else if (CastInst *CI = dyn_cast(I)) { Changed |= OptimizeAwayTrappingUsesOfValue(CI, - ConstantExpr::getCast(NewV, CI->getType())); + ConstantExpr::getCast(CI->getOpcode(), + NewV, CI->getType())); if (CI->use_empty()) { Changed = true; CI->eraseFromParent(); @@ -670,7 +671,7 @@ /// variable, and transforms the program as if it always contained the result of /// the specified malloc. Because it is always the result of the specified /// malloc, there is no reason to actually DO the malloc. Instead, turn the -/// malloc into a global, and any laods of GV as uses of the new global. +/// malloc into a global, and any loads of GV as uses of the new global. static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, MallocInst *MI) { DOUT << "PROMOTING MALLOC GLOBAL: " << *GV << " MALLOC = " << *MI; @@ -707,7 +708,8 @@ Constant *RepValue = NewGV; if (NewGV->getType() != GV->getType()->getElementType()) - RepValue = ConstantExpr::getCast(RepValue, GV->getType()->getElementType()); + RepValue = ConstantExpr::getCast(Instruction::BitCast, + RepValue, GV->getType()->getElementType()); // If there is a comparison against null, we will insert a global bool to // keep track of whether the global was initialized yet or not. @@ -1056,7 +1058,8 @@ GV->getInitializer()->isNullValue()) { if (Constant *SOVC = dyn_cast(StoredOnceVal)) { if (GV->getInitializer()->getType() != SOVC->getType()) - SOVC = ConstantExpr::getCast(SOVC, GV->getInitializer()->getType()); + SOVC = ConstantExpr::getCast(Instruction::BitCast, + SOVC, GV->getInitializer()->getType()); // Optimize away any trapping uses of the loaded value. if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC)) @@ -1507,7 +1510,7 @@ if (!GCL->use_empty()) { Constant *V = NGV; if (V->getType() != GCL->getType()) - V = ConstantExpr::getCast(V, GCL->getType()); + V = ConstantExpr::getCast(Instruction::BitCast, V, GCL->getType()); GCL->replaceAllUsesWith(V); } GCL->eraseFromParent(); From sabre at nondot.org Thu Nov 30 11:35:22 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 11:35:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200611301735.kAUHZMaY020035@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.75 -> 1.76 --- Log message: make it clear that this is always a zext --- Diffs of the changes: (+1 -1) GlobalOpt.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.75 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.76 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.75 Thu Nov 30 11:32:29 2006 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Nov 30 11:35:08 2006 @@ -1177,7 +1177,7 @@ LoadInst *NLI = new LoadInst(NewGV, Name+".b", LI); Value *NSI; if (IsOneZero) - NSI = CastInst::createInferredCast(NLI, LI->getType(), Name, LI); + NSI = new ZExtInst(NLI, LI->getType(), Name, LI); else NSI = new SelectInst(NLI, OtherVal, InitVal, Name, LI); LI->replaceAllUsesWith(NSI); From jlaskey at apple.com Thu Nov 30 12:29:38 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 30 Nov 2006 12:29:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp Message-ID: <200611301829.kAUITcZB021245@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineDebugInfo.cpp updated: 1.61 -> 1.62 --- Log message: better check for version --- Diffs of the changes: (+14 -2) MachineDebugInfo.cpp | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.61 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.62 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.61 Thu Nov 30 08:35:45 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Thu Nov 30 12:29:23 2006 @@ -1390,11 +1390,23 @@ return false; } - // Get the Tag + // Get the Tag. unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); // Check for user defined descriptors. - if (Tag == DW_TAG_invalid) return true; + if (Tag == DW_TAG_invalid) { + ValiditySlot = Valid; + return true; + } + + // Get the Version. + unsigned Version = DebugInfoDesc::VersionFromGlobal(GV); + + // Check for version mismatch. + if (Version != LLVMDebugVersion) { + ValiditySlot = Invalid; + return false; + } // Construct an empty DebugInfoDesc. DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag); From reid at x10sys.com Thu Nov 30 15:28:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 15:28:20 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/inc/core.inc.php Message-ID: <200611302128.kAULSKWB025116@zion.cs.uiuc.edu> Changes in directory llvm-www/poll/inc: core.inc.php updated: 1.1 -> 1.2 --- Log message: Increase the cookie timeout to 100 days. --- Diffs of the changes: (+2 -2) core.inc.php | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/poll/inc/core.inc.php diff -u llvm-www/poll/inc/core.inc.php:1.1 llvm-www/poll/inc/core.inc.php:1.2 --- llvm-www/poll/inc/core.inc.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/inc/core.inc.php Thu Nov 30 15:28:05 2006 @@ -70,7 +70,7 @@ *****************************************************/ $script_version = '1.8'; - $time_range = '1440'; // Minutes (60 minutes * 24 hours = 1440 minutes) + $time_range = '144000'; // Minutes (60 minutes * 24 hours = 1440 minutes) $number_decimals = '2'; $hide_results = false; // true, false $sort_results = 0; // 0 = off @@ -692,4 +692,4 @@ -?> \ No newline at end of file +?> From evan.cheng at apple.com Thu Nov 30 15:56:01 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 15:56:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td X86InstrX86-64.td Message-ID: <200611302156.kAULu1EN025612@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.132 -> 1.133 X86ISelLowering.cpp updated: 1.298 -> 1.299 X86ISelLowering.h updated: 1.80 -> 1.81 X86InstrInfo.td updated: 1.295 -> 1.296 X86InstrX86-64.td updated: 1.8 -> 1.9 --- Log message: - Use a different wrapper node for RIP-relative GV, etc. - Proper support for both small static and PIC modes under X86-64 - Some (non-optimal) support for medium modes. --- Diffs of the changes: (+81 -62) X86ISelDAGToDAG.cpp | 64 ++++++++-------------------------------------------- X86ISelLowering.cpp | 43 +++++++++++++++++++++++++++++----- X86ISelLowering.h | 4 +++ X86InstrInfo.td | 5 +++- X86InstrX86-64.td | 27 +++++++++++++++++++++ 5 files changed, 81 insertions(+), 62 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.132 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.133 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.132 Wed Nov 29 17:46:27 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Nov 30 15:55:46 2006 @@ -590,63 +590,19 @@ break; } - case ISD::TargetConstantPool: - if (AM.BaseType == X86ISelAddressMode::RegBase && - AM.Base.Reg.Val == 0 && - AM.CP == 0) { - ConstantPoolSDNode *CP = cast(N); - AM.CP = CP->getConstVal(); - AM.Align = CP->getAlignment(); - AM.Disp += CP->getOffset(); - return false; - } - break; - - case ISD::TargetGlobalAddress: - if (AM.BaseType == X86ISelAddressMode::RegBase && - AM.Base.Reg.Val == 0 && - AM.GV == 0) { - GlobalAddressSDNode *G = cast(N); - AM.GV = G->getGlobal(); - AM.Disp += G->getOffset(); - return false; - } - break; - - case ISD::TargetExternalSymbol: - if (isRoot && - AM.BaseType == X86ISelAddressMode::RegBase && - AM.Base.Reg.Val == 0) { - ExternalSymbolSDNode *S = cast(N.getOperand(0)); - AM.ES = S->getSymbol(); - return false; - } - break; - - case ISD::TargetJumpTable: - if (isRoot && - AM.BaseType == X86ISelAddressMode::RegBase && - AM.Base.Reg.Val == 0) { - JumpTableSDNode *J = cast(N.getOperand(0)); - AM.JT = J->getIndex(); - return false; - } - break; - case X86ISD::Wrapper: + case X86ISD::WrapperRIP: { + bool isRIP = N.getOpcode() == X86ISD::WrapperRIP; + // Under X86-64 non-small code model, GV (and friends) are 64-bits. + if (!isRIP && Subtarget->is64Bit() && TM.getCodeModel() != CodeModel::Small) + break; + // If value is available in a register both base and index components have // been picked, we can't fit the result available in the register in the // addressing mode. Duplicate GlobalAddress or ConstantPool as displacement. - - // Can't fit GV or CP in addressing mode for X86-64 medium or large code - // model since the displacement field is 32-bit. Ok for small code model. - - // For X86-64 PIC code, only allow GV / CP + displacement so we can use RIP - // relative addressing mode. - if (Subtarget->is64Bit() && TM.getCodeModel() != CodeModel::Small) - break; if (!Available || (AM.Base.Reg.Val && AM.IndexReg.Val)) { - bool isRIP = Subtarget->is64Bit(); + // For X86-64 PIC code, only allow GV / CP + displacement so we can use + // RIP relative addressing mode. if (isRIP && (AM.Base.Reg.Val || AM.Scale > 1 || AM.IndexReg.Val || AM.BaseType == X86ISelAddressMode::FrameIndexBase)) @@ -683,6 +639,7 @@ } } break; + } case ISD::FrameIndex: if (AM.BaseType == X86ISelAddressMode::RegBase && AM.Base.Reg.Val == 0) { @@ -1040,7 +997,8 @@ SDOperand N0 = N.getOperand(0); SDOperand N1 = N.getOperand(1); if (N.Val->getValueType(0) == PtrVT && - N0.getOpcode() == X86ISD::Wrapper && + (N0.getOpcode() == X86ISD::Wrapper + || N0.getOpcode() == X86ISD::WrapperRIP) && N1.getOpcode() == ISD::Constant) { unsigned Offset = (unsigned)cast(N1)->getValue(); SDOperand C(0, 0); Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.298 llvm/lib/Target/X86/X86ISelLowering.cpp:1.299 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.298 Wed Nov 29 17:48:14 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Nov 30 15:55:46 2006 @@ -3832,8 +3832,15 @@ SDOperand Result = DAG.getTargetConstantPool(CP->getConstVal(), getPointerTy(), CP->getAlignment()); + // Use X86ISD::WrapperRIP if we are in X86-64 small / medium PIC mode. + TargetMachine &tm = getTargetMachine(); + unsigned WrapperOpcode = (Subtarget->is64Bit() && + (tm.getCodeModel() == CodeModel::Small || + tm.getCodeModel() == CodeModel::Medium) && + tm.getRelocationModel() == Reloc::PIC_) + ? X86ISD::WrapperRIP : X86ISD::Wrapper; + Result = DAG.getNode(WrapperOpcode, getPointerTy(), Result); if (Subtarget->isTargetDarwin()) { - Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -3848,8 +3855,15 @@ X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { GlobalValue *GV = cast(Op)->getGlobal(); SDOperand Result = DAG.getTargetGlobalAddress(GV, getPointerTy()); + // Use X86ISD::WrapperRIP if we are in X86-64 small / medium PIC mode. + TargetMachine &tm = getTargetMachine(); + unsigned WrapperOpcode = (Subtarget->is64Bit() && + (tm.getCodeModel() == CodeModel::Small || + tm.getCodeModel() == CodeModel::Medium) && + tm.getRelocationModel() == Reloc::PIC_) + ? X86ISD::WrapperRIP : X86ISD::Wrapper; + Result = DAG.getNode(WrapperOpcode, getPointerTy(), Result); if (Subtarget->isTargetDarwin()) { - Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -3865,7 +3879,6 @@ Subtarget->GVRequiresExtraLoad(GV, false)) Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result, NULL, 0); } else if (Subtarget->GVRequiresExtraLoad(GV, false)) { - Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result, NULL, 0); } @@ -3876,8 +3889,15 @@ X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) { const char *Sym = cast(Op)->getSymbol(); SDOperand Result = DAG.getTargetExternalSymbol(Sym, getPointerTy()); + // Use X86ISD::WrapperRIP if we are in X86-64 small / medium PIC mode. + TargetMachine &tm = getTargetMachine(); + unsigned WrapperOpcode = (Subtarget->is64Bit() && + (tm.getCodeModel() == CodeModel::Small || + tm.getCodeModel() == CodeModel::Medium) && + tm.getRelocationModel() == Reloc::PIC_) + ? X86ISD::WrapperRIP : X86ISD::Wrapper; + Result = DAG.getNode(WrapperOpcode, getPointerTy(), Result); if (Subtarget->isTargetDarwin()) { - Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -4244,8 +4264,15 @@ SDOperand X86TargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) { JumpTableSDNode *JT = cast(Op); SDOperand Result = DAG.getTargetJumpTable(JT->getIndex(), getPointerTy()); + // Use X86ISD::WrapperRIP if we are in X86-64 small / medium PIC mode. + TargetMachine &tm = getTargetMachine(); + unsigned WrapperOpcode = (Subtarget->is64Bit() && + (tm.getCodeModel() == CodeModel::Small || + tm.getCodeModel() == CodeModel::Medium) && + tm.getRelocationModel() == Reloc::PIC_) + ? X86ISD::WrapperRIP : X86ISD::Wrapper; + Result = DAG.getNode(WrapperOpcode, getPointerTy(), Result); if (Subtarget->isTargetDarwin()) { - Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -4978,6 +5005,7 @@ case X86ISD::LOAD_UA: return "X86ISD::LOAD_UA"; case X86ISD::GlobalBaseReg: return "X86ISD::GlobalBaseReg"; case X86ISD::Wrapper: return "X86ISD::Wrapper"; + case X86ISD::WrapperRIP: return "X86ISD::WrapperRIP"; case X86ISD::S2VEC: return "X86ISD::S2VEC"; case X86ISD::PEXTRW: return "X86ISD::PEXTRW"; case X86ISD::PINSRW: return "X86ISD::PINSRW"; @@ -5220,12 +5248,13 @@ /// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the /// node is a GlobalAddress + an offset. static bool isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) { - if (N->getOpcode() == X86ISD::Wrapper) { + unsigned Opc = N->getOpcode(); + if (Opc == X86ISD::Wrapper || Opc == X86ISD::WrapperRIP) { if (dyn_cast(N->getOperand(0))) { GA = cast(N->getOperand(0))->getGlobal(); return true; } - } else if (N->getOpcode() == ISD::ADD) { + } else if (Opc == ISD::ADD) { SDOperand N1 = N->getOperand(0); SDOperand N2 = N->getOperand(1); if (isGAPlusOffset(N1.Val, GA, Offset)) { Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.80 llvm/lib/Target/X86/X86ISelLowering.h:1.81 --- llvm/lib/Target/X86/X86ISelLowering.h:1.80 Fri Nov 10 15:43:37 2006 +++ llvm/lib/Target/X86/X86ISelLowering.h Thu Nov 30 15:55:46 2006 @@ -150,6 +150,10 @@ /// TargetExternalSymbol, and TargetGlobalAddress. Wrapper, + /// WrapperRIP - Special wrapper used under X86-64 PIC mode for RIP + /// relative displacements. + WrapperRIP, + /// S2VEC - X86 version of SCALAR_TO_VECTOR. The destination base does not /// have to match the operand type. S2VEC, Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.295 llvm/lib/Target/X86/X86InstrInfo.td:1.296 --- llvm/lib/Target/X86/X86InstrInfo.td:1.295 Wed Nov 29 02:28:13 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Thu Nov 30 15:55:46 2006 @@ -84,7 +84,8 @@ def X86rdtsc : SDNode<"X86ISD::RDTSC_DAG",SDTX86RdTsc, [SDNPHasChain, SDNPOutFlag]>; -def X86Wrapper : SDNode<"X86ISD::Wrapper", SDTX86Wrapper>; +def X86Wrapper : SDNode<"X86ISD::Wrapper", SDTX86Wrapper>; +def X86WrapperRIP : SDNode<"X86ISD::WrapperRIP", SDTX86Wrapper>; //===----------------------------------------------------------------------===// // X86 Operand Definitions. @@ -169,6 +170,8 @@ def FPStack : Predicate<"!Subtarget->hasSSE2()">; def In32BitMode : Predicate<"!Subtarget->is64Bit()">; def In64BitMode : Predicate<"Subtarget->is64Bit()">; +def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">; +def NotSmallCode :Predicate<"TM.getCodeModel() != CodeModel::Small">; //===----------------------------------------------------------------------===// // X86 specific pattern fragments. Index: llvm/lib/Target/X86/X86InstrX86-64.td diff -u llvm/lib/Target/X86/X86InstrX86-64.td:1.8 llvm/lib/Target/X86/X86InstrX86-64.td:1.9 --- llvm/lib/Target/X86/X86InstrX86-64.td:1.8 Mon Nov 27 19:28:00 2006 +++ llvm/lib/Target/X86/X86InstrX86-64.td Thu Nov 30 15:55:46 2006 @@ -36,7 +36,8 @@ // Complex Pattern Definitions... // def lea64addr : ComplexPattern; + [add, mul, shl, or, frameindex, X86WrapperRIP], + []>; //===----------------------------------------------------------------------===// // Instruction templates... @@ -1020,6 +1021,30 @@ // Non-Instruction Patterns //===----------------------------------------------------------------------===// +// ConstantPool GlobalAddress, ExternalSymbol, and JumpTable +def : Pat<(i64 (X86Wrapper tconstpool :$dst)), + (MOV64ri32 tconstpool :$dst)>, Requires<[SmallCode]>; +def : Pat<(i64 (X86Wrapper tjumptable :$dst)), + (MOV64ri32 tjumptable :$dst)>, Requires<[SmallCode]>; +def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), + (MOV64ri32 tglobaladdr :$dst)>, Requires<[SmallCode]>; +def : Pat<(i64 (X86Wrapper texternalsym:$dst)), + (MOV64ri32 texternalsym:$dst)>, Requires<[SmallCode]>; + +def : Pat<(i64 (X86Wrapper tconstpool :$dst)), + (MOV64ri tconstpool :$dst)>, Requires<[NotSmallCode]>; +def : Pat<(i64 (X86Wrapper tjumptable :$dst)), + (MOV64ri tjumptable :$dst)>, Requires<[NotSmallCode]>; +def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), + (MOV64ri tglobaladdr :$dst)>, Requires<[NotSmallCode]>; +def : Pat<(i64 (X86Wrapper texternalsym:$dst)), + (MOV64ri texternalsym:$dst)>, Requires<[NotSmallCode]>; + +def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst), + (MOV64mi32 addr:$dst, tglobaladdr:$src)>, Requires<[SmallCode]>; +def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst), + (MOV64mi32 addr:$dst, texternalsym:$src)>, Requires<[SmallCode]>; + // Calls // Direct PC relative function call for small code model. 32-bit displacement // sign extended to 64-bit. From evan.cheng at apple.com Thu Nov 30 16:07:15 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 30 Nov 2006 16:07:15 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/x86-64-mem.ll Message-ID: <200611302207.kAUM7Fbu025808@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: x86-64-mem.ll added (r1.1) --- Log message: Add X86-64 load / store codegen tests. --- Diffs of the changes: (+36 -0) x86-64-mem.ll | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+) Index: llvm/test/Regression/CodeGen/X86/x86-64-mem.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/x86-64-mem.ll:1.1 *** /dev/null Thu Nov 30 16:07:10 2006 --- llvm/test/Regression/CodeGen/X86/x86-64-mem.ll Thu Nov 30 16:07:00 2006 *************** *** 0 **** --- 1,36 ---- + ; RUN: llvm-as < %s | llc -march=x86-64 && + ; RUN: llvm-as < %s | llc -march=x86-64 | grep GOTPCREL | wc -l | grep 4 && + ; RUN: llvm-as < %s | llc -march=x86-64 | grep rip | wc -l | grep 6 && + ; RUN: llvm-as < %s | llc -march=x86-64 | grep movq | wc -l | grep 6 && + ; RUN: llvm-as < %s | llc -march=x86-64 | grep leaq | wc -l | grep 1 && + ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep rip | wc -l | grep 4 && + ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep movl | wc -l | grep 2 && + ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep movq | wc -l | grep 2 + + %ptr = external global int* + %src = external global [0 x int] + %dst = external global [0 x int] + %lptr = internal global int* null + %ldst = internal global [500 x int] zeroinitializer, align 32 + %lsrc = internal global [500 x int] zeroinitializer, align 32 + %bsrc = internal global [500000 x int] zeroinitializer, align 32 + %bdst = internal global [500000 x int] zeroinitializer, align 32 + + void %test1() { + %tmp = load int* getelementptr ([0 x int]* %src, int 0, int 0) + store int %tmp, int* getelementptr ([0 x int]* %dst, int 0, int 0) + ret void + } + + void %test2() { + store int* getelementptr ([0 x int]* %dst, int 0, int 0), int** %ptr + ret void + } + + void %test3() { + store int* getelementptr ([500 x int]* %ldst, int 0, int 0), int** %lptr + br label %return + + return: + ret void + } From asl at math.spbu.ru Thu Nov 30 16:43:10 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 16:43:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp X86Subtarget.h Message-ID: <200611302243.kAUMhAo0026440@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.41 -> 1.42 X86Subtarget.h updated: 1.21 -> 1.22 --- Log message: Factor out GVRequiresExtraLoad() from .h to .cpp --- Diffs of the changes: (+19 -13) X86Subtarget.cpp | 17 +++++++++++++++++ X86Subtarget.h | 15 ++------------- 2 files changed, 19 insertions(+), 13 deletions(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.41 llvm/lib/Target/X86/X86Subtarget.cpp:1.42 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.41 Tue Nov 28 20:00:40 2006 +++ llvm/lib/Target/X86/X86Subtarget.cpp Thu Nov 30 16:42:55 2006 @@ -27,6 +27,23 @@ clEnumValEnd)); +/// True if accessing the GV requires an extra load. For Windows, dllimported +/// symbols are indirect, loading the value at address GV rather then the +/// value of GV itself. This means that the GlobalAddress must be in the base +/// or index register of the address, not the GV offset field. +bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV, bool isDirectCall) const +{ + if (isTargetDarwin()) { + return (!isDirectCall && + (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || + (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()))); + } else if (isTargetCygwin() || isTargetWindows()) { + return (GV->hasDLLImportLinkage()); + } + + return false; +} + /// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in the /// specified arguments. If we can't run cpuid on the host, return true. bool X86::GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX, Index: llvm/lib/Target/X86/X86Subtarget.h diff -u llvm/lib/Target/X86/X86Subtarget.h:1.21 llvm/lib/Target/X86/X86Subtarget.h:1.22 --- llvm/lib/Target/X86/X86Subtarget.h:1.21 Mon Nov 20 18:01:06 2006 +++ llvm/lib/Target/X86/X86Subtarget.h Thu Nov 30 16:42:55 2006 @@ -14,13 +14,13 @@ #ifndef X86SUBTARGET_H #define X86SUBTARGET_H -#include "llvm/GlobalValue.h" #include "llvm/Target/TargetSubtarget.h" #include namespace llvm { class Module; +class GlobalValue; class X86Subtarget : public TargetSubtarget { public: @@ -111,18 +111,7 @@ /// symbols are indirect, loading the value at address GV rather then the /// value of GV itself. This means that the GlobalAddress must be in the base /// or index register of the address, not the GV offset field. - bool GVRequiresExtraLoad(const GlobalValue* GV, bool isDirectCall) const - { - if (isTargetDarwin()) { - return (!isDirectCall && - (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()))); - } else if (isTargetCygwin() || isTargetWindows()) { - return (GV->hasDLLImportLinkage()); - } - - return false; - } + bool GVRequiresExtraLoad(const GlobalValue* GV, bool isDirectCall) const; }; namespace X86 { From reid at x10sys.com Thu Nov 30 17:00:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 17:00:56 -0600 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200611302300.kAUN0uOO026772@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.245 -> 1.246 --- Log message: Add a facility for linking test programs against the llvm-gcc libraries that it was produced with. Some programs will use libstdc++.a or libgcc.a in such a way that it matters which version of those libraries is linked into the program. Leaving it to the system compiler's discretion can lead to runtime failures in the test program. So, to ensure that your test programs link with the right libraries, enable the make variable LINK_WITH_LLVMGCC_LIBS --- Diffs of the changes: (+17 -3) Makefile.programs | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.245 llvm-test/Makefile.programs:1.246 --- llvm-test/Makefile.programs:1.245 Tue Nov 28 01:18:25 2006 +++ llvm-test/Makefile.programs Thu Nov 30 17:00:41 2006 @@ -94,6 +94,18 @@ RUNSAFELY := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK) endif +# LLVMGCCLD - This sets up the command to use for linking test programs +# that were generated with llvm-gcc. Usually $(CC) is sufficient but, +# depending on libstdc++ and libgcc.a usage, it may be necessary to ensure +# that the link is done against llvm-gcc's version of those libraries. If +# the LINK_WITH_LLVMGCC_LIBS variable is set, then the link is done that +# way. Unfortunately, this can't help JIT because it is always linked with +# the libraries of lli. +LLVMGCCLD := $(CC) +ifdef LINK_WITH_LLVMGCC_LIBS +LLVMGCCLD := $(CC) -L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib +endif + ifndef STDIN_FILENAME STDIN_FILENAME := /dev/null endif @@ -295,7 +307,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.cbe): \ Output/%.cbe: Output/%.cbe.c - -$(CC) $< $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 -fno-inline $(TARGET_FLAGS) -o $@ + -$(LLVMGCCLD) $< $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 -fno-inline $(TARGET_FLAGS) -o $@ # # Compile a linked program to machine code with LLC. @@ -321,11 +333,13 @@ # $(PROGRAMS_TO_TEST:%=Output/%.llc): \ Output/%.llc: Output/%.llc.s - -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(TARGET_FLAGS) $(LDFLAGS) -o $@ + -$(LLVMGCCLD) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) \ + $(TARGET_FLAGS) $(LDFLAGS) -o $@ $(PROGRAMS_TO_TEST:%=Output/%.llc-beta): \ Output/%.llc-beta: Output/%.llc-beta.s - -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(TARGET_FLAGS) $(LDFLAGS) -o $@ + -$(LLVMGCCLD) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) \ + $(TARGET_FLAGS) $(LDFLAGS) -o $@ # From reid at x10sys.com Thu Nov 30 17:02:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 17:02:35 -0600 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/252.eon/Makefile Message-ID: <200611302302.kAUN2ZIB026816@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CINT2000/252.eon: Makefile updated: 1.14 -> 1.15 --- Log message: Allow this program to link against the correct llvm-gcc libraries and thereby not crash in libstdc++. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm-test/External/SPEC/CINT2000/252.eon/Makefile diff -u llvm-test/External/SPEC/CINT2000/252.eon/Makefile:1.14 llvm-test/External/SPEC/CINT2000/252.eon/Makefile:1.15 --- llvm-test/External/SPEC/CINT2000/252.eon/Makefile:1.14 Fri Nov 3 13:14:05 2006 +++ llvm-test/External/SPEC/CINT2000/252.eon/Makefile Thu Nov 30 17:02:21 2006 @@ -3,6 +3,7 @@ STDOUT_FILENAME = cook_log.out STDERR_FILENAME = cook_log.err FP_ABSTOLERANCE := 0.005 +LINK_WITH_LLVMGCC_LIBS := 1 # Yes, we know this is an old crufty C++ benchmark. Don't tell us about it GCC! CPPFLAGS = -include errno.h -Wno-deprecated -Wno-non-template-friend -DHAS_ERRLIST -DUSE_STRERROR -DSPEC_STDCPP -DNDEBUG From reid at x10sys.com Thu Nov 30 17:13:50 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 17:13:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200611302313.kAUNDo6c027006@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.555 -> 1.556 --- Log message: Remove 4 FIXMEs to hack around cast-to-bool problems which no longer exist. --- Diffs of the changes: (+3 -46) InstructionCombining.cpp | 49 ++--------------------------------------------- 1 files changed, 3 insertions(+), 46 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.555 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.556 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.555 Wed Nov 29 01:18:39 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Nov 30 17:13:36 2006 @@ -5778,13 +5778,6 @@ unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - // See if we can simplify any instructions used by the LHS whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero = 0, KnownOne = 0; @@ -6092,35 +6085,11 @@ } Instruction *InstCombiner::visitFPToUI(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitFPToSI(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitUIToFP(CastInst &CI) { @@ -6132,19 +6101,7 @@ } Instruction *InstCombiner::visitPtrToInt(CastInst &CI) { - if (Instruction *I = commonCastTransforms(CI)) - return I; - - // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is - // because codegen cannot accurately perform a truncate to bool operation. - // Something goes wrong in promotion to a larger type. When CodeGen can - // handle a proper truncation to bool, this should be removed. - Value *Src = CI.getOperand(0); - const Type *SrcTy = Src->getType(); - const Type *DestTy = CI.getType(); - if (DestTy == Type::BoolTy) - return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy)); - return 0; + return commonCastTransforms(CI); } Instruction *InstCombiner::visitIntToPtr(CastInst &CI) { From asl at math.spbu.ru Thu Nov 30 18:25:36 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200612010025.kB10Pahp028221@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.119 -> 1.120 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+24 -12) LinkModules.cpp | 36 ++++++++++++++++++++++++------------ 1 files changed, 24 insertions(+), 12 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.119 llvm/lib/Linker/LinkModules.cpp:1.120 --- llvm/lib/Linker/LinkModules.cpp:1.119 Mon Nov 27 04:09:12 2006 +++ llvm/lib/Linker/LinkModules.cpp Thu Nov 30 18:25:12 2006 @@ -360,6 +360,7 @@ // 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()) { LinkFromSrc = true; LT = Src->getLinkage(); @@ -379,8 +380,9 @@ LinkFromSrc = true; // Special cased. LT = Src->getLinkage(); } else if (Src->hasWeakLinkage() || Src->hasLinkOnceLinkage()) { - // At this point we know that Dest has LinkOnce, External, Weak, DLL* linkage. - if (Dest->hasLinkOnceLinkage() && Src->hasWeakLinkage()) { + // At this point we know that Dest has LinkOnce, External*, Weak, DLL* linkage. + if ((Dest->hasLinkOnceLinkage() && Src->hasWeakLinkage()) || + Dest->hasExternalWeakLinkage()) { LinkFromSrc = true; LT = Src->getLinkage(); } else { @@ -388,16 +390,23 @@ LT = Dest->getLinkage(); } } else if (Dest->hasWeakLinkage() || Dest->hasLinkOnceLinkage()) { - // At this point we know that Src has External or DLL* linkage. - LinkFromSrc = true; - LT = GlobalValue::ExternalLinkage; + // At this point we know that Src has External* or DLL* linkage. + if (Src->hasExternalWeakLinkage()) { + LinkFromSrc = false; + LT = Dest->getLinkage(); + } else { + LinkFromSrc = true; + LT = GlobalValue::ExternalLinkage; + } } else { assert((Dest->hasExternalLinkage() || Dest->hasDLLImportLinkage() || - Dest->hasDLLExportLinkage()) && + Dest->hasDLLExportLinkage() || + Dest->hasExternalWeakLinkage()) && (Src->hasExternalLinkage() || Src->hasDLLImportLinkage() || - Src->hasDLLExportLinkage()) && + Src->hasDLLExportLinkage() || + Src->hasExternalWeakLinkage()) && "Unexpected linkage type!"); return Error(Err, "Linking globals named '" + Src->getName() + "': symbol multiply defined!"); @@ -631,19 +640,22 @@ ValueMap.insert(std::make_pair(SF, DF)); DF->setLinkage(SF->getLinkage()); } else if (SF->hasWeakLinkage() || SF->hasLinkOnceLinkage()) { - // At this point we know that DF has LinkOnce, Weak, or External linkage. + // At this point we know that DF has LinkOnce, Weak, or External* linkage. ValueMap.insert(std::make_pair(SF, DF)); // Linkonce+Weak = Weak - if (DF->hasLinkOnceLinkage() && SF->hasWeakLinkage()) + // *+External Weak = * + if ((DF->hasLinkOnceLinkage() && SF->hasWeakLinkage()) || + DF->hasExternalWeakLinkage()) DF->setLinkage(SF->getLinkage()); + } else if (DF->hasWeakLinkage() || DF->hasLinkOnceLinkage()) { - // At this point we know that SF has LinkOnce or External linkage. + // At this point we know that SF has LinkOnce or External* linkage. ValueMap.insert(std::make_pair(SF, DF)); - if (!SF->hasLinkOnceLinkage()) // Don't inherit linkonce linkage + if (!SF->hasLinkOnceLinkage() && !SF->hasExternalWeakLinkage()) + // Don't inherit linkonce & external weak linkage DF->setLinkage(SF->getLinkage()); - } else if (SF->getLinkage() != DF->getLinkage()) { return Error(Err, "Functions named '" + SF->getName() + "' have different linkage specifiers!"); From asl at math.spbu.ru Thu Nov 30 18:25:35 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200612010025.kB10PZBG028212@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.89 -> 1.90 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+1 -1) ExecutionEngine.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.89 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.90 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.89 Mon Nov 27 17:54:50 2006 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Thu Nov 30 18:25:12 2006 @@ -681,7 +681,7 @@ // Otherwise, we know it's linkonce/weak, replace it if this is a strong // symbol. - if (GV->hasExternalLinkage()) + if (GV->hasExternalLinkage() || GVEntry->hasExternalWeakLinkage()) GVEntry = GV; } } From asl at math.spbu.ru Thu Nov 30 18:25:35 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200612010025.kB10PZq4028215@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.100 -> 1.101 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+2 -5) ConstantFolding.cpp | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.100 llvm/lib/VMCore/ConstantFolding.cpp:1.101 --- llvm/lib/VMCore/ConstantFolding.cpp:1.100 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 18:25:12 2006 @@ -894,11 +894,8 @@ case Instruction::PtrToInt: // Cast of a global address to boolean is always true. - if (isa(V)) { - if (DestTy == Type::BoolTy) - // FIXME: When we support 'external weak' references, we have to - // prevent this transformation from happening. This code will need - // to be updated to ignore external weak symbols when we support it. + if (const GlobalValue *GV = dyn_cast(V)) { + if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) return ConstantBool::getTrue(); } break; From asl at math.spbu.ru Thu Nov 30 18:25:36 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200612010025.kB10PaG2028218@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.289 -> 1.290 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+11 -4) Writer.cpp | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.289 llvm/lib/Target/CBackend/Writer.cpp:1.290 --- llvm/lib/Target/CBackend/Writer.cpp:1.289 Tue Nov 28 17:07:32 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Thu Nov 30 18:25:12 2006 @@ -1157,8 +1157,6 @@ << "#define __attribute__(X)\n" << "#endif\n\n"; -#if 0 - // At some point, we should support "external weak" vs. "weak" linkages. // On Mac OS X, "external weak" is spelled "__attribute__((weak_import))". Out << "#if defined(__GNUC__) && defined(__APPLE_CC__)\n" << "#define __EXTERNAL_WEAK__ __attribute__((weak_import))\n" @@ -1167,7 +1165,6 @@ << "#else\n" << "#define __EXTERNAL_WEAK__\n" << "#endif\n\n"; -#endif // For now, turn off the weak linkage attribute on Mac OS X. (See above.) Out << "#if defined(__GNUC__) && defined(__APPLE_CC__)\n" @@ -1357,7 +1354,11 @@ Out << "__declspec(dllimport) "; printType(Out, I->getType()->getElementType(), Mang->getValueName(I)); Out << ";\n"; - } + } else if (I->hasExternalWeakLinkage()) { + Out << "extern "; + printType(Out, I->getType()->getElementType(), Mang->getValueName(I)); + Out << " __EXTERNAL_WEAK__ ;\n"; + } } } @@ -1370,9 +1371,13 @@ // Don't print declarations for intrinsic functions. if (!I->getIntrinsicID() && I->getName() != "setjmp" && I->getName() != "longjmp" && I->getName() != "_setjmp") { + if (I->hasExternalWeakLinkage()) + Out << "extern "; printFunctionSignature(I, true); if (I->hasWeakLinkage() || I->hasLinkOnceLinkage()) Out << " __ATTRIBUTE_WEAK__"; + if (I->hasExternalWeakLinkage()) + Out << " __EXTERNAL_WEAK__"; if (StaticCtors.count(I)) Out << " __ATTRIBUTE_CTOR__"; if (StaticDtors.count(I)) @@ -1405,6 +1410,8 @@ Out << " __attribute__((common))"; else if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__"; + else if (I->hasExternalWeakLinkage()) + Out << " __EXTERNAL_WEAK__"; Out << ";\n"; } } From asl at math.spbu.ru Thu Nov 30 18:25:29 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200612010025.kB10PTWc028199@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.279 -> 1.280 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+1 -1) llvmAsmParser.y | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.279 llvm/lib/AsmParser/llvmAsmParser.y:1.280 --- llvm/lib/AsmParser/llvmAsmParser.y:1.279 Tue Nov 28 16:47:12 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Thu Nov 30 18:25:12 2006 @@ -2201,7 +2201,7 @@ FnDeclareLinkage: /*default*/ | DLLIMPORT { CurFun.Linkage = GlobalValue::DLLImportLinkage; } | - EXTERN_WEAK { CurFun.Linkage = GlobalValue::DLLImportLinkage; }; + EXTERN_WEAK { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; }; FunctionProto : DECLARE { CurFun.isDeclare = true; } FnDeclareLinkage FunctionHeaderH { $$ = CurFun.CurrentFunction; From asl at math.spbu.ru Thu Nov 30 18:25:33 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 30 Nov 2006 18:25:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86AsmPrinter.h Message-ID: <200612010025.kB10PXvW028209@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.74 -> 1.75 X86AsmPrinter.cpp updated: 1.213 -> 1.214 X86AsmPrinter.h updated: 1.35 -> 1.36 --- Log message: Introducing external weak linkage. Darwin codegen should be added later. --- Diffs of the changes: (+39 -3) X86ATTAsmPrinter.cpp | 4 ++++ X86AsmPrinter.cpp | 35 ++++++++++++++++++++++++++++++++--- X86AsmPrinter.h | 3 +++ 3 files changed, 39 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.74 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.75 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.74 Wed Nov 29 17:19:45 2006 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Thu Nov 30 18:25:12 2006 @@ -255,6 +255,10 @@ } O << Name; } + + if (GV->hasExternalWeakLinkage()) { + ExtWeakSymbols.insert(Name); + } int Offset = MO.getOffset(); if (Offset > 0) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.213 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.214 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.213 Tue Oct 31 15:53:31 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Thu Nov 30 18:25:12 2006 @@ -128,11 +128,12 @@ // from how MASM does things. When making changes here don't forget to look // at X86IntelAsmPrinter::doFinalization(). const TargetData *TD = TM.getTargetData(); - + // 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->hasInitializer()) continue; // External global require no code + if (!I->hasInitializer() && !I->hasExternalWeakLinkage()) + 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)) @@ -176,6 +177,17 @@ O << "\t\t" << TAI->getCommentString() << " " << I->getName() << "\n"; } else { switch (I->getLinkage()) { + case GlobalValue::ExternalWeakLinkage: + if (Subtarget->isTargetDarwin()) { + assert(0 && "External weak linkage for Darwin not implemented yet"); + } else if (Subtarget->isTargetCygwin()) { + // There is no external weak linkage on Mingw32 platform. + // Defaulting just to external + O << "\t.globl " << name << "\n"; + } else { + O << "\t.weak " << name << "\n"; + break; + } case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: if (Subtarget->isTargetDarwin()) { @@ -270,7 +282,24 @@ i != e; ++i) { O << "\t.ascii \" -export:" << *i << "\"\n"; } - + + if (Subtarget->isTargetDarwin()) { + if (ExtWeakSymbols.begin() != ExtWeakSymbols.end()) + assert(0 && "External weak linkage for Darwin not implemented yet"); + } else if (Subtarget->isTargetCygwin()) { + // There is no external weak linkage on Mingw32 platform. + // Defaulting to external + } else { + if (ExtWeakSymbols.begin() != ExtWeakSymbols.end()) + SwitchToDataSection(""); + + for (std::set::iterator i = ExtWeakSymbols.begin(), + e = ExtWeakSymbols.end(); + i != e; ++i) { + O << "\t.weak " << *i << "\n"; + } + } + if (Subtarget->isTargetDarwin()) { SwitchToDataSection(""); Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.35 llvm/lib/Target/X86/X86AsmPrinter.h:1.36 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.35 Tue Oct 31 02:31:24 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.h Thu Nov 30 18:25:12 2006 @@ -84,6 +84,9 @@ // Necessary for dllexport support std::set DLLExportedFns, DLLExportedGVs; + + // Necessary for external weak linkage support + std::set ExtWeakSymbols; inline static bool isScale(const MachineOperand &MO) { return MO.isImmediate() && From reid at x10sys.com Thu Nov 30 18:34:01 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 18:34:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l.cvs llvmAsmParser.cpp.cvs llvmAsmParser.y.cvs Message-ID: <200612010034.kB10Y1uj028402@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.15 -> 1.16 Lexer.l.cvs updated: 1.11 -> 1.12 llvmAsmParser.cpp.cvs updated: 1.27 -> 1.28 llvmAsmParser.y.cvs updated: 1.28 -> 1.29 --- Log message: Regenerate. --- Diffs of the changes: (+185 -197) Lexer.cpp.cvs | 326 ++++++++++++++++++++++++-------------------------- Lexer.l.cvs | 40 ++---- llvmAsmParser.cpp.cvs | 8 - llvmAsmParser.y.cvs | 8 - 4 files changed, 185 insertions(+), 197 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.15 llvm/lib/AsmParser/Lexer.cpp.cvs:1.16 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.15 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Thu Nov 30 18:33:46 2006 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.15 2006/11/27 01:05:09 reid Exp $ + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.16 2006/12/01 00:33:46 reid Exp $ */ #define FLEX_SCANNER @@ -893,7 +893,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 1 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" #define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // @@ -908,7 +908,7 @@ // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 -#line 28 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 28 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -935,17 +935,11 @@ llvmAsmlval.type.obsolete = true; \ return sym -// Construct a token value for a non-obsolete type -#define RET_TY(CType, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = isSignless; \ - return sym - // Construct a token value for an obsolete token -#define RET_TY_OBSOLETE(CType, sign, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = sign; \ - return sym +#define RET_TY(CTYPE, SIGN, SYM) \ + llvmAsmlval.TypeVal.type = new PATypeHolder(CTYPE); \ + llvmAsmlval.TypeVal.signedness = SIGN; \ + return SYM namespace llvm { @@ -1055,7 +1049,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1059 "Lexer.cpp" +#line 1053 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1206,10 +1200,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 200 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -#line 1213 "Lexer.cpp" +#line 1207 "Lexer.cpp" if ( yy_init ) { @@ -1302,607 +1296,607 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 196 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 198 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 199 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 200 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 201 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 202 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 203 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 204 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 205 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 206 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 207 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 208 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 209 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLIMPORT; } YY_BREAK case 14: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 210 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLEXPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 211 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERN_WEAK; } YY_BREAK case 16: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 212 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERNAL; } /* Deprecated, turn into external */ YY_BREAK case 17: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 213 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 18: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 214 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return IMPLEMENTATION; } YY_BREAK case 19: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 215 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 20: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 216 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 21: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 217 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 22: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 218 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 225 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 219 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 24: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 220 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 25: YY_RULE_SETUP -#line 227 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 221 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return NOT; } /* Deprecated, turned into XOR */ YY_BREAK case 26: YY_RULE_SETUP -#line 228 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 222 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 27: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 223 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 28: YY_RULE_SETUP -#line 230 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 224 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 29: YY_RULE_SETUP -#line 231 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 225 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 30: YY_RULE_SETUP -#line 232 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 226 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ENDIAN; } YY_BREAK case 31: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 227 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return POINTERSIZE; } YY_BREAK case 32: YY_RULE_SETUP -#line 234 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 228 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DATALAYOUT; } YY_BREAK case 33: YY_RULE_SETUP -#line 235 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 229 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return LITTLE; } YY_BREAK case 34: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 230 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return BIG; } YY_BREAK case 35: YY_RULE_SETUP -#line 237 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 231 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 36: YY_RULE_SETUP -#line 238 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 232 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ALIGN; } YY_BREAK case 37: YY_RULE_SETUP -#line 239 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 233 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return SECTION; } YY_BREAK case 38: YY_RULE_SETUP -#line 240 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 234 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return MODULE; } YY_BREAK case 39: YY_RULE_SETUP -#line 241 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 235 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ASM_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 242 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 236 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return SIDEEFFECT; } YY_BREAK case 41: YY_RULE_SETUP -#line 244 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 238 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 245 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 239 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CCC_TOK; } YY_BREAK case 43: YY_RULE_SETUP -#line 246 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 240 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CSRETCC_TOK; } YY_BREAK case 44: YY_RULE_SETUP -#line 247 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 241 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FASTCC_TOK; } YY_BREAK case 45: YY_RULE_SETUP -#line 248 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 242 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return COLDCC_TOK; } YY_BREAK case 46: YY_RULE_SETUP -#line 249 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 243 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return X86_STDCALLCC_TOK; } YY_BREAK case 47: YY_RULE_SETUP -#line 250 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 244 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return X86_FASTCALLCC_TOK; } YY_BREAK case 48: YY_RULE_SETUP -#line 252 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::VoidTy, VOID); } +#line 246 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::VoidTy, isSignless, VOID); } YY_BREAK case 49: YY_RULE_SETUP -#line 253 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::BoolTy, BOOL); } +#line 247 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::BoolTy, isSignless, BOOL); } YY_BREAK case 50: YY_RULE_SETUP -#line 254 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::SByteTy, isSigned, SBYTE); } +#line 248 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::SByteTy, isSigned, SBYTE); } YY_BREAK case 51: YY_RULE_SETUP -#line 255 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::UByteTy, isUnsigned, UBYTE); } +#line 249 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UByteTy, isUnsigned, UBYTE); } YY_BREAK case 52: YY_RULE_SETUP -#line 256 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::ShortTy, isSigned, SHORT); } +#line 250 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::ShortTy, isSigned, SHORT); } YY_BREAK case 53: YY_RULE_SETUP -#line 257 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::UShortTy,isUnsigned, USHORT); } +#line 251 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UShortTy,isUnsigned, USHORT);} YY_BREAK case 54: YY_RULE_SETUP -#line 258 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::IntTy, isSigned, INT); } +#line 252 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::IntTy, isSigned, INT); } YY_BREAK case 55: YY_RULE_SETUP -#line 259 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::UIntTy, isUnsigned, UINT); } +#line 253 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UIntTy, isUnsigned, UINT); } YY_BREAK case 56: YY_RULE_SETUP -#line 260 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::LongTy, isSigned, LONG); } +#line 254 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LongTy, isSigned, LONG); } YY_BREAK case 57: YY_RULE_SETUP -#line 261 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY_OBSOLETE(Type::ULongTy, isUnsigned, ULONG); } +#line 255 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::ULongTy, isUnsigned, ULONG); } YY_BREAK case 58: YY_RULE_SETUP -#line 262 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::FloatTy, FLOAT); } +#line 256 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::FloatTy, isSignless, FLOAT); } YY_BREAK case 59: YY_RULE_SETUP -#line 263 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::DoubleTy, DOUBLE); } +#line 257 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::DoubleTy,isSignless, DOUBLE);} YY_BREAK case 60: YY_RULE_SETUP -#line 264 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::LabelTy, LABEL); } +#line 258 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LabelTy, isSignless, LABEL); } YY_BREAK case 61: YY_RULE_SETUP -#line 265 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 259 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TYPE; } YY_BREAK case 62: YY_RULE_SETUP -#line 266 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 260 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return OPAQUE; } YY_BREAK case 63: YY_RULE_SETUP -#line 268 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 262 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 64: YY_RULE_SETUP -#line 269 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 263 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 65: YY_RULE_SETUP -#line 270 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 264 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 66: YY_RULE_SETUP -#line 271 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 265 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK_OBSOLETE(BinaryOpVal, UDiv, UDIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 272 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 266 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, UDiv, UDIV); } YY_BREAK case 68: YY_RULE_SETUP -#line 273 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 267 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SDiv, SDIV); } YY_BREAK case 69: YY_RULE_SETUP -#line 274 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 268 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FDiv, FDIV); } YY_BREAK case 70: YY_RULE_SETUP -#line 275 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 269 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK_OBSOLETE(BinaryOpVal, URem, UREM); } YY_BREAK case 71: YY_RULE_SETUP -#line 276 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 270 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, URem, UREM); } YY_BREAK case 72: YY_RULE_SETUP -#line 277 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 271 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SRem, SREM); } YY_BREAK case 73: YY_RULE_SETUP -#line 278 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 272 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FRem, FREM); } YY_BREAK case 74: YY_RULE_SETUP -#line 279 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 273 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 75: YY_RULE_SETUP -#line 280 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 274 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 76: YY_RULE_SETUP -#line 281 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 275 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 77: YY_RULE_SETUP -#line 282 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 276 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 78: YY_RULE_SETUP -#line 283 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 277 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 79: YY_RULE_SETUP -#line 284 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 278 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 80: YY_RULE_SETUP -#line 285 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 279 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 81: YY_RULE_SETUP -#line 286 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 280 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 82: YY_RULE_SETUP -#line 287 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 281 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 83: YY_RULE_SETUP -#line 289 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 283 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 84: YY_RULE_SETUP -#line 290 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 284 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 85: YY_RULE_SETUP -#line 291 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 285 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK_OBSOLETE(CastOpVal, Trunc, TRUNC); } YY_BREAK case 86: YY_RULE_SETUP -#line 292 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 286 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, Trunc, TRUNC); } YY_BREAK case 87: YY_RULE_SETUP -#line 293 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 287 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, ZExt, ZEXT); } YY_BREAK case 88: YY_RULE_SETUP -#line 294 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 288 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SExt, SEXT); } YY_BREAK case 89: YY_RULE_SETUP -#line 295 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 289 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } YY_BREAK case 90: YY_RULE_SETUP -#line 296 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 290 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPExt, FPEXT); } YY_BREAK case 91: YY_RULE_SETUP -#line 297 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 291 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, UIToFP, UITOFP); } YY_BREAK case 92: YY_RULE_SETUP -#line 298 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 292 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SIToFP, SITOFP); } YY_BREAK case 93: YY_RULE_SETUP -#line 299 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 293 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToUI, FPTOUI); } YY_BREAK case 94: YY_RULE_SETUP -#line 300 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 294 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToSI, FPTOSI); } YY_BREAK case 95: YY_RULE_SETUP -#line 301 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 295 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } YY_BREAK case 96: YY_RULE_SETUP -#line 302 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 296 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } YY_BREAK case 97: YY_RULE_SETUP -#line 303 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 297 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, BitCast, BITCAST); } YY_BREAK case 98: YY_RULE_SETUP -#line 304 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 298 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 99: YY_RULE_SETUP -#line 305 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 299 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Shl, SHL); } YY_BREAK case 100: YY_RULE_SETUP -#line 306 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 300 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK_OBSOLETE(OtherOpVal, LShr, LSHR); } YY_BREAK case 101: YY_RULE_SETUP -#line 307 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 301 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, LShr, LSHR); } YY_BREAK case 102: YY_RULE_SETUP -#line 308 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 302 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, AShr, ASHR); } YY_BREAK case 103: YY_RULE_SETUP -#line 309 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 303 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return VANEXT_old; } YY_BREAK case 104: YY_RULE_SETUP -#line 310 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 304 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return VAARG_old; } YY_BREAK case 105: YY_RULE_SETUP -#line 311 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 305 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 106: YY_RULE_SETUP -#line 312 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 306 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 107: YY_RULE_SETUP -#line 313 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 307 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 108: YY_RULE_SETUP -#line 314 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 308 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 109: YY_RULE_SETUP -#line 315 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 309 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 110: YY_RULE_SETUP -#line 316 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 310 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 111: YY_RULE_SETUP -#line 317 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 311 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK case 112: YY_RULE_SETUP -#line 319 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 313 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK case 113: YY_RULE_SETUP -#line 320 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 314 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK case 114: YY_RULE_SETUP -#line 321 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 315 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK case 115: YY_RULE_SETUP -#line 322 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 316 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK case 116: YY_RULE_SETUP -#line 323 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 317 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK case 117: YY_RULE_SETUP -#line 324 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 318 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK case 118: YY_RULE_SETUP -#line 326 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 320 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK case 119: YY_RULE_SETUP -#line 327 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 321 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK case 120: YY_RULE_SETUP -#line 328 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 322 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK case 121: YY_RULE_SETUP -#line 331 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 325 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % @@ -1911,7 +1905,7 @@ YY_BREAK case 122: YY_RULE_SETUP -#line 336 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 330 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1921,7 +1915,7 @@ YY_BREAK case 123: YY_RULE_SETUP -#line 342 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 336 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1931,7 +1925,7 @@ YY_BREAK case 124: YY_RULE_SETUP -#line 349 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 343 "/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 @@ -1944,12 +1938,12 @@ YY_BREAK case 125: YY_RULE_SETUP -#line 360 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 354 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK case 126: YY_RULE_SETUP -#line 361 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 355 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range @@ -1961,7 +1955,7 @@ YY_BREAK case 127: YY_RULE_SETUP -#line 369 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 363 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; @@ -1969,7 +1963,7 @@ YY_BREAK case 128: YY_RULE_SETUP -#line 374 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 368 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -1980,7 +1974,7 @@ YY_BREAK case 129: YY_RULE_SETUP -#line 381 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 375 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range @@ -1992,16 +1986,16 @@ YY_BREAK case 130: YY_RULE_SETUP -#line 390 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 384 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 131: YY_RULE_SETUP -#line 391 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 385 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 393 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 387 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -2012,20 +2006,20 @@ YY_BREAK case 132: YY_RULE_SETUP -#line 401 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 395 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK case 133: YY_RULE_SETUP -#line 402 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 396 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK case 134: YY_RULE_SETUP -#line 404 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2029 "Lexer.cpp" +#line 2023 "Lexer.cpp" case YY_END_OF_BUFFER: { @@ -2903,5 +2897,5 @@ return 0; } #endif -#line 404 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/Lexer.l.cvs diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.11 llvm/lib/AsmParser/Lexer.l.cvs:1.12 --- llvm/lib/AsmParser/Lexer.l.cvs:1.11 Sun Nov 26 19:05:09 2006 +++ llvm/lib/AsmParser/Lexer.l.cvs Thu Nov 30 18:33:46 2006 @@ -51,17 +51,11 @@ llvmAsmlval.type.obsolete = true; \ return sym -// Construct a token value for a non-obsolete type -#define RET_TY(CType, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = isSignless; \ - return sym - // Construct a token value for an obsolete token -#define RET_TY_OBSOLETE(CType, sign, sym) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CType); \ - llvmAsmlval.TypeVal.signedness = sign; \ - return sym +#define RET_TY(CTYPE, SIGN, SYM) \ + llvmAsmlval.TypeVal.type = new PATypeHolder(CTYPE); \ + llvmAsmlval.TypeVal.signedness = SIGN; \ + return SYM namespace llvm { @@ -249,19 +243,19 @@ x86_stdcallcc { return X86_STDCALLCC_TOK; } x86_fastcallcc { return X86_FASTCALLCC_TOK; } -void { RET_TY(Type::VoidTy, VOID); } -bool { RET_TY(Type::BoolTy, BOOL); } -sbyte { RET_TY_OBSOLETE(Type::SByteTy, isSigned, SBYTE); } -ubyte { RET_TY_OBSOLETE(Type::UByteTy, isUnsigned, UBYTE); } -short { RET_TY_OBSOLETE(Type::ShortTy, isSigned, SHORT); } -ushort { RET_TY_OBSOLETE(Type::UShortTy,isUnsigned, USHORT); } -int { RET_TY_OBSOLETE(Type::IntTy, isSigned, INT); } -uint { RET_TY_OBSOLETE(Type::UIntTy, isUnsigned, UINT); } -long { RET_TY_OBSOLETE(Type::LongTy, isSigned, LONG); } -ulong { RET_TY_OBSOLETE(Type::ULongTy, isUnsigned, ULONG); } -float { RET_TY(Type::FloatTy, FLOAT); } -double { RET_TY(Type::DoubleTy, DOUBLE); } -label { RET_TY(Type::LabelTy, LABEL); } +void { RET_TY(Type::VoidTy, isSignless, VOID); } +bool { RET_TY(Type::BoolTy, isSignless, BOOL); } +sbyte { RET_TY(Type::SByteTy, isSigned, SBYTE); } +ubyte { RET_TY(Type::UByteTy, isUnsigned, UBYTE); } +short { RET_TY(Type::ShortTy, isSigned, SHORT); } +ushort { RET_TY(Type::UShortTy,isUnsigned, USHORT);} +int { RET_TY(Type::IntTy, isSigned, INT); } +uint { RET_TY(Type::UIntTy, isUnsigned, UINT); } +long { RET_TY(Type::LongTy, isSigned, LONG); } +ulong { RET_TY(Type::ULongTy, isUnsigned, ULONG); } +float { RET_TY(Type::FloatTy, isSignless, FLOAT); } +double { RET_TY(Type::DoubleTy,isSignless, DOUBLE);} +label { RET_TY(Type::LabelTy, isSignless, LABEL); } type { return TYPE; } opaque { return OPAQUE; } Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.27 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.28 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.27 Tue Nov 28 01:29:44 2006 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Thu Nov 30 18:33:46 2006 @@ -328,8 +328,8 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include -#include #include #include @@ -364,7 +364,7 @@ // //#define DEBUG_UPREFS 1 #ifdef DEBUG_UPREFS -#define UR_OUT(X) std::cerr << X +#define UR_OUT(X) llvm_cerr << X #else #define UR_OUT(X) #endif @@ -4497,7 +4497,7 @@ case 195: #line 2204 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} + { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;} break; case 196: @@ -5083,7 +5083,7 @@ case 245: #line 2635 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - std::cerr << "WARNING: Use of eliminated 'not' instruction:" + llvm_cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal).val->getType()); Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.28 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.29 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.28 Tue Nov 28 01:29:44 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Thu Nov 30 18:33:46 2006 @@ -22,8 +22,8 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include -#include #include #include @@ -58,7 +58,7 @@ // //#define DEBUG_UPREFS 1 #ifdef DEBUG_UPREFS -#define UR_OUT(X) std::cerr << X +#define UR_OUT(X) llvm_cerr << X #else #define UR_OUT(X) #endif @@ -2201,7 +2201,7 @@ FnDeclareLinkage: /*default*/ | DLLIMPORT { CurFun.Linkage = GlobalValue::DLLImportLinkage; } | - EXTERN_WEAK { CurFun.Linkage = GlobalValue::DLLImportLinkage; }; + EXTERN_WEAK { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; }; FunctionProto : DECLARE { CurFun.isDeclare = true; } FnDeclareLinkage FunctionHeaderH { $$ = CurFun.CurrentFunction; @@ -2633,7 +2633,7 @@ delete $2.type; } | NOT ResolvedVal { - std::cerr << "WARNING: Use of eliminated 'not' instruction:" + llvm_cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; Value *Ones = ConstantIntegral::getAllOnesValue($2.val->getType()); From reid at x10sys.com Thu Nov 30 18:37:32 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 18:37:32 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200612010037.kB10bWXg028485@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.252 -> 1.253 --- Log message: For PR1019: http://llvm.org/PR1019 : Add HAVE_PTHREAD to makefiles with support from configure and use it to determine whether to build examples/ParallelJIT. Patch by Anton Korobeynikov. --- Diffs of the changes: (+5 -1) configure.ac | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.252 llvm/autoconf/configure.ac:1.253 --- llvm/autoconf/configure.ac:1.252 Thu Nov 16 21:32:33 2006 +++ llvm/autoconf/configure.ac Thu Nov 30 18:37:14 2006 @@ -637,7 +637,11 @@ AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h]) AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h]) if test "$ENABLE_THREADS" -eq 1 ; then - AC_CHECK_HEADERS(pthread.h) + AC_CHECK_HEADER(pthread.h, + AC_SUBST(HAVE_PTHREAD, 1), + AC_SUBST(HAVE_PTHREAD, 0)) +else + AC_SUBST(HAVE_PTHREAD, 0) fi dnl===-----------------------------------------------------------------------=== From reid at x10sys.com Thu Nov 30 18:37:32 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 18:37:32 -0600 Subject: [llvm-commits] CVS: llvm/configure Makefile.config.in Message-ID: <200612010037.kB10bWng028480@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.257 -> 1.258 Makefile.config.in updated: 1.68 -> 1.69 --- Log message: For PR1019: http://llvm.org/PR1019 : Add HAVE_PTHREAD to makefiles with support from configure and use it to determine whether to build examples/ParallelJIT. Patch by Anton Korobeynikov. --- Diffs of the changes: (+71 -71) Makefile.config.in | 3 - configure | 139 ++++++++++++++++++++++++++--------------------------- 2 files changed, 71 insertions(+), 71 deletions(-) Index: llvm/configure diff -u llvm/configure:1.257 llvm/configure:1.258 --- llvm/configure:1.257 Thu Nov 16 21:32:33 2006 +++ llvm/configure Thu Nov 30 18:37:14 2006 @@ -896,6 +896,7 @@ ETAGSFLAGS LLVMGCC LLVMGXX +HAVE_PTHREAD HUGE_VAL_SANITY ALLOCA MMAP_FILE @@ -10298,7 +10299,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12446 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14160,11 +14161,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14163: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14164: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14167: \$? = $ac_status" >&5 + echo "$as_me:14168: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14428,11 +14429,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14431: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14432: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14435: \$? = $ac_status" >&5 + echo "$as_me:14436: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14532,11 +14533,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14535: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14536: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14539: \$? = $ac_status" >&5 + echo "$as_me:14540: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16984,7 +16985,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:19456: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19459: \$? = $ac_status" >&5 + echo "$as_me:19460: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19556,11 +19557,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19559: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19560: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19563: \$? = $ac_status" >&5 + echo "$as_me:19564: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21126,11 +21127,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21129: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21130: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21133: \$? = $ac_status" >&5 + echo "$as_me:21134: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -21230,11 +21231,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21233: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21234: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21237: \$? = $ac_status" >&5 + echo "$as_me:21238: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23465,11 +23466,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23468: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23469: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23472: \$? = $ac_status" >&5 + echo "$as_me:23473: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -23733,11 +23734,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23736: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23737: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23740: \$? = $ac_status" >&5 + echo "$as_me:23741: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -23837,11 +23838,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23840: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23841: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:23844: \$? = $ac_status" >&5 + echo "$as_me:23845: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -29033,23 +29034,18 @@ done if test "$ENABLE_THREADS" -eq 1 ; then - -for ac_header in pthread.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + if test "${ac_cv_header_pthread_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -29057,7 +29053,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -29106,15 +29102,15 @@ echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -29154,25 +29150,25 @@ # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to llvmbugs at cs.uiuc.edu ## @@ -29181,26 +29177,28 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_header_pthread_h=$ac_header_preproc fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test $ac_cv_header_pthread_h = yes; then + HAVE_PTHREAD=1 + +else + HAVE_PTHREAD=0 fi -done + +else + HAVE_PTHREAD=0 fi @@ -34276,6 +34274,7 @@ ETAGSFLAGS!$ETAGSFLAGS$ac_delim LLVMGCC!$LLVMGCC$ac_delim LLVMGXX!$LLVMGXX$ac_delim +HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim ALLOCA!$ALLOCA$ac_delim MMAP_FILE!$MMAP_FILE$ac_delim @@ -34299,7 +34298,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.68 llvm/Makefile.config.in:1.69 --- llvm/Makefile.config.in:1.68 Thu Nov 16 21:32:33 2006 +++ llvm/Makefile.config.in Thu Nov 30 18:37:14 2006 @@ -165,7 +165,8 @@ TCLSH := @TCLSH@ ZIP := @ZIP@ -HAVE_PERL := @HAVE_PERL@ +HAVE_PERL := @HAVE_PERL@ +HAVE_PTHREAD := @HAVE_PTHREAD@ LIBS := @LIBS@ From reid at x10sys.com Thu Nov 30 18:37:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 18:37:31 -0600 Subject: [llvm-commits] CVS: llvm/examples/Makefile Message-ID: <200612010037.kB10bV0R028472@zion.cs.uiuc.edu> Changes in directory llvm/examples: Makefile updated: 1.7 -> 1.8 --- Log message: For PR1019: http://llvm.org/PR1019 : Add HAVE_PTHREAD to makefiles with support from configure and use it to determine whether to build examples/ParallelJIT. Patch by Anton Korobeynikov. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/examples/Makefile diff -u llvm/examples/Makefile:1.7 llvm/examples/Makefile:1.8 --- llvm/examples/Makefile:1.7 Wed May 31 20:09:43 2006 +++ llvm/examples/Makefile Thu Nov 30 18:37:14 2006 @@ -12,7 +12,7 @@ PARALLEL_DIRS:= Fibonacci HowToUseJIT ModuleMaker BFtoLLVM -ifeq ($(ENABLE_THREADS),1) +ifeq ($(HAVE_PTHREAD),1) PARALLEL_DIRS += ParallelJIT endif From nicholas at mxc.ca Thu Nov 30 18:43:29 2006 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 30 Nov 2006 18:43:29 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200612010043.kB10hTa4028646@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.121 -> 1.122 --- Log message: Fix opt -o option. Don't pass a pointer to an auto variable which is going away before it's needed, and don't try to delete that pointer! --- Diffs of the changes: (+3 -4) opt.cpp | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.121 llvm/tools/opt/opt.cpp:1.122 --- llvm/tools/opt/opt.cpp:1.121 Tue Nov 28 18:19:40 2006 +++ llvm/tools/opt/opt.cpp Thu Nov 30 18:43:14 2006 @@ -252,10 +252,9 @@ Passes.add(createVerifierPass()); // Write bytecode out to disk or cout as the last step... - if (!NoOutput && !AnalyzeOnly) { - llvm_ostream L(*Out); - Passes.add(new WriteBytecodePass(&L, Out != &std::cout, !NoCompress)); - } + llvm_ostream L(*Out); + if (!NoOutput && !AnalyzeOnly) + Passes.add(new WriteBytecodePass(&L, false, !NoCompress)); // Now that we have all of the passes ready, run them. Passes.run(*M.get()); From nicholas at mxc.ca Thu Nov 30 19:05:29 2006 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 30 Nov 2006 19:05:29 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200612010105.kB115TQr029118@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.112 -> 1.113 --- Log message: Remove extra header. --- Diffs of the changes: (+0 -1) gccld.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.112 llvm/tools/gccld/gccld.cpp:1.113 --- llvm/tools/gccld/gccld.cpp:1.112 Tue Nov 28 18:19:40 2006 +++ llvm/tools/gccld/gccld.cpp Thu Nov 30 19:05:14 2006 @@ -25,7 +25,6 @@ #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" -#include "llvm/Bytecode/WriteBytecodePass.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" From clattner at apple.com Thu Nov 30 19:33:45 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 17:33:45 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: <200612010025.kB10PZq4028215@zion.cs.uiuc.edu> References: <200612010025.kB10PZq4028215@zion.cs.uiuc.edu> Message-ID: <6384D3DD-BC5B-4A10-915F-842E579B6AA7@apple.com> Reid, On Nov 30, 2006, at 4:25 PM, Anton Korobeynikov wrote: > Introducing external weak linkage. Darwin codegen should be added > later. > > Index: llvm/lib/VMCore/ConstantFolding.cpp > diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.100 llvm/lib/VMCore/ > ConstantFolding.cpp:1.101 > --- llvm/lib/VMCore/ConstantFolding.cpp:1.100 Sun Nov 26 19:05:10 2006 > +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 18:25:12 2006 > @@ -894,11 +894,8 @@ > > case Instruction::PtrToInt: > // Cast of a global address to boolean is always true. > - if (isa(V)) { > - if (DestTy == Type::BoolTy) > - // FIXME: When we support 'external weak' references, we > have to > - // prevent this transformation from happening. This code > will need > - // to be updated to ignore external weak symbols when we > support it. > + if (const GlobalValue *GV = dyn_cast(V)) { > + if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) > return ConstantBool::getTrue(); > This code is wrong, but it's not anton's fault. This is fallout from the cast patch. ptrtoint(&GV, bool) is not guaranteed to be true, even with non-extern-weak symbols, as the ptrtoint truncates, it doesn't compare to null any more. This code should be removed, and code should be added to ConstantFolding.cpp in the setne(&GV, null)/seteq(&GV, null) codepath to handle this. Thanks, -Chris From sabre at nondot.org Thu Nov 30 19:45:54 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 19:45:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200612010145.kB11jsZY029785@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.237 -> 1.238 --- Log message: Fix the CodeGen/PowerPC/vec_constants.ll regression. --- Diffs of the changes: (+9 -6) PPCISelLowering.cpp | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.237 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.238 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.237 Wed Nov 29 13:58:49 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Thu Nov 30 19:45:39 2006 @@ -1958,13 +1958,17 @@ static SDOperand BuildSplatI(int Val, unsigned SplatSize, MVT::ValueType VT, SelectionDAG &DAG) { assert(Val >= -16 && Val <= 15 && "vsplti is out of range!"); - - // Force vspltis[hw] -1 to vspltisb -1. - if (Val == -1) SplatSize = 1; - + static const MVT::ValueType VTys[] = { // canonical VT to use for each size. MVT::v16i8, MVT::v8i16, MVT::Other, MVT::v4i32 }; + + MVT::ValueType ReqVT = VT != MVT::Other ? VT : VTys[SplatSize-1]; + + // Force vspltis[hw] -1 to vspltisb -1 to canonicalize. + if (Val == -1) + SplatSize = 1; + MVT::ValueType CanonicalVT = VTys[SplatSize-1]; // Build a canonical splat for this value. @@ -1973,8 +1977,7 @@ Ops.assign(MVT::getVectorNumElements(CanonicalVT), Elt); SDOperand Res = DAG.getNode(ISD::BUILD_VECTOR, CanonicalVT, &Ops[0], Ops.size()); - if (VT == MVT::Other) return Res; - return DAG.getNode(ISD::BIT_CONVERT, VT, Res); + return DAG.getNode(ISD::BIT_CONVERT, ReqVT, Res); } /// BuildIntrinsicOp - Return a binary operator intrinsic node with the From rspencer at reidspencer.com Thu Nov 30 19:48:52 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 30 Nov 2006 17:48:52 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: <6384D3DD-BC5B-4A10-915F-842E579B6AA7@apple.com> References: <200612010025.kB10PZq4028215@zion.cs.uiuc.edu> <6384D3DD-BC5B-4A10-915F-842E579B6AA7@apple.com> Message-ID: <1164937732.2837.205.camel@bashful.x10sys.com> On Thu, 2006-11-30 at 17:33 -0800, Chris Lattner wrote: > Reid, > > On Nov 30, 2006, at 4:25 PM, Anton Korobeynikov wrote: > > Introducing external weak linkage. Darwin codegen should be added > > later. > > > > Index: llvm/lib/VMCore/ConstantFolding.cpp > > diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.100 llvm/lib/VMCore/ > > ConstantFolding.cpp:1.101 > > --- llvm/lib/VMCore/ConstantFolding.cpp:1.100 Sun Nov 26 19:05:10 2006 > > +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 18:25:12 2006 > > @@ -894,11 +894,8 @@ > > > > case Instruction::PtrToInt: > > // Cast of a global address to boolean is always true. > > - if (isa(V)) { > > - if (DestTy == Type::BoolTy) > > - // FIXME: When we support 'external weak' references, we > > have to > > - // prevent this transformation from happening. This code > > will need > > - // to be updated to ignore external weak symbols when we > > support it. > > + if (const GlobalValue *GV = dyn_cast(V)) { > > + if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) > > return ConstantBool::getTrue(); > > > > This code is wrong, but it's not anton's fault. This is fallout from > the cast patch. ptrtoint(&GV, bool) is not guaranteed to be true, > even with non-extern-weak symbols, as the ptrtoint truncates, it > doesn't compare to null any more. > > This code should be removed, Okay, I agree. It should be removed. > and code should be added to > ConstantFolding.cpp in the setne(&GV, null)/seteq(&GV, null) codepath > to handle this. Which code path? You mean you generally want a setne(&GV, null) to be folded to ConstBool::True and seteq(&GV, null) to be folded to ConstBool::False ? > > Thanks, > > -Chris > > From reid at x10sys.com Thu Nov 30 19:51:00 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 19:51:00 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll Message-ID: <200612010151.kB11p0pR029905@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast-and-cast.ll updated: 1.2 -> 1.3 --- Log message: The InstCombine hack has been removed, no need to XFAIL this any more. --- Diffs of the changes: (+0 -4) cast-and-cast.ll | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.2 llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.2 Mon Nov 27 14:01:48 2006 +++ llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll Thu Nov 30 19:50:45 2006 @@ -1,9 +1,5 @@ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast -;; This requires Reid to remove the instcombine hack that turns trunc to bool into setne. -; XFAIL: * - - bool %test1(uint %val) { %t1 = bitcast uint %val to int %t2 = and int %t1, 1 From asl at math.spbu.ru Thu Nov 30 18:46:58 2006 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 01 Dec 2006 03:46:58 +0300 Subject: [llvm-commits] External weak linkage. llvm-gcc support Message-ID: <1164934018.21760.21.camel@asl.dorms.spbu.ru> Hello, Everyone. Please find patch for llvm-gcc4, which enables external weak linkage. All "supporting" patches to LLVM has been commited to CVS HEAD already. Please note, that applying this patch will, probably, break crtstuff.c compilation on Darwin, since there is no Darwin codegen for external weak linkage inside. PS: I've successfully bootstrapped llvm-gcc4 with these patches on Linux. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-gcc.diff Type: text/x-patch Size: 4695 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061201/a3088da5/attachment.bin From clattner at apple.com Thu Nov 30 20:09:56 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 18:09:56 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: <1164937732.2837.205.camel@bashful.x10sys.com> References: <200612010025.kB10PZq4028215@zion.cs.uiuc.edu> <6384D3DD-BC5B-4A10-915F-842E579B6AA7@apple.com> <1164937732.2837.205.camel@bashful.x10sys.com> Message-ID: <7D729331-698B-4EE0-898E-9CC588940FF6@apple.com> > >> and code should be added to >> ConstantFolding.cpp in the setne(&GV, null)/seteq(&GV, null) codepath >> to handle this. > > Which code path? You mean you generally want a setne(&GV, null) to be > folded to ConstBool::True and seteq(&GV, null) to be folded to > ConstBool::False ? Yep exactly. Unless the global is external weak. -Chris From reid at x10sys.com Thu Nov 30 21:46:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 21:46:16 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200612010346.kB13kGbL031558@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.70 -> 1.71 --- Log message: Define the HAVE_PTHREAD symbol. --- Diffs of the changes: (+0 -3) config.h.in | 3 --- 1 files changed, 3 deletions(-) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.70 llvm/include/llvm/Config/config.h.in:1.71 --- llvm/include/llvm/Config/config.h.in:1.70 Sun Nov 5 11:08:18 2006 +++ llvm/include/llvm/Config/config.h.in Thu Nov 30 21:46:01 2006 @@ -267,9 +267,6 @@ /* Define to have the %a format string */ #undef HAVE_PRINTF_A -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_H - /* Have pthread_mutex_lock */ #undef HAVE_PTHREAD_MUTEX_LOCK From reid at x10sys.com Thu Nov 30 21:56:45 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 21:56:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200612010356.kB13ujBt031763@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.101 -> 1.102 --- Log message: Don't fold "ptrtoint GV to bool" since this should be doing a truncate not a comparison against zero. Instead fold setne(GV,null) and seteq(GV,null) to ConstantBool::True or ConstantBool::False, respectively. --- Diffs of the changes: (+27 -7) ConstantFolding.cpp | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.101 llvm/lib/VMCore/ConstantFolding.cpp:1.102 --- llvm/lib/VMCore/ConstantFolding.cpp:1.101 Thu Nov 30 18:25:12 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 21:56:30 2006 @@ -893,11 +893,6 @@ break; case Instruction::PtrToInt: - // Cast of a global address to boolean is always true. - if (const GlobalValue *GV = dyn_cast(V)) { - if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) - return ConstantBool::getTrue(); - } break; case Instruction::BitCast: // Check to see if we are casting a pointer to an aggregate to a pointer to @@ -1371,10 +1366,35 @@ case Instruction::Shl: C = ConstRules::get(V1, V2).shl(V1, V2); break; case Instruction::LShr: C = ConstRules::get(V1, V2).lshr(V1, V2); break; case Instruction::AShr: C = ConstRules::get(V1, V2).ashr(V1, V2); break; - case Instruction::SetEQ: C = ConstRules::get(V1, V2).equalto(V1, V2); break; + case Instruction::SetEQ: + // SetEQ(null,GV) -> false + if (V1->isNullValue()) { + if (const GlobalValue *GV = dyn_cast(V2)) + if (!GV->hasExternalWeakLinkage()) + return ConstantBool::getFalse(); + // SetEQ(GV,null) -> false + } else if (V2->isNullValue()) { + if (const GlobalValue *GV = dyn_cast(V1)) + if (!GV->hasExternalWeakLinkage()) + return ConstantBool::getFalse(); + } + C = ConstRules::get(V1, V2).equalto(V1, V2); + break; case Instruction::SetLT: C = ConstRules::get(V1, V2).lessthan(V1, V2);break; case Instruction::SetGT: C = ConstRules::get(V1, V2).lessthan(V2, V1);break; - case Instruction::SetNE: // V1 != V2 === !(V1 == V2) + case Instruction::SetNE: + // SetNE(null,GV) -> true + if (V1->isNullValue()) { + if (const GlobalValue *GV = dyn_cast(V2)) + if (!GV->hasExternalWeakLinkage()) + return ConstantBool::getTrue(); + // SetNE(GV,null) -> true + } else if (V2->isNullValue()) { + if (const GlobalValue *GV = dyn_cast(V1)) + if (!GV->hasExternalWeakLinkage()) + return ConstantBool::getTrue(); + } + // V1 != V2 === !(V1 == V2) C = ConstRules::get(V1, V2).equalto(V1, V2); if (C) return ConstantExpr::getNot(C); break; From clattner at apple.com Thu Nov 30 22:51:49 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 20:51:49 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: <200612010356.kB13ujBt031763@zion.cs.uiuc.edu> References: <200612010356.kB13ujBt031763@zion.cs.uiuc.edu> Message-ID: On Nov 30, 2006, at 7:56 PM, Reid Spencer wrote: > > case Instruction::PtrToInt: > - // Cast of a global address to boolean is always true. > - if (const GlobalValue *GV = dyn_cast(V)) { > - if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) > - return ConstantBool::getTrue(); > - } > break; Thanks Reid, the patch looks great. I think you can remove this empty case now though, -Chris From reid at x10sys.com Thu Nov 30 23:01:02 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Nov 2006 21:01:02 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: References: <200612010356.kB13ujBt031763@zion.cs.uiuc.edu> Message-ID: <1164949262.2837.212.camel@bashful.x10sys.com> On Thu, 2006-11-30 at 20:51 -0800, Chris Lattner wrote: > On Nov 30, 2006, at 7:56 PM, Reid Spencer wrote: > > > > > case Instruction::PtrToInt: > > - // Cast of a global address to boolean is always true. > > - if (const GlobalValue *GV = dyn_cast(V)) { > > - if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) > > - return ConstantBool::getTrue(); > > - } > > break; > > Thanks Reid, the patch looks great. I think you can remove this > empty case now though, The default asserts, trying to catch bad opcodes. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061130/edd584fd/attachment.bin From clattner at apple.com Thu Nov 30 23:32:54 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 21:32:54 -0800 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp In-Reply-To: <1164949262.2837.212.camel@bashful.x10sys.com> References: <200612010356.kB13ujBt031763@zion.cs.uiuc.edu> <1164949262.2837.212.camel@bashful.x10sys.com> Message-ID: On Nov 30, 2006, at 9:01 PM, Reid Spencer wrote: > On Thu, 2006-11-30 at 20:51 -0800, Chris Lattner wrote: >> On Nov 30, 2006, at 7:56 PM, Reid Spencer wrote: >> >>> >>> case Instruction::PtrToInt: >>> - // Cast of a global address to boolean is always true. >>> - if (const GlobalValue *GV = dyn_cast(V)) { >>> - if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) >>> - return ConstantBool::getTrue(); >>> - } >>> break; >> >> Thanks Reid, the patch looks great. I think you can remove this >> empty case now though, > > The default asserts, trying to catch bad opcodes. Ah, good call, thanks again! -Chris From sabre at nondot.org Thu Nov 30 23:55:02 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 23:55:02 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ConstProp/2006-11-30-vector-cast.ll Message-ID: <200612010555.kB15t27q001339@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ConstProp: 2006-11-30-vector-cast.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+7 -0) 2006-11-30-vector-cast.ll | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/Regression/Transforms/ConstProp/2006-11-30-vector-cast.ll diff -c /dev/null llvm/test/Regression/Transforms/ConstProp/2006-11-30-vector-cast.ll:1.1 *** /dev/null Thu Nov 30 23:54:58 2006 --- llvm/test/Regression/Transforms/ConstProp/2006-11-30-vector-cast.ll Thu Nov 30 23:54:48 2006 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 4294967295 && + ; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep zeroinitializer + + < 4 x uint> %test() { + %tmp40 = bitcast <2 x long> bitcast (<4 x int> < int 0, int 0, int -1, int 0 > to <2 x long>) to <4 x uint> + ret <4 x uint> %tmp40 + } From sabre at nondot.org Thu Nov 30 23:55:40 2006 From: sabre at nondot.org (Chris Lattner) Date: Thu, 30 Nov 2006 23:55:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200612010555.kB15teT4001372@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.102 -> 1.103 --- Log message: Fix a typo introduced by the cast patch that horribly broke a lot of vector code. Testcase here: Transforms/ConstProp/2006-11-30-vector-cast.ll --- Diffs of the changes: (+1 -1) ConstantFolding.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.102 llvm/lib/VMCore/ConstantFolding.cpp:1.103 --- llvm/lib/VMCore/ConstantFolding.cpp:1.102 Thu Nov 30 21:56:30 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 23:55:25 2006 @@ -743,7 +743,7 @@ (SrcEltTy->isFloatingPoint() && DstEltTy->isFloatingPoint())) { for (unsigned i = 0; i != SrcNumElts; ++i) Result.push_back( - ConstantExpr::getCast(Instruction::BitCast, CP->getOperand(1), + ConstantExpr::getCast(Instruction::BitCast, CP->getOperand(i), DstEltTy)); return ConstantPacked::get(Result); } From sabre at nondot.org Fri Dec 1 00:35:11 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 00:35:11 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2006-11-30-ConstantExprCrash.cpp Message-ID: <200612010635.kB16ZBMK002118@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2006-11-30-ConstantExprCrash.cpp added (r1.1) --- Log message: new testcase for PR1027: http://llvm.org/PR1027 --- Diffs of the changes: (+27 -0) 2006-11-30-ConstantExprCrash.cpp | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/test/Regression/C++Frontend/2006-11-30-ConstantExprCrash.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2006-11-30-ConstantExprCrash.cpp:1.1 *** /dev/null Fri Dec 1 00:35:06 2006 --- llvm/test/Regression/C++Frontend/2006-11-30-ConstantExprCrash.cpp Fri Dec 1 00:34:56 2006 *************** *** 0 **** --- 1,27 ---- + // RUN: %llvmgxx %s -emit-llvm -S -o - + // PR1027 + + struct sys_var { + unsigned name_length; + + bool no_support_one_shot; + sys_var() {} + }; + + + struct sys_var_thd : public sys_var { + }; + + extern sys_var_thd sys_auto_is_null; + + sys_var *getsys_variables() { + return &sys_auto_is_null; + } + + sys_var *sys_variables = &sys_auto_is_null; + + + + + + From clattner at apple.com Fri Dec 1 00:36:24 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 22:36:24 -0800 Subject: [llvm-commits] patch for pr1027 Message-ID: Simple patch, GCC's tree IR isn't as consistent as you might think, particularly the C++ front-end. -Chris Index: llvm-convert.cpp =================================================================== --- llvm-convert.cpp (revision 120751) +++ llvm-convert.cpp (working copy) @@ -4911,13 +4911,6 @@ FieldPtr = ConstantExpr::getCast(FieldPtr, PointerType::get (FieldTy)); } - // If this is a bitfield reference, return it as such. - if (DECL_SIZE(FieldDecl) && TREE_CODE(DECL_SIZE(FieldDecl)) == INTEGER_CST && - TREE_INT_CST_LOW(DECL_SIZE(FieldDecl)) != 8*TD.getTypeSize (FieldTy)) { - assert(0 && "Cannot take the address of a bitfield!"); - abort(); - } - assert(BitStart == 0 && "It's a bitfield reference or we didn't get to the field!"); return FieldPtr; From clattner at apple.com Fri Dec 1 01:01:52 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 30 Nov 2006 23:01:52 -0800 Subject: [llvm-commits] External weak linkage. llvm-gcc support In-Reply-To: <1164934018.21760.21.camel@asl.dorms.spbu.ru> References: <1164934018.21760.21.camel@asl.dorms.spbu.ru> Message-ID: <3CAE6DB6-5C5A-422C-ABE6-6C689EFF8F14@apple.com> On Nov 30, 2006, at 4:46 PM, Anton Korobeynikov wrote: > Hello, Everyone. > > Please find patch for llvm-gcc4, which enables external weak linkage. > All "supporting" patches to LLVM has been commited to CVS HEAD > already. > > Please note, that applying this patch will, probably, break crtstuff.c > compilation on Darwin, since there is no Darwin codegen for external > weak linkage inside. > > PS: I've successfully bootstrapped llvm-gcc4 with these patches on > Linux. Looks great, applied, thanks! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061130/cd3bbbbc/attachment.html From sabre at nondot.org Fri Dec 1 01:14:40 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 01:14:40 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/extern-weak.c Message-ID: <200612010714.kB17Eewv002829@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: extern-weak.c added (r1.1) --- Log message: new testcase to verify external weak continues to work --- Diffs of the changes: (+13 -0) extern-weak.c | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/Regression/CFrontend/extern-weak.c diff -c /dev/null llvm/test/Regression/CFrontend/extern-weak.c:1.1 *** /dev/null Fri Dec 1 01:14:36 2006 --- llvm/test/Regression/CFrontend/extern-weak.c Fri Dec 1 01:14:26 2006 *************** *** 0 **** --- 1,13 ---- + // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak + + // TODO: Enable this when darwin gets weak support: + // : %llvmgcc -O3 -S -o - -emit-llvm | llvm-as | llc + + #ifdef __APPLE_CC__ + void foo() __attribute__((weak_import)); + #else + void foo() __attribute__((weak)); + #endif + + void bar() { foo(); } + From evan.cheng at apple.com Fri Dec 1 01:15:39 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 01:15:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200612010715.kB17FdaV002858@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.214 -> 1.215 --- Log message: Darwin X86 external weak linkage support. --- Diffs of the changes: (+3 -5) X86AsmPrinter.cpp | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.214 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.215 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.214 Thu Nov 30 18:25:12 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Dec 1 01:15:24 2006 @@ -283,10 +283,7 @@ O << "\t.ascii \" -export:" << *i << "\"\n"; } - if (Subtarget->isTargetDarwin()) { - if (ExtWeakSymbols.begin() != ExtWeakSymbols.end()) - assert(0 && "External weak linkage for Darwin not implemented yet"); - } else if (Subtarget->isTargetCygwin()) { + if (Subtarget->isTargetCygwin()) { // There is no external weak linkage on Mingw32 platform. // Defaulting to external } else { @@ -296,7 +293,8 @@ for (std::set::iterator i = ExtWeakSymbols.begin(), e = ExtWeakSymbols.end(); i != e; ++i) { - O << "\t.weak " << *i << "\n"; + O << (Subtarget->isTargetDarwin() ? "\t.weak_reference" : "\t.weak") + << " " << *i << "\n"; } } From evan.cheng at apple.com Fri Dec 1 01:17:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 01:17:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200612010717.kB17HE9J002893@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.215 -> 1.216 --- Log message: Fix indentation. --- Diffs of the changes: (+1 -2) X86AsmPrinter.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.215 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.216 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.215 Fri Dec 1 01:15:24 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Dec 1 01:17:00 2006 @@ -291,8 +291,7 @@ SwitchToDataSection(""); for (std::set::iterator i = ExtWeakSymbols.begin(), - e = ExtWeakSymbols.end(); - i != e; ++i) { + e = ExtWeakSymbols.end(); i != e; ++i) { O << (Subtarget->isTargetDarwin() ? "\t.weak_reference" : "\t.weak") << " " << *i << "\n"; } From evan.cheng at apple.com Fri Dec 1 01:38:37 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 01:38:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp Message-ID: <200612010738.kB17cbaY003257@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.75 -> 1.76 X86AsmPrinter.cpp updated: 1.216 -> 1.217 --- Log message: Minor code clean up. --- Diffs of the changes: (+2 -4) X86ATTAsmPrinter.cpp | 3 +-- X86AsmPrinter.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.75 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.76 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.75 Thu Nov 30 18:25:12 2006 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Fri Dec 1 01:38:23 2006 @@ -256,9 +256,8 @@ O << Name; } - if (GV->hasExternalWeakLinkage()) { + if (GV->hasExternalWeakLinkage()) ExtWeakSymbols.insert(Name); - } int Offset = MO.getOffset(); if (Offset > 0) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.216 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.217 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.216 Fri Dec 1 01:17:00 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Dec 1 01:38:23 2006 @@ -283,10 +283,9 @@ O << "\t.ascii \" -export:" << *i << "\"\n"; } - if (Subtarget->isTargetCygwin()) { + if (!Subtarget->isTargetCygwin()) { // There is no external weak linkage on Mingw32 platform. // Defaulting to external - } else { if (ExtWeakSymbols.begin() != ExtWeakSymbols.end()) SwitchToDataSection(""); From evan.cheng at apple.com Fri Dec 1 01:56:52 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 01:56:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200612010756.kB17uq94003545@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.211 -> 1.212 --- Log message: Darwin PPC external weak linkage support. --- Diffs of the changes: (+15 -1) PPCAsmPrinter.cpp | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.212 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211 Tue Nov 28 12:21:52 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 1 01:56:37 2006 @@ -52,6 +52,9 @@ std::set FnStubs, GVStubs; const PPCSubtarget &Subtarget; + // Necessary for external weak linkage support + std::set ExtWeakSymbols; + PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T) : AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget()) { } @@ -159,6 +162,8 @@ std::string Name = Mang->getValueName(GV); FnStubs.insert(Name); O << "L" << Name << "$stub"; + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(Name); return; } } @@ -330,8 +335,10 @@ return; } } - O << Name; + + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(Name); return; } @@ -633,6 +640,13 @@ } } + if (ExtWeakSymbols.begin() != ExtWeakSymbols.end()) + SwitchToDataSection(""); + for (std::set::iterator i = ExtWeakSymbols.begin(), + e = ExtWeakSymbols.end(); i != e; ++i) { + O << "\t.weak_reference " << *i << "\n"; + } + bool isPPC64 = TD->getPointerSizeInBits() == 64; // Output stubs for dynamically-linked functions From evan.cheng at apple.com Fri Dec 1 03:10:49 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 03:10:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200612010910.kB19Ankq013586@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.217 -> 1.218 --- Log message: A initialized global variable cannot be extern weak. However, if a global value's initializer is itself a external weak symbol, emit the weak reference. --- Diffs of the changes: (+6 -11) X86AsmPrinter.cpp | 17 ++++++----------- 1 files changed, 6 insertions(+), 11 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.217 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.218 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.217 Fri Dec 1 01:38:23 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Dec 1 03:10:28 2006 @@ -177,17 +177,6 @@ O << "\t\t" << TAI->getCommentString() << " " << I->getName() << "\n"; } else { switch (I->getLinkage()) { - case GlobalValue::ExternalWeakLinkage: - if (Subtarget->isTargetDarwin()) { - assert(0 && "External weak linkage for Darwin not implemented yet"); - } else if (Subtarget->isTargetCygwin()) { - // There is no external weak linkage on Mingw32 platform. - // Defaulting just to external - O << "\t.globl " << name << "\n"; - } else { - O << "\t.weak " << name << "\n"; - break; - } case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: if (Subtarget->isTargetDarwin()) { @@ -257,6 +246,12 @@ if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size " << name << ", " << Size << "\n"; + // If the initializer is a extern weak symbol, remember to emit the weak + // reference! + if (const GlobalValue *GV = dyn_cast(C)) + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(Mang->getValueName(GV)); + EmitGlobalConstant(C); O << '\n'; } From evan.cheng at apple.com Fri Dec 1 03:13:41 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 03:13:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200612010913.kB19Df5A013670@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.212 -> 1.213 --- Log message: A initialized global variable cannot be extern weak. However, if a global value's initializer is itself a external weak symbol, emit the weak reference. --- Diffs of the changes: (+10 -0) PPCAsmPrinter.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.212 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.213 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.212 Fri Dec 1 01:56:37 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 1 03:13:26 2006 @@ -605,6 +605,9 @@ } else { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: + case GlobalValue::ExternalWeakLinkage: + O << "\t.weak_reference " << name << "\n"; + break; case GlobalValue::WeakLinkage: O << "\t.globl " << name << '\n' << "\t.weak_definition " << name << '\n'; @@ -635,6 +638,13 @@ EmitAlignment(Align, I); O << name << ":\t\t\t\t; '" << I->getName() << "'\n"; + + // If the initializer is a extern weak symbol, remember to emit the weak + // reference! + if (const GlobalValue *GV = dyn_cast(C)) + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(Mang->getValueName(GV)); + EmitGlobalConstant(C); O << '\n'; } From evan.cheng at apple.com Fri Dec 1 03:18:34 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 03:18:34 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/extern_weak.ll Message-ID: <200612010918.kB19IY6P013771@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: extern_weak.ll added (r1.1) --- Log message: Add a extern weak test case. --- Diffs of the changes: (+11 -0) extern_weak.ll | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/Regression/CodeGen/X86/extern_weak.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/extern_weak.ll:1.1 *** /dev/null Fri Dec 1 03:18:30 2006 --- llvm/test/Regression/CodeGen/X86/extern_weak.ll Fri Dec 1 03:18:20 2006 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep weak_reference | wc -l | grep 2 + + %Y = global int (sbyte*)* %X + declare extern_weak int %X(sbyte*) + + void %bar() { + tail call void (...)* %foo( ) + ret void + } + + declare extern_weak void %foo(...) From evan.cheng at apple.com Fri Dec 1 04:17:51 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 04:17:51 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll Message-ID: <200612011017.kB1AHpK2015168@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2005-05-08-FPStackifierPHI.ll updated: 1.1 -> 1.2 --- Log message: This test is meant for X86 CPU which does not support SSE2. --- Diffs of the changes: (+1 -1) 2005-05-08-FPStackifierPHI.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll diff -u llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll:1.1 llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll:1.2 --- llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll:1.1 Sun May 8 22:36:11 2005 +++ llvm/test/Regression/CodeGen/X86/2005-05-08-FPStackifierPHI.ll Fri Dec 1 04:17:36 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 +; RUN: llvm-as < %s | llc -march=x86 -mcpu=generic ; Make sure LLC doesn't crash in the stackifier due to FP PHI nodes. void %radfg_() { From evan.cheng at apple.com Fri Dec 1 04:12:05 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 04:12:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86FloatingPoint.cpp Message-ID: <200612011012.kB1AC5Xs015078@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86FloatingPoint.cpp updated: 1.62 -> 1.63 --- Log message: Fix 2005-05-08-FPStackifierPHI.ll failure. --- Diffs of the changes: (+7 -26) X86FloatingPoint.cpp | 33 +++++++-------------------------- 1 files changed, 7 insertions(+), 26 deletions(-) Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.62 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.63 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.62 Thu Nov 30 01:12:03 2006 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Fri Dec 1 04:11:51 2006 @@ -62,11 +62,12 @@ MachineFunctionPass::getAnalysisUsage(AU); } private: - LiveVariables *LV; // Live variable info for current function... - MachineBasicBlock *MBB; // Current basic block - unsigned Stack[8]; // FP Registers in each stack slot... - unsigned RegMap[8]; // Track which stack slot contains each register - unsigned StackTop; // The current top of the FP stack. + const TargetInstrInfo *TII; // Machine instruction info. + LiveVariables *LV; // Live variable info for current function... + MachineBasicBlock *MBB; // Current basic block + unsigned Stack[8]; // FP Registers in each stack slot... + unsigned RegMap[8]; // Track which stack slot contains each register + unsigned StackTop; // The current top of the FP stack. void dumpStack() const { std::cerr << "Stack contents:"; @@ -107,9 +108,6 @@ bool isAtTop(unsigned RegNo) const { return getSlot(RegNo) == StackTop-1; } void moveToTop(unsigned RegNo, MachineBasicBlock::iterator &I) { if (!isAtTop(RegNo)) { - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); - unsigned STReg = getSTReg(RegNo); unsigned RegOnTop = getStackEntry(0); @@ -127,8 +125,6 @@ } void duplicateToTop(unsigned RegNo, unsigned AsReg, MachineInstr *I) { - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); unsigned STReg = getSTReg(RegNo); pushReg(AsReg); // New register on top of stack @@ -179,6 +175,7 @@ // Early exit. if (!FPIsUsed) return false; + TII = MF.getTarget().getInstrInfo(); LV = &getAnalysis(); StackTop = 0; @@ -431,8 +428,6 @@ assert(StackTop > 0 && "Cannot pop empty stack!"); RegMap[Stack[--StackTop]] = ~0; // Update state - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Check to see if there is a popping version of this instruction... int Opcode = Lookup(PopTable, ARRAY_SIZE(PopTable), I->getOpcode()); if (Opcode != -1) { @@ -464,8 +459,6 @@ RegMap[TopReg] = OldSlot; RegMap[FPRegNo] = ~0; Stack[--StackTop] = ~0; - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); I = BuildMI(*MBB, ++I, TII->get(X86::FSTPrr)).addReg(STReg); } @@ -486,8 +479,6 @@ /// void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); unsigned DestReg = getFPReg(MI->getOperand(0)); // Change from the pseudo instruction to the concrete instruction. @@ -528,8 +519,6 @@ // Convert from the pseudo instruction to the concrete instruction. MI->RemoveOperand(NumOps-1); // Remove explicit ST(0) operand - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); if (MI->getOpcode() == X86::FISTP64m || @@ -575,8 +564,6 @@ } // Change from the pseudo instruction to the concrete instruction. - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); MI->RemoveOperand(1); // Drop the source operand. MI->RemoveOperand(0); // Drop the destination operand. MI->setInstrDescriptor(TII->get(getConcreteOpcode(MI->getOpcode()))); @@ -704,8 +691,6 @@ // Replace the old instruction with a new instruction MBB->remove(I++); - MachineFunction *MF = MI->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); I = BuildMI(*MBB, I, TII->get(Opcode)).addReg(getSTReg(NotTOS)); // If both operands are killed, pop one off of the stack in addition to @@ -743,8 +728,6 @@ // anywhere. moveToTop(Op0, I); - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Change from the pseudo instruction to the concrete instruction. MI->getOperand(0).setReg(getSTReg(Op1)); MI->RemoveOperand(1); @@ -769,8 +752,6 @@ // The first operand *must* be on the top of the stack. moveToTop(Op0, I); - MachineFunction *MF = I->getParent()->getParent(); - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); // Change the second operand to the stack register that the operand is in. // Change from the pseudo instruction to the concrete instruction. MI->RemoveOperand(0); From rafael.espindola at gmail.com Fri Dec 1 07:11:07 2006 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Fri, 1 Dec 2006 10:11:07 -0300 Subject: [llvm-commits] [llvm-gcc4] gcc/llvm-debug.cpp In-Reply-To: <669AB0BF-8725-4E50-AD64-0B20C910E966@apple.com> References: <669AB0BF-8725-4E50-AD64-0B20C910E966@apple.com> Message-ID: <564d96fb0612010511p2541fb45ib5775f93b2a56ceb@mail.gmail.com> Could you please send this patch as an attachment? Sending it inline broke something... Thanks, Rafael From jlaskey at apple.com Fri Dec 1 08:37:53 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 1 Dec 2006 08:37:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200612011437.kB1EbrEU019435@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.213 -> 1.214 --- Log message: ExternalWeak case in wrong location. --- Diffs of the changes: (+1 -1) PPCAsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.213 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.214 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.213 Fri Dec 1 03:13:26 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 1 08:37:39 2006 @@ -604,10 +604,10 @@ O << "\t\t; '" << I->getName() << "'\n"; } else { switch (I->getLinkage()) { - case GlobalValue::LinkOnceLinkage: case GlobalValue::ExternalWeakLinkage: O << "\t.weak_reference " << name << "\n"; break; + case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: O << "\t.globl " << name << '\n' << "\t.weak_definition " << name << '\n'; From jlaskey at apple.com Fri Dec 1 10:31:02 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 1 Dec 2006 10:31:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200612011631.kB1GV2TV021683@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.238 -> 1.239 --- Log message: 1. In ppc64 mode we need only use one GPR. 2. Float values need to be promoted to double when they are vararg. --- Diffs of the changes: (+7 -1) PPCISelLowering.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.238 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.239 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.238 Thu Nov 30 19:45:39 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Dec 1 10:30:47 2006 @@ -1377,6 +1377,12 @@ break; case MVT::f32: case MVT::f64: + if (isVarArg && isPPC64) { + // Float varargs need to be promoted to double. + if (Arg.getValueType() == MVT::f32) + Arg = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Arg); + } + if (FPR_idx != NumFPRs) { RegsToPass.push_back(std::make_pair(FPR[FPR_idx++], Arg)); @@ -1390,7 +1396,7 @@ MemOpChains.push_back(Load.getValue(1)); RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load)); } - if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64) { + if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64 && !isPPC64){ SDOperand ConstFour = DAG.getConstant(4, PtrOff.getValueType()); PtrOff = DAG.getNode(ISD::ADD, PtrVT, PtrOff, ConstFour); SDOperand Load = DAG.getLoad(PtrVT, Store, PtrOff, NULL, 0); From sabre at nondot.org Fri Dec 1 12:04:23 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 12:04:23 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/extern-weak.c Message-ID: <200612011804.kB1I4N7V023393@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: extern-weak.c updated: 1.1 -> 1.2 --- Log message: enable this now that codegen support is in place --- Diffs of the changes: (+2 -4) extern-weak.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/test/Regression/CFrontend/extern-weak.c diff -u llvm/test/Regression/CFrontend/extern-weak.c:1.1 llvm/test/Regression/CFrontend/extern-weak.c:1.2 --- llvm/test/Regression/CFrontend/extern-weak.c:1.1 Fri Dec 1 01:14:26 2006 +++ llvm/test/Regression/CFrontend/extern-weak.c Fri Dec 1 12:04:08 2006 @@ -1,7 +1,5 @@ -// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak - -// TODO: Enable this when darwin gets weak support: -// : %llvmgcc -O3 -S -o - -emit-llvm | llvm-as | llc +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak && +// RUN: %llvmgcc -O3 -S -o - -emit-llvm | llvm-as | llc #ifdef __APPLE_CC__ void foo() __attribute__((weak_import)); From sabre at nondot.org Fri Dec 1 12:11:29 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 12:11:29 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c Message-ID: <200612011811.kB1IBTYj023663@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput: fixoutput.c updated: 1.2 -> 1.3 --- Log message: let this pass on ppc --- Diffs of the changes: (+1 -0) fixoutput.c | 1 + 1 files changed, 1 insertion(+) Index: llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c:1.2 llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c:1.3 --- llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c:1.2 Fri Oct 29 14:43:45 2004 +++ llvm-test/MultiSource/Benchmarks/Prolangs-C/fixoutput/fixoutput.c Fri Dec 1 12:11:15 2006 @@ -317,4 +317,5 @@ if (ERROR_CNT) printf("****** %d format errors found in output of your scanner.\n", ERROR_CNT); + exit(0); } From sabre at nondot.org Fri Dec 1 12:18:01 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 12:18:01 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/build.c divides.c multiplies.c Message-ID: <200612011818.kB1II1u4023818@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector: build.c updated: 1.1 -> 1.2 divides.c updated: 1.1 -> 1.2 multiplies.c updated: 1.1 -> 1.2 --- Log message: Allow these to pass on ppc --- Diffs of the changes: (+5 -5) build.c | 8 +++----- divides.c | 1 + multiplies.c | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-test/SingleSource/UnitTests/Vector/build.c diff -u llvm-test/SingleSource/UnitTests/Vector/build.c:1.1 llvm-test/SingleSource/UnitTests/Vector/build.c:1.2 --- llvm-test/SingleSource/UnitTests/Vector/build.c:1.1 Tue Mar 21 19:48:35 2006 +++ llvm-test/SingleSource/UnitTests/Vector/build.c Fri Dec 1 12:17:46 2006 @@ -5,10 +5,8 @@ if (argc == 1123) X = 2.38213; FV A; A.V = (v4sf){ X, X, X, X }; // splat - A.V = A.V * A.V; - printFV(&A); - A.V = (v4sf){ X, X, 0, 0 }; - A.V = A.V+A.V; - printFV(&A); + //A.V = A.V * A.V; + printf("%f", A.A[1]); + return 0; } Index: llvm-test/SingleSource/UnitTests/Vector/divides.c diff -u llvm-test/SingleSource/UnitTests/Vector/divides.c:1.1 llvm-test/SingleSource/UnitTests/Vector/divides.c:1.2 --- llvm-test/SingleSource/UnitTests/Vector/divides.c:1.1 Thu Oct 26 00:59:25 2006 +++ llvm-test/SingleSource/UnitTests/Vector/divides.c Fri Dec 1 12:17:46 2006 @@ -30,4 +30,5 @@ printf("U3.V = <%u %u %u %u>\n", U3.A[0], U3.A[1], U3.A[2], U3.A[3]); printf("S3.V = <%u %u %u %u>\n", S3.A[0], S3.A[1], S3.A[2], S3.A[3]); + return 0; } Index: llvm-test/SingleSource/UnitTests/Vector/multiplies.c diff -u llvm-test/SingleSource/UnitTests/Vector/multiplies.c:1.1 llvm-test/SingleSource/UnitTests/Vector/multiplies.c:1.2 --- llvm-test/SingleSource/UnitTests/Vector/multiplies.c:1.1 Tue Apr 4 01:50:24 2006 +++ llvm-test/SingleSource/UnitTests/Vector/multiplies.c Fri Dec 1 12:17:46 2006 @@ -30,5 +30,6 @@ ProcessArray(v4f32); ProcessArray(v2f64); #endif + return 0; } From sabre at nondot.org Fri Dec 1 13:03:10 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:03:10 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll Message-ID: <200612011903.kB1J3Ajq024732@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ConstProp: 2006-12-01-TruncBoolBug.ll added (r1.1) --- Log message: new 'cast' miscompilation, reduced from perlbmk by Evan --- Diffs of the changes: (+5 -0) 2006-12-01-TruncBoolBug.ll | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/test/Regression/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll diff -c /dev/null llvm/test/Regression/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll:1.1 *** /dev/null Fri Dec 1 13:03:06 2006 --- llvm/test/Regression/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll Fri Dec 1 13:02:56 2006 *************** *** 0 **** --- 1,5 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'ret bool false' + bool %test() { + %X = trunc uint 320 to bool + ret bool %X + } From sabre at nondot.org Fri Dec 1 13:20:18 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:20:18 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200612011920.kB1JKIqc025083@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.95 -> 1.96 --- Log message: add a new ConstantIntegral::get method. Simplify the implementation of ConstantInt::get --- Diffs of the changes: (+4 -0) Constants.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.95 llvm/include/llvm/Constants.h:1.96 --- llvm/include/llvm/Constants.h:1.95 Sun Nov 26 19:05:09 2006 +++ llvm/include/llvm/Constants.h Fri Dec 1 13:20:02 2006 @@ -44,6 +44,10 @@ uint64_t Val; ConstantIntegral(const Type *Ty, ValueTy VT, uint64_t V); public: + + /// ConstantIntegral::get - Return a bool or integer constant. + static ConstantIntegral *get(const Type *Ty, int64_t V); + /// Return the constant as a 64-bit unsigned integer value after it /// has been zero extended as appropriate for the type of this constant. /// @brief Return the zero extended value. From sabre at nondot.org Fri Dec 1 13:20:16 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:20:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200612011920.kB1JKGnO025077@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.172 -> 1.173 --- Log message: add a new ConstantIntegral::get method. Simplify the implementation of ConstantInt::get --- Diffs of the changes: (+6 -3) Constants.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.172 llvm/lib/VMCore/Constants.cpp:1.173 --- llvm/lib/VMCore/Constants.cpp:1.172 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/Constants.cpp Fri Dec 1 13:20:02 2006 @@ -929,9 +929,12 @@ // just return the stored value while getSExtValue has to convert back to sign // extended. getZExtValue is more common in LLVM than getSExtValue(). ConstantInt *ConstantInt::get(const Type *Ty, int64_t V) { - unsigned Size = Ty->getPrimitiveSizeInBits(); - uint64_t ZeroExtendedCanonicalization = V & (~uint64_t(0UL) >> (64-Size)); - return IntConstants->getOrCreate(Ty, ZeroExtendedCanonicalization ); + return IntConstants->getOrCreate(Ty, V & Ty->getIntegralTypeMask()); +} + +ConstantIntegral *ConstantIntegral::get(const Type *Ty, int64_t V) { + if (Ty == Type::BoolTy) return ConstantBool::get(V&1); + return IntConstants->getOrCreate(Ty, V & Ty->getIntegralTypeMask()); } //---- ConstantFP::get() implementation... From sabre at nondot.org Fri Dec 1 13:22:56 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:22:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200612011922.kB1JMuZx025170@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.103 -> 1.104 --- Log message: this logic is broken for trunc to bool, replace the folding logic for trunc completely, as it is trivial. We should probably do this for the rest of the cast operations. This fixes ConstProp/2006-12-01-TruncBoolBug.ll. --- Diffs of the changes: (+8 -5) ConstantFolding.cpp | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.103 llvm/lib/VMCore/ConstantFolding.cpp:1.104 --- llvm/lib/VMCore/ConstantFolding.cpp:1.103 Thu Nov 30 23:55:25 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Fri Dec 1 13:22:41 2006 @@ -860,10 +860,10 @@ // We actually have to do a cast now, but first, we might need to fix up // the value of the operand. switch (opc) { + case Instruction::PtrToInt: case Instruction::FPTrunc: - case Instruction::Trunc: case Instruction::FPExt: - break; // floating point input & output, no fixup needed + break; case Instruction::FPToUI: { ConstRules &Rules = ConstRules::get(V, V); V = Rules.castToULong(V); // make sure we get an unsigned value first @@ -891,9 +891,12 @@ V = ConstantInt::get(SrcTy->getSignedVersion(), cast(V)->getSExtValue()); break; - - case Instruction::PtrToInt: - break; + case Instruction::Trunc: + // We just handle trunc directly here. The code below doesn't work for + // trunc to bool. + if (const ConstantInt *CI = dyn_cast(V)) + return ConstantIntegral::get(DestTy, CI->getZExtValue()); + return 0; case Instruction::BitCast: // Check to see if we are casting a pointer to an aggregate to a pointer to // the first element. If so, return the appropriate GEP instruction. From evan.cheng at apple.com Fri Dec 1 11:39:37 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 1 Dec 2006 11:39:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200612011739.kB1Hdb7X022884@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.214 -> 1.215 --- Log message: Copy and paste error. An initialized global cannot be a weak reference. --- Diffs of the changes: (+0 -3) PPCAsmPrinter.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.214 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.215 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.214 Fri Dec 1 08:37:39 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 1 11:39:22 2006 @@ -604,9 +604,6 @@ O << "\t\t; '" << I->getName() << "'\n"; } else { switch (I->getLinkage()) { - case GlobalValue::ExternalWeakLinkage: - O << "\t.weak_reference " << name << "\n"; - break; case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: O << "\t.globl " << name << '\n' From sabre at nondot.org Fri Dec 1 13:25:28 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:25:28 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/build.c Message-ID: <200612011925.kB1JPSDU025279@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector: build.c updated: 1.2 -> 1.3 --- Log message: correct this test --- Diffs of the changes: (+5 -2) build.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/UnitTests/Vector/build.c diff -u llvm-test/SingleSource/UnitTests/Vector/build.c:1.2 llvm-test/SingleSource/UnitTests/Vector/build.c:1.3 --- llvm-test/SingleSource/UnitTests/Vector/build.c:1.2 Fri Dec 1 12:17:46 2006 +++ llvm-test/SingleSource/UnitTests/Vector/build.c Fri Dec 1 13:25:13 2006 @@ -5,8 +5,11 @@ if (argc == 1123) X = 2.38213; FV A; A.V = (v4sf){ X, X, X, X }; // splat - //A.V = A.V * A.V; - printf("%f", A.A[1]); + A.V = A.V * A.V; + printFV(&A); + A.V = (v4sf){ X, X, 0, 0 }; + A.V = A.V+A.V; + printFV(&A); return 0; } From jlaskey at apple.com Fri Dec 1 13:29:35 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 1 Dec 2006 13:29:35 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2006-12-01-float_varg.ll Message-ID: <200612011929.kB1JTZH5025363@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: 2006-12-01-float_varg.ll added (r1.1) --- Log message: Test for float varargs. --- Diffs of the changes: (+16 -0) 2006-12-01-float_varg.ll | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/test/Regression/CodeGen/PowerPC/2006-12-01-float_varg.ll diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/2006-12-01-float_varg.ll:1.1 *** /dev/null Fri Dec 1 13:29:31 2006 --- llvm/test/Regression/CodeGen/PowerPC/2006-12-01-float_varg.ll Fri Dec 1 13:29:20 2006 *************** *** 0 **** --- 1,16 ---- + ; RUN: llvm-as < %s | llc -march=ppc64 -o - | tail -n +2 > Output/2006-12-01-float_varg.s + ; RUN: as -arch ppc64 Output/2006-12-01-float_varg.s -o Output/2006-12-01-float_varg.o + ; RUN: gcc -arch ppc64 Output/2006-12-01-float_varg.o -o Output/2006-12-01-float_varg.exe + ; RUN: Output/2006-12-01-float_varg.exe | grep "foo 1.230000 1.231210 3.100000 1.310000" + + %str = internal constant [17 x sbyte] c"foo %f %f %f %f\0A\00" + + implementation + + declare int %printf(sbyte*, ...) + + int %main(int %argc, sbyte** %argv) { + entry: + %tmp = tail call int (sbyte*, ...)* %printf( sbyte* getelementptr ([17 x sbyte]* %str, int 0, uint 0), double 1.23, double 1.23121, double 3.1, double 1.31 ) + ret int 0 + } From llvm at cs.uiuc.edu Fri Dec 1 13:39:47 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Fri, 1 Dec 2006 13:39:47 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2006-12-01-float_varg.ll Message-ID: <200612011939.kB1Jdl52025570@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: 2006-12-01-float_varg.ll (r1.1) removed --- Log message: wrong spot --- Diffs of the changes: (+0 -0) 0 files changed From jlaskey at apple.com Fri Dec 1 13:48:42 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 1 Dec 2006 13:48:42 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2006-12-01-float_varg.c Message-ID: <200612011948.kB1Jmg55025725@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: 2006-12-01-float_varg.c added (r1.1) --- Log message: Add float vararg test. --- Diffs of the changes: (+6 -0) 2006-12-01-float_varg.c | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/SingleSource/UnitTests/2006-12-01-float_varg.c diff -c /dev/null llvm-test/SingleSource/UnitTests/2006-12-01-float_varg.c:1.1 *** /dev/null Fri Dec 1 13:48:37 2006 --- llvm-test/SingleSource/UnitTests/2006-12-01-float_varg.c Fri Dec 1 13:48:26 2006 *************** *** 0 **** --- 1,6 ---- + #include + + int main(int argc, char *argv[]) { + printf("foo %f %f %f %f\n", 1.23, 12312.1, 3.1, 13.1); + return 0; + } From sabre at nondot.org Fri Dec 1 13:50:18 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:50:18 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ConstProp/2006-12-01-bool-casts.ll Message-ID: <200612011950.kB1JoI9K025823@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ConstProp: 2006-12-01-bool-casts.ll added (r1.1) --- Log message: test1 is miscompiled --- Diffs of the changes: (+13 -0) 2006-12-01-bool-casts.ll | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/Regression/Transforms/ConstProp/2006-12-01-bool-casts.ll diff -c /dev/null llvm/test/Regression/Transforms/ConstProp/2006-12-01-bool-casts.ll:1.1 *** /dev/null Fri Dec 1 13:50:14 2006 --- llvm/test/Regression/Transforms/ConstProp/2006-12-01-bool-casts.ll Fri Dec 1 13:50:04 2006 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 'ret int -1' && + ; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 'ret uint 1' + + int %test1() { + %A = sext bool true to int + ret int %A + } + + uint %test2() { + %A = zext bool true to uint + ret uint %A + } + From sabre at nondot.org Fri Dec 1 13:51:09 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 13:51:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200612011951.kB1Jp9oA025846@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.104 -> 1.105 --- Log message: These should be rewritten to fold without using the 'Rules' mechanism, but until this happens at least make sext from bool and sitofp from bool do the right thing. --- Diffs of the changes: (+3 -0) ConstantFolding.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.104 llvm/lib/VMCore/ConstantFolding.cpp:1.105 --- llvm/lib/VMCore/ConstantFolding.cpp:1.104 Fri Dec 1 13:22:41 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Fri Dec 1 13:50:54 2006 @@ -890,6 +890,9 @@ if (isa(V)) V = ConstantInt::get(SrcTy->getSignedVersion(), cast(V)->getSExtValue()); + else if (const ConstantBool *CB = dyn_cast(V)) + V = ConstantInt::get(Type::SByteTy, CB->getValue() ? -1 : 0); + break; case Instruction::Trunc: // We just handle trunc directly here. The code below doesn't work for From sabre at nondot.org Fri Dec 1 14:15:02 2006 From: sabre at nondot.org (Chris Lattner) Date: Fri, 1 Dec 2006 14:15:02 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/PassSupport.h Message-ID: <200612012015.kB1KF22x026282@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassSupport.h updated: 1.30 -> 1.31 --- Log message: Remove dead methods --- Diffs of the changes: (+0 -22) PassSupport.h | 22 ---------------------- 1 files changed, 22 deletions(-) Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.30 llvm/include/llvm/PassSupport.h:1.31 --- llvm/include/llvm/PassSupport.h:1.30 Sun Aug 27 19:42:29 2006 +++ llvm/include/llvm/PassSupport.h Fri Dec 1 14:14:47 2006 @@ -184,28 +184,6 @@ callDefaultCtor) { if (CFGOnly) setOnlyUsesCFG(); } - - // Register Pass using default constructor explicitly... - RegisterPass(const char *PassArg, const char *Name, - Pass *(*ctor)(), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) { - if (CFGOnly) setOnlyUsesCFG(); - } - - // Register Pass using TargetMachine constructor... - RegisterPass(const char *PassArg, const char *Name, - Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) { - if (CFGOnly) setOnlyUsesCFG(); - } - - // Generic constructor version that has an unknown ctor type... - template - RegisterPass(const char *PassArg, const char *Name, CtorType *Fn, - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0) { - if (CFGOnly) setOnlyUsesCFG(); - } }; From reid at x10sys.com Fri Dec 1 14:26:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 1 Dec 2006 14:26:35 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/Makefile ParserInternals.h UpgradeLexer.cpp UpgradeLexer.cpp.cvs UpgradeLexer.l UpgradeLexer.l.cvs UpgradeParser.cpp UpgradeParser.cpp.cvs UpgradeParser.h UpgradeParser.h.cvs UpgradeParser.y UpgradeParser.y.cvs llvm-upgrade.cpp Message-ID: <200612012026.kB1KQZnP026637@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: Makefile updated: 1.2 -> 1.3 ParserInternals.h updated: 1.2 -> 1.3 UpgradeLexer.cpp updated: 1.2 -> 1.3 UpgradeLexer.cpp.cvs updated: 1.2 -> 1.3 UpgradeLexer.l updated: 1.2 -> 1.3 UpgradeLexer.l.cvs updated: 1.2 -> 1.3 UpgradeParser.cpp updated: 1.2 -> 1.3 UpgradeParser.cpp.cvs updated: 1.2 -> 1.3 UpgradeParser.h updated: 1.1 -> 1.2 UpgradeParser.h.cvs updated: 1.1 -> 1.2 UpgradeParser.y updated: 1.2 -> 1.3 UpgradeParser.y.cvs updated: 1.2 -> 1.3 llvm-upgrade.cpp updated: 1.2 -> 1.3 --- Log message: First version of llvm-upgrade that can correctly upgrade a large test case. --- Diffs of the changes: (+4518 -3717) Makefile | 9 ParserInternals.h | 78 + UpgradeLexer.cpp | 297 ++--- UpgradeLexer.cpp.cvs | 297 ++--- UpgradeLexer.l | 47 UpgradeLexer.l.cvs | 47 UpgradeParser.cpp | 2864 ++++++++++++++++++++++++++------------------------ UpgradeParser.cpp.cvs | 2864 ++++++++++++++++++++++++++------------------------ UpgradeParser.h | 226 +-- UpgradeParser.h.cvs | 226 +-- UpgradeParser.y | 637 +++++++---- UpgradeParser.y.cvs | 637 +++++++---- llvm-upgrade.cpp | 6 13 files changed, 4518 insertions(+), 3717 deletions(-) Index: llvm/tools/llvm-upgrade/Makefile diff -u llvm/tools/llvm-upgrade/Makefile:1.2 llvm/tools/llvm-upgrade/Makefile:1.3 --- llvm/tools/llvm-upgrade/Makefile:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/Makefile Fri Dec 1 14:26:20 2006 @@ -19,5 +19,12 @@ # header file it needs is built. $(ObjDir)/upgradeLexer.o: $(PROJ_SRC_DIR)/UpgradeParser.h +TESTCASE=../../test/Regression/Assembler/2004-09-29-VerifierIsReallySlow.llx test: - ../../Debug/bin/llvm-upgrade -o - ../../test/Feature/basictest.ll + llvm-as $(TESTCASE) -o - | llvm-dis -o source.ll -f + ../../Debug/bin/llvm-upgrade -o - $(TESTCASE) 2>err.out | llvm-as | \ + llvm-dis > upgrade.ll -f + diff source.ll upgrade.ll > diff.out + +$(PROJ_SRC_DIR)/UpgradeParser.h: $(PROJ_SRC_DIR)/UpgradeParser.y +$(PROJ_SRC_DIR)/UpgradeParser.cpp: $(PROJ_SRC_DIR)/UpgradeParser.y Index: llvm/tools/llvm-upgrade/ParserInternals.h diff -u llvm/tools/llvm-upgrade/ParserInternals.h:1.2 llvm/tools/llvm-upgrade/ParserInternals.h:1.3 --- llvm/tools/llvm-upgrade/ParserInternals.h:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/ParserInternals.h Fri Dec 1 14:26:20 2006 @@ -26,12 +26,88 @@ extern std::istream* LexInput; -void UpgradeAssembly(const std::string & infile, std::istream& in, std::ostream &out); +void UpgradeAssembly( + const std::string & infile, std::istream& in, std::ostream &out, bool debug); // Globals exported by the parser... extern char* Upgradetext; extern int Upgradeleng; +extern unsigned SizeOfPointer; int yyerror(const char *ErrorMsg) ; +/// This enum is used to keep track of the original (1.9) type used to form +/// a type. These are needed for type upgrades and to determine how to upgrade +/// signed instructions with signless operands. +enum Types { + BoolTy, SByteTy, UByteTy, ShortTy, UShortTy, IntTy, UIntTy, LongTy, ULongTy, + FloatTy, DoubleTy, PointerTy, PackedTy, ArrayTy, StructTy, OpaqueTy, VoidTy, + LabelTy, FunctionTy +}; + +/// This type is used to keep track of the signedness of the obsolete +/// integer types. Instead of creating an llvm::Type directly, the Lexer will +/// create instances of TypeInfo which retains the signedness indication so +/// it can be used by the parser for upgrade decisions. +/// For example if "uint" is encountered then the "first" field will be set +/// to "int32" and the "second" field will be set to "isUnsigned". If the +/// type is not obsolete then "second" will be set to "isSignless". +struct TypeInfo { + std::string* newTy; + Types oldTy; + + void destroy() { delete newTy; } + + bool isSigned() { + return oldTy == SByteTy || oldTy == ShortTy || + oldTy == IntTy || oldTy == LongTy; + } + + bool isUnsigned() { + return oldTy == UByteTy || oldTy == UShortTy || + oldTy == UIntTy || oldTy == ULongTy; + } + + bool isSignless() { return !isSigned() && !isUnsigned(); } + bool isInteger() { return isSigned() || isUnsigned(); } + bool isIntegral() { return oldTy == BoolTy || isInteger(); } + bool isFloatingPoint() { return oldTy == DoubleTy || oldTy == FloatTy; } + bool isPacked() { return oldTy == PackedTy; } + bool isPointer() { return oldTy == PointerTy; } + bool isOther() { return !isPacked() && !isPointer() && !isFloatingPoint() + && !isIntegral(); } + + unsigned getBitWidth() { + switch (oldTy) { + case LabelTy: + case VoidTy : return 0; + case BoolTy : return 1; + case SByteTy: case UByteTy : return 8; + case ShortTy: case UShortTy : return 16; + case IntTy: case UIntTy: case FloatTy: return 32; + case LongTy: case ULongTy: case DoubleTy : return 64; + case PointerTy: return SizeOfPointer; // global var + default: + return 128; /// Struct/Packed/Array --> doesn't matter + + } + } +}; + +/// This type is used to keep track of the signedness of values. Instead +/// of creating llvm::Value directly, the parser will create ValueInfo which +/// associates a Value* with a Signedness indication. +struct ValueInfo { + std::string* val; + TypeInfo type; + void destroy() { delete val; type.destroy(); } +}; + +/// This type is used to keep track of the signedness of constants. +struct ConstInfo { + std::string *cnst; + TypeInfo type; + void destroy() { delete cnst; type.destroy(); } +}; + #endif Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp diff -u llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.2 llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.3 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.cpp Fri Dec 1 14:26:20 2006 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp,v 1.2 2006/11/30 16:50:26 reid Exp $ + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp,v 1.3 2006/12/01 20:26:20 reid Exp $ */ #define FLEX_SCANNER @@ -334,11 +334,11 @@ 62, 80, 67, 88, 84, 61, 73, 105, 112, 112, 86, 46, 81, 82, 66, 96, 70, 97, 53, 85, - 21, 109, 65, 69, 23, 4, 58, 64, 52, 68, + 21, 109, 65, 69, 23, 4, 59, 64, 52, 68, 45, 11, 112, 33, 2, 5, 55, 57, 47, 75, 79, 77, 78, 76, 74, 49, 98, 48, 54, 20, 95, 42, 56, 27, 41, 7, 91, 30, 94, 35, - 59, 83, 90, 24, 25, 92, 50, 87, 40, 6, + 58, 83, 90, 24, 25, 92, 50, 87, 40, 6, 26, 34, 8, 16, 9, 10, 32, 12, 14, 13, 29, 37, 15, 28, 93, 99, 101, 102, 43, 100, 17, 44, 18 @@ -858,17 +858,10 @@ #line 28 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" #include "ParserInternals.h" -#define YYSTYPE std::string* #include "UpgradeParser.h" #include #include -static void trim(std::string& str) { - size_t startpos = str.find_first_not_of(" \t\n\r",0); - if (startpos != std::string::npos) - str.erase(0,startpos); -} - #define YY_INPUT(buf,result,max_size) \ { \ if (LexInput->good() && !LexInput->eof()) { \ @@ -882,8 +875,12 @@ // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ - Upgradelval = new std::string(yytext); \ - trim(*Upgradelval); \ + Upgradelval.String = new std::string(yytext); \ + return sym + +#define RET_TY(sym,OldTY,NewTY,sign) \ + Upgradelval.Type.newTy = new std::string(NewTY); \ + Upgradelval.Type.oldTy = OldTY; \ return sym #define YY_NEVER_INTERACTIVE 1 @@ -903,7 +900,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 907 "UpgradeLexer.cpp" +#line 904 "UpgradeLexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1054,10 +1051,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -#line 1061 "UpgradeLexer.cpp" +#line 1058 "UpgradeLexer.cpp" if ( yy_init ) { @@ -1150,571 +1147,571 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BEGINTOK); } YY_BREAK case 3: YY_RULE_SETUP -#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDTOK); } YY_BREAK case 4: YY_RULE_SETUP -#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUETOK); } YY_BREAK case 5: YY_RULE_SETUP -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FALSETOK); } YY_BREAK case 6: YY_RULE_SETUP -#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DECLARE); } YY_BREAK case 7: YY_RULE_SETUP -#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GLOBAL); } YY_BREAK case 8: YY_RULE_SETUP -#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CONSTANT); } YY_BREAK case 9: YY_RULE_SETUP -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INTERNAL); } YY_BREAK case 10: YY_RULE_SETUP -#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LINKONCE); } YY_BREAK case 11: YY_RULE_SETUP -#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( WEAK); } YY_BREAK case 12: YY_RULE_SETUP -#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( APPENDING); } YY_BREAK case 13: YY_RULE_SETUP -#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLIMPORT); } YY_BREAK case 14: YY_RULE_SETUP -#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLEXPORT); } YY_BREAK case 15: YY_RULE_SETUP -#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERN_WEAK); } YY_BREAK case 16: YY_RULE_SETUP -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERNAL); } YY_BREAK case 17: YY_RULE_SETUP -#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( IMPLEMENTATION); } YY_BREAK case 18: YY_RULE_SETUP -#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ZEROINITIALIZER); } YY_BREAK case 19: YY_RULE_SETUP -#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOTDOTDOT); } YY_BREAK case 20: YY_RULE_SETUP -#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNDEF); } YY_BREAK case 21: YY_RULE_SETUP -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( NULL_TOK); } YY_BREAK case 22: YY_RULE_SETUP -#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TO); } YY_BREAK case 23: YY_RULE_SETUP -#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TAIL); } YY_BREAK case 24: YY_RULE_SETUP -#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TARGET); } YY_BREAK case 25: YY_RULE_SETUP -#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRIPLE); } YY_BREAK case 26: YY_RULE_SETUP -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DEPLIBS); } YY_BREAK case 27: YY_RULE_SETUP -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDIAN); } YY_BREAK case 28: YY_RULE_SETUP -#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( POINTERSIZE); } YY_BREAK case 29: YY_RULE_SETUP -#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DATALAYOUT); } YY_BREAK case 30: YY_RULE_SETUP -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LITTLE); } YY_BREAK case 31: YY_RULE_SETUP -#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BIG); } YY_BREAK case 32: YY_RULE_SETUP -#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOLATILE); } YY_BREAK case 33: YY_RULE_SETUP -#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALIGN); } YY_BREAK case 34: YY_RULE_SETUP -#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SECTION); } YY_BREAK case 35: YY_RULE_SETUP -#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MODULE); } YY_BREAK case 36: YY_RULE_SETUP -#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASM_TOK); } YY_BREAK case 37: YY_RULE_SETUP -#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SIDEEFFECT); } YY_BREAK case 38: YY_RULE_SETUP -#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CC_TOK); } YY_BREAK case 39: YY_RULE_SETUP -#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CCC_TOK); } YY_BREAK case 40: YY_RULE_SETUP -#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CSRETCC_TOK); } YY_BREAK case 41: YY_RULE_SETUP -#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FASTCC_TOK); } YY_BREAK case 42: YY_RULE_SETUP -#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( COLDCC_TOK); } YY_BREAK case 43: YY_RULE_SETUP -#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_STDCALLCC_TOK); } YY_BREAK case 44: YY_RULE_SETUP -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_FASTCALLCC_TOK); } YY_BREAK case 45: YY_RULE_SETUP -#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( VOID); } +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(VOID,VoidTy,"void",false); } YY_BREAK case 46: YY_RULE_SETUP -#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( BOOL); } +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(BOOL,BoolTy,"bool",false); } YY_BREAK case 47: YY_RULE_SETUP -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( SBYTE); } +#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(SBYTE,SByteTy,"sbyte",true); } YY_BREAK case 48: YY_RULE_SETUP -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( UBYTE); } +#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(UBYTE,UByteTy,"ubyte",false); } YY_BREAK case 49: YY_RULE_SETUP -#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( SHORT); } +#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(SHORT,ShortTy,"short",true); } YY_BREAK case 50: YY_RULE_SETUP -#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( USHORT); } +#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(USHORT,UShortTy,"ushort",false); } YY_BREAK case 51: YY_RULE_SETUP -#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( INT); } +#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(INT,IntTy,"int",true); } YY_BREAK case 52: YY_RULE_SETUP -#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( UINT); } +#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(UINT,UIntTy,"uint",false); } YY_BREAK case 53: YY_RULE_SETUP -#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( LONG); } +#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(LONG,LongTy,"long",true); } YY_BREAK case 54: YY_RULE_SETUP -#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( ULONG); } +#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(ULONG,ULongTy,"ulong",false); } YY_BREAK case 55: YY_RULE_SETUP -#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( FLOAT); } +#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(FLOAT,FloatTy,"float",false); } YY_BREAK case 56: YY_RULE_SETUP -#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( DOUBLE); } +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(DOUBLE,DoubleTy,"double",false); } YY_BREAK case 57: YY_RULE_SETUP -#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( LABEL); } +#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(LABEL,LabelTy,"label",false); } YY_BREAK case 58: YY_RULE_SETUP -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( TYPE); } +#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(OPAQUE,OpaqueTy,"opaque",false); } YY_BREAK case 59: YY_RULE_SETUP -#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( OPAQUE); } +#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(TYPE); } YY_BREAK case 60: YY_RULE_SETUP -#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ADD); } YY_BREAK case 61: YY_RULE_SETUP -#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SUB); } YY_BREAK case 62: YY_RULE_SETUP -#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MUL); } YY_BREAK case 63: YY_RULE_SETUP -#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 64: YY_RULE_SETUP -#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 65: YY_RULE_SETUP -#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SDIV); } YY_BREAK case 66: YY_RULE_SETUP -#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FDIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 68: YY_RULE_SETUP -#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 69: YY_RULE_SETUP -#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SREM); } YY_BREAK case 70: YY_RULE_SETUP -#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREM); } YY_BREAK case 71: YY_RULE_SETUP -#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( AND); } YY_BREAK case 72: YY_RULE_SETUP -#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OR); } YY_BREAK case 73: YY_RULE_SETUP -#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( XOR); } YY_BREAK case 74: YY_RULE_SETUP -#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETNE); } YY_BREAK case 75: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETEQ); } YY_BREAK case 76: YY_RULE_SETUP -#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLT); } YY_BREAK case 77: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGT); } YY_BREAK case 78: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLE); } YY_BREAK case 79: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGE); } YY_BREAK case 80: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( PHI_TOK); } YY_BREAK case 81: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CALL); } YY_BREAK case 82: YY_RULE_SETUP -#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( TRUNC); } +#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK( CAST); } YY_BREAK case 83: YY_RULE_SETUP -#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SELECT); } YY_BREAK case 84: YY_RULE_SETUP -#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHL); } YY_BREAK case 85: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LSHR); } YY_BREAK case 86: YY_RULE_SETUP -#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASHR); } YY_BREAK case 87: YY_RULE_SETUP -#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAARG); } YY_BREAK case 88: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( RET); } YY_BREAK case 89: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BR); } YY_BREAK case 90: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SWITCH); } YY_BREAK case 91: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INVOKE); } YY_BREAK case 92: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNWIND); } YY_BREAK case 93: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNREACHABLE); } YY_BREAK case 94: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MALLOC); } YY_BREAK case 95: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALLOCA); } YY_BREAK case 96: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREE); } YY_BREAK case 97: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LOAD); } YY_BREAK case 98: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STORE); } YY_BREAK case 99: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GETELEMENTPTR); } YY_BREAK case 100: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTRACTELEMENT); } YY_BREAK case 101: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INSERTELEMENT); } YY_BREAK case 102: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHUFFLEVECTOR); } YY_BREAK case 103: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAR_ID); } YY_BREAK case 104: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 105: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 106: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STRINGCONSTANT ); } YY_BREAK case 107: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EUINT64VAL ); } YY_BREAK case 108: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ESINT64VAL ); } YY_BREAK case 109: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } YY_BREAK case 110: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINTVAL); } YY_BREAK case 111: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SINTVAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case 113: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 222 "/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! @@ -1725,20 +1722,20 @@ YY_BREAK case 114: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 230 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore whitespace */ } YY_BREAK case 115: YY_RULE_SETUP -#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 231 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return yytext[0]; } YY_BREAK case 116: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1742 "UpgradeLexer.cpp" +#line 1739 "UpgradeLexer.cpp" case YY_END_OF_BUFFER: { @@ -2616,5 +2613,5 @@ return 0; } #endif -#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" Index: llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.2 llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.3 --- llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs Fri Dec 1 14:26:20 2006 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.2 2006/11/30 16:50:26 reid Exp $ + * $Header: /var/cvs/llvm/llvm/tools/llvm-upgrade/UpgradeLexer.cpp.cvs,v 1.3 2006/12/01 20:26:20 reid Exp $ */ #define FLEX_SCANNER @@ -334,11 +334,11 @@ 62, 80, 67, 88, 84, 61, 73, 105, 112, 112, 86, 46, 81, 82, 66, 96, 70, 97, 53, 85, - 21, 109, 65, 69, 23, 4, 58, 64, 52, 68, + 21, 109, 65, 69, 23, 4, 59, 64, 52, 68, 45, 11, 112, 33, 2, 5, 55, 57, 47, 75, 79, 77, 78, 76, 74, 49, 98, 48, 54, 20, 95, 42, 56, 27, 41, 7, 91, 30, 94, 35, - 59, 83, 90, 24, 25, 92, 50, 87, 40, 6, + 58, 83, 90, 24, 25, 92, 50, 87, 40, 6, 26, 34, 8, 16, 9, 10, 32, 12, 14, 13, 29, 37, 15, 28, 93, 99, 101, 102, 43, 100, 17, 44, 18 @@ -858,17 +858,10 @@ #line 28 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" #include "ParserInternals.h" -#define YYSTYPE std::string* #include "UpgradeParser.h" #include #include -static void trim(std::string& str) { - size_t startpos = str.find_first_not_of(" \t\n\r",0); - if (startpos != std::string::npos) - str.erase(0,startpos); -} - #define YY_INPUT(buf,result,max_size) \ { \ if (LexInput->good() && !LexInput->eof()) { \ @@ -882,8 +875,12 @@ // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ - Upgradelval = new std::string(yytext); \ - trim(*Upgradelval); \ + Upgradelval.String = new std::string(yytext); \ + return sym + +#define RET_TY(sym,OldTY,NewTY,sign) \ + Upgradelval.Type.newTy = new std::string(NewTY); \ + Upgradelval.Type.oldTy = OldTY; \ return sym #define YY_NEVER_INTERACTIVE 1 @@ -903,7 +900,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 907 "UpgradeLexer.cpp" +#line 904 "UpgradeLexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1054,10 +1051,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -#line 1061 "UpgradeLexer.cpp" +#line 1058 "UpgradeLexer.cpp" if ( yy_init ) { @@ -1150,571 +1147,571 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BEGINTOK); } YY_BREAK case 3: YY_RULE_SETUP -#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDTOK); } YY_BREAK case 4: YY_RULE_SETUP -#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRUETOK); } YY_BREAK case 5: YY_RULE_SETUP -#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FALSETOK); } YY_BREAK case 6: YY_RULE_SETUP -#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DECLARE); } YY_BREAK case 7: YY_RULE_SETUP -#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GLOBAL); } YY_BREAK case 8: YY_RULE_SETUP -#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CONSTANT); } YY_BREAK case 9: YY_RULE_SETUP -#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INTERNAL); } YY_BREAK case 10: YY_RULE_SETUP -#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LINKONCE); } YY_BREAK case 11: YY_RULE_SETUP -#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( WEAK); } YY_BREAK case 12: YY_RULE_SETUP -#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( APPENDING); } YY_BREAK case 13: YY_RULE_SETUP -#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLIMPORT); } YY_BREAK case 14: YY_RULE_SETUP -#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DLLEXPORT); } YY_BREAK case 15: YY_RULE_SETUP -#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERN_WEAK); } YY_BREAK case 16: YY_RULE_SETUP -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTERNAL); } YY_BREAK case 17: YY_RULE_SETUP -#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( IMPLEMENTATION); } YY_BREAK case 18: YY_RULE_SETUP -#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ZEROINITIALIZER); } YY_BREAK case 19: YY_RULE_SETUP -#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DOTDOTDOT); } YY_BREAK case 20: YY_RULE_SETUP -#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNDEF); } YY_BREAK case 21: YY_RULE_SETUP -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( NULL_TOK); } YY_BREAK case 22: YY_RULE_SETUP -#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TO); } YY_BREAK case 23: YY_RULE_SETUP -#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TAIL); } YY_BREAK case 24: YY_RULE_SETUP -#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TARGET); } YY_BREAK case 25: YY_RULE_SETUP -#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( TRIPLE); } YY_BREAK case 26: YY_RULE_SETUP -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DEPLIBS); } YY_BREAK case 27: YY_RULE_SETUP -#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ENDIAN); } YY_BREAK case 28: YY_RULE_SETUP -#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( POINTERSIZE); } YY_BREAK case 29: YY_RULE_SETUP -#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( DATALAYOUT); } YY_BREAK case 30: YY_RULE_SETUP -#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LITTLE); } YY_BREAK case 31: YY_RULE_SETUP -#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BIG); } YY_BREAK case 32: YY_RULE_SETUP -#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VOLATILE); } YY_BREAK case 33: YY_RULE_SETUP -#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALIGN); } YY_BREAK case 34: YY_RULE_SETUP -#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SECTION); } YY_BREAK case 35: YY_RULE_SETUP -#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MODULE); } YY_BREAK case 36: YY_RULE_SETUP -#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASM_TOK); } YY_BREAK case 37: YY_RULE_SETUP -#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SIDEEFFECT); } YY_BREAK case 38: YY_RULE_SETUP -#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CC_TOK); } YY_BREAK case 39: YY_RULE_SETUP -#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CCC_TOK); } YY_BREAK case 40: YY_RULE_SETUP -#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CSRETCC_TOK); } YY_BREAK case 41: YY_RULE_SETUP -#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FASTCC_TOK); } YY_BREAK case 42: YY_RULE_SETUP -#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( COLDCC_TOK); } YY_BREAK case 43: YY_RULE_SETUP -#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_STDCALLCC_TOK); } YY_BREAK case 44: YY_RULE_SETUP -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( X86_FASTCALLCC_TOK); } YY_BREAK case 45: YY_RULE_SETUP -#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( VOID); } +#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(VOID,VoidTy,"void",false); } YY_BREAK case 46: YY_RULE_SETUP -#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( BOOL); } +#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(BOOL,BoolTy,"bool",false); } YY_BREAK case 47: YY_RULE_SETUP -#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( SBYTE); } +#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(SBYTE,SByteTy,"sbyte",true); } YY_BREAK case 48: YY_RULE_SETUP -#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( UBYTE); } +#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(UBYTE,UByteTy,"ubyte",false); } YY_BREAK case 49: YY_RULE_SETUP -#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( SHORT); } +#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(SHORT,ShortTy,"short",true); } YY_BREAK case 50: YY_RULE_SETUP -#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( USHORT); } +#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(USHORT,UShortTy,"ushort",false); } YY_BREAK case 51: YY_RULE_SETUP -#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( INT); } +#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(INT,IntTy,"int",true); } YY_BREAK case 52: YY_RULE_SETUP -#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( UINT); } +#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(UINT,UIntTy,"uint",false); } YY_BREAK case 53: YY_RULE_SETUP -#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( LONG); } +#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(LONG,LongTy,"long",true); } YY_BREAK case 54: YY_RULE_SETUP -#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( ULONG); } +#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(ULONG,ULongTy,"ulong",false); } YY_BREAK case 55: YY_RULE_SETUP -#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( FLOAT); } +#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(FLOAT,FloatTy,"float",false); } YY_BREAK case 56: YY_RULE_SETUP -#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( DOUBLE); } +#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(DOUBLE,DoubleTy,"double",false); } YY_BREAK case 57: YY_RULE_SETUP -#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( LABEL); } +#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(LABEL,LabelTy,"label",false); } YY_BREAK case 58: YY_RULE_SETUP -#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( TYPE); } +#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TY(OPAQUE,OpaqueTy,"opaque",false); } YY_BREAK case 59: YY_RULE_SETUP -#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( OPAQUE); } +#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK(TYPE); } YY_BREAK case 60: YY_RULE_SETUP -#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ADD); } YY_BREAK case 61: YY_RULE_SETUP -#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SUB); } YY_BREAK case 62: YY_RULE_SETUP -#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MUL); } YY_BREAK case 63: YY_RULE_SETUP -#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 64: YY_RULE_SETUP -#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UDIV); } YY_BREAK case 65: YY_RULE_SETUP -#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SDIV); } YY_BREAK case 66: YY_RULE_SETUP -#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FDIV); } YY_BREAK case 67: YY_RULE_SETUP -#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 68: YY_RULE_SETUP -#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UREM); } YY_BREAK case 69: YY_RULE_SETUP -#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SREM); } YY_BREAK case 70: YY_RULE_SETUP -#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREM); } YY_BREAK case 71: YY_RULE_SETUP -#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( AND); } YY_BREAK case 72: YY_RULE_SETUP -#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( OR); } YY_BREAK case 73: YY_RULE_SETUP -#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( XOR); } YY_BREAK case 74: YY_RULE_SETUP -#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETNE); } YY_BREAK case 75: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETEQ); } YY_BREAK case 76: YY_RULE_SETUP -#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLT); } YY_BREAK case 77: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGT); } YY_BREAK case 78: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETLE); } YY_BREAK case 79: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SETGE); } YY_BREAK case 80: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( PHI_TOK); } YY_BREAK case 81: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( CALL); } YY_BREAK case 82: YY_RULE_SETUP -#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" -{ RET_TOK( TRUNC); } +#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +{ RET_TOK( CAST); } YY_BREAK case 83: YY_RULE_SETUP -#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SELECT); } YY_BREAK case 84: YY_RULE_SETUP -#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHL); } YY_BREAK case 85: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LSHR); } YY_BREAK case 86: YY_RULE_SETUP -#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ASHR); } YY_BREAK case 87: YY_RULE_SETUP -#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAARG); } YY_BREAK case 88: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( RET); } YY_BREAK case 89: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( BR); } YY_BREAK case 90: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SWITCH); } YY_BREAK case 91: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INVOKE); } YY_BREAK case 92: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNWIND); } YY_BREAK case 93: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UNREACHABLE); } YY_BREAK case 94: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( MALLOC); } YY_BREAK case 95: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ALLOCA); } YY_BREAK case 96: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FREE); } YY_BREAK case 97: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LOAD); } YY_BREAK case 98: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STORE); } YY_BREAK case 99: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( GETELEMENTPTR); } YY_BREAK case 100: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EXTRACTELEMENT); } YY_BREAK case 101: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( INSERTELEMENT); } YY_BREAK case 102: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SHUFFLEVECTOR); } YY_BREAK case 103: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( VAR_ID); } YY_BREAK case 104: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 105: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( LABELSTR); } YY_BREAK case 106: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( STRINGCONSTANT ); } YY_BREAK case 107: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( EUINT64VAL ); } YY_BREAK case 108: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( ESINT64VAL ); } YY_BREAK case 109: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); } YY_BREAK case 110: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( UINTVAL); } YY_BREAK case 111: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( SINTVAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case 113: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { RET_TOK( FPVAL); } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 222 "/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! @@ -1725,20 +1722,20 @@ YY_BREAK case 114: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 230 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { /* Ignore whitespace */ } YY_BREAK case 115: YY_RULE_SETUP -#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 231 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" { return yytext[0]; } YY_BREAK case 116: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1742 "UpgradeLexer.cpp" +#line 1739 "UpgradeLexer.cpp" case YY_END_OF_BUFFER: { @@ -2616,5 +2613,5 @@ return 0; } #endif -#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l" +#line 233 "/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.2 llvm/tools/llvm-upgrade/UpgradeLexer.l:1.3 --- llvm/tools/llvm-upgrade/UpgradeLexer.l:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l Fri Dec 1 14:26:20 2006 @@ -27,17 +27,10 @@ %{ #include "ParserInternals.h" -#define YYSTYPE std::string* #include "UpgradeParser.h" #include #include -static void trim(std::string& str) { - size_t startpos = str.find_first_not_of(" \t\n\r",0); - if (startpos != std::string::npos) - str.erase(0,startpos); -} - #define YY_INPUT(buf,result,max_size) \ { \ if (LexInput->good() && !LexInput->eof()) { \ @@ -51,8 +44,12 @@ // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ - Upgradelval = new std::string(yytext); \ - trim(*Upgradelval); \ + Upgradelval.String = new std::string(yytext); \ + return sym + +#define RET_TY(sym,OldTY,NewTY,sign) \ + Upgradelval.Type.newTy = new std::string(NewTY); \ + Upgradelval.Type.oldTy = OldTY; \ return sym #define YY_NEVER_INTERACTIVE 1 @@ -147,21 +144,21 @@ x86_stdcallcc { RET_TOK( X86_STDCALLCC_TOK); } x86_fastcallcc { RET_TOK( X86_FASTCALLCC_TOK); } -void { RET_TOK( VOID); } -bool { RET_TOK( BOOL); } -sbyte { RET_TOK( SBYTE); } -ubyte { RET_TOK( UBYTE); } -short { RET_TOK( SHORT); } -ushort { RET_TOK( USHORT); } -int { RET_TOK( INT); } -uint { RET_TOK( UINT); } -long { RET_TOK( LONG); } -ulong { RET_TOK( ULONG); } -float { RET_TOK( FLOAT); } -double { RET_TOK( DOUBLE); } -label { RET_TOK( LABEL); } -type { RET_TOK( TYPE); } -opaque { RET_TOK( OPAQUE); } +void { RET_TY(VOID,VoidTy,"void",false); } +bool { RET_TY(BOOL,BoolTy,"bool",false); } +sbyte { RET_TY(SBYTE,SByteTy,"sbyte",true); } +ubyte { RET_TY(UBYTE,UByteTy,"ubyte",false); } +short { RET_TY(SHORT,ShortTy,"short",true); } +ushort { RET_TY(USHORT,UShortTy,"ushort",false); } +int { RET_TY(INT,IntTy,"int",true); } +uint { RET_TY(UINT,UIntTy,"uint",false); } +long { RET_TY(LONG,LongTy,"long",true); } +ulong { RET_TY(ULONG,ULongTy,"ulong",false); } +float { RET_TY(FLOAT,FloatTy,"float",false); } +double { RET_TY(DOUBLE,DoubleTy,"double",false); } +label { RET_TY(LABEL,LabelTy,"label",false); } +opaque { RET_TY(OPAQUE,OpaqueTy,"opaque",false); } +type { RET_TOK(TYPE); } add { RET_TOK( ADD); } sub { RET_TOK( SUB); } @@ -186,7 +183,7 @@ phi { RET_TOK( PHI_TOK); } call { RET_TOK( CALL); } -cast { RET_TOK( TRUNC); } +cast { RET_TOK( CAST); } select { RET_TOK( SELECT); } shl { RET_TOK( SHL); } lshr { RET_TOK( LSHR); } Index: llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs diff -u llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.2 llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.3 --- llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeLexer.l.cvs Fri Dec 1 14:26:20 2006 @@ -27,17 +27,10 @@ %{ #include "ParserInternals.h" -#define YYSTYPE std::string* #include "UpgradeParser.h" #include #include -static void trim(std::string& str) { - size_t startpos = str.find_first_not_of(" \t\n\r",0); - if (startpos != std::string::npos) - str.erase(0,startpos); -} - #define YY_INPUT(buf,result,max_size) \ { \ if (LexInput->good() && !LexInput->eof()) { \ @@ -51,8 +44,12 @@ // Construct a token value for a non-obsolete token #define RET_TOK(sym) \ - Upgradelval = new std::string(yytext); \ - trim(*Upgradelval); \ + Upgradelval.String = new std::string(yytext); \ + return sym + +#define RET_TY(sym,OldTY,NewTY,sign) \ + Upgradelval.Type.newTy = new std::string(NewTY); \ + Upgradelval.Type.oldTy = OldTY; \ return sym #define YY_NEVER_INTERACTIVE 1 @@ -147,21 +144,21 @@ x86_stdcallcc { RET_TOK( X86_STDCALLCC_TOK); } x86_fastcallcc { RET_TOK( X86_FASTCALLCC_TOK); } -void { RET_TOK( VOID); } -bool { RET_TOK( BOOL); } -sbyte { RET_TOK( SBYTE); } -ubyte { RET_TOK( UBYTE); } -short { RET_TOK( SHORT); } -ushort { RET_TOK( USHORT); } -int { RET_TOK( INT); } -uint { RET_TOK( UINT); } -long { RET_TOK( LONG); } -ulong { RET_TOK( ULONG); } -float { RET_TOK( FLOAT); } -double { RET_TOK( DOUBLE); } -label { RET_TOK( LABEL); } -type { RET_TOK( TYPE); } -opaque { RET_TOK( OPAQUE); } +void { RET_TY(VOID,VoidTy,"void",false); } +bool { RET_TY(BOOL,BoolTy,"bool",false); } +sbyte { RET_TY(SBYTE,SByteTy,"sbyte",true); } +ubyte { RET_TY(UBYTE,UByteTy,"ubyte",false); } +short { RET_TY(SHORT,ShortTy,"short",true); } +ushort { RET_TY(USHORT,UShortTy,"ushort",false); } +int { RET_TY(INT,IntTy,"int",true); } +uint { RET_TY(UINT,UIntTy,"uint",false); } +long { RET_TY(LONG,LongTy,"long",true); } +ulong { RET_TY(ULONG,ULongTy,"ulong",false); } +float { RET_TY(FLOAT,FloatTy,"float",false); } +double { RET_TY(DOUBLE,DoubleTy,"double",false); } +label { RET_TY(LABEL,LabelTy,"label",false); } +opaque { RET_TY(OPAQUE,OpaqueTy,"opaque",false); } +type { RET_TOK(TYPE); } add { RET_TOK( ADD); } sub { RET_TOK( SUB); } @@ -186,7 +183,7 @@ phi { RET_TOK( PHI_TOK); } call { RET_TOK( CALL); } -cast { RET_TOK( TRUNC); } +cast { RET_TOK( CAST); } select { RET_TOK( SELECT); } shl { RET_TOK( SHL); } lshr { RET_TOK( LSHR); } Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.2 llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.3 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp Fri Dec 1 14:26:20 2006 @@ -69,47 +69,47 @@ SINTVAL = 260, UINTVAL = 261, FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - VOLATILE = 290, - TO = 291, - DOTDOTDOT = 292, - NULL_TOK = 293, - UNDEF = 294, - CONST = 295, - INTERNAL = 296, - LINKONCE = 297, - WEAK = 298, - APPENDING = 299, + TRUETOK = 263, + FALSETOK = 264, + NULL_TOK = 265, + UNDEF = 266, + ZEROINITIALIZER = 267, + VOID = 268, + BOOL = 269, + SBYTE = 270, + UBYTE = 271, + SHORT = 272, + USHORT = 273, + INT = 274, + UINT = 275, + LONG = 276, + ULONG = 277, + FLOAT = 278, + DOUBLE = 279, + LABEL = 280, + OPAQUE = 281, + TYPE = 282, + VAR_ID = 283, + LABELSTR = 284, + STRINGCONSTANT = 285, + IMPLEMENTATION = 286, + BEGINTOK = 287, + ENDTOK = 288, + DECLARE = 289, + GLOBAL = 290, + CONSTANT = 291, + SECTION = 292, + VOLATILE = 293, + TO = 294, + DOTDOTDOT = 295, + CONST = 296, + INTERNAL = 297, + LINKONCE = 298, + WEAK = 299, DLLIMPORT = 300, DLLEXPORT = 301, EXTERN_WEAK = 302, - OPAQUE = 303, + APPENDING = 303, NOT = 304, EXTERNAL = 305, TARGET = 306, @@ -163,28 +163,16 @@ LOAD = 354, STORE = 355, GETELEMENTPTR = 356, - TRUNC = 357, - ZEXT = 358, - SEXT = 359, - FPTRUNC = 360, - FPEXT = 361, - BITCAST = 362, - UITOFP = 363, - SITOFP = 364, - FPTOUI = 365, - FPTOSI = 366, - INTTOPTR = 367, - PTRTOINT = 368, - PHI_TOK = 369, - SELECT = 370, - SHL = 371, - LSHR = 372, - ASHR = 373, - VAARG = 374, - EXTRACTELEMENT = 375, - INSERTELEMENT = 376, - SHUFFLEVECTOR = 377, - CAST = 378 + PHI_TOK = 357, + SELECT = 358, + SHL = 359, + LSHR = 360, + ASHR = 361, + VAARG = 362, + EXTRACTELEMENT = 363, + INSERTELEMENT = 364, + SHUFFLEVECTOR = 365, + CAST = 366 }; #endif /* Tokens. */ @@ -193,47 +181,47 @@ #define SINTVAL 260 #define UINTVAL 261 #define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define VOLATILE 290 -#define TO 291 -#define DOTDOTDOT 292 -#define NULL_TOK 293 -#define UNDEF 294 -#define CONST 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 +#define TRUETOK 263 +#define FALSETOK 264 +#define NULL_TOK 265 +#define UNDEF 266 +#define ZEROINITIALIZER 267 +#define VOID 268 +#define BOOL 269 +#define SBYTE 270 +#define UBYTE 271 +#define SHORT 272 +#define USHORT 273 +#define INT 274 +#define UINT 275 +#define LONG 276 +#define ULONG 277 +#define FLOAT 278 +#define DOUBLE 279 +#define LABEL 280 +#define OPAQUE 281 +#define TYPE 282 +#define VAR_ID 283 +#define LABELSTR 284 +#define STRINGCONSTANT 285 +#define IMPLEMENTATION 286 +#define BEGINTOK 287 +#define ENDTOK 288 +#define DECLARE 289 +#define GLOBAL 290 +#define CONSTANT 291 +#define SECTION 292 +#define VOLATILE 293 +#define TO 294 +#define DOTDOTDOT 295 +#define CONST 296 +#define INTERNAL 297 +#define LINKONCE 298 +#define WEAK 299 #define DLLIMPORT 300 #define DLLEXPORT 301 #define EXTERN_WEAK 302 -#define OPAQUE 303 +#define APPENDING 303 #define NOT 304 #define EXTERNAL 305 #define TARGET 306 @@ -287,28 +275,16 @@ #define LOAD 354 #define STORE 355 #define GETELEMENTPTR 356 -#define TRUNC 357 -#define ZEXT 358 -#define SEXT 359 -#define FPTRUNC 360 -#define FPEXT 361 -#define BITCAST 362 -#define UITOFP 363 -#define SITOFP 364 -#define FPTOUI 365 -#define FPTOSI 366 -#define INTTOPTR 367 -#define PTRTOINT 368 -#define PHI_TOK 369 -#define SELECT 370 -#define SHL 371 -#define LSHR 372 -#define ASHR 373 -#define VAARG 374 -#define EXTRACTELEMENT 375 -#define INSERTELEMENT 376 -#define SHUFFLEVECTOR 377 -#define CAST 378 +#define PHI_TOK 357 +#define SELECT 358 +#define SHL 359 +#define LSHR 360 +#define ASHR 361 +#define VAARG 362 +#define EXTRACTELEMENT 363 +#define INSERTELEMENT 364 +#define SHUFFLEVECTOR 365 +#define CAST 366 @@ -316,9 +292,6 @@ /* Copy the first part of user declarations. */ #line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" -#define YYERROR_VERBOSE 1 -#define YYSTYPE std::string* - #include "ParserInternals.h" #include #include @@ -326,23 +299,26 @@ #include #include +#define YYERROR_VERBOSE 1 #define YYINCLUDED_STDLIB_H +#define YYDEBUG 1 int yylex(); // declaration" of xxx warnings. int yyparse(); +extern int yydebug; static std::string CurFilename; - static std::ostream *O = 0; - std::istream* LexInput = 0; +unsigned SizeOfPointer = 32; void UpgradeAssembly(const std::string &infile, std::istream& in, - std::ostream &out) + std::ostream &out, bool debug) { Upgradelineno = 1; CurFilename = infile; LexInput = ∈ + yydebug = debug; O = &out; if (yyparse()) { @@ -351,6 +327,82 @@ } } +const char* getCastOpcode(TypeInfo& SrcTy, TypeInfo&DstTy) { + unsigned SrcBits = SrcTy.getBitWidth(); + unsigned DstBits = DstTy.getBitWidth(); + const char* opcode = "bitcast"; + // Run through the possibilities ... + if (DstTy.isIntegral()) { // Casting to integral + if (SrcTy.isIntegral()) { // Casting from integral + if (DstBits < SrcBits) + opcode = "trunc"; + else if (DstBits > SrcBits) { // its an extension + if (SrcTy.isSigned()) + opcode ="sext"; // signed -> SEXT + else + opcode = "zext"; // unsigned -> ZEXT + } else { + opcode = "bitcast"; // Same size, No-op cast + } + } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt + if (DstTy.isSigned()) + opcode = "fptosi"; // FP -> sint + else + opcode = "fptoui"; // FP -> uint + } else if (SrcTy.isPacked()) { + assert(DstBits == SrcTy.getBitWidth() && + "Casting packed to integer of different width"); + opcode = "bitcast"; // same size, no-op cast + } else { + assert(SrcTy.isPointer() && + "Casting from a value that is not first-class type"); + opcode = "ptrtoint"; // ptr -> int + } + } else if (DstTy.isFloatingPoint()) { // Casting to floating pt + if (SrcTy.isIntegral()) { // Casting from integral + if (SrcTy.isSigned()) + opcode = "sitofp"; // sint -> FP + else + opcode = "uitofp"; // uint -> FP + } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt + if (DstBits < SrcBits) { + opcode = "fptrunc"; // FP -> smaller FP + } else if (DstBits > SrcBits) { + opcode = "fpext"; // FP -> larger FP + } else { + opcode ="bitcast"; // same size, no-op cast + } + } else if (SrcTy.isPacked()) { + assert(DstBits == SrcTy.getBitWidth() && + "Casting packed to floating point of different width"); + opcode = "bitcast"; // same size, no-op cast + } else { + assert(0 && "Casting pointer or non-first class to float"); + } + } else if (DstTy.isPacked()) { + if (SrcTy.isPacked()) { + assert(DstTy.getBitWidth() == SrcTy.getBitWidth() && + "Casting packed to packed of different widths"); + opcode = "bitcast"; // packed -> packed + } else if (DstTy.getBitWidth() == SrcBits) { + opcode = "bitcast"; // float/int -> packed + } else { + assert(!"Illegal cast to packed (wrong type or size)"); + } + } else if (DstTy.isPointer()) { + if (SrcTy.isPointer()) { + opcode = "bitcast"; // ptr -> ptr + } else if (SrcTy.isIntegral()) { + opcode = "inttoptr"; // int -> ptr + } else { + assert(!"Casting pointer to other than pointer or int"); + } + } else { + assert(!"Casting to type that is not first-class"); + } + return opcode; +} + /* Enabling traces. */ @@ -372,7 +424,15 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -typedef int YYSTYPE; +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +typedef union YYSTYPE { + std::string* String; + TypeInfo Type; + ValueInfo Value; + ConstInfo Const; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 436 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -384,7 +444,7 @@ /* Line 219 of yacc.c. */ -#line 388 "UpgradeParser.tab.c" +#line 448 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -535,20 +595,20 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1246 +#define YYLAST 1193 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 138 +#define YYNTOKENS 126 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 71 +#define YYNNTS 70 /* YYNRULES -- Number of rules. */ -#define YYNRULES 251 +#define YYNRULES 249 /* YYNRULES -- Number of states. */ -#define YYNSTATES 510 +#define YYNSTATES 508 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 378 +#define YYMAXUTOK 366 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -560,15 +620,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 127, 128, 136, 2, 125, 2, 2, 2, 2, 2, + 115, 116, 124, 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 132, 124, 133, 2, 2, 2, 2, 2, 2, 2, + 120, 112, 121, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 129, 126, 131, 2, 2, 2, 2, 2, 137, + 2, 117, 114, 119, 2, 2, 2, 2, 2, 125, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 130, 2, 2, 134, 2, 135, 2, 2, 2, 2, + 118, 2, 2, 122, 2, 123, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -592,8 +652,7 @@ 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 + 105, 106, 107, 108, 109, 110, 111 }; #if YYDEBUG @@ -605,146 +664,143 @@ 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, 82, 83, 85, 87, 89, 91, 93, 95, 97, - 98, 100, 102, 104, 106, 108, 110, 113, 114, 115, - 118, 119, 123, 126, 127, 129, 130, 134, 136, 139, + 80, 81, 83, 85, 87, 89, 91, 93, 95, 96, + 98, 100, 102, 104, 106, 108, 111, 112, 113, 116, + 117, 121, 124, 125, 127, 128, 132, 134, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, - 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 184, 189, 195, 201, 205, 208, 211, 213, 217, - 219, 223, 225, 226, 231, 235, 239, 244, 249, 253, - 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, - 290, 296, 305, 312, 319, 326, 333, 340, 349, 358, - 362, 364, 366, 368, 370, 373, 376, 381, 384, 386, - 391, 394, 399, 406, 413, 420, 427, 431, 436, 437, - 439, 441, 443, 447, 451, 455, 459, 463, 467, 469, - 470, 472, 474, 476, 477, 480, 484, 486, 488, 492, - 494, 495, 504, 506, 508, 512, 514, 516, 520, 521, - 523, 525, 529, 530, 532, 534, 536, 538, 540, 542, - 544, 546, 548, 552, 554, 560, 562, 564, 566, 568, - 571, 574, 576, 580, 583, 584, 586, 589, 592, 596, - 606, 616, 625, 639, 641, 643, 650, 656, 659, 666, - 674, 676, 680, 682, 683, 686, 688, 694, 700, 706, - 709, 714, 719, 726, 731, 736, 743, 750, 753, 761, - 763, 766, 767, 769, 770, 774, 781, 785, 792, 795, - 800, 807 + 161, 163, 165, 167, 169, 171, 173, 175, 177, 180, + 185, 191, 197, 201, 204, 207, 209, 213, 215, 219, + 221, 222, 227, 231, 235, 240, 245, 249, 252, 255, + 258, 261, 264, 267, 270, 273, 276, 279, 286, 292, + 301, 308, 315, 322, 329, 336, 345, 354, 358, 360, + 362, 364, 366, 369, 372, 377, 380, 382, 387, 390, + 395, 402, 409, 416, 423, 427, 432, 433, 435, 437, + 439, 443, 447, 451, 455, 459, 463, 465, 466, 468, + 470, 472, 473, 476, 480, 482, 484, 488, 490, 491, + 500, 502, 504, 508, 510, 512, 516, 517, 519, 521, + 525, 526, 528, 530, 532, 534, 536, 538, 540, 542, + 544, 548, 550, 556, 558, 560, 562, 564, 567, 570, + 572, 576, 579, 580, 582, 585, 588, 592, 602, 612, + 621, 635, 637, 639, 646, 652, 655, 662, 670, 672, + 676, 678, 679, 682, 684, 690, 696, 702, 705, 710, + 715, 722, 727, 732, 739, 746, 749, 757, 759, 762, + 763, 765, 766, 770, 777, 781, 788, 791, 796, 803 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short int yyrhs[] = { - 170, 0, -1, 5, -1, 6, -1, 3, -1, 4, + 157, 0, -1, 5, -1, 6, -1, 3, -1, 4, -1, 78, -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, 123, -1, 116, - -1, 117, -1, 118, -1, 16, -1, 14, -1, 12, - -1, 10, -1, 17, -1, 15, -1, 13, -1, 11, - -1, 146, -1, 147, -1, 18, -1, 19, -1, 178, - 124, -1, -1, 41, -1, 42, -1, 43, -1, 44, - -1, 45, -1, 46, -1, 47, -1, -1, 65, -1, - 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, - 64, 4, -1, -1, -1, 57, 4, -1, -1, 125, - 57, 4, -1, 34, 24, -1, -1, 155, -1, -1, - 125, 158, 157, -1, 155, -1, 57, 4, -1, 161, - -1, 8, -1, 163, -1, 8, -1, 163, -1, 9, - -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, - -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, - -1, 20, -1, 21, -1, 48, -1, 162, -1, 192, - -1, 126, 4, -1, 160, 127, 165, 128, -1, 129, - 4, 130, 163, 131, -1, 132, 4, 130, 163, 133, - -1, 134, 164, 135, -1, 134, 135, -1, 163, 136, - -1, 163, -1, 164, 125, 163, -1, 164, -1, 164, - 125, 37, -1, 37, -1, -1, 161, 129, 168, 131, - -1, 161, 129, 131, -1, 161, 137, 24, -1, 161, - 132, 168, 133, -1, 161, 134, 168, 135, -1, 161, - 134, 135, -1, 161, 38, -1, 161, 39, -1, 161, - 192, -1, 161, 167, -1, 161, 26, -1, 146, 140, - -1, 147, 4, -1, 9, 27, -1, 9, 28, -1, - 149, 7, -1, 144, 127, 166, 36, 161, 128, -1, - 101, 127, 166, 206, 128, -1, 115, 127, 166, 125, - 166, 125, 166, 128, -1, 141, 127, 166, 125, 166, - 128, -1, 142, 127, 166, 125, 166, 128, -1, 143, - 127, 166, 125, 166, 128, -1, 145, 127, 166, 125, - 166, 128, -1, 120, 127, 166, 125, 166, 128, -1, - 121, 127, 166, 125, 166, 125, 166, 128, -1, 122, - 127, 166, 125, 166, 125, 166, 128, -1, 168, 125, - 166, -1, 166, -1, 32, -1, 33, -1, 171, -1, - 171, 187, -1, 171, 189, -1, 171, 62, 61, 173, - -1, 171, 25, -1, 172, -1, 172, 150, 20, 159, - -1, 172, 189, -1, 172, 62, 61, 173, -1, 172, - 150, 151, 169, 166, 157, -1, 172, 150, 50, 169, - 161, 157, -1, 172, 150, 45, 169, 161, 157, -1, - 172, 150, 47, 169, 161, 157, -1, 172, 51, 175, - -1, 172, 58, 124, 176, -1, -1, 24, -1, 56, - -1, 55, -1, 53, 124, 174, -1, 54, 124, 4, - -1, 52, 124, 24, -1, 71, 124, 24, -1, 129, - 177, 131, -1, 177, 125, 24, -1, 24, -1, -1, - 22, -1, 24, -1, 178, -1, -1, 161, 179, -1, - 181, 125, 180, -1, 180, -1, 181, -1, 181, 125, - 37, -1, 37, -1, -1, 152, 159, 178, 127, 182, - 128, 156, 153, -1, 29, -1, 134, -1, 151, 183, - 184, -1, 30, -1, 135, -1, 185, 195, 186, -1, - -1, 45, -1, 47, -1, 31, 188, 183, -1, -1, - 63, -1, 3, -1, 4, -1, 7, -1, 27, -1, - 28, -1, 38, -1, 39, -1, 26, -1, 132, 168, - 133, -1, 167, -1, 61, 190, 24, 125, 24, -1, - 139, -1, 178, -1, 192, -1, 191, -1, 161, 193, - -1, 195, 196, -1, 196, -1, 197, 150, 198, -1, - 197, 200, -1, -1, 23, -1, 72, 194, -1, 72, - 8, -1, 73, 21, 193, -1, 73, 9, 193, 125, - 21, 193, 125, 21, 193, -1, 74, 148, 193, 125, - 21, 193, 129, 199, 131, -1, 74, 148, 193, 125, - 21, 193, 129, 131, -1, 75, 152, 159, 193, 127, - 203, 128, 36, 21, 193, 76, 21, 193, -1, 76, - -1, 77, -1, 199, 148, 191, 125, 21, 193, -1, - 148, 191, 125, 21, 193, -1, 150, 205, -1, 161, - 129, 193, 125, 193, 131, -1, 201, 125, 129, 193, - 125, 193, 131, -1, 194, -1, 202, 125, 194, -1, - 202, -1, -1, 60, 59, -1, 59, -1, 141, 161, - 193, 125, 193, -1, 142, 161, 193, 125, 193, -1, - 143, 161, 193, 125, 193, -1, 49, 194, -1, 145, - 194, 125, 194, -1, 144, 194, 36, 161, -1, 115, - 194, 125, 194, 125, 194, -1, 119, 194, 125, 161, - -1, 120, 194, 125, 194, -1, 121, 194, 125, 194, - 125, 194, -1, 122, 194, 125, 194, 125, 194, -1, - 114, 201, -1, 204, 152, 159, 193, 127, 203, 128, - -1, 208, -1, 125, 202, -1, -1, 35, -1, -1, - 96, 161, 154, -1, 96, 161, 125, 15, 193, 154, - -1, 97, 161, 154, -1, 97, 161, 125, 15, 193, - 154, -1, 98, 194, -1, 207, 99, 161, 193, -1, - 207, 100, 194, 125, 161, 193, -1, 101, 161, 193, - 206, -1 + -1, 93, -1, 94, -1, 95, -1, 104, -1, 105, + -1, 106, -1, 21, -1, 19, -1, 17, -1, 15, + -1, 22, -1, 20, -1, 18, -1, 16, -1, 133, + -1, 134, -1, 23, -1, 24, -1, 165, 112, -1, + -1, 42, -1, 43, -1, 44, -1, 48, -1, 45, + -1, 46, -1, 47, -1, -1, 65, -1, 66, -1, + 67, -1, 68, -1, 69, -1, 70, -1, 64, 4, + -1, -1, -1, 57, 4, -1, -1, 113, 57, 4, + -1, 37, 30, -1, -1, 142, -1, -1, 113, 145, + 144, -1, 142, -1, 57, 4, -1, 148, -1, 13, + -1, 150, -1, 13, -1, 150, -1, 14, -1, 15, + -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, + -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, + -1, 26, -1, 149, -1, 179, -1, 114, 4, -1, + 147, 115, 152, 116, -1, 117, 4, 118, 150, 119, + -1, 120, 4, 118, 150, 121, -1, 122, 151, 123, + -1, 122, 123, -1, 150, 124, -1, 150, -1, 151, + 113, 150, -1, 151, -1, 151, 113, 40, -1, 40, + -1, -1, 148, 117, 155, 119, -1, 148, 117, 119, + -1, 148, 125, 30, -1, 148, 120, 155, 121, -1, + 148, 122, 155, 123, -1, 148, 122, 123, -1, 148, + 10, -1, 148, 11, -1, 148, 179, -1, 148, 154, + -1, 148, 12, -1, 133, 128, -1, 134, 4, -1, + 14, 8, -1, 14, 9, -1, 136, 7, -1, 111, + 115, 153, 39, 148, 116, -1, 101, 115, 153, 193, + 116, -1, 103, 115, 153, 113, 153, 113, 153, 116, + -1, 129, 115, 153, 113, 153, 116, -1, 130, 115, + 153, 113, 153, 116, -1, 131, 115, 153, 113, 153, + 116, -1, 132, 115, 153, 113, 153, 116, -1, 108, + 115, 153, 113, 153, 116, -1, 109, 115, 153, 113, + 153, 113, 153, 116, -1, 110, 115, 153, 113, 153, + 113, 153, 116, -1, 155, 113, 153, -1, 153, -1, + 35, -1, 36, -1, 158, -1, 158, 174, -1, 158, + 176, -1, 158, 62, 61, 160, -1, 158, 31, -1, + 159, -1, 159, 137, 27, 146, -1, 159, 176, -1, + 159, 62, 61, 160, -1, 159, 137, 138, 156, 153, + 144, -1, 159, 137, 50, 156, 148, 144, -1, 159, + 137, 45, 156, 148, 144, -1, 159, 137, 47, 156, + 148, 144, -1, 159, 51, 162, -1, 159, 58, 112, + 163, -1, -1, 30, -1, 56, -1, 55, -1, 53, + 112, 161, -1, 54, 112, 4, -1, 52, 112, 30, + -1, 71, 112, 30, -1, 117, 164, 119, -1, 164, + 113, 30, -1, 30, -1, -1, 28, -1, 30, -1, + 165, -1, -1, 148, 166, -1, 168, 113, 167, -1, + 167, -1, 168, -1, 168, 113, 40, -1, 40, -1, + -1, 139, 146, 165, 115, 169, 116, 143, 140, -1, + 32, -1, 122, -1, 138, 170, 171, -1, 33, -1, + 123, -1, 172, 182, 173, -1, -1, 45, -1, 47, + -1, 34, 175, 170, -1, -1, 63, -1, 3, -1, + 4, -1, 7, -1, 8, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 120, 155, 121, -1, 154, -1, + 61, 177, 30, 113, 30, -1, 127, -1, 165, -1, + 179, -1, 178, -1, 148, 180, -1, 182, 183, -1, + 183, -1, 184, 137, 185, -1, 184, 187, -1, -1, + 29, -1, 72, 181, -1, 72, 13, -1, 73, 25, + 180, -1, 73, 14, 180, 113, 25, 180, 113, 25, + 180, -1, 74, 135, 180, 113, 25, 180, 117, 186, + 119, -1, 74, 135, 180, 113, 25, 180, 117, 119, + -1, 75, 139, 146, 180, 115, 190, 116, 39, 25, + 180, 76, 25, 180, -1, 76, -1, 77, -1, 186, + 135, 178, 113, 25, 180, -1, 135, 178, 113, 25, + 180, -1, 137, 192, -1, 148, 117, 180, 113, 180, + 119, -1, 188, 113, 117, 180, 113, 180, 119, -1, + 181, -1, 189, 113, 181, -1, 189, -1, -1, 60, + 59, -1, 59, -1, 129, 148, 180, 113, 180, -1, + 130, 148, 180, 113, 180, -1, 131, 148, 180, 113, + 180, -1, 49, 181, -1, 132, 181, 113, 181, -1, + 111, 181, 39, 148, -1, 103, 181, 113, 181, 113, + 181, -1, 107, 181, 113, 148, -1, 108, 181, 113, + 181, -1, 109, 181, 113, 181, 113, 181, -1, 110, + 181, 113, 181, 113, 181, -1, 102, 188, -1, 191, + 139, 146, 180, 115, 190, 116, -1, 195, -1, 113, + 189, -1, -1, 38, -1, -1, 96, 148, 141, -1, + 96, 148, 113, 20, 180, 141, -1, 97, 148, 141, + -1, 97, 148, 113, 20, 180, 141, -1, 98, 181, + -1, 194, 99, 148, 180, -1, 194, 100, 181, 113, + 148, 180, -1, 101, 148, 180, 193, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 84, 84, 84, 85, 85, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 90, 90, 90, 91, 91, - 91, 91, 91, 91, 92, 93, 93, 93, 97, 97, - 97, 97, 98, 98, 98, 98, 99, 99, 100, 100, - 103, 107, 112, 112, 112, 112, 112, 112, 113, 114, - 117, 117, 117, 117, 117, 118, 118, 119, 124, 125, - 128, 129, 137, 143, 144, 147, 148, 157, 158, 171, - 171, 172, 172, 173, 177, 177, 177, 177, 177, 177, - 177, 178, 178, 178, 178, 178, 178, 179, 179, 179, - 183, 187, 192, 198, 204, 209, 212, 220, 220, 227, - 228, 233, 236, 246, 251, 254, 259, 264, 269, 272, - 277, 282, 287, 292, 298, 303, 308, 313, 318, 325, - 330, 332, 334, 336, 338, 340, 342, 344, 346, 351, - 353, 358, 358, 368, 373, 376, 381, 384, 387, 391, - 396, 401, 406, 411, 416, 421, 426, 431, 436, 441, - 443, 443, 446, 451, 456, 461, 468, 475, 480, 481, - 489, 489, 490, 490, 492, 498, 501, 505, 508, 512, - 515, 519, 534, 537, 541, 550, 551, 553, 559, 560, - 561, 565, 575, 577, 580, 580, 580, 580, 580, 581, - 581, 581, 582, 587, 588, 597, 597, 600, 600, 606, - 612, 614, 621, 625, 630, 633, 639, 644, 649, 654, - 660, 666, 672, 681, 686, 692, 697, 704, 711, 716, - 724, 725, 733, 734, 738, 743, 746, 751, 756, 761, - 766, 771, 776, 781, 786, 791, 796, 801, 806, 815, - 820, 824, 828, 829, 832, 839, 846, 853, 860, 865, - 872, 879 + 0, 189, 189, 189, 190, 190, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 195, 195, 195, 196, 196, + 196, 196, 196, 196, 197, 197, 197, 201, 201, 201, + 201, 202, 202, 202, 202, 203, 203, 204, 204, 207, + 211, 216, 216, 216, 216, 216, 216, 217, 218, 221, + 221, 221, 221, 221, 222, 222, 223, 228, 229, 232, + 233, 241, 247, 248, 251, 252, 261, 262, 275, 275, + 276, 276, 277, 281, 281, 281, 281, 281, 281, 281, + 282, 282, 282, 282, 282, 283, 283, 283, 288, 293, + 299, 306, 313, 319, 323, 333, 336, 344, 345, 350, + 353, 363, 369, 374, 380, 386, 392, 397, 403, 409, + 415, 421, 427, 433, 439, 445, 451, 459, 466, 472, + 477, 482, 487, 492, 497, 502, 507, 517, 522, 527, + 527, 537, 542, 545, 550, 553, 556, 560, 565, 570, + 575, 581, 587, 593, 599, 604, 609, 614, 616, 616, + 619, 624, 631, 636, 643, 650, 655, 656, 664, 664, + 665, 665, 667, 674, 678, 682, 685, 690, 693, 697, + 717, 720, 724, 733, 734, 736, 744, 745, 746, 750, + 763, 765, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 782, 783, 792, 792, 795, 795, 801, 808, 810, + 817, 821, 826, 829, 835, 840, 845, 850, 857, 863, + 869, 878, 883, 889, 894, 902, 909, 915, 923, 924, + 932, 933, 937, 942, 945, 950, 955, 960, 965, 970, + 977, 982, 987, 992, 997, 1002, 1007, 1016, 1021, 1025, + 1029, 1030, 1033, 1040, 1047, 1054, 1061, 1066, 1073, 1080 }; #endif @@ -754,28 +810,26 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", - "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", - "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", - "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", - "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", - "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", - "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_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", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", - "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", - "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", - "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "SHL", "LSHR", + "UINTVAL", "FPVAL", "TRUETOK", "FALSETOK", "NULL_TOK", "UNDEF", + "ZEROINITIALIZER", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "LABEL", "OPAQUE", + "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION", + "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK", + "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL", + "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN", + "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", + "CCC_TOK", "CSRETCC_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", "SETLE", + "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", "ALLOCA", "FREE", + "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "LSHR", "ASHR", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", - "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", - "ArithmeticOps", "LogicalOps", "SetCondOps", "CastOps", "ShiftOps", - "SIntType", "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", + "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "IntVal", "EInt64Val", + "ArithmeticOps", "LogicalOps", "SetCondOps", "ShiftOps", "SIntType", + "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", @@ -807,41 +861,39 @@ 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, 61, 44, 92, 40, 41, 91, - 120, 93, 60, 62, 123, 125, 42, 99 + 365, 366, 61, 44, 92, 40, 41, 91, 120, 93, + 60, 62, 123, 125, 42, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 138, 139, 139, 140, 140, 141, 141, 141, 141, - 141, 141, 141, 141, 141, 142, 142, 142, 143, 143, - 143, 143, 143, 143, 144, 145, 145, 145, 146, 146, - 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, - 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, - 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, - 154, 154, 155, 156, 156, 157, 157, 158, 158, 159, - 159, 160, 160, 161, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 164, 164, 165, - 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, - 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, - 168, 169, 169, 170, 171, 171, 171, 171, 171, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, - 174, 174, 175, 175, 175, 175, 176, 177, 177, 177, - 178, 178, 179, 179, 180, 181, 181, 182, 182, 182, - 182, 183, 184, 184, 185, 186, 186, 187, 188, 188, - 188, 189, 190, 190, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 192, 192, 193, 193, 194, - 195, 195, 196, 197, 197, 197, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 199, 199, 200, 201, 201, - 202, 202, 203, 203, 204, 204, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, - 208, 208 + 0, 126, 127, 127, 128, 128, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 130, 130, 130, 131, 131, + 131, 131, 131, 131, 132, 132, 132, 133, 133, 133, + 133, 134, 134, 134, 134, 135, 135, 136, 136, 137, + 137, 138, 138, 138, 138, 138, 138, 138, 138, 139, + 139, 139, 139, 139, 139, 139, 139, 140, 140, 141, + 141, 142, 143, 143, 144, 144, 145, 145, 146, 146, + 147, 147, 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, 152, 152, 152, + 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, + 154, 154, 154, 154, 154, 154, 154, 155, 155, 156, + 156, 157, 158, 158, 158, 158, 158, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 160, 161, 161, + 162, 162, 162, 162, 163, 164, 164, 164, 165, 165, + 166, 166, 167, 168, 168, 169, 169, 169, 169, 170, + 171, 171, 172, 173, 173, 174, 175, 175, 175, 176, + 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 179, 179, 180, 180, 181, 182, 182, + 183, 184, 184, 184, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 186, 186, 187, 188, 188, 189, 189, + 190, 190, 191, 191, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, + 194, 194, 195, 195, 195, 195, 195, 195, 195, 195 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -850,29 +902,28 @@ 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, 2, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 2, 0, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 2, 0, 0, 2, - 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 5, 5, 3, 2, 2, 1, 3, 1, - 3, 1, 0, 4, 3, 3, 4, 4, 3, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - 5, 8, 6, 6, 6, 6, 6, 8, 8, 3, - 1, 1, 1, 1, 2, 2, 4, 2, 1, 4, - 2, 4, 6, 6, 6, 6, 3, 4, 0, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, - 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, - 0, 8, 1, 1, 3, 1, 1, 3, 0, 1, - 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, - 2, 1, 3, 2, 0, 1, 2, 2, 3, 9, - 9, 8, 13, 1, 1, 6, 5, 2, 6, 7, - 1, 3, 1, 0, 2, 1, 5, 5, 5, 2, - 4, 4, 6, 4, 4, 6, 6, 2, 7, 1, - 2, 0, 1, 0, 3, 6, 3, 6, 2, 4, - 6, 4 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, + 5, 5, 3, 2, 2, 1, 3, 1, 3, 1, + 0, 4, 3, 3, 4, 4, 3, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 6, 5, 8, + 6, 6, 6, 6, 6, 8, 8, 3, 1, 1, + 1, 1, 2, 2, 4, 2, 1, 4, 2, 4, + 6, 6, 6, 6, 3, 4, 0, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 1, 0, 1, 1, + 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, + 1, 1, 3, 1, 1, 3, 0, 1, 1, 3, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 5, 1, 1, 1, 1, 2, 2, 1, + 3, 2, 0, 1, 2, 2, 3, 9, 9, 8, + 13, 1, 1, 6, 5, 2, 6, 7, 1, 3, + 1, 0, 2, 1, 5, 5, 5, 2, 4, 4, + 6, 4, 4, 6, 6, 2, 7, 1, 2, 0, + 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -880,461 +931,449 @@ means the default is an error. */ static const unsigned char yydefact[] = { - 148, 0, 49, 138, 1, 137, 178, 42, 43, 44, - 45, 46, 47, 48, 0, 57, 204, 134, 135, 160, - 161, 0, 0, 0, 49, 0, 140, 179, 180, 57, - 0, 0, 50, 51, 52, 53, 54, 55, 0, 0, - 205, 204, 201, 41, 0, 0, 0, 0, 146, 0, - 0, 0, 0, 0, 0, 0, 40, 181, 149, 136, - 56, 2, 3, 70, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 0, 0, - 0, 0, 195, 0, 0, 69, 88, 73, 196, 89, - 172, 173, 174, 175, 176, 177, 200, 243, 203, 0, - 0, 0, 0, 159, 147, 141, 139, 131, 132, 0, - 0, 0, 0, 90, 0, 0, 72, 95, 97, 0, - 0, 102, 96, 242, 0, 225, 0, 0, 0, 0, - 57, 213, 214, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 0, 0, 0, 0, 0, 0, 25, 26, 27, - 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, - 202, 57, 217, 0, 239, 154, 151, 150, 152, 153, - 155, 158, 0, 65, 65, 65, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 0, 0, 0, - 0, 65, 0, 0, 0, 94, 170, 101, 99, 0, - 0, 229, 224, 207, 206, 0, 0, 31, 35, 30, - 34, 29, 33, 28, 32, 36, 37, 0, 0, 60, - 60, 248, 0, 0, 237, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, - 0, 144, 145, 143, 116, 117, 4, 5, 114, 115, - 118, 113, 109, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 112, 111, - 142, 71, 71, 98, 169, 163, 166, 167, 0, 0, - 91, 184, 185, 186, 191, 187, 188, 189, 190, 182, - 0, 193, 198, 197, 199, 0, 208, 0, 0, 0, - 244, 0, 246, 241, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, - 0, 0, 67, 65, 0, 0, 0, 0, 0, 104, - 130, 0, 0, 108, 0, 105, 0, 0, 0, 0, - 0, 92, 93, 162, 164, 0, 63, 100, 183, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 251, 0, - 0, 0, 233, 234, 0, 0, 0, 0, 0, 231, - 230, 0, 249, 0, 62, 68, 66, 241, 0, 0, - 0, 0, 0, 103, 106, 107, 0, 0, 0, 0, - 0, 168, 165, 64, 58, 0, 192, 0, 0, 223, - 60, 61, 60, 220, 240, 0, 0, 0, 0, 0, - 226, 227, 228, 223, 0, 0, 0, 0, 0, 0, - 129, 0, 0, 0, 0, 0, 0, 171, 0, 0, - 0, 222, 0, 0, 245, 247, 0, 0, 0, 232, - 235, 236, 0, 250, 120, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 194, 0, 0, 0, 221, - 218, 0, 238, 0, 126, 0, 0, 122, 123, 124, - 119, 125, 0, 211, 0, 0, 0, 219, 0, 0, - 0, 209, 0, 210, 0, 0, 121, 127, 128, 0, - 0, 0, 0, 0, 0, 216, 0, 0, 215, 212 + 146, 0, 48, 136, 1, 135, 176, 41, 42, 43, + 45, 46, 47, 44, 0, 56, 202, 132, 133, 158, + 159, 0, 0, 0, 48, 0, 138, 177, 178, 56, + 0, 0, 49, 50, 51, 52, 53, 54, 0, 0, + 203, 202, 199, 40, 0, 0, 0, 0, 144, 0, + 0, 0, 0, 0, 0, 0, 39, 179, 147, 134, + 55, 2, 3, 69, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 0, 0, 0, + 0, 193, 0, 0, 68, 86, 72, 194, 87, 170, + 171, 172, 173, 174, 175, 198, 241, 201, 0, 0, + 0, 0, 157, 145, 139, 137, 129, 130, 0, 0, + 0, 0, 88, 0, 0, 71, 93, 95, 0, 0, + 100, 94, 240, 0, 223, 0, 0, 0, 0, 56, + 211, 212, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 200, 56, + 215, 0, 237, 152, 149, 148, 150, 151, 153, 156, + 0, 64, 64, 64, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 0, 0, 0, 0, 64, + 0, 0, 0, 92, 168, 99, 97, 0, 0, 227, + 222, 205, 204, 0, 0, 30, 34, 29, 33, 28, + 32, 27, 31, 35, 36, 0, 0, 59, 59, 246, + 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 154, 0, 142, + 143, 141, 114, 115, 4, 5, 112, 113, 116, 107, + 108, 111, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 110, 109, 140, 70, + 70, 96, 167, 161, 164, 165, 0, 0, 89, 182, + 183, 184, 185, 186, 187, 188, 189, 180, 0, 191, + 196, 195, 197, 0, 206, 0, 0, 0, 242, 0, + 244, 239, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, + 66, 64, 0, 0, 0, 0, 0, 0, 102, 128, + 0, 0, 106, 0, 103, 0, 0, 0, 0, 90, + 91, 160, 162, 0, 62, 98, 181, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, + 231, 232, 0, 0, 229, 0, 0, 0, 228, 0, + 247, 0, 61, 67, 65, 239, 0, 0, 0, 0, + 0, 0, 101, 104, 105, 0, 0, 0, 0, 166, + 163, 63, 57, 0, 190, 0, 0, 221, 59, 60, + 59, 218, 238, 0, 0, 0, 0, 0, 224, 225, + 226, 221, 0, 0, 0, 0, 0, 0, 0, 127, + 0, 0, 0, 0, 0, 169, 0, 0, 0, 220, + 0, 0, 243, 245, 0, 0, 0, 230, 233, 234, + 0, 248, 118, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 58, 192, 0, 0, 0, 219, 216, 0, + 236, 0, 124, 0, 0, 117, 120, 121, 122, 123, + 0, 209, 0, 0, 0, 217, 0, 0, 0, 207, + 0, 208, 0, 0, 119, 125, 126, 0, 0, 0, + 0, 0, 0, 214, 0, 0, 213, 210 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short int yydefgoto[] = { - -1, 82, 258, 273, 274, 275, 276, 277, 197, 198, - 227, 199, 24, 15, 38, 437, 310, 332, 404, 251, - 333, 83, 84, 200, 86, 87, 119, 209, 340, 301, - 341, 109, 1, 2, 3, 59, 178, 48, 104, 182, - 88, 354, 286, 287, 288, 39, 92, 16, 95, 17, - 29, 18, 359, 302, 89, 304, 413, 41, 42, 43, - 170, 485, 98, 234, 441, 442, 171, 172, 368, 173, - 174 + -1, 81, 256, 272, 273, 274, 275, 195, 196, 225, + 197, 24, 15, 38, 435, 308, 330, 402, 249, 331, + 82, 83, 198, 85, 86, 118, 207, 339, 299, 340, + 108, 1, 2, 3, 59, 176, 48, 103, 180, 87, + 352, 284, 285, 286, 39, 91, 16, 94, 17, 29, + 18, 357, 300, 88, 302, 411, 41, 42, 43, 168, + 483, 97, 232, 439, 440, 169, 170, 366, 171, 172 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -451 +#define YYPACT_NINF -403 static const short int yypact[] = { - -451, 18, 670, 213, -451, -451, 63, -451, -451, -451, - -451, -451, -451, -451, -39, 308, 33, -451, -451, -451, - -451, 14, -36, 31, 150, -12, -451, -451, -451, 308, - 96, 136, -451, -451, -451, -451, -451, -451, 971, -13, - -451, -9, -451, 119, 10, 20, 37, 56, -451, 40, - 96, 971, 45, 45, 45, 45, -451, -451, -451, -451, - -451, -451, -451, 52, -451, -451, -451, -451, -451, -451, - -451, -451, -451, -451, -451, -451, -451, -451, 177, 179, - 180, 85, -451, 119, 58, -451, -451, -52, -451, -451, - -451, -451, -451, -451, -451, -451, -451, 1123, -451, 163, - 97, 185, 174, 178, -451, -451, -451, -451, -451, 1019, - 1019, 1019, 1060, -451, 76, 82, -451, -451, -52, -85, - 86, 786, -451, -451, 1019, -451, 157, 1101, 30, 278, - 308, -451, -451, -451, -451, -451, -451, -451, -451, -451, - -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, - -451, 1019, 1019, 1019, 1019, 1019, 1019, -451, -451, -451, - 1019, 1019, 1019, 1019, -451, 1019, 1019, 1019, 1019, 1019, - -451, 308, -451, 55, -451, -451, -451, -451, -451, -451, - -451, -451, -49, 90, 90, 90, 130, 156, 214, 160, - 217, 162, 218, 168, 220, 224, 225, 170, 221, 227, - 387, 90, 1019, 1019, 1019, -451, 827, -451, 111, 122, - 560, -451, -451, 52, -451, 560, 560, -451, -451, -451, - -451, -451, -451, -451, -451, -451, -451, 560, 971, 123, - 126, -451, 560, 118, 127, 128, 140, 141, 142, 143, - 560, 560, 560, 233, 145, 971, 1019, 1019, 248, -451, - -23, -451, -451, -451, -451, -451, -451, -451, -451, -451, - -451, -451, -451, -451, 146, 147, 149, 169, 171, 868, - 1060, 537, 253, 173, 181, 182, 183, 187, -451, -451, - -451, -94, 6, -52, -451, 119, -451, 158, 188, 889, - -451, -451, -451, -451, -451, -451, -451, -451, -451, 234, - 1060, -451, -451, -451, -451, 190, -451, 197, 560, -5, - -451, 8, -451, 201, 560, 199, 1019, 1019, 1019, 1019, - 1019, 205, 207, 208, 1019, 1019, 560, 560, 209, -451, - 282, 303, -451, 90, 1060, 1060, 1060, 1060, 1060, -451, - -451, -44, -89, -451, -56, -451, 1060, 1060, 1060, 1060, - 1060, -451, -451, -451, -451, 930, 304, -451, -451, 313, - -14, 320, 323, 219, 560, 344, 560, 1019, -451, 226, - 560, 228, -451, -451, 229, 230, 560, 560, 560, -451, - -451, 222, -451, 1019, -451, -451, -451, 201, 231, 238, - 239, 241, 1060, -451, -451, -451, 244, 245, 257, 348, - 261, -451, -451, -451, 330, 263, -451, 560, 560, 1019, - 264, -451, 264, -451, 265, 560, 266, 1019, 1019, 1019, - -451, -451, -451, 1019, 560, 267, 1060, 1060, 1060, 1060, - -451, 1060, 1060, 1060, 1019, 1060, 390, -451, 373, 273, - 270, 265, 272, 345, -451, -451, 1019, 274, 560, -451, - -451, -451, 275, -451, -451, 276, 279, 281, 285, 284, - 286, 287, 288, 290, -451, -451, 383, 15, 384, -451, - -451, 291, -451, 1060, -451, 1060, 1060, -451, -451, -451, - -451, -451, 560, -451, 661, 47, 398, -451, 293, 295, - 296, -451, 302, -451, 661, 560, -451, -451, -451, 408, - 306, 356, 560, 412, 414, -451, 560, 560, -451, -451 + -403, 26, 210, 114, -403, -403, 106, -403, -403, -403, + -403, -403, -403, -403, -49, 201, 53, -403, -403, -403, + -403, 15, -5, 59, 31, 42, -403, -403, -403, 201, + 113, 167, -403, -403, -403, -403, -403, -403, 920, 11, + -403, 9, -403, 140, 72, 74, 79, 85, -403, 87, + 113, 920, 104, 104, 104, 104, -403, -403, -403, -403, + -403, -403, -403, 94, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, 226, 227, 229, + 408, -403, 140, 120, -403, -403, -59, -403, -403, -403, + -403, -403, -403, -403, -403, -403, 1082, -403, 204, 119, + 232, 213, 215, -403, -403, -403, -403, -403, 974, 974, + 974, 1002, -403, 128, 131, -403, -403, -59, -72, 135, + 78, -403, -403, 974, -403, 192, 1030, 41, 196, 201, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + 974, 974, 974, 974, 974, 974, -403, -403, -403, 974, + 974, 974, 974, 974, 974, 974, 974, 974, -403, 201, + -403, 81, -403, -403, -403, -403, -403, -403, -403, -403, + 50, 147, 147, 147, 169, 179, 257, 186, 258, 190, + 259, 216, 278, 277, 279, 219, 283, 281, 559, 147, + 974, 974, 974, -403, 446, -403, 176, 175, 684, -403, + -403, 94, -403, 684, 684, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, 684, 920, 180, 181, -403, + 684, 182, 183, 184, 185, 191, 193, 194, 253, 684, + 684, 684, 195, 920, 974, 974, 265, -403, 2, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, 188, 197, 198, 199, 205, 206, 838, 1002, + 588, 275, 211, 217, 218, 220, -403, -403, -403, 28, + -64, -59, -403, 140, -403, 221, 212, 864, -403, -403, + -403, -403, -403, -403, -403, -403, -403, 246, 1002, -403, + -403, -403, -403, 223, -403, 224, 684, 4, -403, 5, + -403, 228, 684, 214, 974, 974, 974, 974, 974, 974, + 231, 234, 235, 974, 684, 684, 236, -403, 280, 307, + -403, 147, 1002, 1002, 1002, 1002, 1002, 1002, -403, -403, + 54, 24, -403, -60, -403, 1002, 1002, 1002, 1002, -403, + -403, -403, -403, 892, 293, -403, -403, 312, 25, 320, + 325, 237, 684, 347, 684, 974, -403, 240, 684, 241, + -403, -403, 242, 247, -403, 684, 684, 684, -403, 249, + -403, 974, -403, -403, -403, 228, 248, 254, 255, 260, + 323, 1002, -403, -403, -403, 261, 262, 263, 267, -403, + -403, -403, 313, 268, -403, 684, 684, 974, 269, -403, + 269, -403, 271, 684, 272, 974, 974, 974, -403, -403, + -403, 974, 684, 256, 1002, 1002, 1002, 1002, 974, -403, + 1002, 1002, 1002, 1002, 367, -403, 356, 274, 276, 271, + 273, 331, -403, -403, 974, 282, 684, -403, -403, -403, + 284, -403, -403, 286, 288, 292, 294, 296, 299, 300, + 304, 319, -403, -403, 369, 0, 358, -403, -403, 318, + -403, 1002, -403, 1002, 1002, -403, -403, -403, -403, -403, + 684, -403, 730, 12, 370, -403, 326, 327, 328, -403, + 332, -403, 730, 684, -403, -403, -403, 416, 333, 372, + 684, 424, 425, -403, 684, 684, -403, -403 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { - -451, -451, -451, 339, 341, 342, 343, 346, -128, -127, - -450, -451, 401, 421, -97, -451, -224, 92, -451, -177, - -451, -46, -451, -38, -451, -66, 328, -451, -108, 250, - -251, 94, -451, -451, -451, 402, -451, -451, -451, -451, - 0, -451, 98, -451, -451, 422, -451, -451, -451, -451, - -451, 451, -451, -414, -65, 120, -115, -451, 415, -451, - -451, -451, -451, -451, 88, 34, -451, -451, 71, -451, - -451 + -403, -403, -403, 357, 359, 361, 362, -127, -126, -378, + -403, 411, 449, -120, -403, -223, 121, -403, -176, -403, + -47, -403, -38, -403, -66, 363, -403, -108, 287, -234, + 56, -403, -403, -403, 427, -403, -403, -403, -403, 7, + -403, 125, -403, -403, 450, -403, -403, -403, -403, -403, + 478, -403, -402, 34, 178, -115, -403, 441, -403, -403, + -403, -403, -403, 122, 67, -403, -403, 107, -403, -403 }; /* 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 -134 +#define YYTABLE_NINF -132 static const short int yytable[] = { - 85, 225, 226, 25, 201, 106, 312, 252, 253, 211, - 364, 330, 214, 85, 40, 118, 90, 484, 4, 342, - 344, 93, 30, 366, 280, 217, 218, 219, 220, 221, - 222, 223, 224, 228, 331, 494, 392, 351, 231, 215, - 204, 235, 122, 25, 394, 236, 237, 238, 239, 360, - 205, 216, 365, 243, 244, 118, 40, 217, 218, 219, - 220, 221, 222, 223, 224, 365, 44, 45, 46, 392, - 492, 183, 184, 185, 245, -71, 248, 107, 108, 395, - 500, 392, 249, 120, 122, 47, 210, 393, 49, 210, - 61, 62, 50, 116, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 19, 27, 20, - 28, 392, 56, 229, 230, 210, 232, 233, 210, 406, - 58, 91, 210, 210, 210, 210, 94, 240, 241, 242, - 210, 210, 328, 77, 99, 279, 281, 282, 283, 352, - 60, 19, 122, 20, 100, 303, 483, 110, 111, 112, - 303, 303, 176, 177, 246, 247, 386, 254, 255, -31, - -31, 101, 303, -30, -30, -29, -29, 303, 285, 103, - 51, -28, -28, 256, 257, 303, 303, 303, 493, -72, - 102, 113, 308, 114, 115, 121, 444, 175, 445, 179, - 85, 7, 8, 9, 10, 52, 12, 53, 180, 326, - 54, 371, 181, 373, 374, 375, 202, 85, 327, 210, - 380, 78, 203, 206, 79, 250, 212, 80, -35, 81, - 117, -34, -33, 283, -32, 259, 387, 388, 389, 390, - 391, -38, -39, -41, 260, 19, 289, 20, 396, 397, - 398, 399, 400, 303, 6, -41, -41, 314, 309, 303, - 290, 311, 315, 316, -41, -41, -41, -41, -41, -41, - -41, 303, 303, -41, 21, 317, 318, 319, 320, 324, - 325, 22, 329, 334, 335, 23, 336, 345, 210, 372, - 210, 210, 210, 355, 430, 353, 379, 210, 217, 218, - 219, 220, 221, 222, 223, 224, 337, 358, 338, 303, - 346, 303, 449, 450, 451, 303, 384, 385, 347, 348, - 349, 303, 303, 303, 350, 361, 356, 285, 455, 456, - 457, 458, 362, 459, 460, 461, 367, 463, 370, 210, - 376, 469, 377, 378, 383, 305, 306, 405, 330, 225, - 226, 407, 303, 303, 408, 424, 409, 307, 411, 423, - 303, 415, 313, 417, 418, 419, 426, 225, 226, 303, - 321, 322, 323, 427, 428, 488, 429, 489, 490, 431, - 432, 210, 31, 32, 33, 34, 35, 36, 37, 210, - 210, 210, 433, 303, 434, 210, 435, 436, 438, 443, - 446, 448, 61, 62, 464, 454, 462, 465, 466, 467, - 468, 473, 365, 472, 482, 470, 475, 474, 210, 19, - 476, 20, 477, 261, 478, 479, 480, 303, 481, 495, - 486, 496, 487, 497, 498, 262, 263, 499, 363, 502, - 303, 503, 504, 506, 369, 507, 165, 303, 166, 167, - 168, 303, 303, 169, 97, 55, 381, 382, 403, 208, - 278, 57, 105, 402, 26, 414, 96, 452, 425, 0, - 0, 0, 0, 0, 0, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 0, 410, 0, 412, 0, 264, 0, - 416, 0, 0, 0, 0, 0, 420, 421, 422, 0, - 0, 0, 265, 157, 158, 159, 0, 266, 267, 268, - 164, 0, 0, 0, 0, 0, 269, 0, 0, 270, - 0, 271, 0, 0, 272, 0, 0, 439, 440, 0, - 0, 0, 0, 0, 0, 447, 0, 0, 0, 0, - 0, 0, 61, 62, 453, 116, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 75, 76, 19, - 0, 20, 0, 291, 292, 61, 62, 293, 471, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 19, 0, 20, 77, 294, 295, 296, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 297, 298, - 0, 0, 491, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, - 0, 299, 505, 0, 0, 0, 508, 509, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, + 84, 223, 224, 199, 105, 310, 250, 251, 209, 226, + 25, 212, 30, 84, 117, 215, 216, 217, 218, 219, + 220, 221, 222, 278, 362, 364, 4, 215, 216, 217, + 218, 219, 220, 221, 222, 341, 343, 229, 40, 328, + 233, 202, 92, 89, 234, 235, 236, 237, 238, 243, + 25, 203, 242, 391, 117, 213, -70, 350, 51, 329, + 121, 363, 363, 394, 358, 121, 214, 44, 45, 46, + 181, 182, 183, 7, 8, 9, 52, 11, 53, 13, + 490, 54, 40, 61, 62, 208, 47, 482, 208, 119, + 498, 115, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 492, 19, 49, 20, 109, + 110, 111, 227, 228, 208, 230, 231, 208, 205, 481, + 50, 208, 208, 208, 208, 208, 239, 240, 241, 208, + 326, 491, 93, 90, 279, 280, 281, 391, 391, 106, + 107, -40, 19, 58, 20, 393, 404, 349, 6, -40, + -40, 27, 121, 28, 56, 384, -40, -40, -40, -40, + -40, -40, -40, 246, -40, 21, 283, 391, 19, 247, + 20, 60, 22, 392, 174, 175, 23, 252, 253, 306, + 244, 245, -30, -30, 98, 442, 99, 443, 84, -29, + -29, 100, 77, -28, -28, 78, 324, 101, 79, 369, + 80, 371, 372, 373, 102, 84, 325, 208, 378, -71, + -131, 215, 216, 217, 218, 219, 220, 221, 222, -27, + -27, 281, 254, 255, 385, 386, 387, 388, 389, 390, + 112, 113, 277, 114, 173, 120, 177, 395, 396, 397, + 398, 5, 301, 178, 6, 179, 200, 301, 301, 201, + 204, 210, 7, 8, 9, 10, 11, 12, 13, 301, + 248, -34, -33, -32, 301, 31, 32, 33, 34, 35, + 36, 37, 14, 301, 301, 301, 208, 370, 208, 208, + 208, 374, -31, 429, -37, 208, -38, 257, 258, 287, + 351, 288, 319, 307, 309, 327, 313, 314, 315, 312, + 447, 448, 449, 332, 316, 344, 317, 318, 323, 356, + 382, 383, 333, 334, 335, 283, 453, 454, 455, 456, + 336, 337, 458, 459, 460, 461, 345, 208, 354, 467, + 328, 368, 346, 347, 353, 348, 359, 360, 223, 224, + 301, 365, 403, 422, 375, 405, 301, 376, 377, 381, + 406, 409, 407, 413, 415, 416, 223, 224, 301, 301, + 417, 424, 428, 486, 421, 487, 488, 425, 426, 208, + 434, 462, 452, 427, 430, 431, 432, 208, 208, 208, + 433, 436, 441, 208, 444, 446, 463, 464, 363, 466, + 457, 303, 304, 465, 480, 493, 301, 484, 301, 471, + 470, 468, 301, 305, 472, 473, 208, 474, 311, 301, + 301, 301, 475, 61, 62, 476, 477, 320, 321, 322, + 478, 115, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 479, 19, 485, 20, 301, + 301, 500, 494, 495, 496, 497, 501, 301, 502, 504, + 505, 61, 62, 164, 96, 165, 301, 166, 167, 115, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 55, 19, 401, 20, 104, 400, 57, + 301, 26, 95, 206, 361, 276, 282, 412, 450, 0, + 367, 0, 423, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 379, 380, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, + 0, 0, 77, 0, 0, 78, 0, 301, 79, 0, + 80, 116, 0, 0, 301, 0, 0, 0, 301, 301, + 408, 0, 410, 0, 0, 0, 414, 0, 0, 0, + 0, 0, 0, 418, 419, 420, 0, 0, 0, 0, + 77, 0, 0, 78, 61, 62, 79, 0, 80, 259, + 260, 261, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 437, 438, 0, 0, 19, 0, 20, + 0, 445, 0, 61, 62, 0, 0, 0, 0, 0, + 451, 115, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 75, 76, 0, 19, 0, 20, 0, + 0, 0, 0, 0, 469, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 0, 0, 0, 0, - 0, 264, 0, 78, 291, 292, 79, 0, 293, 80, - -133, 81, 343, 0, 0, 265, 157, 158, 159, 0, - 266, 267, 268, 164, 0, 0, 0, 294, 295, 296, - 0, 0, 300, 0, 0, 5, 0, 0, 0, 297, - 298, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 8, 9, 10, 11, 12, 13, 0, 0, - 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 133, + 145, 146, 147, 148, 149, 0, 0, 0, 489, 0, + 262, 0, 263, 156, 157, 158, 0, 264, 265, 266, + 267, 499, 0, 0, 0, 0, 268, 0, 503, 269, + 0, 270, 506, 507, 271, 0, 0, 289, 290, 61, + 62, 291, 292, 293, 294, 295, 296, 0, 0, 0, + 0, 0, 77, 0, 0, 78, 0, 0, 79, 0, + 80, 342, 19, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 289, 290, 0, 0, 291, 292, 293, + 294, 295, 296, 0, 0, 297, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 0, 0, 0, 0, 0, 262, 0, 263, 156, 157, + 158, 297, 264, 265, 266, 267, 0, 0, 0, 0, + 0, 0, 0, 0, 298, 0, 0, 0, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 0, 0, 0, - 0, 0, 264, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 265, 157, 158, 159, - 0, 266, 267, 268, 164, 0, 0, 0, 0, 0, - 0, 61, 62, 300, 116, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 19, 0, - 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, - 0, 0, 61, 62, 77, 116, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 19, - 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 284, 0, 0, 0, 0, 0, - 0, 0, 0, 61, 62, 77, 116, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 75, 76, - 19, 0, 20, 0, 61, 62, 0, 116, 64, 65, + 144, 145, 146, 147, 148, 149, 0, 0, 0, 0, + 0, 262, 0, 263, 156, 157, 158, 0, 264, 265, + 266, 267, 0, 61, 62, 0, 0, 0, 0, 0, + 298, 115, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 75, 76, 0, 19, 0, 20, 61, + 62, 0, 0, 0, 0, 0, 0, 115, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 19, 78, 20, 0, 79, 77, 0, 80, 0, - 81, 0, 0, 0, 0, 0, 357, 0, 0, 0, - 0, 0, 0, 0, 0, 61, 62, 77, 116, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 19, 78, 20, 0, 79, 0, 0, 80, - 0, 81, 0, 0, 0, 0, 0, 401, 0, 0, - 0, 0, 0, 0, 0, 0, 61, 62, 77, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 19, 78, 20, 0, 79, 0, 339, - 80, 0, 81, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, - 0, 80, 0, 81, 61, 62, 0, 116, 64, 65, + 76, 0, 19, 0, 20, 0, 0, 61, 62, 0, + 0, 0, 0, 0, 355, 115, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, + 19, 0, 20, 0, 0, 61, 62, 0, 0, 0, + 0, 0, 399, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 0, 19, 0, + 20, 0, 77, 0, 0, 78, 0, 338, 79, 0, + 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 61, + 62, 78, 0, 0, 79, 0, 80, 115, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 19, 0, 20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 78, 0, 0, 79, - 0, 0, 80, 0, 81, 61, 62, 77, 116, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 75, 76, 19, 0, 20, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, - 79, 0, 0, 80, 0, 81, 61, 62, 77, 213, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 19, 0, 20, 0, 0, 0, 0, + 76, 0, 19, 0, 20, 0, 77, 61, 62, 78, + 0, 0, 79, 0, 80, 115, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 75, 76, 0, + 19, 0, 20, 0, 77, 61, 62, 78, 0, 0, + 79, 0, 80, 211, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 0, 19, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 78, 0, 0, 79, 77, - 0, 80, 0, 81, 0, 0, 0, 0, 123, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, + 0, 78, 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 125, 126, 0, 0, 78, 0, 0, 79, - 0, 0, 80, 0, 81, 127, 128, 129, 130, 131, + 0, 0, 0, 0, 0, 0, 77, 0, 0, 78, + 122, 0, 79, 0, 80, 0, 0, 0, 0, 0, + 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 124, 125, 0, 77, 0, 0, 78, 0, 0, + 79, 0, 80, 0, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 0, 0, 154, 0, 0, 78, 0, 0, - 79, 0, 0, 80, 0, 81, 0, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164 + 152, 0, 0, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163 }; static const short int yycheck[] = { - 38, 129, 129, 3, 112, 51, 230, 184, 185, 124, - 15, 34, 127, 51, 23, 81, 29, 467, 0, 270, - 271, 30, 61, 15, 201, 10, 11, 12, 13, 14, - 15, 16, 17, 130, 57, 485, 125, 131, 153, 9, - 125, 156, 136, 43, 133, 160, 161, 162, 163, 300, - 135, 21, 57, 168, 169, 121, 23, 10, 11, 12, - 13, 14, 15, 16, 17, 57, 52, 53, 54, 125, - 484, 109, 110, 111, 171, 127, 125, 32, 33, 135, - 494, 125, 131, 83, 136, 71, 124, 131, 124, 127, - 5, 6, 61, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 45, 24, - 47, 125, 124, 151, 152, 153, 154, 155, 156, 133, - 24, 134, 160, 161, 162, 163, 135, 165, 166, 167, - 168, 169, 247, 48, 124, 200, 202, 203, 204, 133, - 4, 22, 136, 24, 124, 210, 131, 53, 54, 55, - 215, 216, 55, 56, 99, 100, 333, 27, 28, 3, - 4, 124, 227, 3, 4, 3, 4, 232, 206, 129, - 20, 3, 4, 3, 4, 240, 241, 242, 131, 127, - 124, 4, 228, 4, 4, 127, 410, 24, 412, 4, - 228, 41, 42, 43, 44, 45, 46, 47, 24, 245, - 50, 316, 24, 318, 319, 320, 130, 245, 246, 247, - 325, 126, 130, 127, 129, 125, 59, 132, 4, 134, - 135, 4, 4, 289, 4, 4, 334, 335, 336, 337, - 338, 7, 7, 20, 7, 22, 125, 24, 346, 347, - 348, 349, 350, 308, 31, 32, 33, 129, 125, 314, - 128, 125, 125, 125, 41, 42, 43, 44, 45, 46, - 47, 326, 327, 50, 51, 125, 125, 125, 125, 36, - 125, 58, 24, 127, 127, 62, 127, 24, 316, 317, - 318, 319, 320, 125, 392, 285, 324, 325, 10, 11, - 12, 13, 14, 15, 16, 17, 127, 63, 127, 364, - 127, 366, 417, 418, 419, 370, 24, 4, 127, 127, - 127, 376, 377, 378, 127, 125, 128, 355, 426, 427, - 428, 429, 125, 431, 432, 433, 125, 435, 129, 367, - 125, 446, 125, 125, 125, 215, 216, 24, 34, 467, - 467, 21, 407, 408, 21, 383, 127, 227, 4, 127, - 415, 125, 232, 125, 125, 125, 125, 485, 485, 424, - 240, 241, 242, 125, 125, 473, 125, 475, 476, 125, - 125, 409, 64, 65, 66, 67, 68, 69, 70, 417, - 418, 419, 125, 448, 36, 423, 125, 57, 125, 125, - 125, 125, 5, 6, 4, 128, 434, 24, 125, 129, - 128, 125, 57, 128, 21, 131, 125, 128, 446, 22, - 125, 24, 128, 26, 128, 128, 128, 482, 128, 21, - 36, 128, 131, 128, 128, 38, 39, 125, 308, 21, - 495, 125, 76, 21, 314, 21, 97, 502, 97, 97, - 97, 506, 507, 97, 43, 24, 326, 327, 356, 121, - 200, 29, 50, 355, 3, 367, 41, 423, 387, -1, - -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, -1, 364, -1, 366, -1, 101, -1, - 370, -1, -1, -1, -1, -1, 376, 377, 378, -1, - -1, -1, 115, 116, 117, 118, -1, 120, 121, 122, - 123, -1, -1, -1, -1, -1, 129, -1, -1, 132, - -1, 134, -1, -1, 137, -1, -1, 407, 408, -1, - -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, - -1, -1, 5, 6, 424, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, 24, -1, 3, 4, 5, 6, 7, 448, -1, + 38, 128, 128, 111, 51, 228, 182, 183, 123, 129, + 3, 126, 61, 51, 80, 15, 16, 17, 18, 19, + 20, 21, 22, 199, 20, 20, 0, 15, 16, 17, + 18, 19, 20, 21, 22, 269, 270, 152, 29, 37, + 155, 113, 33, 32, 159, 160, 161, 162, 163, 169, + 43, 123, 167, 113, 120, 14, 115, 121, 27, 57, + 124, 57, 57, 123, 298, 124, 25, 52, 53, 54, + 108, 109, 110, 42, 43, 44, 45, 46, 47, 48, + 482, 50, 29, 5, 6, 123, 71, 465, 126, 82, + 492, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 483, 28, 112, 30, 53, + 54, 55, 150, 151, 152, 153, 154, 155, 40, 119, + 61, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 245, 119, 123, 122, 200, 201, 202, 113, 113, 35, + 36, 27, 28, 30, 30, 121, 121, 119, 34, 35, + 36, 45, 124, 47, 112, 331, 42, 43, 44, 45, + 46, 47, 48, 113, 50, 51, 204, 113, 28, 119, + 30, 4, 58, 119, 55, 56, 62, 8, 9, 226, + 99, 100, 3, 4, 112, 408, 112, 410, 226, 3, + 4, 112, 114, 3, 4, 117, 243, 112, 120, 314, + 122, 316, 317, 318, 117, 243, 244, 245, 323, 115, + 0, 15, 16, 17, 18, 19, 20, 21, 22, 3, + 4, 287, 3, 4, 332, 333, 334, 335, 336, 337, + 4, 4, 198, 4, 30, 115, 4, 345, 346, 347, + 348, 31, 208, 30, 34, 30, 118, 213, 214, 118, + 115, 59, 42, 43, 44, 45, 46, 47, 48, 225, + 113, 4, 4, 4, 230, 64, 65, 66, 67, 68, + 69, 70, 62, 239, 240, 241, 314, 315, 316, 317, + 318, 319, 4, 391, 7, 323, 7, 4, 7, 113, + 283, 116, 39, 113, 113, 30, 113, 113, 113, 117, + 415, 416, 417, 115, 113, 30, 113, 113, 113, 63, + 30, 4, 115, 115, 115, 353, 424, 425, 426, 427, + 115, 115, 430, 431, 432, 433, 115, 365, 116, 444, + 37, 117, 115, 115, 113, 115, 113, 113, 465, 465, + 306, 113, 30, 381, 113, 25, 312, 113, 113, 113, + 25, 4, 115, 113, 113, 113, 483, 483, 324, 325, + 113, 113, 39, 471, 115, 473, 474, 113, 113, 407, + 57, 4, 116, 113, 113, 113, 113, 415, 416, 417, + 113, 113, 113, 421, 113, 113, 30, 113, 57, 116, + 428, 213, 214, 117, 25, 25, 362, 39, 364, 113, + 116, 119, 368, 225, 116, 113, 444, 113, 230, 375, + 376, 377, 116, 5, 6, 116, 116, 239, 240, 241, + 116, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 116, 28, 119, 30, 405, + 406, 25, 116, 116, 116, 113, 113, 413, 76, 25, + 25, 5, 6, 96, 43, 96, 422, 96, 96, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 24, 28, 354, 30, 50, 353, 29, + 446, 3, 41, 120, 306, 198, 40, 365, 421, -1, + 312, -1, 385, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 324, 325, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 480, -1, -1, -1, -1, -1, + -1, -1, 114, -1, -1, 117, -1, 493, 120, -1, + 122, 123, -1, -1, 500, -1, -1, -1, 504, 505, + 362, -1, 364, -1, -1, -1, 368, -1, -1, -1, + -1, -1, -1, 375, 376, 377, -1, -1, -1, -1, + 114, -1, -1, 117, 5, 6, 120, -1, 122, 10, + 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 405, 406, -1, -1, 28, -1, 30, + -1, 413, -1, 5, 6, -1, -1, -1, -1, -1, + 422, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, -1, 28, -1, 30, -1, + -1, -1, -1, -1, 446, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, -1, -1, -1, 480, -1, + 101, -1, 103, 104, 105, 106, -1, 108, 109, 110, + 111, 493, -1, -1, -1, -1, 117, -1, 500, 120, + -1, 122, 504, 505, 125, -1, -1, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, + -1, -1, 114, -1, -1, 117, -1, -1, 120, -1, + 122, 123, 28, -1, 30, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, -1, -1, 7, 8, 9, + 10, 11, 12, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, 24, 48, 26, 27, 28, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 38, 39, - -1, -1, 482, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 495, -1, -1, -1, -1, - -1, 61, 502, -1, -1, -1, 506, 507, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, + -1, -1, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + -1, -1, -1, -1, -1, 101, -1, 103, 104, 105, + 106, 61, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, 120, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, -1, - -1, 101, -1, 126, 3, 4, 129, -1, 7, 132, - 0, 134, 135, -1, -1, 115, 116, 117, 118, -1, - 120, 121, 122, 123, -1, -1, -1, 26, 27, 28, - -1, -1, 132, -1, -1, 25, -1, -1, -1, 38, - 39, 31, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 62, -1, -1, -1, -1, -1, -1, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 115, 116, 117, 118, - -1, 120, 121, 122, 123, -1, -1, -1, -1, -1, - -1, 5, 6, 132, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 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, 20, 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, 20, 21, - 22, -1, 24, -1, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 126, 24, -1, 129, 48, -1, 132, -1, - 134, -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, - 20, 21, 22, 126, 24, -1, 129, -1, -1, 132, - -1, 134, -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, 20, 21, 22, 126, 24, -1, 129, -1, 131, - 132, -1, 134, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, - -1, 132, -1, 134, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 126, -1, -1, 129, - -1, -1, 132, -1, 134, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, - 129, -1, -1, 132, -1, 134, 5, 6, 48, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, + -1, 101, -1, 103, 104, 105, 106, -1, 108, 109, + 110, 111, -1, 5, 6, -1, -1, -1, -1, -1, + 120, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, -1, 28, -1, 30, 5, + 6, -1, -1, -1, -1, -1, -1, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, -1, 28, -1, 30, -1, -1, 5, 6, -1, + -1, -1, -1, -1, 40, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, + 28, -1, 30, -1, -1, 5, 6, -1, -1, -1, + -1, -1, 40, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, -1, 28, -1, + 30, -1, 114, -1, -1, 117, -1, 119, 120, -1, + 122, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 114, 5, + 6, 117, -1, -1, 120, -1, 122, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, -1, 28, -1, 30, -1, 114, 5, 6, 117, + -1, -1, 120, -1, 122, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, + 28, -1, 30, -1, 114, 5, 6, 117, -1, -1, + 120, -1, 122, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, -1, 28, -1, + 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 126, -1, -1, 129, 48, - -1, 132, -1, 134, -1, -1, -1, -1, 35, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, + -1, 117, -1, -1, 120, -1, 122, -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, 126, -1, -1, 129, - -1, -1, 132, -1, 134, 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, -1, -1, 101, -1, -1, 126, -1, -1, - 129, -1, -1, 132, -1, 134, -1, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123 + -1, -1, -1, -1, -1, -1, 114, -1, -1, 117, + 38, -1, 120, -1, 122, -1, -1, -1, -1, -1, + -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 114, -1, -1, 117, -1, -1, + 120, -1, 122, -1, 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, -1, -1, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 170, 171, 172, 0, 25, 31, 41, 42, 43, - 44, 45, 46, 47, 62, 151, 185, 187, 189, 22, - 24, 51, 58, 62, 150, 178, 189, 45, 47, 188, - 61, 64, 65, 66, 67, 68, 69, 70, 152, 183, - 23, 195, 196, 197, 52, 53, 54, 71, 175, 124, - 61, 20, 45, 47, 50, 151, 124, 183, 24, 173, - 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 48, 126, 129, - 132, 134, 139, 159, 160, 161, 162, 163, 178, 192, - 29, 134, 184, 30, 135, 186, 196, 150, 200, 124, - 124, 124, 124, 129, 176, 173, 159, 32, 33, 169, - 169, 169, 169, 4, 4, 4, 8, 135, 163, 164, - 178, 127, 136, 35, 49, 59, 60, 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, 101, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 141, 142, 143, 144, 145, - 198, 204, 205, 207, 208, 24, 55, 56, 174, 4, - 24, 24, 177, 161, 161, 161, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 146, 147, 149, - 161, 166, 130, 130, 125, 135, 127, 37, 164, 165, - 161, 194, 59, 8, 194, 9, 21, 10, 11, 12, - 13, 14, 15, 16, 17, 146, 147, 148, 152, 161, - 161, 194, 161, 161, 201, 194, 194, 194, 194, 194, - 161, 161, 161, 194, 194, 152, 99, 100, 125, 131, - 125, 157, 157, 157, 27, 28, 3, 4, 140, 4, - 7, 26, 38, 39, 101, 115, 120, 121, 122, 129, - 132, 134, 137, 141, 142, 143, 144, 145, 167, 192, - 157, 163, 163, 163, 37, 161, 180, 181, 182, 125, - 128, 3, 4, 7, 26, 27, 28, 38, 39, 61, - 132, 167, 191, 192, 193, 193, 193, 193, 159, 125, - 154, 125, 154, 193, 129, 125, 125, 125, 125, 125, - 125, 193, 193, 193, 36, 125, 159, 161, 194, 24, - 34, 57, 155, 158, 127, 127, 127, 127, 127, 131, - 166, 168, 168, 135, 168, 24, 127, 127, 127, 127, - 127, 131, 133, 178, 179, 125, 128, 37, 63, 190, - 168, 125, 125, 193, 15, 57, 15, 125, 206, 193, - 129, 194, 161, 194, 194, 194, 125, 125, 125, 161, - 194, 193, 193, 125, 24, 4, 157, 166, 166, 166, - 166, 166, 125, 131, 133, 135, 166, 166, 166, 166, - 166, 37, 180, 155, 156, 24, 133, 21, 21, 127, - 193, 4, 193, 194, 202, 125, 193, 125, 125, 125, - 193, 193, 193, 127, 161, 206, 125, 125, 125, 125, - 166, 125, 125, 125, 36, 125, 57, 153, 125, 193, - 193, 202, 203, 125, 154, 154, 125, 193, 125, 194, - 194, 194, 203, 193, 128, 166, 166, 166, 166, 166, - 166, 166, 161, 166, 4, 24, 125, 129, 128, 194, - 131, 193, 128, 125, 128, 125, 125, 128, 128, 128, - 128, 128, 21, 131, 148, 199, 36, 131, 166, 166, - 166, 193, 191, 131, 148, 21, 128, 128, 128, 125, - 191, 193, 21, 125, 76, 193, 21, 21, 193, 193 + 0, 157, 158, 159, 0, 31, 34, 42, 43, 44, + 45, 46, 47, 48, 62, 138, 172, 174, 176, 28, + 30, 51, 58, 62, 137, 165, 176, 45, 47, 175, + 61, 64, 65, 66, 67, 68, 69, 70, 139, 170, + 29, 182, 183, 184, 52, 53, 54, 71, 162, 112, + 61, 27, 45, 47, 50, 138, 112, 170, 30, 160, + 4, 5, 6, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 114, 117, 120, + 122, 127, 146, 147, 148, 149, 150, 165, 179, 32, + 122, 171, 33, 123, 173, 183, 137, 187, 112, 112, + 112, 112, 117, 163, 160, 146, 35, 36, 156, 156, + 156, 156, 4, 4, 4, 13, 123, 150, 151, 165, + 115, 124, 38, 49, 59, 60, 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, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 129, 130, 131, 132, 185, 191, + 192, 194, 195, 30, 55, 56, 161, 4, 30, 30, + 164, 148, 148, 148, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 133, 134, 136, 148, 153, + 118, 118, 113, 123, 115, 40, 151, 152, 148, 181, + 59, 13, 181, 14, 25, 15, 16, 17, 18, 19, + 20, 21, 22, 133, 134, 135, 139, 148, 148, 181, + 148, 148, 188, 181, 181, 181, 181, 181, 181, 148, + 148, 148, 181, 139, 99, 100, 113, 119, 113, 144, + 144, 144, 8, 9, 3, 4, 128, 4, 7, 10, + 11, 12, 101, 103, 108, 109, 110, 111, 117, 120, + 122, 125, 129, 130, 131, 132, 154, 179, 144, 150, + 150, 150, 40, 148, 167, 168, 169, 113, 116, 3, + 4, 7, 8, 9, 10, 11, 12, 61, 120, 154, + 178, 179, 180, 180, 180, 180, 146, 113, 141, 113, + 141, 180, 117, 113, 113, 113, 113, 113, 113, 39, + 180, 180, 180, 113, 146, 148, 181, 30, 37, 57, + 142, 145, 115, 115, 115, 115, 115, 115, 119, 153, + 155, 155, 123, 155, 30, 115, 115, 115, 115, 119, + 121, 165, 166, 113, 116, 40, 63, 177, 155, 113, + 113, 180, 20, 57, 20, 113, 193, 180, 117, 181, + 148, 181, 181, 181, 148, 113, 113, 113, 181, 180, + 180, 113, 30, 4, 144, 153, 153, 153, 153, 153, + 153, 113, 119, 121, 123, 153, 153, 153, 153, 40, + 167, 142, 143, 30, 121, 25, 25, 115, 180, 4, + 180, 181, 189, 113, 180, 113, 113, 113, 180, 180, + 180, 115, 148, 193, 113, 113, 113, 113, 39, 153, + 113, 113, 113, 113, 57, 140, 113, 180, 180, 189, + 190, 113, 141, 141, 113, 180, 113, 181, 181, 181, + 190, 180, 116, 153, 153, 153, 153, 148, 153, 153, + 153, 153, 4, 30, 113, 117, 116, 181, 119, 180, + 116, 113, 116, 113, 113, 116, 116, 116, 116, 116, + 25, 119, 135, 186, 39, 119, 153, 153, 153, 180, + 178, 119, 135, 25, 116, 116, 116, 113, 178, 180, + 25, 113, 76, 180, 25, 25, 180, 180 }; #define yyerrok (yyerrstatus = 0) @@ -2003,1193 +2042,1332 @@ YY_REDUCE_PRINT (yyn); switch (yyn) { - case 40: -#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 39: +#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyvsp[-1])->append(" = "); - (yyval) = (yyvsp[-1]); + *(yyvsp[-1].String) += " = "; + (yyval.String) = (yyvsp[-1].String); ;} break; - case 41: -#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 40: +#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string(""); + (yyval.String) = new std::string(""); ;} break; - case 49: -#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(""); ;} + case 48: +#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(""); ;} + break; + + case 56: +#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(""); ;} break; case 57: -#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(""); ;} +#line 228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; case 58: -#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} +#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { *(yyvsp[-1].String) += " " + *(yyvsp[0].Const).cnst; delete (yyvsp[0].Const).cnst; (yyval.String) = (yyvsp[-1].String); ;} break; case 59: -#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { *(yyvsp[-1]) += " " + *(yyvsp[0]); delete (yyvsp[0]); (yyval) = (yyvsp[-1]); ;} +#line 232 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; case 60: -#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} +#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[-1].String)->insert(0, ", "); + *(yyvsp[-1].String) += " " + *(yyvsp[0].Const).cnst; + delete (yyvsp[0].Const).cnst; + (yyval.String) = (yyvsp[-1].String); + ;} break; case 61: -#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyvsp[-1])->insert(0, ", "); - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-1].String); ;} break; case 62: -#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); - ;} +#line 247 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; - case 63: -#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} + case 64: +#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; case 65: -#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} - break; - - case 66: -#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 252 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyvsp[-1])->insert(0, ", "); - if (!(yyvsp[0])->empty()) - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + (yyvsp[-1].String)->insert(0, ", "); + if (!(yyvsp[0].String)->empty()) + *(yyvsp[-1].String) += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-1].String); ;} break; - case 68: -#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 67: +#line 262 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].Const).cnst; + delete (yyvsp[0].Const).cnst; + (yyval.String) = (yyvsp[-1].String); ;} break; - case 90: -#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 87: +#line 283 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.Type).newTy = (yyvsp[0].String); ;} + break; + + case 88: +#line 288 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference - (yyvsp[0])->insert(0, "\\"); - (yyval) = (yyvsp[0]); + (yyvsp[0].Const).cnst->insert(0, "\\"); + (yyval.Type).newTy = (yyvsp[0].Const).cnst; + (yyval.Type).oldTy = OpaqueTy; ;} break; - case 91: -#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 89: +#line 293 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? - *(yyvsp[-3]) += "( " + *(yyvsp[-1]) + " )"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )"; + delete (yyvsp[-1].String); + (yyval.Type).newTy = (yyvsp[-3].Type).newTy; + (yyval.Type).oldTy = FunctionTy; ;} break; - case 92: -#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 90: +#line 299 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? - (yyvsp[-3])->insert(0,"[ "); - *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " ]"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); + (yyvsp[-3].Const).cnst->insert(0,"[ "); + *(yyvsp[-3].Const).cnst += " x " + *(yyvsp[-1].Type).newTy + " ]"; + delete (yyvsp[-1].Type).newTy; + (yyval.Type).newTy = (yyvsp[-3].Const).cnst; + (yyval.Type).oldTy = ArrayTy; ;} break; - case 93: -#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 91: +#line 306 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? - (yyvsp[-3])->insert(0,"< "); - *(yyvsp[-3]) += " x " + *(yyvsp[-1]) + " >"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); + (yyvsp[-3].Const).cnst->insert(0,"< "); + *(yyvsp[-3].Const).cnst += " x " + *(yyvsp[-1].Type).newTy + " >"; + delete (yyvsp[-1].Type).newTy; + (yyval.Type).newTy = (yyvsp[-3].Const).cnst; + (yyval.Type).oldTy = PackedTy; ;} break; - case 94: -#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 92: +#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? - (yyvsp[-1])->insert(0, "{ "); - *(yyvsp[-1]) += " }"; - (yyval) = (yyvsp[-1]); + (yyvsp[-1].String)->insert(0, "{ "); + *(yyvsp[-1].String) += " }"; + (yyval.Type).newTy = (yyvsp[-1].String); + (yyval.Type).oldTy = StructTy; ;} break; - case 95: -#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 93: +#line 319 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? - (yyval) = new std::string("{ }"); + (yyval.Type).newTy = new std::string("{ }"); + (yyval.Type).oldTy = StructTy; ;} break; - case 96: -#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 94: +#line 323 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? - *(yyvsp[-1]) += '*'; - (yyval) = (yyvsp[-1]); + *(yyvsp[-1].Type).newTy += '*'; + (yyvsp[-1].Type).oldTy = PointerTy; + (yyval.Type) = (yyvsp[-1].Type); + ;} + break; + + case 95: +#line 333 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.String) = (yyvsp[0].Type).newTy; + ;} + break; + + case 96: +#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy; + delete (yyvsp[0].Type).newTy; + (yyval.String) = (yyvsp[-2].String); ;} break; case 98: -#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 345 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2].String) += ", ..."; + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); + ;} + break; + + case 99: +#line 350 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += ", " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + (yyval.String) = (yyvsp[0].String); ;} break; case 100: -#line 228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 353 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += ", ..."; - delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + (yyval.String) = new std::string(); ;} break; case 101: -#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval) = (yyvsp[0]); +#line 363 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + (yyval.Const).type = (yyvsp[-3].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy); + *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]"; + delete (yyvsp[-1].String); ;} break; case 102: -#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 369 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string(); + (yyval.Const).type = (yyvsp[-2].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy); + *(yyval.Const).cnst += "[ ]"; ;} break; case 103: -#line 246 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Nonempty unsized arr - *(yyvsp[-3]) += " [ " + *(yyvsp[-1]) + " ]"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); +#line 374 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.Const).type = (yyvsp[-2].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy); + *(yyval.Const).cnst += " c" + *(yyvsp[0].String); + delete (yyvsp[0].String); ;} break; case 104: -#line 251 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval) = new std::string("[ ]"); +#line 380 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + (yyval.Const).type = (yyvsp[-3].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy); + *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >"; + delete (yyvsp[-1].String); ;} break; case 105: -#line 254 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " c" + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + (yyval.Const).type = (yyvsp[-3].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy); + *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }"; + delete (yyvsp[-1].String); ;} break; case 106: -#line 259 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Nonempty unsized arr - *(yyvsp[-3]) += " < " + *(yyvsp[-1]) + " >"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); +#line 392 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.Const).type = (yyvsp[-2].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy); + *(yyval.Const).cnst += " [ ]"; ;} break; case 107: -#line 264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 397 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += " { " + *(yyvsp[-1]) + " }"; - delete (yyvsp[-1]); - (yyval) = (yyvsp[-3]); + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 108: -#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 403 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string("[ ]"); + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 109: -#line 272 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 409 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); ;} break; case 110: -#line 277 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 415 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); ;} break; case 111: -#line 282 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 112: -#line 287 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 427 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 113: -#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 433 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 114: -#line 298 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // integral constants - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 439 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 115: -#line 303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // integral constants - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 445 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 116: -#line 308 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Boolean constants - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Float & Double constants + (yyval.Const).type = (yyvsp[-1].Type); + (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy); + *(yyval.Const).cnst += " " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); ;} break; case 117: -#line 313 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Boolean constants - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 459 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + // We must infer the cast opcode from the types of the operands. + const char *opcode = getCastOpcode((yyvsp[-3].Const).type, (yyvsp[-1].Type)); + (yyval.String) = new std::string(opcode); + *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + " " + *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + ")"; + delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); ;} break; case 118: -#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Float & Double constants - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); +#line 466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst + " " + *(yyvsp[-1].String) + ")"; + (yyval.String) = (yyvsp[-4].String); + (yyvsp[-2].Const).destroy(); + delete (yyvsp[-1].String); ;} break; case 119: -#line 325 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 472 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " (" + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ")"; - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); - (yyval) = (yyvsp[-5]); + *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-7].String); ;} break; case 120: -#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 477 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 121: -#line 332 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 482 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 122: -#line 334 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 487 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 123: -#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 492 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 124: -#line 338 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 125: -#line 340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 502 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-7].String); ;} break; case 126: -#line 342 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 507 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; + (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); + (yyval.String) = (yyvsp[-7].String); ;} break; case 127: -#line 344 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst; + (yyvsp[0].Const).destroy(); + (yyval.String) = (yyvsp[-2].String); ;} break; case 128: -#line 346 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - ;} +#line 522 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;} break; - case 129: -#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 131: +#line 537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - ;} +;} break; - case 130: -#line 353 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 132: +#line 542 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + (yyval.String) = 0; ;} break; - case 131: -#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { ;} - break; - - case 132: -#line 358 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { ;} - break; - case 133: -#line 368 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 545 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { -;} + *O << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; + ;} break; case 134: -#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 550 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = 0; + *O << "module asm " << " " << *(yyvsp[0].String) << "\n"; ;} break; case 135: -#line 376 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 553 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; + *O << "implementation\n"; ;} break; case 136: -#line 381 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << "module asm " << " " << *(yyvsp[0]) << "\n"; ;} break; case 137: -#line 384 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 560 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << "implementation\n"; + *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n"; + // delete $2; delete $3; $4.destroy(); + (yyval.String) = 0; ;} break; case 138: -#line 387 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { +#line 565 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Function prototypes can be in const pool + *O << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 139: -#line 391 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 570 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Asm blocks can be in the const pool + *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 140: -#line 396 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Function prototypes can be in const pool - *O << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; +#line 575 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4].String) << " " << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Const).cnst << " " + << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 141: -#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Asm blocks can be in the const pool - *O << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 581 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-4].String) << " " << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy + << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 142: -#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 587 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; + *O << *(yyvsp[-4].String) << " " << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy + << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 143: -#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; + *O << *(yyvsp[-4].String) << " " << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy + << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 144: -#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 599 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 145: -#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 604 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; + *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-2].String); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 146: -#line 426 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 609 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; + (yyval.String) = 0; ;} break; - case 147: -#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 150: +#line 619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-2]) << " = " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = 0; + *(yyvsp[-2].String) += " = " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); ;} break; - case 148: -#line 436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval) = 0; + case 151: +#line 624 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2].String) += " = " + *(yyvsp[0].Const).cnst; + if (*(yyvsp[0].Const).cnst == "64") + SizeOfPointer = 64; + (yyvsp[0].Const).destroy(); + (yyval.String) = (yyvsp[-2].String); ;} break; case 152: -#line 446 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 631 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " = " + *(yyvsp[-1]); - delete (yyvsp[-1]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-2].String) += " = " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); ;} break; case 153: -#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 636 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " = " + *(yyvsp[-1]); - delete (yyvsp[-1]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-2].String) += " = " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); ;} break; case 154: -#line 456 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 643 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " = " + *(yyvsp[-1]); - delete (yyvsp[-1]); - (yyval) = (yyvsp[-2]); + (yyvsp[-1].String)->insert(0, "[ "); + *(yyvsp[-1].String) += " ]"; + (yyval.String) = (yyvsp[-1].String); ;} break; case 155: -#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 650 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " = " + *(yyvsp[-1]); - delete (yyvsp[-1]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-2].String) += ", " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); ;} break; - case 156: -#line 468 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 157: +#line 656 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyvsp[-1])->insert(0, "[ "); - *(yyvsp[-1]) += " ]"; - (yyval) = (yyvsp[-1]); + (yyval.String) = new std::string(); ;} break; - case 157: -#line 475 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-2]) += ", " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); - ;} + case 161: +#line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; - case 159: -#line 481 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 162: +#line 667 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string(); - ;} + (yyval.String) = (yyvsp[-1].Type).newTy; + if (!(yyvsp[0].String)->empty()) + *(yyval.String) += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); +;} break; case 163: -#line 490 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} +#line 674 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2].String) += ", " + *(yyvsp[0].String); + delete (yyvsp[0].String); + ;} break; case 164: -#line 492 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = (yyvsp[-1]); - if (!(yyvsp[0])->empty()) - *(yyval) += " " + *(yyvsp[0]); -;} + (yyval.String) = (yyvsp[0].String); + ;} break; case 165: -#line 498 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 682 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += ", " + *(yyvsp[0]); + (yyval.String) = (yyvsp[0].String); ;} break; case 166: -#line 501 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 685 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = (yyvsp[0]); + *(yyvsp[-2].String) += ", ..."; + (yyval.String) = (yyvsp[-2].String); + delete (yyvsp[0].String); ;} break; case 167: -#line 505 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 690 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = (yyvsp[0]); + (yyval.String) = (yyvsp[0].String); ;} break; case 168: -#line 508 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 693 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += ", ..."; - (yyval) = (yyvsp[-2]); + (yyval.String) = new std::string(); ;} break; case 169: -#line 512 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 698 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = (yyvsp[0]); + if (!(yyvsp[-7].String)->empty()) { + *(yyvsp[-7].String) += " "; + } + *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")"; + if (!(yyvsp[-1].String)->empty()) { + *(yyvsp[-7].String) += " " + *(yyvsp[-1].String); + } + if (!(yyvsp[0].String)->empty()) { + *(yyvsp[-7].String) += " " + *(yyvsp[0].String); + } + (yyvsp[-6].Type).destroy(); + delete (yyvsp[-5].String); + delete (yyvsp[-3].String); + delete (yyvsp[-1].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-7].String); ;} break; case 170: -#line 515 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 717 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string(); + (yyval.String) = new std::string("begin"); ;} break; case 171: -#line 520 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[-7])->empty()) { - (yyvsp[-6])->insert(0, *(yyvsp[-7]) + " "); - } - *(yyvsp[-6]) += " " + *(yyvsp[-5]) + "( " + *(yyvsp[-3]) + " )"; - if (!(yyvsp[-1])->empty()) { - *(yyvsp[-6]) += " " + *(yyvsp[-1]); - } - if (!(yyvsp[0])->empty()) { - *(yyvsp[-6]) += " " + *(yyvsp[0]); - } - (yyval) = (yyvsp[-6]); +#line 720 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.String) = new std::string ("{"); ;} break; case 172: -#line 534 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 724 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyval) = new std::string("begin"); - ;} + if (!(yyvsp[-2].String)->empty()) { + *O << *(yyvsp[-2].String) << " "; + } + *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = 0; +;} break; case 173: -#line 537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval) = new std::string ("{"); - ;} +#line 733 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string("end"); ;} break; case 174: -#line 541 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[-2])->empty()) { - *O << *(yyvsp[-2]) << " "; - } - *O << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; -;} +#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string("}"); ;} break; case 175: -#line 550 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string("end"); ;} +#line 736 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[-1].String)) + *O << *(yyvsp[-1].String); + *O << '\n' << *(yyvsp[0].String) << "\n"; + (yyval.String) = 0; +;} break; case 176: -#line 551 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string("}"); ;} +#line 744 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; - case 177: -#line 553 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 179: +#line 750 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[-1].String)->empty()) + *(yyvsp[-2].String) += " " + *(yyvsp[-1].String); + *(yyvsp[-2].String) += " " + *(yyvsp[0].String); + delete (yyvsp[-1].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); + ;} + break; + + case 180: +#line 763 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - if ((yyvsp[-1])) - *O << *(yyvsp[-1]); - *O << '\n' << *(yyvsp[0]) << "\n"; -;} + ;} break; case 181: -#line 565 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-2]) += " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); +#line 765 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { ;} break; case 182: -#line 575 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - ;} +#line 769 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} break; case 183: -#line 577 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - ;} +#line 770 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} break; - case 192: -#line 582 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 184: +#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 185: +#line 772 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 186: +#line 773 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 187: +#line 774 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 188: +#line 775 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 189: +#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 190: +#line 777 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - (yyvsp[-1])->insert(0, "<"); - *(yyvsp[-1]) += ">"; - (yyval) = (yyvsp[-1]); + (yyvsp[-1].String)->insert(0, "<"); + *(yyvsp[-1].String) += ">"; + (yyval.String) = (yyvsp[-1].String); ;} break; - case 194: -#line 588 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 192: +#line 783 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - if (!(yyvsp[-3])->empty()) { - *(yyvsp[-4]) += " " + *(yyvsp[-3]); + if (!(yyvsp[-3].String)->empty()) { + *(yyvsp[-4].String) += " " + *(yyvsp[-3].String); } - *(yyvsp[-4]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[-1]); - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); - (yyval) = (yyvsp[-4]); + *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String); + delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-4].String); ;} break; - case 199: -#line 606 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 193: +#line 792 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = (yyvsp[0].Const).cnst; ;} + break; + + case 197: +#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.Value).type = (yyvsp[-1].Type); + (yyval.Value).val = new std::string(*(yyvsp[-1].Type).newTy + " "); + *(yyval.Value).val += *(yyvsp[0].String); + delete (yyvsp[0].String); + ;} + break; + + case 198: +#line 808 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + ;} + break; + + case 199: +#line 810 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Do not allow functions with 0 basic blocks ;} break; case 200: -#line 612 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 817 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { + *O << *(yyvsp[-1].String) ; ;} break; case 201: -#line 614 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Do not allow functions with 0 basic blocks +#line 821 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 202: -#line 621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 826 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << *(yyvsp[-1]) ; + (yyval.String) = 0; ;} break; case 203: -#line 625 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; + *O << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 204: -#line 630 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval) = 0; +#line 835 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with a result... + *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Value).val << "\n"; + delete (yyvsp[-1].String); (yyvsp[0].Value).destroy(); + (yyval.String) = 0; ;} break; case 205: -#line 633 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *O << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; +#line 840 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Return with no result... + *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n"; + delete (yyvsp[-1].String); (yyvsp[0].Type).destroy(); + (yyval.String) = 0; ;} break; case 206: -#line 639 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Return with a result... - *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 845 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Unconditional Branch... + *O << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 207: -#line 644 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Return with no result... - *O << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 850 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].String) << ", " + << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].String) << ", " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); delete (yyvsp[-6].String); (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); + (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 208: -#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Unconditional Branch... - *O << " " << *(yyvsp[-2]) << " " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 857 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].String) << ", " << *(yyvsp[-4].Type).newTy + << " " << *(yyvsp[-3].String) << " [" << *(yyvsp[-1].String) << " ]\n"; + delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); delete (yyvsp[-6].String); (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); delete (yyvsp[-1].String); + (yyval.String) = 0; ;} break; case 209: -#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " - << *(yyvsp[-3]) << ", " << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; +#line 863 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *O << " " << *(yyvsp[-7].String) << " " << *(yyvsp[-6].Type).newTy << " " << *(yyvsp[-5].String) << ", " + << *(yyvsp[-3].Type).newTy << " " << *(yyvsp[-2].String) << "[]\n"; + delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); delete (yyvsp[-5].String); (yyvsp[-3].Type).destroy(); delete (yyvsp[-2].String); + (yyval.String) = 0; ;} break; case 210: -#line 660 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[-8]) << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << ", " << *(yyvsp[-4]) << " " - << *(yyvsp[-3]) << " [" << *(yyvsp[-1]) << " ]\n"; - delete (yyvsp[-8]); delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); - (yyval) = 0; + *O << " " << *(yyvsp[-12].String) << " " << *(yyvsp[-11].String) << " " << *(yyvsp[-10].Type).newTy << " " << *(yyvsp[-9].String) << " (" + << *(yyvsp[-7].String) << ") " << *(yyvsp[-5].String) << " " << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].String) << " " + << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); delete (yyvsp[-9].String); delete (yyvsp[-7].String); delete (yyvsp[-5].String); + (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 211: -#line 666 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 878 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[-7]) << " " << *(yyvsp[-6]) << " " << *(yyvsp[-5]) << ", " << *(yyvsp[-3]) << " " - << *(yyvsp[-2]) << "[]\n"; - delete (yyvsp[-7]); delete (yyvsp[-6]); delete (yyvsp[-5]); delete (yyvsp[-3]); delete (yyvsp[-2]); - (yyval) = 0; + *O << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 212: -#line 673 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 883 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[-12]) << " " << *(yyvsp[-11]) << " " << *(yyvsp[-10]) << " " << *(yyvsp[-9]) << " (" - << *(yyvsp[-7]) << ") " << *(yyvsp[-5]) << " " << *(yyvsp[-4]) << " " << *(yyvsp[-3]) << " " << *(yyvsp[-2]) << " " - << *(yyvsp[-1]) << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[-12]); delete (yyvsp[-11]); delete (yyvsp[-10]); delete (yyvsp[-9]); delete (yyvsp[-7]); delete (yyvsp[-5]); delete (yyvsp[-4]); - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = 0; + *O << " " << *(yyvsp[0].String) << "\n"; + delete (yyvsp[0].String); + (yyval.String) = 0; ;} break; case 213: -#line 681 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 889 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; + *(yyvsp[-5].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].String); + (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-5].String); ;} break; case 214: -#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 894 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *O << " " << *(yyvsp[0]) << "\n"; - delete (yyvsp[0]); - (yyval) = 0; + (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " ); + *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].String); + (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-3].String); ;} break; case 215: -#line 692 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 902 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); + *(yyvsp[-1].String) += *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-1].String); ;} break; case 216: -#line 697 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-4]) += *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-4]); +#line 909 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { // Used for PHI nodes + (yyvsp[-3].String)->insert(0, *(yyvsp[-5].Type).newTy + "["); + *(yyvsp[-3].String) += "," + *(yyvsp[-1].String) + "]"; + (yyvsp[-5].Type).destroy(); delete (yyvsp[-1].String); + (yyval.String) = (yyvsp[-3].String); ;} break; case 217: -#line 704 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 915 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].String) + "," + *(yyvsp[-1].String) + "]"; + delete (yyvsp[-3].String); delete (yyvsp[-1].String); + (yyval.String) = (yyvsp[-6].String); ;} break; case 218: -#line 711 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { // Used for PHI nodes - *(yyvsp[-5]) += " [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; - delete (yyvsp[-3]); delete (yyvsp[-1]); - (yyval) = (yyvsp[-5]); - ;} +#line 923 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(*(yyvsp[0].Value).val); (yyvsp[0].Value).destroy(); ;} break; case 219: -#line 716 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 924 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-6]) += ", [" + *(yyvsp[-3]) + "," + *(yyvsp[-1]) + "]"; - delete (yyvsp[-3]); delete (yyvsp[-1]); - (yyval) = (yyvsp[-6]); + *(yyvsp[-2].String) += ", " + *(yyvsp[0].Value).val; + (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-2].String); ;} break; case 221: -#line 725 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 933 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} + break; + + case 222: +#line 937 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += ", " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-1].String); ;} break; - case 223: -#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} + case 224: +#line 945 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String); + (yyvsp[-3].Type).destroy(); delete (yyvsp[-2].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-4].String); + ;} break; - case 224: -#line 738 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + case 225: +#line 950 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String); + (yyvsp[-3].Type).destroy(); delete (yyvsp[-2].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-4].String); ;} break; case 226: -#line 746 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 955 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-4]); + *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String); + (yyvsp[-3].Type).destroy(); delete (yyvsp[-2].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-4].String); ;} break; case 227: -#line 751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 960 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-4]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val; + (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-1].String); ;} break; case 228: -#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 965 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-4]) += " " + *(yyvsp[-3]) + " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-3]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-4]); + *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val; + (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-3].String); ;} break; case 229: -#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 970 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + const char *opcode = getCastOpcode((yyvsp[-2].Value).type, (yyvsp[0].Type)); + (yyval.String) = new std::string(opcode); + *(yyval.String) += *(yyvsp[-2].Value).val + " " + *(yyvsp[-1].String) + " " + *(yyvsp[0].Type).newTy; + delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); + delete (yyvsp[-1].String); (yyvsp[0].Type).destroy(); ;} break; case 230: -#line 766 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 977 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val; + (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 231: -#line 771 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 982 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += " " + *(yyvsp[-2]) + " " + *(yyvsp[-1]) + ", " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy; + (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy(); + (yyval.String) = (yyvsp[-3].String); ;} break; case 232: -#line 776 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 987 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); + *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val; + (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-3].String); ;} break; case 233: -#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 992 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val; + (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 234: -#line 786 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 997 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += " " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val; + (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-5].String); ;} break; case 235: -#line 791 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1002 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].String); + delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-1].String); ;} break; case 236: -#line 796 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1007 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + ", " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); - ;} - break; - - case 237: -#line 801 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + if (!(yyvsp[-5].String)->empty()) + *(yyvsp[-6].String) += " " + *(yyvsp[-5].String); + if (!(yyvsp[-6].String)->empty()) + *(yyvsp[-6].String) += " "; + *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + "(" + *(yyvsp[-1].String) + ")"; + delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); delete (yyvsp[-1].String); + (yyval.String) = (yyvsp[-6].String); ;} break; case 238: -#line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[-5])->empty()) - *(yyvsp[-6]) += " " + *(yyvsp[-5]); - if (!(yyvsp[-6])->empty()) - *(yyvsp[-6]) += " "; - *(yyvsp[-6]) += *(yyvsp[-4]) += " " + *(yyvsp[-3]) + "(" + *(yyvsp[-2]) + ")"; - delete (yyvsp[-5]); delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); - (yyval) = (yyvsp[-6]); +#line 1021 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + (yyvsp[0].String)->insert(0, ", "); + (yyval.String) = (yyvsp[0].String); ;} break; - case 240: -#line 820 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - (yyvsp[0])->insert(0, ", "); - (yyval) = (yyvsp[0]); - ;} + case 239: +#line 1025 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} break; case 241: -#line 824 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} +#line 1030 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.String) = new std::string(); ;} + break; + + case 242: +#line 1033 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy; + if (!(yyvsp[0].String)->empty()) + *(yyvsp[-2].String) += " " + *(yyvsp[0].String); + (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); + ;} break; case 243: -#line 829 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { (yyval) = new std::string(); ;} +#line 1040 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" + { + *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].String); + if (!(yyvsp[0].String)->empty()) + *(yyvsp[-5].String) += " " + *(yyvsp[0].String); + (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-5].String); + ;} break; case 244: -#line 832 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1047 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " " + *(yyvsp[-1]); - if (!(yyvsp[0])->empty()) - *(yyvsp[-2]) += " " + *(yyvsp[0]); - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy; + if (!(yyvsp[0].String)->empty()) + *(yyvsp[-2].String) += " " + *(yyvsp[0].String); + (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-2].String); ;} break; case 245: -#line 839 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1054 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); - if (!(yyvsp[0])->empty()) - *(yyvsp[-5]) += " " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); + *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].String); + if (!(yyvsp[0].String)->empty()) + *(yyvsp[-5].String) += " " + *(yyvsp[0].String); + (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-5].String); ;} break; case 246: -#line 846 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1061 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-2]) += " " + *(yyvsp[-1]); - if (!(yyvsp[0])->empty()) - *(yyvsp[-2]) += " " + *(yyvsp[0]); - delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-2]); + *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val; + (yyvsp[0].Value).destroy(); + (yyval.String) = (yyvsp[-1].String); ;} break; case 247: -#line 853 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1066 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-5]) += " " + *(yyvsp[-4]) + ", " + *(yyvsp[-2]) + " " + *(yyvsp[-1]); - if (!(yyvsp[0])->empty()) - *(yyvsp[-5]) += " " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); + if (!(yyvsp[-3].String)->empty()) + *(yyvsp[-3].String) += " "; + *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].String); + delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-3].String); ;} break; case 248: -#line 860 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1073 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-1]) += " " + *(yyvsp[0]); - delete (yyvsp[0]); - (yyval) = (yyvsp[-1]); + if (!(yyvsp[-5].String)->empty()) + *(yyvsp[-5].String) += " "; + *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].String); + delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-5].String); ;} break; case 249: -#line 865 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[-3])->empty()) - *(yyvsp[-3]) += " "; - *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); - ;} - break; - - case 250: -#line 872 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[-5])->empty()) - *(yyvsp[-5]) += " "; - *(yyvsp[-5]) += *(yyvsp[-4]) + " " + *(yyvsp[-3]) + ", " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-4]); delete (yyvsp[-3]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-5]); - ;} - break; - - case 251: -#line 879 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1080 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" { - *(yyvsp[-3]) += *(yyvsp[-2]) + " " + *(yyvsp[-1]) + " " + *(yyvsp[0]); - delete (yyvsp[-2]); delete (yyvsp[-1]); delete (yyvsp[0]); - (yyval) = (yyvsp[-3]); + *(yyvsp[-3].String) += *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].String) + " " + *(yyvsp[0].String); + (yyvsp[-2].Type).destroy(); delete (yyvsp[-1].String); delete (yyvsp[0].String); + (yyval.String) = (yyvsp[-3].String); ;} break; @@ -3198,7 +3376,7 @@ } /* Line 1126 of yacc.c. */ -#line 3202 "UpgradeParser.tab.c" +#line 3380 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -3466,7 +3644,7 @@ } -#line 885 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +#line 1086 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.2 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.3 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.2 Thu Nov 30 10:50:26 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Fri Dec 1 14:26:20 2006 @@ -69,47 +69,47 @@ SINTVAL = 260, UINTVAL = 261, FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - VOLATILE = 290, - TO = 291, - DOTDOTDOT = 292, - NULL_TOK = 293, - UNDEF = 294, - CONST = 295, - INTERNAL = 296, - LINKONCE = 297, - WEAK = 298, - APPENDING = 299, + TRUETOK = 263, + FALSETOK = 264, + NULL_TOK = 265, + UNDEF = 266, + ZEROINITIALIZER = 267, + VOID = 268, + BOOL = 269, + SBYTE = 270, + UBYTE = 271, + SHORT = 272, + USHORT = 273, + INT = 274, + UINT = 275, + LONG = 276, + ULONG = 277, + FLOAT = 278, + DOUBLE = 279, + LABEL = 280, + OPAQUE = 281, + TYPE = 282, + VAR_ID = 283, + LABELSTR = 284, + STRINGCONSTANT = 285, + IMPLEMENTATION = 286, + BEGINTOK = 287, + ENDTOK = 288, + DECLARE = 289, + GLOBAL = 290, + CONSTANT = 291, + SECTION = 292, + VOLATILE = 293, + TO = 294, + DOTDOTDOT = 295, + CONST = 296, + INTERNAL = 297, + LINKONCE = 298, + WEAK = 299, DLLIMPORT = 300, DLLEXPORT = 301, EXTERN_WEAK = 302, - OPAQUE = 303, + APPENDING = 303, NOT = 304, EXTERNAL = 305, TARGET = 306, @@ -163,28 +163,16 @@ LOAD = 354, STORE = 355, GETELEMENTPTR = 356, - TRUNC = 357, - ZEXT = 358, - SEXT = 359, - FPTRUNC = 360, - FPEXT = 361, - BITCAST = 362, - UITOFP = 363, - SITOFP = 364, - FPTOUI = 365, - FPTOSI = 366, - INTTOPTR = 367, - PTRTOINT = 368, - PHI_TOK = 369, - SELECT = 370, - SHL = 371, - LSHR = 372, - ASHR = 373, - VAARG = 374, - EXTRACTELEMENT = 375, - INSERTELEMENT = 376, - SHUFFLEVECTOR = 377, - CAST = 378 + PHI_TOK = 357, + SELECT = 358, + SHL = 359, + LSHR = 360, + ASHR = 361, + VAARG = 362, + EXTRACTELEMENT = 363, + INSERTELEMENT = 364, + SHUFFLEVECTOR = 365, + CAST = 366 }; #endif /* Tokens. */ @@ -193,47 +181,47 @@ #define SINTVAL 260 #define UINTVAL 261 #define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define VOLATILE 290 -#define TO 291 -#define DOTDOTDOT 292 -#define NULL_TOK 293 -#define UNDEF 294 -#define CONST 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 +#define TRUETOK 263 +#define FALSETOK 264 +#define NULL_TOK 265 +#define UNDEF 266 +#define ZEROINITIALIZER 267 +#define VOID 268 +#define BOOL 269 +#define SBYTE 270 +#define UBYTE 271 +#define SHORT 272 +#define USHORT 273 +#define INT 274 +#define UINT 275 +#define LONG 276 +#define ULONG 277 +#define FLOAT 278 +#define DOUBLE 279 +#define LABEL 280 +#define OPAQUE 281 +#define TYPE 282 +#define VAR_ID 283 +#define LABELSTR 284 +#define STRINGCONSTANT 285 +#define IMPLEMENTATION 286 +#define BEGINTOK 287 +#define ENDTOK 288 +#define DECLARE 289 +#define GLOBAL 290 +#define CONSTANT 291 +#define SECTION 292 +#define VOLATILE 293 +#define TO 294 +#define DOTDOTDOT 295 +#define CONST 296 +#define INTERNAL 297 +#define LINKONCE 298 +#define WEAK 299 #define DLLIMPORT 300 #define DLLEXPORT 301 #define EXTERN_WEAK 302 -#define OPAQUE 303 +#define APPENDING 303 #define NOT 304 #define EXTERNAL 305 #define TARGET 306 @@ -287,28 +275,16 @@ #define LOAD 354 #define STORE 355 #define GETELEMENTPTR 356 -#define TRUNC 357 -#define ZEXT 358 -#define SEXT 359 -#define FPTRUNC 360 -#define FPEXT 361 -#define BITCAST 362 -#define UITOFP 363 -#define SITOFP 364 -#define FPTOUI 365 -#define FPTOSI 366 -#define INTTOPTR 367 -#define PTRTOINT 368 -#define PHI_TOK 369 -#define SELECT 370 -#define SHL 371 -#define LSHR 372 -#define ASHR 373 -#define VAARG 374 -#define EXTRACTELEMENT 375 -#define INSERTELEMENT 376 -#define SHUFFLEVECTOR 377 -#define CAST 378 +#define PHI_TOK 357 +#define SELECT 358 +#define SHL 359 +#define LSHR 360 +#define ASHR 361 +#define VAARG 362 +#define EXTRACTELEMENT 363 +#define INSERTELEMENT 364 +#define SHUFFLEVECTOR 365 +#define CAST 366 @@ -316,9 +292,6 @@ /* Copy the first part of user declarations. */ #line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" -#define YYERROR_VERBOSE 1 -#define YYSTYPE std::string* - #include "ParserInternals.h" #include #include @@ -326,23 +299,26 @@ #include #include +#define YYERROR_VERBOSE 1 #define YYINCLUDED_STDLIB_H +#define YYDEBUG 1 int yylex(); // declaration" of xxx warnings. int yyparse(); +extern int yydebug; static std::string CurFilename; - static std::ostream *O = 0; - std::istream* LexInput = 0; +unsigned SizeOfPointer = 32; void UpgradeAssembly(const std::string &infile, std::istream& in, - std::ostream &out) + std::ostream &out, bool debug) { Upgradelineno = 1; CurFilename = infile; LexInput = ∈ + yydebug = debug; O = &out; if (yyparse()) { @@ -351,6 +327,82 @@ } } +const char* getCastOpcode(TypeInfo& SrcTy, TypeInfo&DstTy) { + unsigned SrcBits = SrcTy.getBitWidth(); + unsigned DstBits = DstTy.getBitWidth(); + const char* opcode = "bitcast"; + // Run through the possibilities ... + if (DstTy.isIntegral()) { // Casting to integral + if (SrcTy.isIntegral()) { // Casting from integral + if (DstBits < SrcBits) + opcode = "trunc"; + else if (DstBits > SrcBits) { // its an extension + if (SrcTy.isSigned()) + opcode ="sext"; // signed -> SEXT + else + opcode = "zext"; // unsigned -> ZEXT + } else { + opcode = "bitcast"; // Same size, No-op cast + } + } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt + if (DstTy.isSigned()) + opcode = "fptosi"; // FP -> sint + else + opcode = "fptoui"; // FP -> uint + } else if (SrcTy.isPacked()) { + assert(DstBits == SrcTy.getBitWidth() && + "Casting packed to integer of different width"); + opcode = "bitcast"; // same size, no-op cast + } else { + assert(SrcTy.isPointer() && + "Casting from a value that is not first-class type"); + opcode = "ptrtoint"; // ptr -> int + } + } else if (DstTy.isFloatingPoint()) { // Casting to floating pt + if (SrcTy.isIntegral()) { // Casting from integral + if (SrcTy.isSigned()) + opcode = "sitofp"; // sint -> FP + else + opcode = "uitofp"; // uint -> FP + } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt + if (DstBits < SrcBits) { + opcode = "fptrunc"; // FP -> smaller FP + } else if (DstBits > SrcBits) { + opcode = "fpext"; // FP -> larger FP + } else { + opcode ="bitcast"; // same size, no-op cast + } + } else if (SrcTy.isPacked()) { + assert(DstBits == SrcTy.getBitWidth() && + "Casting packed to floating point of different width"); + opcode = "bitcast"; // same size, no-op cast + } else { + assert(0 && "Casting pointer or non-first class to float"); + } + } else if (DstTy.isPacked()) { + if (SrcTy.isPacked()) { + assert(DstTy.getBitWidth() == SrcTy.getBitWidth() && + "Casting packed to packed of different widths"); + opcode = "bitcast"; // packed -> packed + } else if (DstTy.getBitWidth() == SrcBits) { + opcode = "bitcast"; // float/int -> packed + } else { + assert(!"Illegal cast to packed (wrong type or size)"); + } + } else if (DstTy.isPointer()) { + if (SrcTy.isPointer()) { + opcode = "bitcast"; // ptr -> ptr + } else if (SrcTy.isIntegral()) { + opcode = "inttoptr"; // int -> ptr + } else { + assert(!"Casting pointer to other than pointer or int"); + } + } else { + assert(!"Casting to type that is not first-class"); + } + return opcode; +} + /* Enabling traces. */ @@ -372,7 +424,15 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -typedef int YYSTYPE; +#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y" +typedef union YYSTYPE { + std::string* String; + TypeInfo Type; + ValueInfo Value; + ConstInfo Const; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 436 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -384,7 +444,7 @@ /* Line 219 of yacc.c. */ -#line 388 "UpgradeParser.tab.c" +#line 448 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -535,20 +595,20 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1246 +#define YYLAST 1193 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 138 +#define YYNTOKENS 126 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 71 +#define YYNNTS 70 /* YYNRULES -- Number of rules. */ -#define YYNRULES 251 +#define YYNRULES 249 /* YYNRULES -- Number of states. */ -#define YYNSTATES 510 +#define YYNSTATES 508 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 378 +#define YYMAXUTOK 366 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -560,15 +620,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 127, 128, 136, 2, 125, 2, 2, 2, 2, 2, + 115, 116, 124, 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 132, 124, 133, 2, 2, 2, 2, 2, 2, 2, + 120, 112, 121, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 129, 126, 131, 2, 2, 2, 2, 2, 137, + 2, 117, 114, 119, 2, 2, 2, 2, 2, 125, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 130, 2, 2, 134, 2, 135, 2, 2, 2, 2, + 118, 2, 2, 122, 2, 123, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -592,8 +652,7 @@ 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 + 105, 106, 107, 108, 109, 110, 111 }; #if YYDEBUG @@ -605,146 +664,143 @@ 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, 82, 83, 85, 87, 89, 91, 93, 95, 97, - 98, 100, 102, 104, 106, 108, 110, 113, 114, 115, - 118, 119, 123, 126, 127, 129, 130, 134, 136, 139, + 80, 81, 83, 85, 87, 89, 91, 93, 95, 96, + 98, 100, 102, 104, 106, 108, 111, 112, 113, 116, + 117, 121, 124, 125, 127, 128, 132, 134, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, - 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 184, 189, 195, 201, 205, 208, 211, 213, 217, - 219, 223, 225, 226, 231, 235, 239, 244, 249, 253, - 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, - 290, 296, 305, 312, 319, 326, 333, 340, 349, 358, - 362, 364, 366, 368, 370, 373, 376, 381, 384, 386, - 391, 394, 399, 406, 413, 420, 427, 431, 436, 437, - 439, 441, 443, 447, 451, 455, 459, 463, 467, 469, - 470, 472, 474, 476, 477, 480, 484, 486, 488, 492, - 494, 495, 504, 506, 508, 512, 514, 516, 520, 521, - 523, 525, 529, 530, 532, 534, 536, 538, 540, 542, - 544, 546, 548, 552, 554, 560, 562, 564, 566, 568, - 571, 574, 576, 580, 583, 584, 586, 589, 592, 596, - 606, 616, 625, 639, 641, 643, 650, 656, 659, 666, - 674, 676, 680, 682, 683, 686, 688, 694, 700, 706, - 709, 714, 719, 726, 731, 736, 743, 750, 753, 761, - 763, 766, 767, 769, 770, 774, 781, 785, 792, 795, - 800, 807 + 161, 163, 165, 167, 169, 171, 173, 175, 177, 180, + 185, 191, 197, 201, 204, 207, 209, 213, 215, 219, + 221, 222, 227, 231, 235, 240, 245, 249, 252, 255, + 258, 261, 264, 267, 270, 273, 276, 279, 286, 292, + 301, 308, 315, 322, 329, 336, 345, 354, 358, 360, + 362, 364, 366, 369, 372, 377, 380, 382, 387, 390, + 395, 402, 409, 416, 423, 427, 432, 433, 435, 437, + 439, 443, 447, 451, 455, 459, 463, 465, 466, 468, + 470, 472, 473, 476, 480, 482, 484, 488, 490, 491, + 500, 502, 504, 508, 510, 512, 516, 517, 519, 521, + 525, 526, 528, 530, 532, 534, 536, 538, 540, 542, + 544, 548, 550, 556, 558, 560, 562, 564, 567, 570, + 572, 576, 579, 580, 582, 585, 588, 592, 602, 612, + 621, 635, 637, 639, 646, 652, 655, 662, 670, 672, + 676, 678, 679, 682, 684, 690, 696, 702, 705, 710, + 715, 722, 727, 732, 739, 746, 749, 757, 759, 762, + 763, 765, 766, 770, 777, 781, 788, 791, 796, 803 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short int yyrhs[] = { - 170, 0, -1, 5, -1, 6, -1, 3, -1, 4, + 157, 0, -1, 5, -1, 6, -1, 3, -1, 4, -1, 78, -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, 123, -1, 116, - -1, 117, -1, 118, -1, 16, -1, 14, -1, 12, - -1, 10, -1, 17, -1, 15, -1, 13, -1, 11, - -1, 146, -1, 147, -1, 18, -1, 19, -1, 178, - 124, -1, -1, 41, -1, 42, -1, 43, -1, 44, - -1, 45, -1, 46, -1, 47, -1, -1, 65, -1, - 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, - 64, 4, -1, -1, -1, 57, 4, -1, -1, 125, - 57, 4, -1, 34, 24, -1, -1, 155, -1, -1, - 125, 158, 157, -1, 155, -1, 57, 4, -1, 161, - -1, 8, -1, 163, -1, 8, -1, 163, -1, 9, - -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, - -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, - -1, 20, -1, 21, -1, 48, -1, 162, -1, 192, - -1, 126, 4, -1, 160, 127, 165, 128, -1, 129, - 4, 130, 163, 131, -1, 132, 4, 130, 163, 133, - -1, 134, 164, 135, -1, 134, 135, -1, 163, 136, - -1, 163, -1, 164, 125, 163, -1, 164, -1, 164, - 125, 37, -1, 37, -1, -1, 161, 129, 168, 131, - -1, 161, 129, 131, -1, 161, 137, 24, -1, 161, - 132, 168, 133, -1, 161, 134, 168, 135, -1, 161, - 134, 135, -1, 161, 38, -1, 161, 39, -1, 161, - 192, -1, 161, 167, -1, 161, 26, -1, 146, 140, - -1, 147, 4, -1, 9, 27, -1, 9, 28, -1, - 149, 7, -1, 144, 127, 166, 36, 161, 128, -1, - 101, 127, 166, 206, 128, -1, 115, 127, 166, 125, - 166, 125, 166, 128, -1, 141, 127, 166, 125, 166, - 128, -1, 142, 127, 166, 125, 166, 128, -1, 143, - 127, 166, 125, 166, 128, -1, 145, 127, 166, 125, - 166, 128, -1, 120, 127, 166, 125, 166, 128, -1, - 121, 127, 166, 125, 166, 125, 166, 128, -1, 122, - 127, 166, 125, 166, 125, 166, 128, -1, 168, 125, - 166, -1, 166, -1, 32, -1, 33, -1, 171, -1, - 171, 187, -1, 171, 189, -1, 171, 62, 61, 173, - -1, 171, 25, -1, 172, -1, 172, 150, 20, 159, - -1, 172, 189, -1, 172, 62, 61, 173, -1, 172, - 150, 151, 169, 166, 157, -1, 172, 150, 50, 169, - 161, 157, -1, 172, 150, 45, 169, 161, 157, -1, - 172, 150, 47, 169, 161, 157, -1, 172, 51, 175, - -1, 172, 58, 124, 176, -1, -1, 24, -1, 56, - -1, 55, -1, 53, 124, 174, -1, 54, 124, 4, - -1, 52, 124, 24, -1, 71, 124, 24, -1, 129, - 177, 131, -1, 177, 125, 24, -1, 24, -1, -1, - 22, -1, 24, -1, 178, -1, -1, 161, 179, -1, - 181, 125, 180, -1, 180, -1, 181, -1, 181, 125, - 37, -1, 37, -1, -1, 152, 159, 178, 127, 182, - 128, 156, 153, -1, 29, -1, 134, -1, 151, 183, - 184, -1, 30, -1, 135, -1, 185, 195, 186, -1, - -1, 45, -1, 47, -1, 31, 188, 183, -1, -1, - 63, -1, 3, -1, 4, -1, 7, -1, 27, -1, - 28, -1, 38, -1, 39, -1, 26, -1, 132, 168, - 133, -1, 167, -1, 61, 190, 24, 125, 24, -1, - 139, -1, 178, -1, 192, -1, 191, -1, 161, 193, - -1, 195, 196, -1, 196, -1, 197, 150, 198, -1, - 197, 200, -1, -1, 23, -1, 72, 194, -1, 72, - 8, -1, 73, 21, 193, -1, 73, 9, 193, 125, - 21, 193, 125, 21, 193, -1, 74, 148, 193, 125, - 21, 193, 129, 199, 131, -1, 74, 148, 193, 125, - 21, 193, 129, 131, -1, 75, 152, 159, 193, 127, - 203, 128, 36, 21, 193, 76, 21, 193, -1, 76, - -1, 77, -1, 199, 148, 191, 125, 21, 193, -1, - 148, 191, 125, 21, 193, -1, 150, 205, -1, 161, - 129, 193, 125, 193, 131, -1, 201, 125, 129, 193, - 125, 193, 131, -1, 194, -1, 202, 125, 194, -1, - 202, -1, -1, 60, 59, -1, 59, -1, 141, 161, - 193, 125, 193, -1, 142, 161, 193, 125, 193, -1, - 143, 161, 193, 125, 193, -1, 49, 194, -1, 145, - 194, 125, 194, -1, 144, 194, 36, 161, -1, 115, - 194, 125, 194, 125, 194, -1, 119, 194, 125, 161, - -1, 120, 194, 125, 194, -1, 121, 194, 125, 194, - 125, 194, -1, 122, 194, 125, 194, 125, 194, -1, - 114, 201, -1, 204, 152, 159, 193, 127, 203, 128, - -1, 208, -1, 125, 202, -1, -1, 35, -1, -1, - 96, 161, 154, -1, 96, 161, 125, 15, 193, 154, - -1, 97, 161, 154, -1, 97, 161, 125, 15, 193, - 154, -1, 98, 194, -1, 207, 99, 161, 193, -1, - 207, 100, 194, 125, 161, 193, -1, 101, 161, 193, - 206, -1 + -1, 93, -1, 94, -1, 95, -1, 104, -1, 105, + -1, 106, -1, 21, -1, 19, -1, 17, -1, 15, + -1, 22, -1, 20, -1, 18, -1, 16, -1, 133, + -1, 134, -1, 23, -1, 24, -1, 165, 112, -1, + -1, 42, -1, 43, -1, 44, -1, 48, -1, 45, + -1, 46, -1, 47, -1, -1, 65, -1, 66, -1, + 67, -1, 68, -1, 69, -1, 70, -1, 64, 4, + -1, -1, -1, 57, 4, -1, -1, 113, 57, 4, + -1, 37, 30, -1, -1, 142, -1, -1, 113, 145, + 144, -1, 142, -1, 57, 4, -1, 148, -1, 13, + -1, 150, -1, 13, -1, 150, -1, 14, -1, 15, + -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, + -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, + -1, 26, -1, 149, -1, 179, -1, 114, 4, -1, + 147, 115, 152, 116, -1, 117, 4, 118, 150, 119, + -1, 120, 4, 118, 150, 121, -1, 122, 151, 123, + -1, 122, 123, -1, 150, 124, -1, 150, -1, 151, + 113, 150, -1, 151, -1, 151, 113, 40, -1, 40, + -1, -1, 148, 117, 155, 119, -1, 148, 117, 119, + -1, 148, 125, 30, -1, 148, 120, 155, 121, -1, + 148, 122, 155, 123, -1, 148, 122, 123, -1, 148, + 10, -1, 148, 11, -1, 148, 179, -1, 148, 154, + -1, 148, 12, -1, 133, 128, -1, 134, 4, -1, + 14, 8, -1, 14, 9, -1, 136, 7, -1, 111, + 115, 153, 39, 148, 116, -1, 101, 115, 153, 193, + 116, -1, 103, 115, 153, 113, 153, 113, 153, 116, + -1, 129, 115, 153, 113, 153, 116, -1, 130, 115, + 153, 113, 153, 116, -1, 131, 115, 153, 113, 153, + 116, -1, 132, 115, 153, 113, 153, 116, -1, 108, + 115, 153, 113, 153, 116, -1, 109, 115, 153, 113, + 153, 113, 153, 116, -1, 110, 115, 153, 113, 153, + 113, 153, 116, -1, 155, 113, 153, -1, 153, -1, + 35, -1, 36, -1, 158, -1, 158, 174, -1, 158, + 176, -1, 158, 62, 61, 160, -1, 158, 31, -1, + 159, -1, 159, 137, 27, 146, -1, 159, 176, -1, + 159, 62, 61, 160, -1, 159, 137, 138, 156, 153, + 144, -1, 159, 137, 50, 156, 148, 144, -1, 159, + 137, 45, 156, 148, 144, -1, 159, 137, 47, 156, + 148, 144, -1, 159, 51, 162, -1, 159, 58, 112, + 163, -1, -1, 30, -1, 56, -1, 55, -1, 53, + 112, 161, -1, 54, 112, 4, -1, 52, 112, 30, + -1, 71, 112, 30, -1, 117, 164, 119, -1, 164, + 113, 30, -1, 30, -1, -1, 28, -1, 30, -1, + 165, -1, -1, 148, 166, -1, 168, 113, 167, -1, + 167, -1, 168, -1, 168, 113, 40, -1, 40, -1, + -1, 139, 146, 165, 115, 169, 116, 143, 140, -1, + 32, -1, 122, -1, 138, 170, 171, -1, 33, -1, + 123, -1, 172, 182, 173, -1, -1, 45, -1, 47, + -1, 34, 175, 170, -1, -1, 63, -1, 3, -1, + 4, -1, 7, -1, 8, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 120, 155, 121, -1, 154, -1, + 61, 177, 30, 113, 30, -1, 127, -1, 165, -1, + 179, -1, 178, -1, 148, 180, -1, 182, 183, -1, + 183, -1, 184, 137, 185, -1, 184, 187, -1, -1, + 29, -1, 72, 181, -1, 72, 13, -1, 73, 25, + 180, -1, 73, 14, 180, 113, 25, 180, 113, 25, + 180, -1, 74, 135, 180, 113, 25, 180, 117, 186, + 119, -1, 74, 135, 180, 113, 25, 180, 117, 119, + -1, 75, 139, 146, 180, 115, 190, 116, 39, 25, + 180, 76, 25, 180, -1, 76, -1, 77, -1, 186, + 135, 178, 113, 25, 180, -1, 135, 178, 113, 25, + 180, -1, 137, 192, -1, 148, 117, 180, 113, 180, + 119, -1, 188, 113, 117, 180, 113, 180, 119, -1, + 181, -1, 189, 113, 181, -1, 189, -1, -1, 60, + 59, -1, 59, -1, 129, 148, 180, 113, 180, -1, + 130, 148, 180, 113, 180, -1, 131, 148, 180, 113, + 180, -1, 49, 181, -1, 132, 181, 113, 181, -1, + 111, 181, 39, 148, -1, 103, 181, 113, 181, 113, + 181, -1, 107, 181, 113, 148, -1, 108, 181, 113, + 181, -1, 109, 181, 113, 181, 113, 181, -1, 110, + 181, 113, 181, 113, 181, -1, 102, 188, -1, 191, + 139, 146, 180, 115, 190, 116, -1, 195, -1, 113, + 189, -1, -1, 38, -1, -1, 96, 148, 141, -1, + 96, 148, 113, 20, 180, 141, -1, 97, 148, 141, + -1, 97, 148, 113, 20, 180, 141, -1, 98, 181, + -1, 194, 99, 148, 180, -1, 194, 100, 181, 113, + 148, 180, -1, 101, 148, 180, 193, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 84, 84, 84, 85, 85, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 90, 90, 90, 91, 91, - 91, 91, 91, 91, 92, 93, 93, 93, 97, 97, - 97, 97, 98, 98, 98, 98, 99, 99, 100, 100, - 103, 107, 112, 112, 112, 112, 112, 112, 113, 114, - 117, 117, 117, 117, 117, 118, 118, 119, 124, 125, - 128, 129, 137, 143, 144, 147, 148, 157, 158, 171, - 171, 172, 172, 173, 177, 177, 177, 177, 177, 177, - 177, 178, 178, 178, 178, 178, 178, 179, 179, 179, - 183, 187, 192, 198, 204, 209, 212, 220, 220, 227, - 228, 233, 236, 246, 251, 254, 259, 264, 269, 272, - 277, 282, 287, 292, 298, 303, 308, 313, 318, 325, - 330, 332, 334, 336, 338, 340, 342, 344, 346, 351, - 353, 358, 358, 368, 373, 376, 381, 384, 387, 391, - 396, 401, 406, 411, 416, 421, 426, 431, 436, 441, - 443, 443, 446, 451, 456, 461, 468, 475, 480, 481, - 489, 489, 490, 490, 492, 498, 501, 505, 508, 512, - 515, 519, 534, 537, 541, 550, 551, 553, 559, 560, - 561, 565, 575, 577, 580, 580, 580, 580, 580, 581, - 581, 581, 582, 587, 588, 597, 597, 600, 600, 606, - 612, 614, 621, 625, 630, 633, 639, 644, 649, 654, - 660, 666, 672, 681, 686, 692, 697, 704, 711, 716, - 724, 725, 733, 734, 738, 743, 746, 751, 756, 761, - 766, 771, 776, 781, 786, 791, 796, 801, 806, 815, - 820, 824, 828, 829, 832, 839, 846, 853, 860, 865, - 872, 879 + 0, 189, 189, 189, 190, 190, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 195, 195, 195, 196, 196, + 196, 196, 196, 196, 197, 197, 197, 201, 201, 201, + 201, 202, 202, 202, 202, 203, 203, 204, 204, 207, + 211, 216, 216, 216, 216, 216, 216, 217, 218, 221, + 221, 221, 221, 221, 222, 222, 223, 228, 229, 232, + 233, 241, 247, 248, 251, 252, 261, 262, 275, 275, + 276, 276, 277, 281, 281, 281, 281, 281, 281, 281, + 282, 282, 282, 282, 282, 283, 283, 283, 288, 293, + 299, 306, 313, 319, 323, 333, 336, 344, 345, 350, + 353, 363, 369, 374, 380, 386, 392, 397, 403, 409, + 415, 421, 427, 433, 439, 445, 451, 459, 466, 472, + 477, 482, 487, 492, 497, 502, 507, 517, 522, 527, + 527, 537, 542, 545, 550, 553, 556, 560, 565, 570, + 575, 581, 587, 593, 599, 604, 609, 614, 616, 616, + 619, 624, 631, 636, 643, 650, 655, 656, 664, 664, + 665, 665, 667, 674, 678, 682, 685, 690, 693, 697, + 717, 720, 724, 733, 734, 736, 744, 745, 746, 750, + 763, 765, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 782, 783, 792, 792, 795, 795, 801, 808, 810, + 817, 821, 826, 829, 835, 840, 845, 850, 857, 863, + 869, 878, 883, 889, 894, 902, 909, 915, 923, 924, + 932, 933, 937, 942, 945, 950, 955, 960, 965, 970, + 977, 982, 987, 992, 997, 1002, 1007, 1016, 1021, 1025, + 1029, 1030, 1033, 1040, 1047, 1054, 1061, 1066, 1073, 1080 }; #endif @@ -754,28 +810,26 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", - "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", - "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", - "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", - "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", - "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", - "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_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", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", - "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", - "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", - "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "SHL", "LSHR", + "UINTVAL", "FPVAL", "TRUETOK", "FALSETOK", "NULL_TOK", "UNDEF", + "ZEROINITIALIZER", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "LABEL", "OPAQUE", + "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION", + "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK", + "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL", + "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN", + "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", + "CCC_TOK", "CSRETCC_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", "SETLE", + "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", "ALLOCA", "FREE", + "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "LSHR", "ASHR", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", - "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", - "ArithmeticOps", "LogicalOps", "SetCondOps", "CastOps", "ShiftOps", - "SIntType", "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", + "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "IntVal", "EInt64Val", + "ArithmeticOps", "LogicalOps", "SetCondOps", "ShiftOps", "SIntType", + "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", @@ -807,41 +861,39 @@ 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, 61, 44, 92, 40, 41, 91, - 120, 93, 60, 62, 123, 125, 42, 99 + 365, 366, 61, 44, 92, 40, 41, 91, 120, 93, + 60, 62, 123, 125, 42, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 138, 139, 139, 140, 140, 141, 141, 141, 141, - 141, 141, 141, 141, 141, 142, 142, 142, 143, 143, - 143, 143, 143, 143, 144, 145, 145, 145, 146, 146, - 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, - 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, - 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, - 154, 154, 155, 156, 156, 157, 157, 158, 158, 159, - 159, 160, 160, 161, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 164, 164, 165, - 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, - 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, - 168, 169, 169, 170, 171, 171, 171, 171, 171, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, - 174, 174, 175, 175, 175, 175, 176, 177, 177, 177, - 178, 178, 179, 179, 180, 181, 181, 182, 182, 182, - 182, 183, 184, 184, 185, 186, 186, 187, 188, 188, - 188, 189, 190, 190, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 192, 192, 193, 193, 194, - 195, 195, 196, 197, 197, 197, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 199, 199, 200, 201, 201, - 202, 202, 203, 203, 204, 204, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, - 208, 208 + 0, 126, 127, 127, 128, 128, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 130, 130, 130, 131, 131, + 131, 131, 131, 131, 132, 132, 132, 133, 133, 133, + 133, 134, 134, 134, 134, 135, 135, 136, 136, 137, + 137, 138, 138, 138, 138, 138, 138, 138, 138, 139, + 139, 139, 139, 139, 139, 139, 139, 140, 140, 141, + 141, 142, 143, 143, 144, 144, 145, 145, 146, 146, + 147, 147, 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, 152, 152, 152, + 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, + 154, 154, 154, 154, 154, 154, 154, 155, 155, 156, + 156, 157, 158, 158, 158, 158, 158, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 160, 161, 161, + 162, 162, 162, 162, 163, 164, 164, 164, 165, 165, + 166, 166, 167, 168, 168, 169, 169, 169, 169, 170, + 171, 171, 172, 173, 173, 174, 175, 175, 175, 176, + 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 179, 179, 180, 180, 181, 182, 182, + 183, 184, 184, 184, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 186, 186, 187, 188, 188, 189, 189, + 190, 190, 191, 191, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, + 194, 194, 195, 195, 195, 195, 195, 195, 195, 195 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -850,29 +902,28 @@ 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, 2, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 2, 0, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 2, 0, 0, 2, - 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 5, 5, 3, 2, 2, 1, 3, 1, - 3, 1, 0, 4, 3, 3, 4, 4, 3, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - 5, 8, 6, 6, 6, 6, 6, 8, 8, 3, - 1, 1, 1, 1, 2, 2, 4, 2, 1, 4, - 2, 4, 6, 6, 6, 6, 3, 4, 0, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, - 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, - 0, 8, 1, 1, 3, 1, 1, 3, 0, 1, - 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, - 2, 1, 3, 2, 0, 1, 2, 2, 3, 9, - 9, 8, 13, 1, 1, 6, 5, 2, 6, 7, - 1, 3, 1, 0, 2, 1, 5, 5, 5, 2, - 4, 4, 6, 4, 4, 6, 6, 2, 7, 1, - 2, 0, 1, 0, 3, 6, 3, 6, 2, 4, - 6, 4 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, + 5, 5, 3, 2, 2, 1, 3, 1, 3, 1, + 0, 4, 3, 3, 4, 4, 3, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 6, 5, 8, + 6, 6, 6, 6, 6, 8, 8, 3, 1, 1, + 1, 1, 2, 2, 4, 2, 1, 4, 2, 4, + 6, 6, 6, 6, 3, 4, 0, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 1, 0, 1, 1, + 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, + 1, 1, 3, 1, 1, 3, 0, 1, 1, 3, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 5, 1, 1, 1, 1, 2, 2, 1, + 3, 2, 0, 1, 2, 2, 3, 9, 9, 8, + 13, 1, 1, 6, 5, 2, 6, 7, 1, 3, + 1, 0, 2, 1, 5, 5, 5, 2, 4, 4, + 6, 4, 4, 6, 6, 2, 7, 1, 2, 0, + 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -880,461 +931,449 @@ means the default is an error. */ static const unsigned char yydefact[] = { - 148, 0, 49, 138, 1, 137, 178, 42, 43, 44, - 45, 46, 47, 48, 0, 57, 204, 134, 135, 160, - 161, 0, 0, 0, 49, 0, 140, 179, 180, 57, - 0, 0, 50, 51, 52, 53, 54, 55, 0, 0, - 205, 204, 201, 41, 0, 0, 0, 0, 146, 0, - 0, 0, 0, 0, 0, 0, 40, 181, 149, 136, - 56, 2, 3, 70, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 0, 0, - 0, 0, 195, 0, 0, 69, 88, 73, 196, 89, - 172, 173, 174, 175, 176, 177, 200, 243, 203, 0, - 0, 0, 0, 159, 147, 141, 139, 131, 132, 0, - 0, 0, 0, 90, 0, 0, 72, 95, 97, 0, - 0, 102, 96, 242, 0, 225, 0, 0, 0, 0, - 57, 213, 214, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 0, 0, 0, 0, 0, 0,
      + Site Map:
      @@ -119,7 +119,7 @@ Lattner
      +
      {vote_title}

      From reid at x10sys.com Wed Nov 29 13:49:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:49:05 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291949.kATJn5hU028583@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.8 -> 1.9 --- Log message: Okay, forget the columns. --- Diffs of the changes: (+1 -108) voting.tpl.html | 109 -------------------------------------------------------- 1 files changed, 1 insertion(+), 108 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.8 llvm-www/poll/voting.tpl.html:1.9 --- llvm-www/poll/voting.tpl.html:1.8 Wed Nov 29 13:45:22 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:48:50 2006 @@ -12,114 +12,6 @@

      The LLVM Compiler Infrastructure
      - - - - -
      - -Site Map: - - -
      - -Download! -
      -Download now: -LLVM 1.9
      - -
      -Try the
      -online demo
      -
      - -View the open-source
      -license -
      - -
      - -Search this Site - -
      -
      - -
      - -
      -
      - -
      - -Status Updates - - -
      - -Useful Links -
      - Mailing Lists:
      - LLVM-announce
      - LLVM-dev
      - LLVM-bugs
      - LLVM-commits - LLVM-testresults -

      - - IRC Channel:
      - irc.oftc.net #llvm - -

      - - Dev. Resources:
      - doxygen - cvsweb
      - Nightly Tester
      - LLVM Bugzilla -
      - -
      - -Maintained by:
      Chris -Lattner
      - -
      {vote_title}

      @@ -153,6 +45,7 @@

      Next Question: {txt_next_question}

      +

      Back to LLVM Overview Page

      From reid at x10sys.com Wed Nov 29 13:50:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:50:48 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/index.html Message-ID: <200611291950.kATJomjJ028668@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: index.html updated: 1.1 -> 1.2 --- Log message: Fix a typo. --- Diffs of the changes: (+1 -1) index.html | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/poll/index.html diff -u llvm-www/poll/index.html:1.1 llvm-www/poll/index.html:1.2 --- llvm-www/poll/index.html:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/index.html Wed Nov 29 13:50:34 2006 @@ -21,7 +21,7 @@
    3. First Content Choice
    4. Second Content Choice
    5. Third Content Choice
    6. -
    7. Providing COntent
    8. +
    9. Providing Content
    10. From reid at x10sys.com Wed Nov 29 13:52:22 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:52:22 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/index.html Message-ID: <200611291952.kATJqMYF028744@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: index.html updated: 1.2 -> 1.3 --- Log message: Make this a little more terse. --- Diffs of the changes: (+4 -8) index.html | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) Index: llvm-www/poll/index.html diff -u llvm-www/poll/index.html:1.2 llvm-www/poll/index.html:1.3 --- llvm-www/poll/index.html:1.2 Wed Nov 29 13:50:34 2006 +++ llvm-www/poll/index.html Wed Nov 29 13:52:07 2006 @@ -5,14 +5,10 @@

      The LLVM Oversight team is considering organizing an LLVM Conference in 2007. We would like to make this a useful meeting for LLVM Developers and Users. In order for the participants to get the most out of it, we need to get -your feedback on various items. Please use the poll pages below to provide your -feedback.

      - -

      LLVM Conference Poll Questions
      -
      -

      Here are links to the questions. We would appreciate it if you would answer - all of them. You may only vote once. Return to the links below for updates - on poll results.

      +your feedback on various items. Please use the poll page links below to +provide your feedback.

      +

      We would appreciate it if you would answer all of the questions. You may +only vote once. Return to the links below for updates on poll results.

      1. Interest Level
      2. Attendance
      3. From reid at x10sys.com Wed Nov 29 13:56:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:56:49 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/content1.php content2.php content3.php provide.php paper.php Message-ID: <200611291956.kATJunaq028891@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: content1.php updated: 1.1 -> 1.2 content2.php updated: 1.1 -> 1.2 content3.php updated: 1.1 -> 1.2 provide.php updated: 1.1 -> 1.2 paper.php (r1.1) removed --- Log message: Add an "Other" field for the content questions. --- Diffs of the changes: (+4 -0) content1.php | 1 + content2.php | 1 + content3.php | 1 + provide.php | 1 + 4 files changed, 4 insertions(+) Index: llvm-www/poll/content1.php diff -u llvm-www/poll/content1.php:1.1 llvm-www/poll/content1.php:1.2 --- llvm-www/poll/content1.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/content1.php Wed Nov 29 13:56:35 2006 @@ -15,6 +15,7 @@ $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; + $vote_option[] = 'Other'; $intern_vote_name = 'content1'; $next_page = 'content2.php'; $next_question = 'Second Content Choice'; Index: llvm-www/poll/content2.php diff -u llvm-www/poll/content2.php:1.1 llvm-www/poll/content2.php:1.2 --- llvm-www/poll/content2.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/content2.php Wed Nov 29 13:56:35 2006 @@ -15,6 +15,7 @@ $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; + $vote_option[] = 'Other'; $intern_vote_name = 'content2'; $next_page = 'content3.php'; $next_question = 'Third Content Choice'; Index: llvm-www/poll/content3.php diff -u llvm-www/poll/content3.php:1.1 llvm-www/poll/content3.php:1.2 --- llvm-www/poll/content3.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/content3.php Wed Nov 29 13:56:35 2006 @@ -15,6 +15,7 @@ $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; + $vote_option[] = 'Other'; $intern_vote_name = 'content3'; $next_page = 'provide.php'; $next_question = 'Providing Content'; Index: llvm-www/poll/provide.php diff -u llvm-www/poll/provide.php:1.1 llvm-www/poll/provide.php:1.2 --- llvm-www/poll/provide.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/provide.php Wed Nov 29 13:56:35 2006 @@ -15,6 +15,7 @@ $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; + $vote_option[] = 'Other'; $intern_vote_name = 'provide'; $next_page = 'thanks.html'; $next_question = 'Finished'; From sabre at nondot.org Wed Nov 29 13:58:09 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 13:58:09 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll Message-ID: <200611291958.kATJw9vq028983@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: 2006-11-29-AltivecFPSplat.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+10 -0) 2006-11-29-AltivecFPSplat.ll | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/test/Regression/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll:1.1 *** /dev/null Wed Nov 29 13:58:05 2006 --- llvm/test/Regression/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll Wed Nov 29 13:57:55 2006 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 + + void %glgRunProcessor15() { + %tmp26355.i = shufflevector <4 x float> zeroinitializer, <4 x float> < float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000 >, <4 x uint> < uint 0, uint 1, uint 2, uint 7 > ; <<4 x float>> [#uses=1] + %tmp3030030304.i = cast <4 x float> %tmp26355.i to <8 x short> ; <<8 x short>> [#uses=1] + %tmp30305.i = shufflevector <8 x short> zeroinitializer, <8 x short> %tmp3030030304.i, <8 x uint> < uint 1, uint 3, uint 5, uint 7, uint 9, uint 11, uint 13, uint 15 > ; <<8 x short>> [#uses=1] + %tmp30305.i = cast <8 x short> %tmp30305.i to <4 x int> ; <<4 x int>> [#uses=1] + store <4 x int> %tmp30305.i, <4 x int>* null + ret void + } From sabre at nondot.org Wed Nov 29 13:59:04 2006 From: sabre at nondot.org (Chris Lattner) Date: Wed, 29 Nov 2006 13:59:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200611291959.kATJx4o8029028@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.236 -> 1.237 --- Log message: Fix bug codegen'ing FP constant vectors with integer splats. Make sure the created intrinsics have the right integer types. This fixes PowerPC/2006-11-29-AltivecFPSplat.ll --- Diffs of the changes: (+22 -14) PPCISelLowering.cpp | 36 ++++++++++++++++++++++-------------- 1 files changed, 22 insertions(+), 14 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.236 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.237 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.236 Wed Nov 29 07:37:09 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 29 13:58:49 2006 @@ -1973,6 +1973,7 @@ Ops.assign(MVT::getVectorNumElements(CanonicalVT), Elt); SDOperand Res = DAG.getNode(ISD::BUILD_VECTOR, CanonicalVT, &Ops[0], Ops.size()); + if (VT == MVT::Other) return Res; return DAG.getNode(ISD::BIT_CONVERT, VT, Res); } @@ -2086,6 +2087,7 @@ -1, 1, -2, 2, -3, 3, -4, 4, -5, 5, -6, 6, -7, 7, -8, 8, -9, 9, -10, 10, -11, 11, -12, 12, -13, 13, 14, -14, 15, -15, -16 }; + for (unsigned idx = 0; idx < sizeof(SplatCsts)/sizeof(SplatCsts[0]); ++idx){ // Indirect through the SplatCsts array so that we favor 'vsplti -1' for // cases which are ambiguous (e.g. formation of 0x8000_0000). 'vsplti -1' @@ -2097,43 +2099,47 @@ // vsplti + shl self. if (SextVal == (i << (int)TypeShiftAmt)) { - Op = BuildSplatI(i, SplatSize, Op.getValueType(), DAG); + SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG); static const unsigned IIDs[] = { // Intrinsic to use for each size. Intrinsic::ppc_altivec_vslb, Intrinsic::ppc_altivec_vslh, 0, Intrinsic::ppc_altivec_vslw }; - return BuildIntrinsicOp(IIDs[SplatSize-1], Op, Op, DAG); + Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res); } // vsplti + srl self. if (SextVal == (int)((unsigned)i >> TypeShiftAmt)) { - Op = BuildSplatI(i, SplatSize, Op.getValueType(), DAG); + SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG); static const unsigned IIDs[] = { // Intrinsic to use for each size. Intrinsic::ppc_altivec_vsrb, Intrinsic::ppc_altivec_vsrh, 0, Intrinsic::ppc_altivec_vsrw }; - return BuildIntrinsicOp(IIDs[SplatSize-1], Op, Op, DAG); + Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res); } // vsplti + sra self. if (SextVal == (int)((unsigned)i >> TypeShiftAmt)) { - Op = BuildSplatI(i, SplatSize, Op.getValueType(), DAG); + SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG); static const unsigned IIDs[] = { // Intrinsic to use for each size. Intrinsic::ppc_altivec_vsrab, Intrinsic::ppc_altivec_vsrah, 0, Intrinsic::ppc_altivec_vsraw }; - return BuildIntrinsicOp(IIDs[SplatSize-1], Op, Op, DAG); + Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res); } // vsplti + rol self. if (SextVal == (int)(((unsigned)i << TypeShiftAmt) | ((unsigned)i >> (SplatBitSize-TypeShiftAmt)))) { - Op = BuildSplatI(i, SplatSize, Op.getValueType(), DAG); + SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG); static const unsigned IIDs[] = { // Intrinsic to use for each size. Intrinsic::ppc_altivec_vrlb, Intrinsic::ppc_altivec_vrlh, 0, Intrinsic::ppc_altivec_vrlw }; - return BuildIntrinsicOp(IIDs[SplatSize-1], Op, Op, DAG); + Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res); } // t = vsplti c, result = vsldoi t, t, 1 @@ -2157,15 +2163,17 @@ // Odd, in range [17,31]: (vsplti C)-(vsplti -16). if (SextVal >= 0 && SextVal <= 31) { - SDOperand LHS = BuildSplatI(SextVal-16, SplatSize, Op.getValueType(),DAG); - SDOperand RHS = BuildSplatI(-16, SplatSize, Op.getValueType(), DAG); - return DAG.getNode(ISD::SUB, Op.getValueType(), LHS, RHS); + SDOperand LHS = BuildSplatI(SextVal-16, SplatSize, MVT::Other, DAG); + SDOperand RHS = BuildSplatI(-16, SplatSize, MVT::Other, DAG); + LHS = DAG.getNode(ISD::SUB, Op.getValueType(), LHS, RHS); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), LHS); } // Odd, in range [-31,-17]: (vsplti C)+(vsplti -16). if (SextVal >= -31 && SextVal <= 0) { - SDOperand LHS = BuildSplatI(SextVal+16, SplatSize, Op.getValueType(),DAG); - SDOperand RHS = BuildSplatI(-16, SplatSize, Op.getValueType(), DAG); - return DAG.getNode(ISD::ADD, Op.getValueType(), LHS, RHS); + SDOperand LHS = BuildSplatI(SextVal+16, SplatSize, MVT::Other, DAG); + SDOperand RHS = BuildSplatI(-16, SplatSize, MVT::Other, DAG); + LHS = DAG.getNode(ISD::ADD, Op.getValueType(), LHS, RHS); + return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), LHS); } } From reid at x10sys.com Wed Nov 29 13:41:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 13:41:16 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/voting.tpl.html Message-ID: <200611291941.kATJfG7n028247@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: voting.tpl.html updated: 1.4 -> 1.5 --- Log message: Try cut and paste. --- Diffs of the changes: (+126 -2) voting.tpl.html | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 126 insertions(+), 2 deletions(-) Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.4 llvm-www/poll/voting.tpl.html:1.5 --- llvm-www/poll/voting.tpl.html:1.4 Wed Nov 29 13:38:00 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 13:41:02 2006 @@ -1,4 +1,125 @@ - + + + + + The LLVM Compiler Infrastructure Project + + + + + +
        + The LLVM Compiler Infrastructure +
        + + + + + +
        + +Site Map: + + +
        + +Download! +
        +Download now: +LLVM 1.9
        + +
        +Try the
        +online demo
        +
        + +View the open-source
        +license +
        + +
        + +Search this Site + +
        +
        + +
        + +
        +
        + +
        + +Status Updates + + +
        + +Useful Links +
        + Mailing Lists:
        + LLVM-announce
        + LLVM-dev
        + LLVM-bugs
        + LLVM-commits + LLVM-testresults +

        + + IRC Channel:
        + irc.oftc.net #llvm + +

        + + Dev. Resources:
        + doxygen + cvsweb
        + Nightly Tester
        + LLVM Bugzilla +
        + +
        + +Maintained by:
        Chris +Lattner
        + +
        {vote_title}

        @@ -33,4 +154,7 @@

        Next Question: {txt_next_question}

        - +
        + + From reid at x10sys.com Wed Nov 29 14:23:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 14:23:42 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/annual.php benefit1.php benefit2.php content1.php content2.php content3.php index.html month.php provide.php venue.php Message-ID: <200611292023.kATKNg9W029579@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: annual.php added (r1.1) benefit1.php added (r1.1) benefit2.php added (r1.1) content1.php updated: 1.2 -> 1.3 content2.php updated: 1.2 -> 1.3 content3.php updated: 1.2 -> 1.3 index.html updated: 1.3 -> 1.4 month.php updated: 1.1 -> 1.2 provide.php updated: 1.2 -> 1.3 venue.php updated: 1.1 -> 1.2 --- Log message: Add new pages and link them in. --- Diffs of the changes: (+73 -9) annual.php | 15 +++++++++++++++ benefit1.php | 20 ++++++++++++++++++++ benefit2.php | 20 ++++++++++++++++++++ content1.php | 4 +++- content2.php | 4 +++- content3.php | 4 +++- index.html | 3 +++ month.php | 4 ++-- provide.php | 4 +++- venue.php | 4 +--- 10 files changed, 73 insertions(+), 9 deletions(-) Index: llvm-www/poll/annual.php diff -c /dev/null llvm-www/poll/annual.php:1.1 *** /dev/null Wed Nov 29 14:23:37 2006 --- llvm-www/poll/annual.php Wed Nov 29 14:23:27 2006 *************** *** 0 **** --- 1,15 ---- + Index: llvm-www/poll/benefit1.php diff -c /dev/null llvm-www/poll/benefit1.php:1.1 *** /dev/null Wed Nov 29 14:23:42 2006 --- llvm-www/poll/benefit1.php Wed Nov 29 14:23:27 2006 *************** *** 0 **** --- 1,20 ---- + Index: llvm-www/poll/benefit2.php diff -c /dev/null llvm-www/poll/benefit2.php:1.1 *** /dev/null Wed Nov 29 14:23:42 2006 --- llvm-www/poll/benefit2.php Wed Nov 29 14:23:27 2006 *************** *** 0 **** --- 1,20 ---- + Index: llvm-www/poll/content1.php diff -u llvm-www/poll/content1.php:1.2 llvm-www/poll/content1.php:1.3 --- llvm-www/poll/content1.php:1.2 Wed Nov 29 13:56:35 2006 +++ llvm-www/poll/content1.php Wed Nov 29 14:23:27 2006 @@ -9,13 +9,15 @@ $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; + $vote_option[] = 'Other paper/Presentation'; $vote_option[] = 'Tutorial on using LLVM'; $vote_option[] = 'Tutorial on developing LLVM (extension or maintenance)'; $vote_option[] = 'Tutorial on compiler optimization'; + $vote_option[] = 'Other tutorial'; $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; - $vote_option[] = 'Other'; + $vote_option[] = 'Other (send your ideas to llvm-dev mailing list)'; $intern_vote_name = 'content1'; $next_page = 'content2.php'; $next_question = 'Second Content Choice'; Index: llvm-www/poll/content2.php diff -u llvm-www/poll/content2.php:1.2 llvm-www/poll/content2.php:1.3 --- llvm-www/poll/content2.php:1.2 Wed Nov 29 13:56:35 2006 +++ llvm-www/poll/content2.php Wed Nov 29 14:23:27 2006 @@ -9,13 +9,15 @@ $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; + $vote_option[] = 'Other paper/Presentation'; $vote_option[] = 'Tutorial on using LLVM'; $vote_option[] = 'Tutorial on developing LLVM (extension or maintenance)'; $vote_option[] = 'Tutorial on compiler optimization'; + $vote_option[] = 'Other tutorial'; $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; - $vote_option[] = 'Other'; + $vote_option[] = 'Other (send your ideas to llvm-dev mailing list)'; $intern_vote_name = 'content2'; $next_page = 'content3.php'; $next_question = 'Third Content Choice'; Index: llvm-www/poll/content3.php diff -u llvm-www/poll/content3.php:1.2 llvm-www/poll/content3.php:1.3 --- llvm-www/poll/content3.php:1.2 Wed Nov 29 13:56:35 2006 +++ llvm-www/poll/content3.php Wed Nov 29 14:23:27 2006 @@ -9,13 +9,15 @@ $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; + $vote_option[] = 'Other paper/Presentation'; $vote_option[] = 'Tutorial on using LLVM'; $vote_option[] = 'Tutorial on developing LLVM (extension or maintenance)'; $vote_option[] = 'Tutorial on compiler optimization'; + $vote_option[] = 'Other tutorial'; $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; - $vote_option[] = 'Other'; + $vote_option[] = 'Other (send your ideas to llvm-dev mailing list)'; $intern_vote_name = 'content3'; $next_page = 'provide.php'; $next_question = 'Providing Content'; Index: llvm-www/poll/index.html diff -u llvm-www/poll/index.html:1.3 llvm-www/poll/index.html:1.4 --- llvm-www/poll/index.html:1.3 Wed Nov 29 13:52:07 2006 +++ llvm-www/poll/index.html Wed Nov 29 14:23:27 2006 @@ -14,6 +14,9 @@
      4. Attendance
      5. Venue
      6. Month
      7. +
      8. Annual Event
      9. +
      10. Your Primary Benefit
      11. +
      12. Your Secondary Benefit
      13. First Content Choice
      14. Second Content Choice
      15. Third Content Choice
      16. Index: llvm-www/poll/month.php diff -u llvm-www/poll/month.php:1.1 llvm-www/poll/month.php:1.2 --- llvm-www/poll/month.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/month.php Wed Nov 29 14:23:27 2006 @@ -14,7 +14,7 @@ $vote_option[] = 'September 2007'; $vote_option[] = 'Other'; $intern_vote_name = 'month'; - $next_page = 'content1.php'; - $next_question = 'First Content Choice'; + $next_page = 'annual.php'; + $next_question = 'Annual Event'; include('./vote.details.php'); ?> Index: llvm-www/poll/provide.php diff -u llvm-www/poll/provide.php:1.2 llvm-www/poll/provide.php:1.3 --- llvm-www/poll/provide.php:1.2 Wed Nov 29 13:56:35 2006 +++ llvm-www/poll/provide.php Wed Nov 29 14:23:27 2006 @@ -9,13 +9,15 @@ $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; + $vote_option[] = 'Other paper/Presentation'; $vote_option[] = 'Tutorial on using LLVM'; $vote_option[] = 'Tutorial on developing LLVM (extension or maintenance)'; $vote_option[] = 'Tutorial on compiler optimization'; + $vote_option[] = 'Other tutorial'; $vote_option[] = 'LLVM help session'; $vote_option[] = 'LLVM workshop (plan LLVM future)'; $vote_option[] = 'LLVM workshop (resolve current issues)'; - $vote_option[] = 'Other'; + $vote_option[] = 'Other (send your ideas to llvm-dev mailing list)'; $intern_vote_name = 'provide'; $next_page = 'thanks.html'; $next_question = 'Finished'; Index: llvm-www/poll/venue.php diff -u llvm-www/poll/venue.php:1.1 llvm-www/poll/venue.php:1.2 --- llvm-www/poll/venue.php:1.1 Wed Nov 29 13:29:07 2006 +++ llvm-www/poll/venue.php Wed Nov 29 14:23:27 2006 @@ -11,9 +11,7 @@ $vote_option[] = 'Portland OR'; $vote_option[] = 'San Jose CA'; $vote_option[] = 'San Francisco CA'; - $vote_option[] = 'East Coast USA'; - $vote_option[] = 'Europe'; - $vote_option[] = 'Other'; + $vote_option[] = 'Los Angeles CA'; $intern_vote_name = 'venue'; $next_page = 'month.php'; $next_question = 'Month'; From reid at x10sys.com Wed Nov 29 15:08:03 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 15:08:03 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/provide.php Message-ID: <200611292108.kATL837B014764@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: provide.php updated: 1.3 -> 1.4 --- Log message: Remove double ? --- Diffs of the changes: (+1 -1) provide.php | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/poll/provide.php diff -u llvm-www/poll/provide.php:1.3 llvm-www/poll/provide.php:1.4 --- llvm-www/poll/provide.php:1.3 Wed Nov 29 14:23:27 2006 +++ llvm-www/poll/provide.php Wed Nov 29 15:07:42 2006 @@ -5,7 +5,7 @@ ** documentation file in folder 'docu'. *****************************************************/ $vote_title = 'Providing Content'; - $vote_text = 'Which of the following could you provide??'; + $vote_text = 'Which of the following could you provide?'; $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; From reid at x10sys.com Wed Nov 29 15:37:14 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 15:37:14 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Instruction.def Message-ID: <200611292137.kATLbEFB015284@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instruction.def updated: 1.26 -> 1.27 --- Log message: Get the delegation right for InstVisitor. --- Diffs of the changes: (+12 -12) Instruction.def | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/include/llvm/Instruction.def diff -u llvm/include/llvm/Instruction.def:1.26 llvm/include/llvm/Instruction.def:1.27 --- llvm/include/llvm/Instruction.def:1.26 Sun Nov 26 19:05:09 2006 +++ llvm/include/llvm/Instruction.def Wed Nov 29 15:37:00 2006 @@ -142,18 +142,18 @@ // NOTE: The order matters here because CastInst::isEliminableCastPair // NOTE: (see Instructions.cpp) encodes a table based on this ordering. FIRST_CAST_INST(31) -HANDLE_CAST_INST(31, Trunc , CastInst ) // Truncate integers -HANDLE_CAST_INST(32, ZExt , CastInst ) // Zero extend integers -HANDLE_CAST_INST(33, SExt , CastInst ) // Sign extend integers -HANDLE_CAST_INST(34, FPToUI , CastInst ) // floating point -> UInt -HANDLE_CAST_INST(35, FPToSI , CastInst ) // floating point -> SInt -HANDLE_CAST_INST(36, UIToFP , CastInst ) // UInt -> floating point -HANDLE_CAST_INST(37, SIToFP , CastInst ) // SInt -> floating point -HANDLE_CAST_INST(38, FPTrunc , CastInst ) // Truncate floating point -HANDLE_CAST_INST(39, FPExt , CastInst ) // Extend floating point -HANDLE_CAST_INST(40, PtrToInt, CastInst ) // Pointer -> Integer -HANDLE_CAST_INST(41, IntToPtr, CastInst ) // Integer -> Pointer -HANDLE_CAST_INST(42, BitCast , CastInst ) // Type cast +HANDLE_CAST_INST(31, Trunc , TruncInst ) // Truncate integers +HANDLE_CAST_INST(32, ZExt , ZExtInst ) // Zero extend integers +HANDLE_CAST_INST(33, SExt , SExtInst ) // Sign extend integers +HANDLE_CAST_INST(34, FPToUI , FPToUIInst ) // floating point -> UInt +HANDLE_CAST_INST(35, FPToSI , FPToSIInst ) // floating point -> SInt +HANDLE_CAST_INST(36, UIToFP , UIToFPInst ) // UInt -> floating point +HANDLE_CAST_INST(37, SIToFP , SIToFPInst ) // SInt -> floating point +HANDLE_CAST_INST(38, FPTrunc , FPTruncInst ) // Truncate floating point +HANDLE_CAST_INST(39, FPExt , FPExtInst ) // Extend floating point +HANDLE_CAST_INST(40, PtrToInt, PtrToIntInst) // Pointer -> Integer +HANDLE_CAST_INST(41, IntToPtr, IntToPtrInst) // Integer -> Pointer +HANDLE_CAST_INST(42, BitCast , BitCastInst ) // Type cast LAST_CAST_INST(42) // Other operators... From reid at x10sys.com Wed Nov 29 15:37:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 15:37:16 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/InstVisitor.h Message-ID: <200611292137.kATLbGgl015290@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: InstVisitor.h updated: 1.43 -> 1.44 --- Log message: Get the delegation right for InstVisitor. --- Diffs of the changes: (+13 -1) InstVisitor.h | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.43 llvm/include/llvm/Support/InstVisitor.h:1.44 --- llvm/include/llvm/Support/InstVisitor.h:1.43 Sun Nov 26 19:05:09 2006 +++ llvm/include/llvm/Support/InstVisitor.h Wed Nov 29 15:37:00 2006 @@ -177,7 +177,18 @@ RetTy visitStoreInst(StoreInst &I) { DELEGATE(Instruction); } RetTy visitGetElementPtrInst(GetElementPtrInst &I){ DELEGATE(Instruction); } RetTy visitPHINode(PHINode &I) { DELEGATE(Instruction); } - RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); } + RetTy visitTruncInst(TruncInst &I) { DELEGATE(CastInst); } + RetTy visitZExtInst(ZExtInst &I) { DELEGATE(CastInst); } + RetTy visitSExtInst(SExtInst &I) { DELEGATE(CastInst); } + RetTy visitFPTruncInst(FPTruncInst &I) { DELEGATE(CastInst); } + RetTy visitFPExtInst(FPExtInst &I) { DELEGATE(CastInst); } + RetTy visitFPToUIInst(FPToUIInst &I) { DELEGATE(CastInst); } + RetTy visitFPToSIInst(FPToSIInst &I) { DELEGATE(CastInst); } + RetTy visitUIToFPInst(UIToFPInst &I) { DELEGATE(CastInst); } + RetTy visitSIToFPInst(SIToFPInst &I) { DELEGATE(CastInst); } + RetTy visitPtrToIntInst(PtrToIntInst &I) { DELEGATE(CastInst); } + RetTy visitIntToPtrInst(IntToPtrInst &I) { DELEGATE(CastInst); } + RetTy visitBitCastInst(BitCastInst &I) { DELEGATE(CastInst); } RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); } RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); } RetTy visitShiftInst(ShiftInst &I) { DELEGATE(Instruction); } @@ -194,6 +205,7 @@ RetTy visitBinaryOperator(BinaryOperator &I) { DELEGATE(Instruction); } RetTy visitAllocationInst(AllocationInst &I) { DELEGATE(Instruction); } RetTy visitCmpInst(CmpInst &I) { DELEGATE(Instruction); } + RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); } // If the user wants a 'default' case, they can choose to override this // function. If this function is not overloaded in the users subclass, then From reid at x10sys.com Wed Nov 29 16:15:41 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 16:15:41 -0600 Subject: [llvm-commits] CVS: llvm-www/header.incl Message-ID: <200611292215.kATMFfUX016012@zion.cs.uiuc.edu> Changes in directory llvm-www: header.incl updated: 1.50 -> 1.51 --- Log message: Add a link to the conference poll. --- Diffs of the changes: (+1 -0) header.incl | 1 + 1 files changed, 1 insertion(+) Index: llvm-www/header.incl diff -u llvm-www/header.incl:1.50 llvm-www/header.incl:1.51 --- llvm-www/header.incl:1.50 Mon Nov 20 01:44:49 2006 +++ llvm-www/header.incl Wed Nov 29 16:15:26 2006 @@ -30,6 +30,7 @@ Open Projects
        LLVM People
        Bug Database
        +Conference Poll

      From evan.cheng at apple.com Wed Nov 29 17:20:06 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 17:20:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86ISelDAGToDAG.cpp X86ISelLowering.cpp Message-ID: <200611292320.kATNK6EL021986@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.73 -> 1.74 X86ISelDAGToDAG.cpp updated: 1.130 -> 1.131 X86ISelLowering.cpp updated: 1.296 -> 1.297 --- Log message: Fix for PR1018: http://llvm.org/PR1018 - Better support for X86-64 Linux in small code model. --- Diffs of the changes: (+55 -14) X86ATTAsmPrinter.cpp | 2 +- X86ISelDAGToDAG.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ X86ISelLowering.cpp | 24 +++++++++++------------- 3 files changed, 55 insertions(+), 14 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.73 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.74 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.73 Fri Nov 17 01:52:03 2006 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Nov 29 17:19:45 2006 @@ -262,7 +262,7 @@ else if (Offset < 0) O << Offset; - if (!isCallOp && + if (isMemOp && Subtarget->is64Bit()) { if (isExt && TM.getRelocationModel() != Reloc::Static) O << "@GOTPCREL"; Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.130 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.131 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.130 Mon Nov 27 17:37:22 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Nov 29 17:19:45 2006 @@ -590,6 +590,49 @@ break; } + case ISD::TargetConstantPool: + if (AM.BaseType == X86ISelAddressMode::RegBase && + AM.Base.Reg.Val == 0 && + AM.CP == 0) { + ConstantPoolSDNode *CP = cast(N); + AM.CP = CP->getConstVal(); + AM.Align = CP->getAlignment(); + AM.Disp += CP->getOffset(); + return false; + } + break; + + case ISD::TargetGlobalAddress: + if (AM.BaseType == X86ISelAddressMode::RegBase && + AM.Base.Reg.Val == 0 && + AM.GV == 0) { + GlobalAddressSDNode *G = cast(N); + AM.GV = G->getGlobal(); + AM.Disp += G->getOffset(); + return false; + } + break; + + case ISD::TargetExternalSymbol: + if (isRoot && + AM.BaseType == X86ISelAddressMode::RegBase && + AM.Base.Reg.Val == 0) { + ExternalSymbolSDNode *S = cast(N.getOperand(0)); + AM.ES = S->getSymbol(); + return false; + } + break; + + case ISD::TargetJumpTable: + if (isRoot && + AM.BaseType == X86ISelAddressMode::RegBase && + AM.Base.Reg.Val == 0) { + JumpTableSDNode *J = cast(N.getOperand(0)); + AM.JT = J->getIndex(); + return false; + } + break; + case X86ISD::Wrapper: // If value is available in a register both base and index components have // been picked, we can't fit the result available in the register in the Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.296 llvm/lib/Target/X86/X86ISelLowering.cpp:1.297 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.296 Wed Nov 29 02:28:13 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Nov 29 17:19:46 2006 @@ -3829,11 +3829,11 @@ SDOperand X86TargetLowering::LowerConstantPool(SDOperand Op, SelectionDAG &DAG) { ConstantPoolSDNode *CP = cast(Op); - SDOperand Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), - DAG.getTargetConstantPool(CP->getConstVal(), - getPointerTy(), - CP->getAlignment())); + SDOperand Result = DAG.getTargetConstantPool(CP->getConstVal(), + getPointerTy(), + CP->getAlignment()); if (Subtarget->isTargetDarwin()) { + Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -3847,10 +3847,9 @@ SDOperand X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { GlobalValue *GV = cast(Op)->getGlobal(); - SDOperand Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), - DAG.getTargetGlobalAddress(GV, - getPointerTy())); + SDOperand Result = DAG.getTargetGlobalAddress(GV, getPointerTy()); if (Subtarget->isTargetDarwin()) { + Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -3866,6 +3865,7 @@ Subtarget->GVRequiresExtraLoad(GV, false)) Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result, NULL, 0); } else if (Subtarget->GVRequiresExtraLoad(GV, false)) { + Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result, NULL, 0); } @@ -3875,10 +3875,9 @@ SDOperand X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) { const char *Sym = cast(Op)->getSymbol(); - SDOperand Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), - DAG.getTargetExternalSymbol(Sym, - getPointerTy())); + SDOperand Result = DAG.getTargetExternalSymbol(Sym, getPointerTy()); if (Subtarget->isTargetDarwin()) { + Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) @@ -4244,10 +4243,9 @@ SDOperand X86TargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) { JumpTableSDNode *JT = cast(Op); - SDOperand Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), - DAG.getTargetJumpTable(JT->getIndex(), - getPointerTy())); + SDOperand Result = DAG.getTargetJumpTable(JT->getIndex(), getPointerTy()); if (Subtarget->isTargetDarwin()) { + Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result); // With PIC, the address is actually $g + Offset. if (!Subtarget->is64Bit() && getTargetMachine().getRelocationModel() == Reloc::PIC_) From evan.cheng at apple.com Wed Nov 29 17:46:41 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 17:46:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200611292346.kATNkfwl022420@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.131 -> 1.132 --- Log message: Clean up. --- Diffs of the changes: (+8 -8) X86ISelDAGToDAG.cpp | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.131 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.132 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.131 Wed Nov 29 17:19:45 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Nov 29 17:46:27 2006 @@ -643,11 +643,13 @@ // For X86-64 PIC code, only allow GV / CP + displacement so we can use RIP // relative addressing mode. - if ((!Subtarget->is64Bit() || TM.getCodeModel() == CodeModel::Small) && - (!Available || (AM.Base.Reg.Val && AM.IndexReg.Val))) { + if (Subtarget->is64Bit() && TM.getCodeModel() != CodeModel::Small) + break; + if (!Available || (AM.Base.Reg.Val && AM.IndexReg.Val)) { bool isRIP = Subtarget->is64Bit(); - if (isRIP && (AM.Base.Reg.Val || AM.Scale > 1 || AM.IndexReg.Val || - AM.BaseType == X86ISelAddressMode::FrameIndexBase)) + if (isRIP && + (AM.Base.Reg.Val || AM.Scale > 1 || AM.IndexReg.Val || + AM.BaseType == X86ISelAddressMode::FrameIndexBase)) break; if (ConstantPoolSDNode *CP = dyn_cast(N.getOperand(0))) { @@ -655,8 +657,7 @@ AM.CP = CP->getConstVal(); AM.Align = CP->getAlignment(); AM.Disp += CP->getOffset(); - if (isRIP) - AM.isRIPRel = true; + AM.isRIPRel = isRIP; return false; } } else if (GlobalAddressSDNode *G = @@ -664,8 +665,7 @@ if (AM.GV == 0) { AM.GV = G->getGlobal(); AM.Disp += G->getOffset(); - if (isRIP) - AM.isRIPRel = true; + AM.isRIPRel = isRIP; return false; } } else if (isRoot && isRIP) { From evan.cheng at apple.com Wed Nov 29 17:48:28 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 17:48:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200611292348.kATNmSX9022459@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.297 -> 1.298 --- Log message: In PIC mode, GV not requiring an extra load can be used as address immediate. --- Diffs of the changes: (+7 -14) X86ISelLowering.cpp | 21 +++++++-------------- 1 files changed, 7 insertions(+), 14 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.297 llvm/lib/Target/X86/X86ISelLowering.cpp:1.298 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.297 Wed Nov 29 17:19:46 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Nov 29 17:48:14 2006 @@ -4994,21 +4994,14 @@ } bool X86TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const { - // GV is 64-bit but displacement field is 32-bit unless we are in small code - // model. Mac OS X happens to support only small PIC code model. - // FIXME: better support for other OS's. - if (Subtarget->is64Bit() && !Subtarget->isTargetDarwin()) + // In 64-bit mode, GV is 64-bit so it won't fit in the 32-bit displacement + // field unless we are in small code model. + if (Subtarget->is64Bit() && + getTargetMachine().getCodeModel() != CodeModel::Small) return false; - if (Subtarget->isTargetDarwin()) { - Reloc::Model RModel = getTargetMachine().getRelocationModel(); - if (RModel == Reloc::Static) - return true; - else if (RModel == Reloc::DynamicNoPIC) - return !(Subtarget->GVRequiresExtraLoad(GV, false)); - else - return false; - } else - return true; + Reloc::Model RModel = getTargetMachine().getRelocationModel(); + return (RModel == Reloc::Static) || + !Subtarget->GVRequiresExtraLoad(GV, false); } /// isShuffleMaskLegal - Targets can use this to indicate that they only From evan.cheng at apple.com Wed Nov 29 17:48:52 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 29 Nov 2006 17:48:52 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/loop-strength-reduce2.ll Message-ID: <200611292348.kATNmqke022477@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: loop-strength-reduce2.ll added (r1.1) --- Log message: New LSR test case. --- Diffs of the changes: (+29 -0) loop-strength-reduce2.ll | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+) Index: llvm/test/Regression/CodeGen/X86/loop-strength-reduce2.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/loop-strength-reduce2.ll:1.1 *** /dev/null Wed Nov 29 17:48:47 2006 --- llvm/test/Regression/CodeGen/X86/loop-strength-reduce2.ll Wed Nov 29 17:48:37 2006 *************** *** 0 **** --- 1,29 ---- + ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic | not grep lea + ; + ; Make sure the PIC label flags2-"L1$pb" is not moved up to the preheader. + + %flags2 = internal global [8193 x sbyte] zeroinitializer, align 32 + + void %test(int %k, int %i) { + entry: + %i = bitcast int %i to uint + %k_addr.012 = shl int %i, ubyte 1 + %tmp14 = setgt int %k_addr.012, 8192 + br bool %tmp14, label %return, label %bb + + bb: + %indvar = phi uint [ 0, %entry ], [ %indvar.next, %bb ] + %tmp. = shl uint %i, ubyte 1 + %tmp.15 = mul uint %indvar, %i + %tmp.16 = add uint %tmp.15, %tmp. + %k_addr.0.0 = bitcast uint %tmp.16 to int + %tmp = getelementptr [8193 x sbyte]* %flags2, int 0, uint %tmp.16 + store sbyte 0, sbyte* %tmp + %k_addr.0 = add int %k_addr.0.0, %i + %tmp = setgt int %k_addr.0, 8192 + %indvar.next = add uint %indvar, 1 + br bool %tmp, label %return, label %bb + + return: + ret void + } From reid at x10sys.com Wed Nov 29 18:40:43 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 18:40:43 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/content1.php content2.php content3.php Message-ID: <200611300040.kAU0ehKt025000@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: content1.php updated: 1.3 -> 1.4 content2.php updated: 1.3 -> 1.4 content3.php updated: 1.3 -> 1.4 --- Log message: Fix some grammaros --- Diffs of the changes: (+3 -3) content1.php | 2 +- content2.php | 2 +- content3.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/poll/content1.php diff -u llvm-www/poll/content1.php:1.3 llvm-www/poll/content1.php:1.4 --- llvm-www/poll/content1.php:1.3 Wed Nov 29 14:23:27 2006 +++ llvm-www/poll/content1.php Wed Nov 29 18:40:28 2006 @@ -5,7 +5,7 @@ ** documentation file in folder 'docu'. *****************************************************/ $vote_title = 'First Content Choice'; - $vote_text = 'What would be you first choice for conference content?'; + $vote_text = 'What is your first choice for conference content?'; $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; Index: llvm-www/poll/content2.php diff -u llvm-www/poll/content2.php:1.3 llvm-www/poll/content2.php:1.4 --- llvm-www/poll/content2.php:1.3 Wed Nov 29 14:23:27 2006 +++ llvm-www/poll/content2.php Wed Nov 29 18:40:28 2006 @@ -5,7 +5,7 @@ ** documentation file in folder 'docu'. *****************************************************/ $vote_title = 'Second Content Choice'; - $vote_text = 'What would be you second choice for conference content?'; + $vote_text = 'What is your second choice for conference content?'; $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; Index: llvm-www/poll/content3.php diff -u llvm-www/poll/content3.php:1.3 llvm-www/poll/content3.php:1.4 --- llvm-www/poll/content3.php:1.3 Wed Nov 29 14:23:27 2006 +++ llvm-www/poll/content3.php Wed Nov 29 18:40:28 2006 @@ -5,7 +5,7 @@ ** documentation file in folder 'docu'. *****************************************************/ $vote_title = 'Third Content Choice'; - $vote_text = 'What would be you third choice for conference content?'; + $vote_text = 'What is your third choice for conference content?'; $vote_option[] = 'Paper/presentation on LLVM'; $vote_option[] = 'Paper/presentation on compiler technology'; $vote_option[] = 'Paper/Presentation on using LLVM'; From llvm at cs.uiuc.edu Wed Nov 29 19:35:48 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 29 Nov 2006 19:35:48 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/ Message-ID: <200611300135.kAU1Zmm0025811@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: --- Log message: Directory /var/cvs/llvm/llvm/tools/llvm-upgrade added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Wed Nov 29 16:10:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Nov 2006 16:10:48 -0600 Subject: [llvm-commits] CVS: llvm-www/poll/blue.gif voting.tpl.html Message-ID: <200611292210.kATMAmwY015884@zion.cs.uiuc.edu> Changes in directory llvm-www/poll: blue.gif added (r1.1) voting.tpl.html updated: 1.9 -> 1.10 --- Log message: Make the graph show up. --- Diffs of the changes: (+1 -1) blue.gif | 0 voting.tpl.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/poll/blue.gif Index: llvm-www/poll/voting.tpl.html diff -u llvm-www/poll/voting.tpl.html:1.9 llvm-www/poll/voting.tpl.html:1.10 --- llvm-www/poll/voting.tpl.html:1.9 Wed Nov 29 13:48:50 2006 +++ llvm-www/poll/voting.tpl.html Wed Nov 29 16:10:34 2006 @@ -25,7 +25,7 @@
      {vote_option}    {vote_number}    {relation} %