From baldrick at free.fr Mon Sep 17 03:59:53 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 Sep 2007 10:59:53 +0200
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 - in
/llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp varasm.c
In-Reply-To:
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
Message-ID: <200709171059.54888.baldrick@free.fr>
Hi Bill,
> >> Alias definitions aren't supported on some platforms. Create a
> >> flag (TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS) that indicates
> >> this and stops us from creating aliases.
> >
> > is doing this in the front-end really the right approach? If a
> > target doesn't
> > support aliases surely it is LLVM codegen that should complain or
> > ignore the
> > alias.
>
> It's debatable. I'm not 100% familiar with the "emit_alias_to_llvm()"
> function, but it seems to be modifying the generated LLVM bitcode to
> point to the new alias.
I've CC'd Anton since he's the one who knows all about this stuff. Presumably
when A is an alias for B there are two cases: either this is a "weak alias" or
weakref, meaning that at link time it may turn out that A wasn't an alias for
B after all, or A is a strong alias (a term I just invented) for B, meaning that
this is definitive: you can replace uses of A with uses of B everywhere. In the
first case linker support is required, but not in the second case, so presumably
it is wrong to turn off alias support in the second case. I don't know if your
patch turned this second case off or not.
In the first case (weakrefs) we output a special declaration to the bitcode
saying that A is a weak alias for B. I think it is a mistake not to output
this even for platforms like Darwin that don't handle weakrefs: such aliases
may be resolvable by LLVM, for example when linking modules using llvm-link.
Think also of running bitcode under lli. Thus there are some cases in which
weakrefs can work correctly even on Darwin.
Instead, I suggest we output a warning in the f-e that aliases are not supported,
but still generate the alias in the bitcode. Then we teach the code generators,
which presumably means the asm printer, to ignore aliases on Darwin.
On the other hand, not all bitcode is generated by llvm-gcc. It may be a bad
idea to have LLVM quietly ignore aliases on Darwin because of the potential
surprise and trouble it may create for front-end writers who aren't aware of
this.
> If so, then we need to stop it from doing
> that at that point, which is what my patch does.
>
> Also, I don't think there's anything that emits a warning in LLVM
> after the front-end generates the bitcode. I'm not excited about
> emitting warnings there now. :-)
>
> > Also, how does gcc handle aliases on Darwin? Either it succeeds in
> > outputting them somehow, in which case llvm-gcc should too, or it
> > rejects them
> > in which case there shouldn't be any need for a new flag - the info
> > that darwin
> > doesn't support aliases should exist in gcc already.
> >
> GCC ignores it. If you look at config/darwin.h, it emits a warning
> saying that it won't be doing anything with aliases.
Ciao,
Duncan.
From baldrick at free.fr Mon Sep 17 05:26:40 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 Sep 2007 10:26:40 -0000
Subject: [llvm-commits] [llvm] r42021 -
/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Message-ID: <200709171026.l8HAQfhV001699@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Sep 17 05:26:40 2007
New Revision: 42021
URL: http://llvm.org/viewvc/llvm-project?rev=42021&view=rev
Log:
Factor the trampoline transformation into a subroutine.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=42021&r1=42020&r2=42021&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 17 05:26:40 2007
@@ -235,6 +235,7 @@
private:
Instruction *visitCallSite(CallSite CS);
bool transformConstExprCastCall(CallSite CS);
+ Instruction *transformCallThroughTrampoline(CallSite CS);
public:
// InsertNewInstBefore - insert an instruction New before instruction Old
@@ -7834,6 +7835,11 @@
return EraseInstFromFunction(*CS.getInstruction());
}
+ if (BitCastInst *BC = dyn_cast(Callee))
+ if (IntrinsicInst *In = dyn_cast(BC->getOperand(0)))
+ if (In->getIntrinsicID() == Intrinsic::init_trampoline)
+ return transformCallThroughTrampoline(CS);
+
const PointerType *PTy = cast(Callee->getType());
const FunctionType *FTy = cast(PTy->getElementType());
if (FTy->isVarArg()) {
@@ -7852,143 +7858,6 @@
}
}
- if (BitCastInst *BC = dyn_cast(Callee)) {
- IntrinsicInst *In = dyn_cast(BC->getOperand(0));
- if (In && In->getIntrinsicID() == Intrinsic::init_trampoline) {
- Function *NestF =
- cast(IntrinsicInst::StripPointerCasts(In->getOperand(2)));
- const PointerType *NestFPTy = cast(NestF->getType());
- const FunctionType *NestFTy =
- cast(NestFPTy->getElementType());
-
- if (const ParamAttrsList *NestAttrs = NestFTy->getParamAttrs()) {
- unsigned NestIdx = 1;
- const Type *NestTy = 0;
- uint16_t NestAttr = 0;
-
- Instruction *Caller = CS.getInstruction();
-
- // Look for a parameter marked with the 'nest' attribute.
- for (FunctionType::param_iterator I = NestFTy->param_begin(),
- E = NestFTy->param_end(); I != E; ++NestIdx, ++I)
- if (NestAttrs->paramHasAttr(NestIdx, ParamAttr::Nest)) {
- // Record the parameter type and any other attributes.
- NestTy = *I;
- NestAttr = NestAttrs->getParamAttrs(NestIdx);
- break;
- }
-
- if (NestTy) {
- std::vector NewArgs;
- NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1);
-
- // Insert the nest argument into the call argument list, which may
- // mean appending it.
- {
- unsigned Idx = 1;
- CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
- do {
- if (Idx == NestIdx) {
- // Add the chain argument.
- Value *NestVal = In->getOperand(3);
- if (NestVal->getType() != NestTy)
- NestVal = new BitCastInst(NestVal, NestTy, "nest", Caller);
- NewArgs.push_back(NestVal);
- }
-
- if (I == E)
- break;
-
- // Add the original argument.
- NewArgs.push_back(*I);
-
- ++Idx, ++I;
- } while (1);
- }
-
- // The trampoline may have been bitcast to a bogus type (FTy).
- // Handle this by synthesizing a new function type, equal to FTy
- // with the chain parameter inserted. Likewise for attributes.
-
- const ParamAttrsList *Attrs = FTy->getParamAttrs();
- std::vector NewTypes;
- ParamAttrsVector NewAttrs;
- NewTypes.reserve(FTy->getNumParams()+1);
-
- // Add any function result attributes.
- uint16_t Attr = Attrs ? Attrs->getParamAttrs(0) : 0;
- if (Attr)
- NewAttrs.push_back (ParamAttrsWithIndex::get(0, Attr));
-
- // Insert the chain's type into the list of parameter types, which may
- // mean appending it. Likewise for the chain's attributes.
- {
- unsigned Idx = 1;
- FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end();
-
- do {
- if (Idx == NestIdx) {
- // Add the chain's type and attributes.
- NewTypes.push_back(NestTy);
- NewAttrs.push_back(ParamAttrsWithIndex::get(NestIdx, NestAttr));
- }
-
- if (I == E)
- break;
-
- // Add the original type and attributes.
- NewTypes.push_back(*I);
- Attr = Attrs ? Attrs->getParamAttrs(Idx) : 0;
- if (Attr)
- NewAttrs.push_back
- (ParamAttrsWithIndex::get(Idx + (Idx >= NestIdx), Attr));
-
- ++Idx, ++I;
- } while (1);
- }
-
- // Replace the trampoline call with a direct call. Let the generic
- // code sort out any function type mismatches.
- FunctionType *NewFTy =
- FunctionType::get(FTy->getReturnType(), NewTypes, FTy->isVarArg(),
- ParamAttrsList::get(NewAttrs));
- Constant *NewCallee = NestF->getType() == PointerType::get(NewFTy) ?
- NestF : ConstantExpr::getBitCast(NestF, PointerType::get(NewFTy));
-
- Instruction *NewCaller;
- if (InvokeInst *II = dyn_cast(Caller)) {
- NewCaller = new InvokeInst(NewCallee, II->getNormalDest(),
- II->getUnwindDest(), NewArgs.begin(),
- NewArgs.end(), Caller->getName(),
- Caller);
- cast(NewCaller)->setCallingConv(II->getCallingConv());
- } else {
- NewCaller = new CallInst(NewCallee, NewArgs.begin(), NewArgs.end(),
- Caller->getName(), Caller);
- if (cast(Caller)->isTailCall())
- cast(NewCaller)->setTailCall();
- cast(NewCaller)->
- setCallingConv(cast(Caller)->getCallingConv());
- }
- if (Caller->getType() != Type::VoidTy && !Caller->use_empty())
- Caller->replaceAllUsesWith(NewCaller);
- Caller->eraseFromParent();
- RemoveFromWorkList(Caller);
- return 0;
- }
- }
-
- // Replace the trampoline call with a direct call. Since there is no
- // 'nest' parameter, there is no need to adjust the argument list. Let
- // the generic code sort out any function type mismatches.
- Constant *NewCallee = NestF->getType() == PTy ?
- NestF : ConstantExpr::getBitCast(NestF, PTy);
- CS.setCalledFunction(NewCallee);
- Changed = true;
- }
- }
-
return Changed ? CS.getInstruction() : 0;
}
@@ -8191,6 +8060,148 @@
return true;
}
+// transformCallThroughTrampoline - Turn a call to a function created by the
+// init_trampoline intrinsic into a direct call to the underlying function.
+//
+Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
+ Value *Callee = CS.getCalledValue();
+ const PointerType *PTy = cast(Callee->getType());
+ const FunctionType *FTy = cast(PTy->getElementType());
+
+ IntrinsicInst *Tramp =
+ cast(cast(Callee)->getOperand(0));
+
+ Function *NestF =
+ cast(IntrinsicInst::StripPointerCasts(Tramp->getOperand(2)));
+ const PointerType *NestFPTy = cast(NestF->getType());
+ const FunctionType *NestFTy = cast(NestFPTy->getElementType());
+
+ if (const ParamAttrsList *NestAttrs = NestFTy->getParamAttrs()) {
+ unsigned NestIdx = 1;
+ const Type *NestTy = 0;
+ uint16_t NestAttr = 0;
+
+ // Look for a parameter marked with the 'nest' attribute.
+ for (FunctionType::param_iterator I = NestFTy->param_begin(),
+ E = NestFTy->param_end(); I != E; ++NestIdx, ++I)
+ if (NestAttrs->paramHasAttr(NestIdx, ParamAttr::Nest)) {
+ // Record the parameter type and any other attributes.
+ NestTy = *I;
+ NestAttr = NestAttrs->getParamAttrs(NestIdx);
+ break;
+ }
+
+ if (NestTy) {
+ Instruction *Caller = CS.getInstruction();
+ std::vector NewArgs;
+ NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1);
+
+ // Insert the nest argument into the call argument list, which may
+ // mean appending it.
+ {
+ unsigned Idx = 1;
+ CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
+ do {
+ if (Idx == NestIdx) {
+ // Add the chain argument.
+ Value *NestVal = Tramp->getOperand(3);
+ if (NestVal->getType() != NestTy)
+ NestVal = new BitCastInst(NestVal, NestTy, "nest", Caller);
+ NewArgs.push_back(NestVal);
+ }
+
+ if (I == E)
+ break;
+
+ // Add the original argument.
+ NewArgs.push_back(*I);
+
+ ++Idx, ++I;
+ } while (1);
+ }
+
+ // The trampoline may have been bitcast to a bogus type (FTy).
+ // Handle this by synthesizing a new function type, equal to FTy
+ // with the chain parameter inserted. Likewise for attributes.
+
+ const ParamAttrsList *Attrs = FTy->getParamAttrs();
+ std::vector NewTypes;
+ ParamAttrsVector NewAttrs;
+ NewTypes.reserve(FTy->getNumParams()+1);
+
+ // Add any function result attributes.
+ uint16_t Attr = Attrs ? Attrs->getParamAttrs(0) : 0;
+ if (Attr)
+ NewAttrs.push_back (ParamAttrsWithIndex::get(0, Attr));
+
+ // Insert the chain's type into the list of parameter types, which may
+ // mean appending it. Likewise for the chain's attributes.
+ {
+ unsigned Idx = 1;
+ FunctionType::param_iterator I = FTy->param_begin(),
+ E = FTy->param_end();
+
+ do {
+ if (Idx == NestIdx) {
+ // Add the chain's type and attributes.
+ NewTypes.push_back(NestTy);
+ NewAttrs.push_back(ParamAttrsWithIndex::get(NestIdx, NestAttr));
+ }
+
+ if (I == E)
+ break;
+
+ // Add the original type and attributes.
+ NewTypes.push_back(*I);
+ Attr = Attrs ? Attrs->getParamAttrs(Idx) : 0;
+ if (Attr)
+ NewAttrs.push_back
+ (ParamAttrsWithIndex::get(Idx + (Idx >= NestIdx), Attr));
+
+ ++Idx, ++I;
+ } while (1);
+ }
+
+ // Replace the trampoline call with a direct call. Let the generic
+ // code sort out any function type mismatches.
+ FunctionType *NewFTy =
+ FunctionType::get(FTy->getReturnType(), NewTypes, FTy->isVarArg(),
+ ParamAttrsList::get(NewAttrs));
+ Constant *NewCallee = NestF->getType() == PointerType::get(NewFTy) ?
+ NestF : ConstantExpr::getBitCast(NestF, PointerType::get(NewFTy));
+
+ Instruction *NewCaller;
+ if (InvokeInst *II = dyn_cast(Caller)) {
+ NewCaller = new InvokeInst(NewCallee,
+ II->getNormalDest(), II->getUnwindDest(),
+ NewArgs.begin(), NewArgs.end(),
+ Caller->getName(), Caller);
+ cast(NewCaller)->setCallingConv(II->getCallingConv());
+ } else {
+ NewCaller = new CallInst(NewCallee, NewArgs.begin(), NewArgs.end(),
+ Caller->getName(), Caller);
+ if (cast(Caller)->isTailCall())
+ cast(NewCaller)->setTailCall();
+ cast(NewCaller)->
+ setCallingConv(cast(Caller)->getCallingConv());
+ }
+ if (Caller->getType() != Type::VoidTy && !Caller->use_empty())
+ Caller->replaceAllUsesWith(NewCaller);
+ Caller->eraseFromParent();
+ RemoveFromWorkList(Caller);
+ return 0;
+ }
+ }
+
+ // Replace the trampoline call with a direct call. Since there is no 'nest'
+ // parameter, there is no need to adjust the argument list. Let the generic
+ // code sort out any function type mismatches.
+ Constant *NewCallee =
+ NestF->getType() == PTy ? NestF : ConstantExpr::getBitCast(NestF, PTy);
+ CS.setCalledFunction(NewCallee);
+ return CS.getInstruction();
+}
+
/// FoldPHIArgBinOpIntoPHI - If we have something like phi [add (a,b), add(c,d)]
/// and if a/b/c/d and the add's all have a single use, turn this into two phi's
/// and a single binop.
From baldrick at free.fr Mon Sep 17 05:29:56 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 Sep 2007 12:29:56 +0200
Subject: [llvm-commits] [llvm] r41844 -
/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
In-Reply-To:
References: <200709111435.l8BEZj3w032506@zion.cs.uiuc.edu>
Message-ID: <200709171229.58060.baldrick@free.fr>
Hi Chris,
> Nice! Can you please add a testcase?
I already did (Transforms/InstCombine/2007-09-11-Trampoline.ll).
> Also, can you please move the
> body of the transformation out of visitCallSite, so that you end up
> with something like this:
>
> if (BitCastInst *BC = dyn_cast(Callee)) {
> if (IntrinsicInst *In = dyn_cast(BC->getOperand(0)))
> if (In->getIntrinsicID() == Intrinsic::init_trampoline)
> if (Instruction *I = HandleCallThroughInitTrampoline(...))
> return I;
>
> in visitCallSite?
Done.
> Thanks work, I think the single intrinsic approach is much cleaner! :)
I thought of pushing this to mainline gcc, but I'm not sure they'll be interested.
Ciao,
Duncan.
From baldrick at free.fr Mon Sep 17 05:45:31 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 Sep 2007 12:45:31 +0200
Subject: [llvm-commits] Trampoline changes
In-Reply-To:
References: <200709090003.59557.baldrick@free.fr>
<200709091046.23869.baldrick@free.fr>
Message-ID: <200709171245.31771.baldrick@free.fr>
Hi Chris,
> > My hope was that some of these trampoline calls could be eliminated
> > using this optimization. But for
> > that to happen, the routines in the container library have to be
> > small enough to be inlined. They are
> > not. In fact they're rather small in terms of lines of code, but
> > exception handling etc really bulks
> > up the LLVM bitcode making the inliner pass them over.
>
> It would be pretty straight-forward to implement an IPO pass that
> turns trampoline pointers into fat pointers in cases like this.
that's a very interesting idea. It sounds hard to an LLVM minnow like
myself though :)
> It sounds like it could be a big win for the container library, because
> the container (if the routines get marked internal) would
> automatically be converted to take fat pointers, even if there are
> multiple different trampolines being passed in.
Yes, it would be pretty nice. But how feasible is it? Surely it will
only work well if we can find out all or at least most of the places that
the trampoline function pointer gets passed to. This requires effective
alias analysis, but currently alias analysis doesn't seem up to it. For
example, the use of exception handling blows away alias info (due to the
eh intrinsics using IntrWriteMem) but almost all Ada code has eh in it.
Likewise, the init_trampoline intrinsic itself blocks effective alias
analysis.
Best wishes,
Duncan.
From baldrick at free.fr Mon Sep 17 08:10:38 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 Sep 2007 15:10:38 +0200
Subject: [llvm-commits] [llvm] r42016 -
/llvm/trunk/lib/Analysis/IPA/Andersens.cpp
In-Reply-To: <200709162145.l8GLj3Bg001134@zion.cs.uiuc.edu>
References: <200709162145.l8GLj3Bg001134@zion.cs.uiuc.edu>
Message-ID: <200709171510.39213.baldrick@free.fr>
Hi,
> Rewrite of andersen's to be about 100x faster, cleaner, and begin to support field sensitivity
some nitpicking comments:
> +// without any issues. To wit, an indirect call Y(a,b) is equivalence to
equivalence -> equivalent
> STATISTIC(NumIters , "Number of iterations to reach convergence");
> STATISTIC(NumConstraints , "Number of constraints");
> STATISTIC(NumNodes , "Number of nodes");
> -STATISTIC(NumEscapingFunctions, "Number of internal functions that escape");
> -STATISTIC(NumIndirectCallees , "Number of indirect callees found");
> +STATISTIC(NumUnified , "Number of variables unified");
there are now a lot of pointless spaces here. How about aligning commas on the
end of NumConstraints?
> + /// Constraint - Objects of this structure are used to represent the various
> + /// constraints identified by the algorithm. The constraints are 'copy',
> + /// for statements like "A = B", 'load' for statements like "A = *B",
> + /// 'store' for statements like "*A = B", and AddressOf for statements like
> + /// A = alloca; The Offset is applied as *(A + K) = B for stores,
> + /// A = *(B + K) for loads, and A = B + K for copies. It is
> + /// illegal on addressof constraints (Because it is statically
Because -> because
Also, in this and other comments some lines are rather short, and I can't always see why
you break them early.
> + struct Node {
> + Value *Val;
> + SparseBitVector<> *Edges;
strange indentation of Val.
> + // compression. NodeRep gives the index into GraphNodes
> + // representative for this one.
Probably "the GraphNodes representative"
> + unsigned NodeRep; public:
shouldn't "public:" be on the next line?
> +
> + Node() : Val(0), Edges(0), PointsTo(0), OldPointsTo(0), Changed(false),
> + NodeRep(SelfRep) {
> + }
Closing } could follow the opening { on the previous line.
> + // Map from graph node to maximum K value that is allowed (For functions,
For -> for
> + // Stack for Tarjans
Tarjan's
> + // This may look a bit ugly, but what it does is allow us to process
> + // both store and load constraints with the same function.
with the same function -> within the same function (?)
> + // Need to increment the member by K since that is where we are
> + // supposed to copy to/from
Missing full stop.
> + // Node that in positive weight cycles, which occur in address taking
Node that -> Note that
Ciao,
Duncan.
From dberlin at dberlin.org Mon Sep 17 09:18:07 2007
From: dberlin at dberlin.org (Daniel Berlin)
Date: Mon, 17 Sep 2007 10:18:07 -0400
Subject: [llvm-commits] [llvm] r42016 -
/llvm/trunk/lib/Analysis/IPA/Andersens.cpp
In-Reply-To: <200709171510.39213.baldrick@free.fr>
References: <200709162145.l8GLj3Bg001134@zion.cs.uiuc.edu>
<200709171510.39213.baldrick@free.fr>
Message-ID: <4aca3dc20709170718m1689ee77odd443fc89bf73a90@mail.gmail.com>
On 9/17/07, Duncan Sands wrote:
> Hi,
>
> > Rewrite of andersen's to be about 100x faster, cleaner, and begin to support field sensitivity
>
> some nitpicking comments:
>
> > +// without any issues. To wit, an indirect call Y(a,b) is equivalence to
>
> equivalence -> equivalent
Fixed
>
> > STATISTIC(NumIters , "Number of iterations to reach convergence");
> > STATISTIC(NumConstraints , "Number of constraints");
> > STATISTIC(NumNodes , "Number of nodes");
> > -STATISTIC(NumEscapingFunctions, "Number of internal functions that escape");
> > -STATISTIC(NumIndirectCallees , "Number of indirect callees found");
> > +STATISTIC(NumUnified , "Number of variables unified");
>
> there are now a lot of pointless spaces here. How about aligning commas on the
> end of NumConstraints?
Sure
>
> > + /// Constraint - Objects of this structure are used to represent the various
> > + /// constraints identified by the algorithm. The constraints are 'copy',
> > + /// for statements like "A = B", 'load' for statements like "A = *B",
> > + /// 'store' for statements like "*A = B", and AddressOf for statements like
> > + /// A = alloca; The Offset is applied as *(A + K) = B for stores,
> > + /// A = *(B + K) for loads, and A = B + K for copies. It is
> > + /// illegal on addressof constraints (Because it is statically
>
> Because -> because
Fixed
>
> Also, in this and other comments some lines are rather short, and I can't always see why
> you break them early.
I just do whatever emacs fill-paragraph does. I'll rerun it on the comments :)
>
> > + struct Node {
> > + Value *Val;
> > + SparseBitVector<> *Edges;
>
> strange indentation of Val.
Fixed
>
> > + // compression. NodeRep gives the index into GraphNodes
> > + // representative for this one.
>
> Probably "the GraphNodes representative"
Fixed
>
> > + unsigned NodeRep; public:
>
> shouldn't "public:" be on the next line?
>
Fixed
> > +
> > + Node() : Val(0), Edges(0), PointsTo(0), OldPointsTo(0), Changed(false),
> > + NodeRep(SelfRep) {
> > + }
>
> Closing } could follow the opening { on the previous line.
Fixed
>
> > + // Map from graph node to maximum K value that is allowed (For functions,
>
> For -> for
Fixed
>
> > + // Stack for Tarjans
>
> Tarjan's
Fixed
> + // This may look a bit ugly, but what it does is allow us to process
> > + // both store and load constraints with the same function.
>
> with the same function -> within the same function (?)
No. It really should be "with the same code"
> > + // Need to increment the member by K since that is where we are
> > + // supposed to copy to/from
>
> Missing full stop.
Fixed
>
> > + // Node that in positive weight cycles, which occur in address taking
>
> Node that -> Note that
Fixed.
Thanks!
I have something that spell checks comments, but not something that
grammar checks them, so these things are always helpful :)
From djg at cray.com Mon Sep 17 09:35:24 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 14:35:24 -0000
Subject: [llvm-commits] [llvm] r42024 - in /llvm/trunk:
lib/Target/X86/X86InstrX86-64.td test/CodeGen/X86/cmp0.ll
Message-ID: <200709171435.l8HEZOul009279@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 09:35:24 2007
New Revision: 42024
URL: http://llvm.org/viewvc/llvm-project?rev=42024&view=rev
Log:
Use "test reg,reg" in place of "cmp reg,0" for 64-bit operands. This was
previously only done for 32-bit and smaller operands.
Added:
llvm/trunk/test/CodeGen/X86/cmp0.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrX86-64.td
Modified: llvm/trunk/lib/Target/X86/X86InstrX86-64.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrX86-64.td?rev=42024&r1=42023&r2=42024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrX86-64.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrX86-64.td Mon Sep 17 09:35:24 2007
@@ -1076,6 +1076,12 @@
def : Pat<(X86tailcall GR64:$dst),
(CALL64r GR64:$dst)>;
+// Comparisons.
+
+// TEST R,R is smaller than CMP R,0
+def : Pat<(X86cmp GR64:$src1, 0),
+ (TEST64rr GR64:$src1, GR64:$src1)>;
+
// {s|z}extload bool -> {s|z}extload byte
def : Pat<(sextloadi64i1 addr:$src), (MOVSX64rm8 addr:$src)>;
def : Pat<(zextloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
Added: llvm/trunk/test/CodeGen/X86/cmp0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmp0.ll?rev=42024&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cmp0.ll (added)
+++ llvm/trunk/test/CodeGen/X86/cmp0.ll Mon Sep 17 09:35:24 2007
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep -v cmp
+
+define i64 @foo(i64 %x) {
+ %t = icmp eq i64 %x, 0
+ %r = zext i1 %t to i64
+ ret i64 %r
+}
From djg at cray.com Mon Sep 17 09:49:27 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 14:49:27 -0000
Subject: [llvm-commits] [llvm] r42026 - in /llvm/trunk:
lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/cmp1.ll
Message-ID: <200709171449.l8HEnRvR009707@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 09:49:27 2007
New Revision: 42026
URL: http://llvm.org/viewvc/llvm-project?rev=42026&view=rev
Log:
Emit integer x<1 as x<=0, as comparisons with zero (now includeing
64-bit) can use test instead of cmp with an immediate.
Added:
llvm/trunk/test/CodeGen/X86/cmp1.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=42026&r1=42025&r2=42026&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 17 09:49:27 2007
@@ -1546,6 +1546,11 @@
// X < 0 -> X == 0, jump on sign.
X86CC = X86::COND_S;
return true;
+ } else if (SetCCOpcode == ISD::SETLT && RHSC->getValue() == 1) {
+ // X < 1 -> X <= 0
+ RHS = DAG.getConstant(0, RHS.getValueType());
+ X86CC = X86::COND_LE;
+ return true;
}
}
Added: llvm/trunk/test/CodeGen/X86/cmp1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmp1.ll?rev=42026&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cmp1.ll (added)
+++ llvm/trunk/test/CodeGen/X86/cmp1.ll Mon Sep 17 09:49:27 2007
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep -v cmp
+
+define i64 @foo(i64 %x) {
+ %t = icmp slt i64 %x, 1
+ %r = zext i1 %t to i64
+ ret i64 %r
+}
From djg at cray.com Mon Sep 17 09:55:08 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 14:55:08 -0000
Subject: [llvm-commits] [llvm] r42027 -
/llvm/trunk/lib/Target/X86/X86InstrX86-64.td
Message-ID: <200709171455.l8HEt8p8009857@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 09:55:08 2007
New Revision: 42027
URL: http://llvm.org/viewvc/llvm-project?rev=42027&view=rev
Log:
Use xorl instead of xorq to enter a zero into a 64-bit register.
Modified:
llvm/trunk/lib/Target/X86/X86InstrX86-64.td
Modified: llvm/trunk/lib/Target/X86/X86InstrX86-64.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrX86-64.td?rev=42027&r1=42026&r2=42027&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrX86-64.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrX86-64.td Mon Sep 17 09:55:08 2007
@@ -1018,13 +1018,15 @@
[(set GR64:$dst, (zextloadi64i32 addr:$src))]>;
-// Alias instructions that map movr0 to xor.
+// Alias instructions that map movr0 to xor. Use xorl instead of xorq; it's
+// equivalent due to implicit zero-extending, and it sometimes has a smaller
+// encoding.
// FIXME: remove when we can teach regalloc that xor reg, reg is ok.
// FIXME: AddedComplexity gives MOV64r0 a higher priority than MOV64ri32. Remove
// when we have a better way to specify isel priority.
let Defs = [EFLAGS], AddedComplexity = 1, isReMaterializable = 1 in
def MOV64r0 : RI<0x31, MRMInitReg, (outs GR64:$dst), (ins),
- "xor{q}\t$dst, $dst",
+ "xor{l}\t${dst:subreg32}, ${dst:subreg32}",
[(set GR64:$dst, 0)]>;
// Materialize i64 constant where top 32-bits are zero.
From djg at cray.com Mon Sep 17 10:19:08 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 15:19:08 -0000
Subject: [llvm-commits] [llvm] r42029 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Message-ID: <200709171519.l8HFJ8k2010460@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 10:19:08 2007
New Revision: 42029
URL: http://llvm.org/viewvc/llvm-project?rev=42029&view=rev
Log:
Add 64-bit jmp instructions to the list of instructions that
can terminate a block with no fall-through.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=42029&r1=42028&r2=42029&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Sep 17 10:19:08 2007
@@ -582,7 +582,9 @@
case X86::TAILJMPm:
case X86::JMP: // Uncond branch.
case X86::JMP32r: // Indirect branch.
+ case X86::JMP64r: // Indirect branch (64-bit).
case X86::JMP32m: // Indirect branch through mem.
+ case X86::JMP64m: // Indirect branch through mem (64-bit).
return true;
default: return false;
}
From gordonhenriksen at mac.com Mon Sep 17 12:04:45 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Mon, 17 Sep 2007 17:04:45 -0000
Subject: [llvm-commits] [llvm] r42032 - /llvm/trunk/CREDITS.TXT
Message-ID: <200709171704.l8HH4jFB017211@zion.cs.uiuc.edu>
Author: gordon
Date: Mon Sep 17 12:04:44 2007
New Revision: 42032
URL: http://llvm.org/viewvc/llvm-project?rev=42032&view=rev
Log:
Adding myself to credits.
Modified:
llvm/trunk/CREDITS.TXT
Modified: llvm/trunk/CREDITS.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CREDITS.TXT?rev=42032&r1=42031&r2=42032&view=diff
==============================================================================
--- llvm/trunk/CREDITS.TXT (original)
+++ llvm/trunk/CREDITS.TXT Mon Sep 17 12:04:44 2007
@@ -106,6 +106,10 @@
D: Miscellaneous bug fixes
D: Register allocation refactoring
+N: Gordon Henriksen
+E: gordonhenriksen at mac.com
+D: C interface
+
N: Raul Fernandes Herbster
E: raul at dsc.ufcg.edu.br
D: JIT support for ARM
From djg at cray.com Mon Sep 17 12:31:57 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 17:31:57 -0000
Subject: [llvm-commits] [llvm] r42035 - in /llvm/trunk:
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/srem.ll test/Transforms/InstCombine/urem.ll
Message-ID: <200709171731.l8HHVvEp020169@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 12:31:57 2007
New Revision: 42035
URL: http://llvm.org/viewvc/llvm-project?rev=42035&view=rev
Log:
Instcombine x-((x/y)*y) into a remainder operator.
Added:
llvm/trunk/test/Transforms/InstCombine/srem.ll
llvm/trunk/test/Transforms/InstCombine/urem.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=42035&r1=42034&r2=42035&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 17 12:31:57 2007
@@ -2257,6 +2257,17 @@
Constant *CP1 = Subtract(ConstantInt::get(I.getType(), 1), C2);
return BinaryOperator::createMul(Op0, CP1);
}
+
+ // X - ((X / Y) * Y) --> X % Y
+ if (Op1I->getOpcode() == Instruction::Mul)
+ if (Instruction *I = dyn_cast(Op1I->getOperand(0)))
+ if (Op0 == I->getOperand(0) &&
+ Op1I->getOperand(1) == I->getOperand(1)) {
+ if (I->getOpcode() == Instruction::SDiv)
+ return BinaryOperator::createSRem(Op0, Op1I->getOperand(1));
+ if (I->getOpcode() == Instruction::UDiv)
+ return BinaryOperator::createURem(Op0, Op1I->getOperand(1));
+ }
}
}
@@ -2902,7 +2913,7 @@
/// getICmpValue - This is the complement of getICmpCode, which turns an
/// opcode and two operands into either a constant true or false, or a brand
-/// new /// ICmp instruction. The sign is passed in to determine which kind
+/// new ICmp instruction. The sign is passed in to determine which kind
/// of predicate to use in new icmp instructions.
static Value *getICmpValue(bool sign, unsigned code, Value *LHS, Value *RHS) {
switch (code) {
Added: llvm/trunk/test/Transforms/InstCombine/srem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/srem.ll?rev=42035&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/srem.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/srem.ll Mon Sep 17 12:31:57 2007
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep srem
+
+define i64 @foo(i64 %x1, i64 %y2) {
+ %r = sdiv i64 %x1, %y2
+ %r7 = mul i64 %r, %y2
+ %r8 = sub i64 %x1, %r7
+ ret i64 %r8
+}
Added: llvm/trunk/test/Transforms/InstCombine/urem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/urem.ll?rev=42035&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/urem.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/urem.ll Mon Sep 17 12:31:57 2007
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep urem
+
+define i64 @rem_unsigned(i64 %x1, i64 %y2) {
+ %r = udiv i64 %x1, %y2
+ %r7 = mul i64 %r, %y2
+ %r8 = sub i64 %x1, %r7
+ ret i64 %r8
+}
From sabre at nondot.org Mon Sep 17 12:40:48 2007
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 17 Sep 2007 17:40:48 -0000
Subject: [llvm-commits] [llvm] r42036 - in /llvm/trunk/utils/TableGen:
FileLexer.cpp.cvs FileParser.cpp.cvs FileParser.h.cvs
Message-ID: <200709171740.l8HHenXn021610@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Sep 17 12:40:48 2007
New Revision: 42036
URL: http://llvm.org/viewvc/llvm-project?rev=42036&view=rev
Log:
regenerate
Modified:
llvm/trunk/utils/TableGen/FileLexer.cpp.cvs
llvm/trunk/utils/TableGen/FileParser.cpp.cvs
llvm/trunk/utils/TableGen/FileParser.h.cvs
Modified: llvm/trunk/utils/TableGen/FileLexer.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FileLexer.cpp.cvs?rev=42036&r1=42035&r2=42036&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/FileLexer.cpp.cvs (original)
+++ llvm/trunk/utils/TableGen/FileLexer.cpp.cvs Mon Sep 17 12:40:48 2007
@@ -21,7 +21,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header$
+ * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
*/
#define FLEX_SCANNER
@@ -502,7 +502,7 @@
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#define INITIAL 0
/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
//
@@ -520,7 +520,7 @@
#define YY_NEVER_INTERACTIVE 1
#define comment 1
-#line 30 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#include "llvm/Config/config.h"
#include "llvm/Support/Streams.h"
#include "Record.h"
@@ -817,7 +817,7 @@
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 185 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#line 824 "Lexer.cpp"
@@ -913,185 +913,185 @@
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
-#line 187 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 187 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ /* Ignore comments */ }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 189 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ HandleInclude(yytext); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 190 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
return CODEFRAGMENT; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 193 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return INT; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 194 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return BIT; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 195 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 195 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return BITS; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 196 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return STRING; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 197 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return LIST; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 198 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CODE; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 199 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DAG; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 201 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 201 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CLASS; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 202 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DEF; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 203 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DEFM; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 204 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return MULTICLASS; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 205 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return FIELD; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 206 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 206 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return LET; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 207 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return IN; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 209 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CONCATTOK; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 210 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRATOK; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 211 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 211 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRLTOK; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 212 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SHLTOK; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 213 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return STRCONCATTOK; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 216 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
return ID; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 218 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
return VARNAME; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 221 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
return STRVAL; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 224 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 226 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ /* Ignore whitespace */ }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 229 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ BEGIN(comment); CommentDepth++; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 230 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat anything that's not a '*' or '/' */
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 231 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up '*'s not followed by '/'s */
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 232 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 232 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ ++CommentDepth; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 233 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up /'s not followed by *'s */
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 234 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 234 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ if (!--CommentDepth) { BEGIN(INITIAL); } }
YY_BREAK
case YY_STATE_EOF(comment):
-#line 235 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 235 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ err() << "Unterminated comment!\n"; exit(1); }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 237 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 237 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return Filetext[0]; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1098 "Lexer.cpp"
@@ -1978,6 +1978,6 @@
return 0;
}
#endif
-#line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
Modified: llvm/trunk/utils/TableGen/FileParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FileParser.cpp.cvs?rev=42036&r1=42035&r2=42036&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/FileParser.cpp.cvs (original)
+++ llvm/trunk/utils/TableGen/FileParser.cpp.cvs Mon Sep 17 12:40:48 2007
@@ -1,134 +1,42 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y
+ by GNU Bison version 1.28 */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+#define YYBISON 1 /* Identify Bison output. */
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton 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.3"
-
-/* 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 Fileparse
-#define yylex Filelex
+#define yylex Filelex
#define yyerror Fileerror
-#define yylval Filelval
-#define yychar Filechar
+#define yylval Filelval
+#define yychar Filechar
#define yydebug Filedebug
#define yynerrs Filenerrs
+#define INT 257
+#define BIT 258
+#define STRING 259
+#define BITS 260
+#define LIST 261
+#define CODE 262
+#define DAG 263
+#define CLASS 264
+#define DEF 265
+#define MULTICLASS 266
+#define DEFM 267
+#define FIELD 268
+#define LET 269
+#define IN 270
+#define CONCATTOK 271
+#define SHLTOK 272
+#define SRATOK 273
+#define SRLTOK 274
+#define STRCONCATTOK 275
+#define INTVAL 276
+#define ID 277
+#define VARNAME 278
+#define STRVAL 279
+#define CODEFRAGMENT 280
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- INT = 258,
- BIT = 259,
- STRING = 260,
- BITS = 261,
- LIST = 262,
- CODE = 263,
- DAG = 264,
- CLASS = 265,
- DEF = 266,
- MULTICLASS = 267,
- DEFM = 268,
- FIELD = 269,
- LET = 270,
- IN = 271,
- SHLTOK = 272,
- SRATOK = 273,
- SRLTOK = 274,
- STRCONCATTOK = 275,
- INTVAL = 276,
- ID = 277,
- VARNAME = 278,
- STRVAL = 279,
- CODEFRAGMENT = 280
- };
-#endif
-/* Tokens. */
-#define INT 258
-#define BIT 259
-#define STRING 260
-#define BITS 261
-#define LIST 262
-#define CODE 263
-#define DAG 264
-#define CLASS 265
-#define DEF 266
-#define MULTICLASS 267
-#define DEFM 268
-#define FIELD 269
-#define LET 270
-#define IN 271
-#define SHLTOK 272
-#define SRATOK 273
-#define SRLTOK 274
-#define STRCONCATTOK 275
-#define INTVAL 276
-#define ID 277
-#define VARNAME 278
-#define STRVAL 279
-#define CODEFRAGMENT 280
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 14 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+#line 14 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
#include "Record.h"
#include "llvm/ADT/StringExtras.h"
@@ -324,29 +232,8 @@
using namespace llvm;
-
-/* 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 union YYSTYPE
-#line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
-{
+#line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+typedef union {
std::string* StrVal;
int IntVal;
llvm::RecTy* Ty;
@@ -358,1195 +245,575 @@
SubClassRefTy* SubClassRef;
std::vector* SubClassList;
std::vector >* DagValueList;
-}
-/* Line 193 of yacc.c. */
-#line 364 "FileParser.tab.c"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+} YYSTYPE;
+#include
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
-/* Copy the second part of user declarations. */
+#define YYFINAL 194
+#define YYFLAG -32768
+#define YYNTBASE 42
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 280 ? yytranslate[x] : 91)
+
+static const 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, 36,
+ 37, 2, 2, 38, 40, 35, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 39, 41, 27,
+ 29, 28, 30, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 33, 2, 34, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 31, 2, 32, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
+};
-/* Line 216 of yacc.c. */
-#line 377 "FileParser.tab.c"
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 6, 11, 13, 18, 20, 22, 24,
+ 25, 27, 28, 31, 33, 35, 37, 39, 41, 43,
+ 47, 52, 57, 61, 65, 70, 75, 82, 89, 96,
+ 103, 110, 111, 114, 117, 122, 123, 125, 127, 131,
+ 134, 138, 144, 149, 151, 152, 156, 157, 159, 161,
+ 165, 170, 173, 180, 181, 184, 186, 190, 192, 197,
+ 199, 203, 204, 207, 209, 213, 217, 218, 220, 222,
+ 223, 225, 227, 229, 230, 234, 235, 236, 243, 247,
+ 249, 251, 254, 256, 257, 258, 267, 268, 275, 277,
+ 279, 281, 283, 288, 290, 294, 295, 300, 305, 308,
+ 310, 313
+};
-#ifdef short
-# undef short
-#endif
+static const short yyrhs[] = { 23,
+ 0, 5, 0, 4, 0, 6, 27, 22, 28, 0,
+ 3, 0, 7, 27, 43, 28, 0, 8, 0, 9,
+ 0, 42, 0, 0, 14, 0, 0, 29, 47, 0,
+ 23, 0, 46, 0, 22, 0, 25, 0, 26, 0,
+ 30, 0, 31, 54, 32, 0, 23, 27, 55, 28,
+ 0, 47, 31, 52, 32, 0, 33, 54, 34, 0,
+ 47, 35, 23, 0, 36, 46, 50, 37, 0, 47,
+ 33, 52, 34, 0, 17, 36, 47, 38, 47, 37,
+ 0, 18, 36, 47, 38, 47, 37, 0, 19, 36,
+ 47, 38, 47, 37, 0, 20, 36, 47, 38, 47,
+ 37, 0, 21, 36, 47, 38, 47, 37, 0, 0,
+ 39, 24, 0, 47, 48, 0, 49, 38, 47, 48,
+ 0, 0, 49, 0, 22, 0, 22, 40, 22, 0,
+ 22, 22, 0, 51, 38, 22, 0, 51, 38, 22,
+ 40, 22, 0, 51, 38, 22, 22, 0, 51, 0,
+ 0, 31, 52, 32, 0, 0, 55, 0, 47, 0,
+ 55, 38, 47, 0, 44, 43, 23, 45, 0, 56,
+ 41, 0, 15, 23, 53, 29, 47, 41, 0, 0,
+ 58, 57, 0, 41, 0, 31, 58, 32, 0, 42,
+ 0, 42, 27, 55, 28, 0, 60, 0, 61, 38,
+ 60, 0, 0, 39, 61, 0, 56, 0, 63, 38,
+ 56, 0, 27, 63, 28, 0, 0, 64, 0, 23,
+ 0, 0, 66, 0, 67, 0, 67, 0, 0, 62,
+ 71, 59, 0, 0, 0, 10, 68, 73, 65, 74,
+ 70, 0, 11, 69, 70, 0, 75, 0, 76, 0,
+ 77, 76, 0, 23, 0, 0, 0, 12, 78, 80,
+ 65, 81, 31, 77, 32, 0, 0, 13, 23, 83,
+ 39, 60, 41, 0, 72, 0, 75, 0, 79, 0,
+ 82, 0, 23, 53, 29, 47, 0, 85, 0, 86,
+ 38, 85, 0, 0, 15, 88, 86, 16, 0, 87,
+ 31, 89, 32, 0, 87, 84, 0, 84, 0, 89,
+ 84, 0, 89, 0
+};
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 246, 268, 270, 272, 274, 276, 278, 280, 282, 286,
+ 286, 288, 288, 290, 313, 315, 317, 320, 323, 325,
+ 338, 366, 373, 376, 383, 386, 394, 396, 398, 400,
+ 402, 406, 409, 413, 418, 424, 427, 430, 433, 446,
+ 460, 462, 475, 491, 493, 493, 497, 499, 503, 506,
+ 510, 527, 529, 535, 535, 536, 536, 538, 540, 544,
+ 549, 554, 557, 561, 564, 569, 570, 570, 572, 572,
+ 574, 581, 599, 624, 638, 643, 645, 647, 651, 661,
+ 675, 678, 682, 693, 695, 697, 702, 702, 776, 776,
+ 777, 777, 779, 784, 784, 787, 787, 790, 793, 797,
+ 797, 799
+};
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-# define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# else
-# define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#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
-
-/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
-#endif
-{
- return i;
-}
+static const char * const yytname[] = { "$","error","$undefined.","INT","BIT",
+"STRING","BITS","LIST","CODE","DAG","CLASS","DEF","MULTICLASS","DEFM","FIELD",
+"LET","IN","CONCATTOK","SHLTOK","SRATOK","SRLTOK","STRCONCATTOK","INTVAL","ID",
+"VARNAME","STRVAL","CODEFRAGMENT","'<'","'>'","'='","'?'","'{'","'}'","'['",
+"']'","'.'","'('","')'","','","':'","'-'","';'","ClassID","Type","OptPrefix",
+"OptValue","IDValue","Value","OptVarName","DagArgListNE","DagArgList","RBitList",
+"BitList","OptBitList","ValueList","ValueListNE","Declaration","BodyItem","BodyList",
+"Body","SubClassRef","ClassListNE","ClassList","DeclListNE","TemplateArgList",
+"OptTemplateArgList","OptID","ObjectName","ClassName","DefName","ObjectBody",
+"@1","ClassInst","@2","@3","DefInst","MultiClassDef","MultiClassBody","MultiClassName",
+"MultiClassInst","@4","@5","DefMInst","@6","Object","LETItem","LETList","LETCommand",
+"@7","ObjectList","File", NULL
+};
#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
-# elif defined __BUILTIN_VA_ARG_INCR
-# include /* INFRINGES ON USER NAME SPACE */
-# elif defined _AIX
-# define YYSTACK_ALLOC __alloca
-# elif defined _MSC_VER
-# include /* INFRINGES ON USER NAME SPACE */
-# define alloca _alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
- && ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
-# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# 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
-{
- yytype_int16 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 (yytype_int16) + 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 (YYID (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 (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 27
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 204
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 41
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 50
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 102
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 188
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 280
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const yytype_uint8 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,
- 35, 36, 2, 2, 37, 39, 34, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 38, 40,
- 26, 28, 27, 29, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 32, 2, 33, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 30, 2, 31, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 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
+static const short yyr1[] = { 0,
+ 42, 43, 43, 43, 43, 43, 43, 43, 43, 44,
+ 44, 45, 45, 46, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 48, 48, 49, 49, 50, 50, 51, 51, 51,
+ 51, 51, 51, 52, 53, 53, 54, 54, 55, 55,
+ 56, 57, 57, 58, 58, 59, 59, 60, 60, 61,
+ 61, 62, 62, 63, 63, 64, 65, 65, 66, 66,
+ 67, 68, 69, 71, 70, 73, 74, 72, 75, 76,
+ 77, 77, 78, 80, 81, 79, 83, 82, 84, 84,
+ 84, 84, 85, 86, 86, 88, 87, 84, 84, 89,
+ 89, 90
};
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint16 yyprhs[] =
-{
- 0, 0, 3, 5, 7, 9, 14, 16, 21, 23,
- 25, 27, 28, 30, 31, 34, 36, 38, 40, 42,
- 44, 46, 50, 55, 60, 64, 68, 73, 78, 85,
- 92, 99, 106, 107, 110, 113, 118, 119, 121, 123,
- 127, 130, 134, 140, 145, 147, 148, 152, 153, 155,
- 157, 161, 166, 169, 176, 177, 180, 182, 186, 188,
- 193, 195, 199, 200, 203, 205, 209, 213, 214, 216,
- 218, 219, 221, 223, 225, 226, 230, 231, 232, 239,
- 243, 245, 247, 250, 252, 253, 254, 263, 264, 271,
- 273, 275, 277, 279, 284, 286, 290, 291, 296, 301,
- 304, 306, 309
+static const short yyr2[] = { 0,
+ 1, 1, 1, 4, 1, 4, 1, 1, 1, 0,
+ 1, 0, 2, 1, 1, 1, 1, 1, 1, 3,
+ 4, 4, 3, 3, 4, 4, 6, 6, 6, 6,
+ 6, 0, 2, 2, 4, 0, 1, 1, 3, 2,
+ 3, 5, 4, 1, 0, 3, 0, 1, 1, 3,
+ 4, 2, 6, 0, 2, 1, 3, 1, 4, 1,
+ 3, 0, 2, 1, 3, 3, 0, 1, 1, 0,
+ 1, 1, 1, 0, 3, 0, 0, 6, 3, 1,
+ 1, 2, 1, 0, 0, 8, 0, 6, 1, 1,
+ 1, 1, 4, 1, 3, 0, 4, 4, 2, 1,
+ 2, 1
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 90, 0, -1, 22, -1, 5, -1, 4, -1, 6,
- 26, 21, 27, -1, 3, -1, 7, 26, 43, 27,
- -1, 8, -1, 9, -1, 42, -1, -1, 14, -1,
- -1, 28, 47, -1, 22, -1, 46, -1, 21, -1,
- 24, -1, 25, -1, 29, -1, 30, 54, 31, -1,
- 22, 26, 55, 27, -1, 47, 30, 52, 31, -1,
- 32, 54, 33, -1, 47, 34, 22, -1, 35, 46,
- 50, 36, -1, 47, 32, 52, 33, -1, 17, 35,
- 47, 37, 47, 36, -1, 18, 35, 47, 37, 47,
- 36, -1, 19, 35, 47, 37, 47, 36, -1, 20,
- 35, 47, 37, 47, 36, -1, -1, 38, 23, -1,
- 47, 48, -1, 49, 37, 47, 48, -1, -1, 49,
- -1, 21, -1, 21, 39, 21, -1, 21, 21, -1,
- 51, 37, 21, -1, 51, 37, 21, 39, 21, -1,
- 51, 37, 21, 21, -1, 51, -1, -1, 30, 52,
- 31, -1, -1, 55, -1, 47, -1, 55, 37, 47,
- -1, 44, 43, 22, 45, -1, 56, 40, -1, 15,
- 22, 53, 28, 47, 40, -1, -1, 58, 57, -1,
- 40, -1, 30, 58, 31, -1, 42, -1, 42, 26,
- 55, 27, -1, 60, -1, 61, 37, 60, -1, -1,
- 38, 61, -1, 56, -1, 63, 37, 56, -1, 26,
- 63, 27, -1, -1, 64, -1, 22, -1, -1, 66,
- -1, 67, -1, 67, -1, -1, 62, 71, 59, -1,
- -1, -1, 10, 68, 73, 65, 74, 70, -1, 11,
- 69, 70, -1, 75, -1, 76, -1, 77, 76, -1,
- 22, -1, -1, -1, 12, 78, 80, 65, 81, 30,
- 77, 31, -1, -1, 13, 22, 83, 38, 60, 40,
- -1, 72, -1, 75, -1, 79, -1, 82, -1, 22,
- 53, 28, 47, -1, 85, -1, 86, 37, 85, -1,
- -1, 15, 88, 86, 16, -1, 87, 30, 89, 31,
- -1, 87, 84, -1, 84, -1, 89, 84, -1, 89,
- -1
+static const short yydefact[] = { 0,
+ 70, 70, 0, 0, 96, 89, 90, 91, 92, 100,
+ 0, 102, 69, 71, 72, 76, 73, 62, 83, 84,
+ 87, 0, 0, 99, 101, 67, 0, 74, 79, 67,
+ 0, 45, 94, 0, 0, 10, 68, 77, 1, 58,
+ 60, 63, 0, 85, 0, 0, 0, 97, 0, 98,
+ 11, 0, 64, 0, 62, 0, 0, 54, 56, 75,
+ 0, 0, 38, 44, 0, 0, 95, 5, 3, 2,
+ 0, 0, 7, 8, 9, 0, 66, 10, 78, 0,
+ 0, 0, 0, 0, 16, 14, 17, 18, 19, 47,
+ 47, 0, 15, 49, 0, 61, 10, 0, 88, 40,
+ 0, 0, 46, 93, 0, 0, 12, 65, 0, 0,
+ 0, 0, 0, 0, 0, 48, 0, 14, 36, 0,
+ 0, 0, 59, 0, 0, 57, 0, 55, 80, 81,
+ 0, 39, 41, 0, 0, 0, 51, 0, 0, 0,
+ 0, 0, 0, 20, 23, 32, 37, 0, 0, 0,
+ 24, 50, 45, 52, 86, 82, 43, 0, 4, 6,
+ 13, 0, 0, 0, 0, 0, 21, 0, 34, 0,
+ 25, 22, 26, 0, 42, 0, 0, 0, 0, 0,
+ 33, 32, 0, 27, 28, 29, 30, 31, 35, 0,
+ 53, 0, 0, 0
};
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
-{
- 0, 246, 246, 268, 270, 272, 274, 276, 278, 280,
- 282, 286, 286, 288, 288, 290, 313, 315, 317, 320,
- 323, 325, 338, 366, 373, 376, 383, 386, 394, 396,
- 398, 400, 404, 407, 411, 416, 422, 425, 428, 431,
- 444, 458, 460, 473, 489, 491, 491, 495, 497, 501,
- 504, 508, 525, 527, 533, 533, 534, 534, 536, 538,
- 542, 547, 552, 555, 559, 562, 567, 568, 568, 570,
- 570, 572, 579, 597, 622, 622, 641, 643, 641, 649,
- 659, 673, 676, 680, 691, 693, 691, 700, 700, 774,
- 774, 775, 775, 777, 782, 782, 785, 785, 788, 791,
- 795, 795, 797
+static const short yydefgoto[] = { 40,
+ 76, 52, 137, 93, 94, 169, 147, 148, 64, 65,
+ 47, 115, 116, 53, 128, 97, 60, 41, 42, 28,
+ 54, 37, 38, 14, 15, 16, 18, 29, 43, 6,
+ 26, 55, 7, 130, 131, 20, 8, 30, 61, 9,
+ 31, 10, 33, 34, 11, 22, 12, 192
};
-#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", "INT", "BIT", "STRING", "BITS", "LIST",
- "CODE", "DAG", "CLASS", "DEF", "MULTICLASS", "DEFM", "FIELD", "LET",
- "IN", "SHLTOK", "SRATOK", "SRLTOK", "STRCONCATTOK", "INTVAL", "ID",
- "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'", "'>'", "'='", "'?'", "'{'",
- "'}'", "'['", "']'", "'.'", "'('", "')'", "','", "':'", "'-'", "';'",
- "$accept", "ClassID", "Type", "OptPrefix", "OptValue", "IDValue",
- "Value", "OptVarName", "DagArgListNE", "DagArgList", "RBitList",
- "BitList", "OptBitList", "ValueList", "ValueListNE", "Declaration",
- "BodyItem", "BodyList", "Body", "SubClassRef", "ClassListNE",
- "ClassList", "DeclListNE", "TemplateArgList", "OptTemplateArgList",
- "OptID", "ObjectName", "ClassName", "DefName", "ObjectBody", "@1",
- "ClassInst", "@2", "@3", "DefInst", "MultiClassDef", "MultiClassBody",
- "MultiClassName", "MultiClassInst", "@4", "@5", "DefMInst", "@6",
- "Object", "LETItem", "LETList", "LETCommand", "@7", "ObjectList", "File", 0
+static const short yypact[] = { 147,
+ -17, -17, 8, 12,-32768,-32768,-32768,-32768,-32768,-32768,
+ 3, 147,-32768,-32768,-32768,-32768,-32768, -13,-32768,-32768,
+-32768, 17, 147,-32768,-32768, 21, 58,-32768,-32768, 21,
+ 45, 55,-32768, -5, -3, 77,-32768,-32768,-32768, 68,
+-32768, 64, -4,-32768, 58, 84, 81,-32768, 17,-32768,
+-32768, 16,-32768, 13, -13, 43, 58,-32768,-32768,-32768,
+ 88, 74, 10, 83, 93, 43,-32768,-32768,-32768,-32768,
+ 100, 104,-32768,-32768,-32768, 110,-32768, 77,-32768, 117,
+ 125, 127, 128, 129,-32768, 139,-32768,-32768,-32768, 43,
+ 43, 132,-32768, 59, 14,-32768, 40, 156,-32768,-32768,
+ 146, 148,-32768, 59, 149, 16, 140,-32768, 43, 43,
+ 43, 43, 43, 43, 141, 134, 142,-32768, 43, 84,
+ 84, 151,-32768, 43, 152,-32768, 136,-32768,-32768,-32768,
+ 6,-32768, 35, 150, 153, 43,-32768, 70, 76, 85,
+ 91, 97, 39,-32768,-32768, 54, 144, 143, 154, 145,
+-32768, 59, 55,-32768,-32768,-32768,-32768, 161,-32768,-32768,
+ 59, 43, 43, 43, 43, 43,-32768, 160,-32768, 43,
+-32768,-32768,-32768, 158,-32768, 103, 106, 111, 114, 119,
+-32768, 54, 43,-32768,-32768,-32768,-32768,-32768,-32768, 47,
+-32768, 185, 188,-32768
};
-#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 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, 60, 62, 61, 63,
- 123, 125, 91, 93, 46, 40, 41, 44, 58, 45,
- 59
+static const short yypgoto[] = { -50,
+ 86,-32768,-32768, 98, -66, 7,-32768,-32768,-32768, -8,
+ 38, 102, -55, -48,-32768,-32768,-32768, 26,-32768,-32768,
+-32768,-32768, 164,-32768, 193,-32768,-32768, 155,-32768,-32768,
+-32768,-32768, -95, 65,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, -7, 157,-32768,-32768,-32768, 174,-32768
};
-# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
- 43, 44, 44, 45, 45, 46, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
- 51, 51, 51, 51, 52, 53, 53, 54, 54, 55,
- 55, 56, 57, 57, 58, 58, 59, 59, 60, 60,
- 61, 61, 62, 62, 63, 63, 64, 65, 65, 66,
- 66, 67, 68, 69, 71, 70, 73, 74, 72, 75,
- 76, 77, 77, 78, 80, 81, 79, 83, 82, 84,
- 84, 84, 84, 85, 86, 86, 88, 87, 84, 84,
- 89, 89, 90
-};
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 1, 1, 4, 1, 4, 1, 1,
- 1, 0, 1, 0, 2, 1, 1, 1, 1, 1,
- 1, 3, 4, 4, 3, 3, 4, 4, 6, 6,
- 6, 6, 0, 2, 2, 4, 0, 1, 1, 3,
- 2, 3, 5, 4, 1, 0, 3, 0, 1, 1,
- 3, 4, 2, 6, 0, 2, 1, 3, 1, 4,
- 1, 3, 0, 2, 1, 3, 3, 0, 1, 1,
- 0, 1, 1, 1, 0, 3, 0, 0, 6, 3,
- 1, 1, 2, 1, 0, 0, 8, 0, 6, 1,
- 1, 1, 1, 4, 1, 3, 0, 4, 4, 2,
- 1, 2, 1
-};
+#define YYLAST 210
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
-{
- 0, 70, 70, 0, 0, 96, 89, 90, 91, 92,
- 100, 0, 102, 0, 69, 71, 72, 76, 73, 62,
- 83, 84, 87, 0, 0, 99, 101, 1, 67, 0,
- 74, 79, 67, 0, 45, 94, 0, 0, 11, 68,
- 77, 2, 58, 60, 63, 0, 85, 0, 0, 0,
- 97, 0, 98, 12, 0, 64, 0, 62, 0, 0,
- 54, 56, 75, 0, 0, 38, 44, 0, 0, 95,
- 6, 4, 3, 0, 0, 8, 9, 10, 0, 66,
- 11, 78, 0, 0, 0, 0, 17, 15, 18, 19,
- 20, 47, 47, 0, 16, 49, 0, 61, 11, 0,
- 88, 40, 0, 0, 46, 93, 0, 0, 13, 65,
- 0, 0, 0, 0, 0, 0, 48, 0, 15, 36,
- 0, 0, 0, 59, 0, 0, 57, 0, 55, 80,
- 81, 0, 39, 41, 0, 0, 0, 51, 0, 0,
- 0, 0, 0, 21, 24, 32, 37, 0, 0, 0,
- 25, 50, 45, 52, 86, 82, 43, 0, 5, 7,
- 14, 0, 0, 0, 0, 22, 0, 34, 0, 26,
- 23, 27, 0, 42, 0, 0, 0, 0, 33, 32,
- 0, 28, 29, 30, 31, 35, 0, 53
-};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 42, 78, 54, 137, 94, 95, 167, 146, 147,
- 66, 67, 49, 115, 116, 55, 128, 98, 62, 43,
- 44, 30, 56, 39, 40, 15, 16, 17, 19, 31,
- 45, 6, 28, 57, 7, 130, 131, 21, 8, 32,
- 63, 9, 33, 10, 35, 36, 11, 23, 12, 13
+static const short yytable[] = { 104,
+ 95, 75, 129, 24, 25, 13, 1, 2, 3, 4,
+ 48, 5, 1, 2, 3, 4, 2, 5, 68, 69,
+ 70, 71, 72, 73, 74, 27, 58, 25, 50, 108,
+ 19, 100, 49, 23, 21, 129, 59, 155, 39, 32,
+ 77, 123, 138, 139, 140, 141, 142, 36, 127, 101,
+ 78, 124, 146, 51, 125, 75, 157, 152, 143, 80,
+ 81, 82, 83, 84, 85, 86, 167, 87, 88, 161,
+ 62, 126, 89, 90, 158, 91, 124, 120, 92, 121,
+ 39, 122, 96, 45, 120, 46, 121, 191, 122, 120,
+ 51, 121, 168, 122, 56, 176, 177, 178, 179, 180,
+ 120, 57, 121, 182, 122, 63, 120, 162, 121, 66,
+ 122, 149, 150, 163, 99, 120, 190, 121, 98, 122,
+ 102, 120, 164, 121, 103, 122, 105, 120, 165, 121,
+ 106, 122, 107, 120, 166, 121, 120, 122, 121, 184,
+ 122, 120, 185, 121, 120, 122, 121, 186, 122, 120,
+ 187, 121, 109, 122, 118, 188, 1, 2, 3, 4,
+ 110, 5, 111, 112, 113, 114, 2, 132, 136, 133,
+ 134, 124, 144, 151, 153, 145, 154, 159, 173, 171,
+ 160, 170, 175, 181, 193, 172, 183, 194, 189, 119,
+ 174, 135, 117, 44, 17, 156, 35, 0, 0, 0,
+ 0, 0, 0, 0, 0, 67, 0, 0, 0, 79
};
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -97
-static const yytype_int16 yypact[] =
-{
- 129, 3, 3, 11, 19, -97, -97, -97, -97, -97,
- -97, 2, 129, 48, -97, -97, -97, -97, -97, 29,
- -97, -97, -97, 31, 129, -97, -97, -97, 43, 56,
- -97, -97, 43, 42, 53, -97, -6, -4, 71, -97,
- -97, -97, 72, -97, 65, 9, -97, 56, 87, 78,
- -97, 31, -97, -97, 15, -97, 13, 29, 41, 56,
- -97, -97, -97, 84, 80, 7, 81, 106, 41, -97,
- -97, -97, -97, 120, 122, -97, -97, -97, 127, -97,
- 71, -97, 115, 116, 117, 118, -97, 128, -97, -97,
- -97, 41, 41, 133, -97, 113, 27, -97, 60, 145,
- -97, -97, 136, 137, -97, 113, 138, 15, 132, -97,
- 41, 41, 41, 41, 41, 130, 125, 131, -97, 41,
- 87, 87, 141, -97, 41, 143, -97, 126, -97, -97,
- -97, 5, -97, 8, 140, 142, 41, -97, 67, 73,
- 79, 85, 45, -97, -97, 54, 134, 139, 146, 135,
- -97, 113, 53, -97, -97, -97, -97, 149, -97, -97,
- 113, 41, 41, 41, 41, -97, 150, -97, 41, -97,
- -97, -97, 144, -97, 91, 94, 99, 102, -97, 54,
- 41, -97, -97, -97, -97, -97, 47, -97
+static const short yycheck[] = { 66,
+ 56, 52, 98, 11, 12, 23, 10, 11, 12, 13,
+ 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
+ 5, 6, 7, 8, 9, 39, 31, 35, 32, 78,
+ 23, 22, 38, 31, 23, 131, 41, 32, 23, 23,
+ 28, 28, 109, 110, 111, 112, 113, 27, 97, 40,
+ 38, 38, 119, 14, 15, 106, 22, 124, 114, 17,
+ 18, 19, 20, 21, 22, 23, 28, 25, 26, 136,
+ 45, 32, 30, 31, 40, 33, 38, 31, 36, 33,
+ 23, 35, 57, 39, 31, 31, 33, 41, 35, 31,
+ 14, 33, 39, 35, 27, 162, 163, 164, 165, 166,
+ 31, 38, 33, 170, 35, 22, 31, 38, 33, 29,
+ 35, 120, 121, 38, 41, 31, 183, 33, 31, 35,
+ 38, 31, 38, 33, 32, 35, 27, 31, 38, 33,
+ 27, 35, 23, 31, 38, 33, 31, 35, 33, 37,
+ 35, 31, 37, 33, 31, 35, 33, 37, 35, 31,
+ 37, 33, 36, 35, 23, 37, 10, 11, 12, 13,
+ 36, 15, 36, 36, 36, 27, 11, 22, 29, 22,
+ 22, 38, 32, 23, 23, 34, 41, 28, 34, 37,
+ 28, 38, 22, 24, 0, 32, 29, 0, 182, 92,
+ 153, 106, 91, 30, 2, 131, 23, -1, -1, -1,
+ -1, -1, -1, -1, -1, 49, -1, -1, -1, 55
};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/share/bison.simple"
+/* This file comes from bison-1.28. */
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int16 yypgoto[] =
-{
- -97, -52, 69, -97, -97, 86, -68, -5, -97, -97,
- -97, -31, 26, 88, -57, -46, -97, -97, -97, -21,
- -97, -97, -97, -97, 151, -97, 179, -97, -97, 147,
- -97, -97, -97, -97, -96, 51, -97, -97, -97, -97,
- -97, -97, -97, -7, 148, -97, -97, -97, 160, -97
-};
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-/* 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 -1
-static const yytype_uint8 yytable[] =
-{
- 105, 96, 77, 129, 25, 26, 1, 2, 3, 4,
- 50, 5, 1, 2, 3, 4, 2, 5, 70, 71,
- 72, 73, 74, 75, 76, 14, 64, 52, 101, 156,
- 26, 51, 24, 20, 109, 129, 154, 41, 97, 60,
- 79, 22, 138, 139, 140, 141, 102, 157, 27, 61,
- 80, 145, 127, 34, 123, 77, 151, 142, 82, 83,
- 84, 85, 86, 87, 124, 88, 89, 29, 160, 38,
- 90, 91, 165, 92, 53, 125, 93, 120, 41, 121,
- 47, 122, 124, 48, 120, 53, 121, 187, 122, 148,
- 149, 126, 166, 174, 175, 176, 177, 120, 58, 121,
- 179, 122, 59, 120, 161, 121, 68, 122, 65, 120,
- 162, 121, 186, 122, 99, 120, 163, 121, 103, 122,
- 100, 120, 164, 121, 120, 122, 121, 181, 122, 120,
- 182, 121, 120, 122, 121, 183, 122, 104, 184, 1,
- 2, 3, 4, 120, 5, 121, 106, 122, 107, 108,
- 110, 111, 112, 113, 114, 118, 2, 132, 133, 134,
- 136, 143, 124, 150, 144, 152, 153, 158, 171, 159,
- 173, 168, 180, 178, 185, 169, 135, 170, 172, 119,
- 117, 18, 155, 46, 37, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,
- 0, 0, 0, 0, 81
-};
+ 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.
-static const yytype_int16 yycheck[] =
-{
- 68, 58, 54, 99, 11, 12, 10, 11, 12, 13,
- 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
- 5, 6, 7, 8, 9, 22, 47, 31, 21, 21,
- 37, 37, 30, 22, 80, 131, 31, 22, 59, 30,
- 27, 22, 110, 111, 112, 113, 39, 39, 0, 40,
- 37, 119, 98, 22, 27, 107, 124, 114, 17, 18,
- 19, 20, 21, 22, 37, 24, 25, 38, 136, 26,
- 29, 30, 27, 32, 14, 15, 35, 30, 22, 32,
- 38, 34, 37, 30, 30, 14, 32, 40, 34, 120,
- 121, 31, 38, 161, 162, 163, 164, 30, 26, 32,
- 168, 34, 37, 30, 37, 32, 28, 34, 21, 30,
- 37, 32, 180, 34, 30, 30, 37, 32, 37, 34,
- 40, 30, 37, 32, 30, 34, 32, 36, 34, 30,
- 36, 32, 30, 34, 32, 36, 34, 31, 36, 10,
- 11, 12, 13, 30, 15, 32, 26, 34, 26, 22,
- 35, 35, 35, 35, 26, 22, 11, 21, 21, 21,
- 28, 31, 37, 22, 33, 22, 40, 27, 33, 27,
- 21, 37, 28, 23, 179, 36, 107, 31, 152, 93,
- 92, 2, 131, 32, 24, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
- -1, -1, -1, -1, 57
-};
+ 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.
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
-{
- 0, 10, 11, 12, 13, 15, 72, 75, 79, 82,
- 84, 87, 89, 90, 22, 66, 67, 68, 67, 69,
- 22, 78, 22, 88, 30, 84, 84, 0, 73, 38,
- 62, 70, 80, 83, 22, 85, 86, 89, 26, 64,
- 65, 22, 42, 60, 61, 71, 65, 38, 30, 53,
- 16, 37, 31, 14, 44, 56, 63, 74, 26, 37,
- 30, 40, 59, 81, 60, 21, 51, 52, 28, 85,
- 3, 4, 5, 6, 7, 8, 9, 42, 43, 27,
- 37, 70, 17, 18, 19, 20, 21, 22, 24, 25,
- 29, 30, 32, 35, 46, 47, 55, 60, 58, 30,
- 40, 21, 39, 37, 31, 47, 26, 26, 22, 56,
- 35, 35, 35, 35, 26, 54, 55, 54, 22, 46,
- 30, 32, 34, 27, 37, 15, 31, 56, 57, 75,
- 76, 77, 21, 21, 21, 43, 28, 45, 47, 47,
- 47, 47, 55, 31, 33, 47, 49, 50, 52, 52,
- 22, 47, 22, 40, 31, 76, 21, 39, 27, 27,
- 47, 37, 37, 37, 37, 27, 38, 48, 37, 36,
- 31, 33, 53, 21, 47, 47, 47, 47, 23, 47,
- 28, 36, 36, 36, 36, 48, 47, 40
-};
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
+#define YYEMPTY -2
#define YYEOF 0
-
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
-
#define YYFAIL goto yyerrlab
-
#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
+#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
goto yybackup; \
} \
else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
#define YYTERROR 1
#define YYERRCODE 256
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (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 (YYID (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
+#ifndef YYPURE
+#define YYLEX yylex()
#endif
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
-# define YYLEX yylex ()
+#define YYLEX yylex(&yylval, &yylloc)
#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 (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
+#define YYLEX yylex(&yylval)
#endif
-{
- if (!yyvaluep)
- return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
+#endif /* not YYLSP_NEEDED */
#endif
-{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
+/* If nonreentrant, generate the variables here */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
+#ifndef YYPURE
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
#endif
-{
- int yynrhs = yyr2[yyrule];
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
- /* The symbols being reduced. */
- for (yyi = 0; yyi < yynrhs; yyi++)
- {
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
- }
-}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
+#define YYINITDEPTH 200
#endif
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
+#define YYMAXDEPTH 10000
#endif
-
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# 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. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
- return yyd - 1;
+ while (i-- > 0)
+ *t++ = *f++;
}
-# 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 == '"')
- {
- YYSIZE_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
+#else /* __cplusplus */
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- 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;
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
- }
+ while (i-- > 0)
+ *t++ = *f++;
}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-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
-{
- YYUSE (yyvaluep);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
+#endif
+#line 217 "/usr/share/bison.simple"
-/* Prevent warnings from -Wmissing-prototypes. */
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
#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;
+#endif
-/* Number of syntax errors so far. */
-int yynerrs;
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-/*----------.
-| yyparse. |
-`----------*/
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
+#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
#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;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `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. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+ int yylen;
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* The number of symbols on the RHS of the reduced rule.
- Keep to zero when no symbol should be popped. */
- int yylen = 0;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
yystate = 0;
yyerrstatus = 0;
@@ -1558,665 +825,676 @@
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss;
+ yyssp = yyss - 1;
yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. So pushing a state here evens the stacks. */
- yyssp++;
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
- yysetstate:
- *yyssp = yystate;
+ *++yyssp = yystate;
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
{
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ int size = yyssp - yyss + 1;
#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *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;
- }
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
/* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
+ if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-
- {
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
#endif /* no yyoverflow */
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
goto yybackup;
+ yybackup:
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
- /* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ /* First try to decide what to do without reference to lookahead token. */
- /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yyn == YYFLAG)
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
yychar = YYLEX;
}
- if (yychar <= YYEOF)
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
{
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
}
else
{
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
}
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
+
yyn = yytable[yyn];
- if (yyn <= 0)
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
+ if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
+ /* Shift the lookahead token. */
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
- /* Discard the shifted token unless it is eof. */
+ /* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
- yystate = yyn;
*++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
- goto yynewstate;
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+ yystate = yyn;
+ goto yynewstate;
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
+/* Do the default action for the current state. */
yydefault:
+
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
- goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
+/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
- /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
- 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];
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 246 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+
+ switch (yyn) {
+
+case 1:
+#line 246 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
if (CurDefmPrefix) {
// If CurDefmPrefix is set, we're parsing a defm, which means that this is
// actually the name of a multiclass.
- MultiClass *MC = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+ MultiClass *MC = MultiClasses[*yyvsp[0].StrVal];
if (MC == 0) {
- err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- (yyval.Rec) = &MC->Rec;
+ yyval.Rec = &MC->Rec;
} else {
- (yyval.Rec) = Records.getClass(*(yyvsp[(1) - (1)].StrVal));
+ yyval.Rec = Records.getClass(*yyvsp[0].StrVal);
}
- if ((yyval.Rec) == 0) {
- err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ if (yyval.Rec == 0) {
+ err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 3:
-#line 268 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // string type
- (yyval.Ty) = new StringRecTy();
- ;}
- break;
-
- case 4:
-#line 270 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // bit type
- (yyval.Ty) = new BitRecTy();
- ;}
- break;
-
- case 5:
-#line 272 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // bits type
- (yyval.Ty) = new BitsRecTy((yyvsp[(3) - (4)].IntVal));
- ;}
- break;
-
- case 6:
-#line 274 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // int type
- (yyval.Ty) = new IntRecTy();
- ;}
- break;
-
- case 7:
-#line 276 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // list type
- (yyval.Ty) = new ListRecTy((yyvsp[(3) - (4)].Ty));
- ;}
- break;
-
- case 8:
-#line 278 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // code type
- (yyval.Ty) = new CodeRecTy();
- ;}
- break;
-
- case 9:
-#line 280 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // dag type
- (yyval.Ty) = new DagRecTy();
- ;}
- break;
-
- case 10:
-#line 282 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // Record Type
- (yyval.Ty) = new RecordRecTy((yyvsp[(1) - (1)].Rec));
- ;}
- break;
-
- case 11:
-#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.IntVal) = 0; ;}
- break;
-
- case 12:
-#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.IntVal) = 1; ;}
- break;
-
- case 13:
-#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.Initializer) = 0; ;}
- break;
-
- case 14:
-#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.Initializer) = (yyvsp[(2) - (2)].Initializer); ;}
- break;
-
- case 15:
-#line 290 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if (const RecordVal *RV = (CurRec ? CurRec->getValue(*(yyvsp[(1) - (1)].StrVal)) : 0)) {
- (yyval.Initializer) = new VarInit(*(yyvsp[(1) - (1)].StrVal), RV->getType());
- } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal))) {
- const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal));
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 2:
+#line 268 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // string type
+ yyval.Ty = new StringRecTy();
+ ;
+ break;}
+case 3:
+#line 270 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // bit type
+ yyval.Ty = new BitRecTy();
+ ;
+ break;}
+case 4:
+#line 272 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // bits type
+ yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
+ ;
+ break;}
+case 5:
+#line 274 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // int type
+ yyval.Ty = new IntRecTy();
+ ;
+ break;}
+case 6:
+#line 276 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // list type
+ yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
+ ;
+ break;}
+case 7:
+#line 278 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // code type
+ yyval.Ty = new CodeRecTy();
+ ;
+ break;}
+case 8:
+#line 280 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // dag type
+ yyval.Ty = new DagRecTy();
+ ;
+ break;}
+case 9:
+#line 282 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // Record Type
+ yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
+ ;
+ break;}
+case 10:
+#line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.IntVal = 0; ;
+ break;}
+case 11:
+#line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.IntVal = 1; ;
+ break;}
+case 12:
+#line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.Initializer = 0; ;
+ break;}
+case 13:
+#line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.Initializer = yyvsp[0].Initializer; ;
+ break;}
+case 14:
+#line 290 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
+ yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
+ } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*yyvsp[0].StrVal)) {
+ const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*yyvsp[0].StrVal);
assert(RV && "Template arg doesn't exist??");
- (yyval.Initializer) = new VarInit(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal), RV->getType());
+ yyval.Initializer = new VarInit(CurRec->getName()+":"+*yyvsp[0].StrVal, RV->getType());
} else if (CurMultiClass &&
- CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal))) {
- std::string Name = CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal);
+ CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal)) {
+ std::string Name = CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal;
const RecordVal *RV = CurMultiClass->Rec.getValue(Name);
assert(RV && "Template arg doesn't exist??");
- (yyval.Initializer) = new VarInit(Name, RV->getType());
- } else if (Record *D = Records.getDef(*(yyvsp[(1) - (1)].StrVal))) {
- (yyval.Initializer) = new DefInit(D);
+ yyval.Initializer = new VarInit(Name, RV->getType());
+ } else if (Record *D = Records.getDef(*yyvsp[0].StrVal)) {
+ yyval.Initializer = new DefInit(D);
} else {
- err() << "Variable not defined: '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ err() << "Variable not defined: '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 16:
-#line 313 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (yyvsp[(1) - (1)].Initializer);
- ;}
- break;
-
- case 17:
-#line 315 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new IntInit((yyvsp[(1) - (1)].IntVal));
- ;}
- break;
-
- case 18:
-#line 317 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new StringInit(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 19:
-#line 320 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new CodeInit(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 20:
-#line 323 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new UnsetInit();
- ;}
- break;
-
- case 21:
-#line 325 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- BitsInit *Init = new BitsInit((yyvsp[(2) - (3)].FieldList)->size());
- for (unsigned i = 0, e = (yyvsp[(2) - (3)].FieldList)->size(); i != e; ++i) {
- struct Init *Bit = (*(yyvsp[(2) - (3)].FieldList))[i]->convertInitializerTo(new BitRecTy());
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 15:
+#line 313 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = yyvsp[0].Initializer;
+ ;
+ break;}
+case 16:
+#line 315 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new IntInit(yyvsp[0].IntVal);
+ ;
+ break;}
+case 17:
+#line 317 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 18:
+#line 320 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 19:
+#line 323 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new UnsetInit();
+ ;
+ break;}
+case 20:
+#line 325 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
+ for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
+ struct Init *Bit = (*yyvsp[-1].FieldList)[i]->convertInitializerTo(new BitRecTy());
if (Bit == 0) {
- err() << "Element #" << i << " (" << *(*(yyvsp[(2) - (3)].FieldList))[i]
+ err() << "Element #" << i << " (" << *(*yyvsp[-1].FieldList)[i]
<< ") is not convertable to a bit!\n";
exit(1);
}
- Init->setBit((yyvsp[(2) - (3)].FieldList)->size()-i-1, Bit);
+ Init->setBit(yyvsp[-1].FieldList->size()-i-1, Bit);
}
- (yyval.Initializer) = Init;
- delete (yyvsp[(2) - (3)].FieldList);
- ;}
- break;
-
- case 22:
-#line 338 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ yyval.Initializer = Init;
+ delete yyvsp[-1].FieldList;
+ ;
+ break;}
+case 21:
+#line 338 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// This is a CLASS expression. This is supposed to synthesize
// a new anonymous definition, deriving from CLASS with no
// body.
- Record *Class = Records.getClass(*(yyvsp[(1) - (4)].StrVal));
+ Record *Class = Records.getClass(*yyvsp[-3].StrVal);
if (!Class) {
- err() << "Expected a class, got '" << *(yyvsp[(1) - (4)].StrVal) << "'!\n";
+ err() << "Expected a class, got '" << *yyvsp[-3].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (4)].StrVal);
+ delete yyvsp[-3].StrVal;
static unsigned AnonCounter = 0;
Record *OldRec = CurRec; // Save CurRec.
// Create the new record, set it as CurRec temporarily.
CurRec = new Record("anonymous.val."+utostr(AnonCounter++));
- addSubClass(Class, *(yyvsp[(3) - (4)].FieldList)); // Add info about the subclass to CurRec.
- delete (yyvsp[(3) - (4)].FieldList); // Free up the template args.
+ addSubClass(Class, *yyvsp[-1].FieldList); // Add info about the subclass to CurRec.
+ delete yyvsp[-1].FieldList; // Free up the template args.
CurRec->resolveReferences();
Records.addDef(CurRec);
// The result of the expression is a reference to the new record.
- (yyval.Initializer) = new DefInit(CurRec);
+ yyval.Initializer = new DefInit(CurRec);
// Restore the old CurRec
CurRec = OldRec;
- ;}
- break;
-
- case 23:
-#line 366 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitializerBitRange(*(yyvsp[(3) - (4)].BitList));
- if ((yyval.Initializer) == 0) {
- err() << "Invalid bit range for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+ ;
+ break;}
+case 22:
+#line 366 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
+ if (yyval.Initializer == 0) {
+ err() << "Invalid bit range for value '" << *yyvsp[-3].Initializer << "'!\n";
exit(1);
}
- delete (yyvsp[(3) - (4)].BitList);
- ;}
- break;
-
- case 24:
-#line 373 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new ListInit(*(yyvsp[(2) - (3)].FieldList));
- delete (yyvsp[(2) - (3)].FieldList);
- ;}
- break;
-
- case 25:
-#line 376 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if (!(yyvsp[(1) - (3)].Initializer)->getFieldType(*(yyvsp[(3) - (3)].StrVal))) {
- err() << "Cannot access field '" << *(yyvsp[(3) - (3)].StrVal) << "' of value '" << *(yyvsp[(1) - (3)].Initializer) << "!\n";
+ delete yyvsp[-1].BitList;
+ ;
+ break;}
+case 23:
+#line 373 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
+ delete yyvsp[-1].FieldList;
+ ;
+ break;}
+case 24:
+#line 376 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
+ err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
exit(1);
}
- (yyval.Initializer) = new FieldInit((yyvsp[(1) - (3)].Initializer), *(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
- ;}
- break;
-
- case 26:
-#line 383 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new DagInit((yyvsp[(2) - (4)].Initializer), *(yyvsp[(3) - (4)].DagValueList));
- delete (yyvsp[(3) - (4)].DagValueList);
- ;}
- break;
-
- case 27:
-#line 386 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- std::reverse((yyvsp[(3) - (4)].BitList)->begin(), (yyvsp[(3) - (4)].BitList)->end());
- (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitListSlice(*(yyvsp[(3) - (4)].BitList));
- if ((yyval.Initializer) == 0) {
- err() << "Invalid list slice for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+ yyval.Initializer = new FieldInit(yyvsp[-2].Initializer, *yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 25:
+#line 383 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new DagInit(yyvsp[-2].Initializer, *yyvsp[-1].DagValueList);
+ delete yyvsp[-1].DagValueList;
+ ;
+ break;}
+case 26:
+#line 386 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
+ yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
+ if (yyval.Initializer == 0) {
+ err() << "Invalid list slice for value '" << *yyvsp[-3].Initializer << "'!\n";
exit(1);
}
- delete (yyvsp[(3) - (4)].BitList);
- ;}
- break;
-
- case 28:
-#line 394 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SHL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 29:
-#line 396 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SRA, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 30:
-#line 398 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SRL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 31:
-#line 400 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::STRCONCAT, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 32:
-#line 404 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.StrVal) = new std::string();
- ;}
- break;
-
- case 33:
-#line 407 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
- ;}
- break;
-
- case 34:
-#line 411 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.DagValueList) = new std::vector >();
- (yyval.DagValueList)->push_back(std::make_pair((yyvsp[(1) - (2)].Initializer), *(yyvsp[(2) - (2)].StrVal)));
- delete (yyvsp[(2) - (2)].StrVal);
- ;}
- break;
-
- case 35:
-#line 416 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(1) - (4)].DagValueList)->push_back(std::make_pair((yyvsp[(3) - (4)].Initializer), *(yyvsp[(4) - (4)].StrVal)));
- delete (yyvsp[(4) - (4)].StrVal);
- (yyval.DagValueList) = (yyvsp[(1) - (4)].DagValueList);
- ;}
- break;
-
- case 36:
-#line 422 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.DagValueList) = new std::vector >();
- ;}
- break;
-
- case 37:
-#line 425 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.DagValueList) = (yyvsp[(1) - (1)].DagValueList); ;}
- break;
-
- case 38:
-#line 428 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.BitList) = new std::vector();
- (yyval.BitList)->push_back((yyvsp[(1) - (1)].IntVal));
- ;}
- break;
-
- case 39:
-#line 431 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if ((yyvsp[(1) - (3)].IntVal) < 0 || (yyvsp[(3) - (3)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(1) - (3)].IntVal) << "-" << (yyvsp[(3) - (3)].IntVal) << "!\n";
+ delete yyvsp[-1].BitList;
+ ;
+ break;}
+case 27:
+#line 394 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::CONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 28:
+#line 396 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SHL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 29:
+#line 398 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SRA, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 30:
+#line 400 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SRL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 31:
+#line 402 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::STRCONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 32:
+#line 406 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.StrVal = new std::string();
+ ;
+ break;}
+case 33:
+#line 409 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.StrVal = yyvsp[0].StrVal;
+ ;
+ break;}
+case 34:
+#line 413 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.DagValueList = new std::vector >();
+ yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 35:
+#line 418 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
+ delete yyvsp[0].StrVal;
+ yyval.DagValueList = yyvsp[-3].DagValueList;
+ ;
+ break;}
+case 36:
+#line 424 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.DagValueList = new std::vector >();
+ ;
+ break;}
+case 37:
+#line 427 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.DagValueList = yyvsp[0].DagValueList; ;
+ break;}
+case 38:
+#line 430 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.BitList = new std::vector();
+ yyval.BitList->push_back(yyvsp[0].IntVal);
+ ;
+ break;}
+case 39:
+#line 433 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = new std::vector();
- if ((yyvsp[(1) - (3)].IntVal) < (yyvsp[(3) - (3)].IntVal)) {
- for (int i = (yyvsp[(1) - (3)].IntVal); i <= (yyvsp[(3) - (3)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = new std::vector();
+ if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(1) - (3)].IntVal); i >= (yyvsp[(3) - (3)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 40:
-#line 444 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(2) - (2)].IntVal) = -(yyvsp[(2) - (2)].IntVal);
- if ((yyvsp[(1) - (2)].IntVal) < 0 || (yyvsp[(2) - (2)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(1) - (2)].IntVal) << "-" << (yyvsp[(2) - (2)].IntVal) << "!\n";
+ ;
+ break;}
+case 40:
+#line 446 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[0].IntVal = -yyvsp[0].IntVal;
+ if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = new std::vector();
- if ((yyvsp[(1) - (2)].IntVal) < (yyvsp[(2) - (2)].IntVal)) {
- for (int i = (yyvsp[(1) - (2)].IntVal); i <= (yyvsp[(2) - (2)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = new std::vector();
+ if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(1) - (2)].IntVal); i >= (yyvsp[(2) - (2)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 41:
-#line 458 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.BitList)=(yyvsp[(1) - (3)].BitList))->push_back((yyvsp[(3) - (3)].IntVal));
- ;}
- break;
-
- case 42:
-#line 460 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if ((yyvsp[(3) - (5)].IntVal) < 0 || (yyvsp[(5) - (5)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(3) - (5)].IntVal) << "-" << (yyvsp[(5) - (5)].IntVal) << "!\n";
+ ;
+ break;}
+case 41:
+#line 460 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
+ ;
+ break;}
+case 42:
+#line 462 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = (yyvsp[(1) - (5)].BitList);
- if ((yyvsp[(3) - (5)].IntVal) < (yyvsp[(5) - (5)].IntVal)) {
- for (int i = (yyvsp[(3) - (5)].IntVal); i <= (yyvsp[(5) - (5)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = yyvsp[-4].BitList;
+ if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(3) - (5)].IntVal); i >= (yyvsp[(5) - (5)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 43:
-#line 473 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(4) - (4)].IntVal) = -(yyvsp[(4) - (4)].IntVal);
- if ((yyvsp[(3) - (4)].IntVal) < 0 || (yyvsp[(4) - (4)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(3) - (4)].IntVal) << "-" << (yyvsp[(4) - (4)].IntVal) << "!\n";
+ ;
+ break;}
+case 43:
+#line 475 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[0].IntVal = -yyvsp[0].IntVal;
+ if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = (yyvsp[(1) - (4)].BitList);
- if ((yyvsp[(3) - (4)].IntVal) < (yyvsp[(4) - (4)].IntVal)) {
- for (int i = (yyvsp[(3) - (4)].IntVal); i <= (yyvsp[(4) - (4)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = yyvsp[-3].BitList;
+ if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(3) - (4)].IntVal); i >= (yyvsp[(4) - (4)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 44:
-#line 489 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = (yyvsp[(1) - (1)].BitList); std::reverse((yyvsp[(1) - (1)].BitList)->begin(), (yyvsp[(1) - (1)].BitList)->end()); ;}
- break;
-
- case 45:
-#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = 0; ;}
- break;
-
- case 46:
-#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = (yyvsp[(2) - (3)].BitList); ;}
- break;
-
- case 47:
-#line 495 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = new std::vector();
- ;}
- break;
-
- case 48:
-#line 497 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = (yyvsp[(1) - (1)].FieldList);
- ;}
- break;
-
- case 49:
-#line 501 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = new std::vector();
- (yyval.FieldList)->push_back((yyvsp[(1) - (1)].Initializer));
- ;}
- break;
-
- case 50:
-#line 504 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.FieldList) = (yyvsp[(1) - (3)].FieldList))->push_back((yyvsp[(3) - (3)].Initializer));
- ;}
- break;
-
- case 51:
-#line 508 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- std::string DecName = *(yyvsp[(3) - (4)].StrVal);
+ ;
+ break;}
+case 44:
+#line 491 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;
+ break;}
+case 45:
+#line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = 0; ;
+ break;}
+case 46:
+#line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = yyvsp[-1].BitList; ;
+ break;}
+case 47:
+#line 497 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = new std::vector();
+ ;
+ break;}
+case 48:
+#line 499 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = yyvsp[0].FieldList;
+ ;
+ break;}
+case 49:
+#line 503 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = new std::vector();
+ yyval.FieldList->push_back(yyvsp[0].Initializer);
+ ;
+ break;}
+case 50:
+#line 506 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
+ ;
+ break;}
+case 51:
+#line 510 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ std::string DecName = *yyvsp[-1].StrVal;
if (ParsingTemplateArgs) {
if (CurRec) {
DecName = CurRec->getName() + ":" + DecName;
@@ -2227,119 +1505,104 @@
DecName = CurMultiClass->Rec.getName() + "::" + DecName;
}
- addValue(RecordVal(DecName, (yyvsp[(2) - (4)].Ty), (yyvsp[(1) - (4)].IntVal)));
- setValue(DecName, 0, (yyvsp[(4) - (4)].Initializer));
- (yyval.StrVal) = new std::string(DecName);
-;}
- break;
-
- case 52:
-#line 525 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- delete (yyvsp[(1) - (2)].StrVal);
-;}
- break;
-
- case 53:
-#line 527 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- setValue(*(yyvsp[(2) - (6)].StrVal), (yyvsp[(3) - (6)].BitList), (yyvsp[(5) - (6)].Initializer));
- delete (yyvsp[(2) - (6)].StrVal);
- delete (yyvsp[(3) - (6)].BitList);
-;}
- break;
-
- case 58:
-#line 536 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (1)].Rec), new std::vector());
- ;}
- break;
-
- case 59:
-#line 538 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (4)].Rec), (yyvsp[(3) - (4)].FieldList));
- ;}
- break;
-
- case 60:
-#line 542 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = new std::vector();
- (yyval.SubClassList)->push_back(*(yyvsp[(1) - (1)].SubClassRef));
- delete (yyvsp[(1) - (1)].SubClassRef);
- ;}
- break;
-
- case 61:
-#line 547 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.SubClassList)=(yyvsp[(1) - (3)].SubClassList))->push_back(*(yyvsp[(3) - (3)].SubClassRef));
- delete (yyvsp[(3) - (3)].SubClassRef);
- ;}
- break;
-
- case 62:
-#line 552 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = new std::vector();
- ;}
- break;
-
- case 63:
-#line 555 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = (yyvsp[(2) - (2)].SubClassList);
- ;}
- break;
-
- case 64:
-#line 559 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- getActiveRec()->addTemplateArg(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 65:
-#line 562 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- getActiveRec()->addTemplateArg(*(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
-;}
- break;
-
- case 66:
-#line 567 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 69:
-#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
- break;
-
- case 70:
-#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.StrVal) = new std::string(); ;}
- break;
-
- case 71:
-#line 572 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ addValue(RecordVal(DecName, yyvsp[-2].Ty, yyvsp[-3].IntVal));
+ setValue(DecName, 0, yyvsp[0].Initializer);
+ yyval.StrVal = new std::string(DecName);
+;
+ break;}
+case 52:
+#line 527 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ delete yyvsp[-1].StrVal;
+;
+ break;}
+case 53:
+#line 529 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer);
+ delete yyvsp[-4].StrVal;
+ delete yyvsp[-3].BitList;
+;
+ break;}
+case 58:
+#line 538 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector());
+ ;
+ break;}
+case 59:
+#line 540 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList);
+ ;
+ break;}
+case 60:
+#line 544 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = new std::vector();
+ yyval.SubClassList->push_back(*yyvsp[0].SubClassRef);
+ delete yyvsp[0].SubClassRef;
+ ;
+ break;}
+case 61:
+#line 549 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef);
+ delete yyvsp[0].SubClassRef;
+ ;
+ break;}
+case 62:
+#line 554 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = new std::vector();
+ ;
+ break;}
+case 63:
+#line 557 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = yyvsp[0].SubClassList;
+ ;
+ break;}
+case 64:
+#line 561 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 65:
+#line 564 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 66:
+#line 569 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 69:
+#line 572 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.StrVal = yyvsp[0].StrVal; ;
+ break;}
+case 70:
+#line 572 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.StrVal = new std::string(); ;
+ break;}
+case 71:
+#line 574 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
static unsigned AnonCounter = 0;
- if ((yyvsp[(1) - (1)].StrVal)->empty())
- *(yyvsp[(1) - (1)].StrVal) = "anonymous."+utostr(AnonCounter++);
- (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 72:
-#line 579 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ if (yyvsp[0].StrVal->empty())
+ *yyvsp[0].StrVal = "anonymous."+utostr(AnonCounter++);
+ yyval.StrVal = yyvsp[0].StrVal;
+;
+ break;}
+case 72:
+#line 581 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// If a class of this name already exists, it must be a forward ref.
- if ((CurRec = Records.getClass(*(yyvsp[(1) - (1)].StrVal)))) {
+ if ((CurRec = Records.getClass(*yyvsp[0].StrVal))) {
// If the body was previously defined, this is an error.
if (!CurRec->getValues().empty() ||
!CurRec->getSuperClasses().empty() ||
@@ -2349,18 +1612,17 @@
}
} else {
// If this is the first reference to this class, create and add it.
- CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
+ CurRec = new Record(*yyvsp[0].StrVal);
Records.addClass(CurRec);
}
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 73:
-#line 597 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 73:
+#line 599 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ CurRec = new Record(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
if (!CurMultiClass) {
// Top-level def definition.
@@ -2381,18 +1643,17 @@
}
CurMultiClass->DefPrototypes.push_back(CurRec);
}
-;}
- break;
-
- case 74:
-#line 622 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- for (unsigned i = 0, e = (yyvsp[(1) - (1)].SubClassList)->size(); i != e; ++i) {
- addSubClass((*(yyvsp[(1) - (1)].SubClassList))[i].first, *(*(yyvsp[(1) - (1)].SubClassList))[i].second);
+;
+ break;}
+case 74:
+#line 624 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) {
+ addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second);
// Delete the template arg values for the class
- delete (*(yyvsp[(1) - (1)].SubClassList))[i].second;
+ delete (*yyvsp[0].SubClassList)[i].second;
}
- delete (yyvsp[(1) - (1)].SubClassList); // Delete the class list.
+ delete yyvsp[0].SubClassList; // Delete the class list.
// Process any variables on the let stack.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
@@ -2400,129 +1661,115 @@
setValue(LetStack[i][j].Name,
LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
LetStack[i][j].Value);
- ;}
- break;
-
- case 75:
-#line 636 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = CurRec;
+ ;
+ break;}
+case 75:
+#line 638 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = CurRec;
CurRec = 0;
- ;}
- break;
-
- case 76:
-#line 641 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 76:
+#line 643 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = true;
- ;}
- break;
-
- case 77:
-#line 643 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 77:
+#line 645 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = false;
- ;}
- break;
-
- case 78:
-#line 645 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = (yyvsp[(6) - (6)].Rec);
- ;}
- break;
-
- case 79:
-#line 649 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 78:
+#line 647 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = yyvsp[0].Rec;
+ ;
+ break;}
+case 79:
+#line 651 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
- (yyvsp[(3) - (3)].Rec)->resolveReferences();
+ yyvsp[0].Rec->resolveReferences();
// If ObjectBody has template arguments, it's an error.
- assert((yyvsp[(3) - (3)].Rec)->getTemplateArgs().empty() && "How'd this get template args?");
- (yyval.Rec) = (yyvsp[(3) - (3)].Rec);
-;}
- break;
-
- case 80:
-#line 659 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = (yyvsp[(1) - (1)].Rec);
+ assert(yyvsp[0].Rec->getTemplateArgs().empty() && "How'd this get template args?");
+ yyval.Rec = yyvsp[0].Rec;
+;
+ break;}
+case 80:
+#line 661 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = yyvsp[0].Rec;
// Copy the template arguments for the multiclass into the def.
const std::vector &TArgs = CurMultiClass->Rec.getTemplateArgs();
for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
const RecordVal *RV = CurMultiClass->Rec.getValue(TArgs[i]);
assert(RV && "Template arg doesn't exist?");
- (yyval.Rec)->addValue(*RV);
+ yyval.Rec->addValue(*RV);
}
-;}
- break;
-
- case 81:
-#line 673 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.RecList) = new std::vector();
- (yyval.RecList)->push_back((yyvsp[(1) - (1)].Rec));
-;}
- break;
-
- case 82:
-#line 676 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.RecList)->push_back((yyvsp[(2) - (2)].Rec));
-;}
- break;
-
- case 83:
-#line 680 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- MultiClass *&MCE = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+;
+ break;}
+case 81:
+#line 675 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.RecList = new std::vector();
+ yyval.RecList->push_back(yyvsp[0].Rec);
+;
+ break;}
+case 82:
+#line 678 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.RecList->push_back(yyvsp[0].Rec);
+;
+ break;}
+case 83:
+#line 682 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ MultiClass *&MCE = MultiClasses[*yyvsp[0].StrVal];
if (MCE) {
- err() << "multiclass '" << *(yyvsp[(1) - (1)].StrVal) << "' already defined!\n";
+ err() << "multiclass '" << *yyvsp[0].StrVal << "' already defined!\n";
exit(1);
}
- MCE = CurMultiClass = new MultiClass(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 84:
-#line 691 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ MCE = CurMultiClass = new MultiClass(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 84:
+#line 693 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = true;
- ;}
- break;
-
- case 85:
-#line 693 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 85:
+#line 695 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = false;
- ;}
- break;
-
- case 86:
-#line 695 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 86:
+#line 697 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
CurMultiClass = 0;
-;}
- break;
-
- case 87:
-#line 700 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { CurDefmPrefix = (yyvsp[(2) - (2)].StrVal); ;}
- break;
-
- case 88:
-#line 700 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+;
+ break;}
+case 87:
+#line 702 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ CurDefmPrefix = yyvsp[0].StrVal; ;
+ break;}
+case 88:
+#line 702 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// To instantiate a multiclass, we need to first get the multiclass, then
// instantiate each def contained in the multiclass with the SubClassRef
// template parameters.
- MultiClass *MC = MultiClasses[(yyvsp[(5) - (6)].SubClassRef)->first->getName()];
+ MultiClass *MC = MultiClasses[yyvsp[-1].SubClassRef->first->getName()];
assert(MC && "Didn't lookup multiclass correctly?");
- std::vector &TemplateVals = *(yyvsp[(5) - (6)].SubClassRef)->second;
- delete (yyvsp[(5) - (6)].SubClassRef);
+ std::vector &TemplateVals = *yyvsp[-1].SubClassRef->second;
+ delete yyvsp[-1].SubClassRef;
// Verify that the correct number of template arguments were specified.
const std::vector &TArgs = MC->Rec.getTemplateArgs();
@@ -2537,7 +1784,7 @@
// Add the suffix to the defm name to get the new name.
assert(CurRec == 0 && "A def is current?");
- CurRec = new Record(*(yyvsp[(2) - (6)].StrVal) + DefProto->getName());
+ CurRec = new Record(*yyvsp[-4].StrVal + DefProto->getName());
addSubClass(DefProto, std::vector());
@@ -2573,7 +1820,7 @@
// Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined, "
- << "instantiating defm '" << *(yyvsp[(2) - (6)].StrVal) << "' with subdef '"
+ << "instantiating defm '" << *yyvsp[-4].StrVal << "' with subdef '"
<< DefProto->getName() << "'!\n";
exit(1);
}
@@ -2585,279 +1832,275 @@
}
delete &TemplateVals;
- delete (yyvsp[(2) - (6)].StrVal);
+ delete yyvsp[-4].StrVal;
CurDefmPrefix = 0;
-;}
- break;
-
- case 89:
-#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 90:
-#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 93:
-#line 777 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- LetStack.back().push_back(LetRecord(*(yyvsp[(1) - (4)].StrVal), (yyvsp[(2) - (4)].BitList), (yyvsp[(4) - (4)].Initializer)));
- delete (yyvsp[(1) - (4)].StrVal); delete (yyvsp[(2) - (4)].BitList);
-;}
- break;
-
- case 96:
-#line 785 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { LetStack.push_back(std::vector()); ;}
- break;
-
- case 98:
-#line 788 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+;
+ break;}
+case 89:
+#line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 90:
+#line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 93:
+#line 779 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
+ delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
+;
+ break;}
+case 96:
+#line 787 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ LetStack.push_back(std::vector()); ;
+ break;}
+case 98:
+#line 790 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
LetStack.pop_back();
- ;}
- break;
-
- case 99:
-#line 791 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 99:
+#line 793 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
LetStack.pop_back();
- ;}
- break;
-
- case 100:
-#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 101:
-#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
+ ;
+ break;}
+case 100:
+#line 797 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 101:
+#line 797 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/usr/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
-/* Line 1267 of yacc.c. */
-#line 2643 "FileParser.tab.c"
- default: break;
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
}
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
+#endif
*++yyvsp = yyval;
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
+yyerrlab: /* here on detecting error */
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
{
++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
-#else
- {
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
- }
-#endif
- }
-
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
+ if (yyn > YYFLAG && yyn < YYLAST)
{
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
}
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
}
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
-/*---------------------------------------------------.
-| 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 (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
- yystate = *yyssp;
- goto yyerrlab1;
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
- for (;;)
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
{
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
+yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
- yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
- YYPOPSTACK (1);
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
- *++yyvsp = yylval;
-
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
yystate = yyn;
goto yynewstate;
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- YYPOPSTACK (yylen);
- YY_STACK_PRINT (yyss, yyssp);
- while (yyssp != yyss)
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
{
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK (1);
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ }
+ return 1;
}
-
-
-#line 799 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+#line 801 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
int yyerror(const char *ErrorMsg) {
err() << "Error parsing: " << ErrorMsg << "\n";
exit(1);
}
-
Modified: llvm/trunk/utils/TableGen/FileParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FileParser.h.cvs?rev=42036&r1=42035&r2=42036&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/FileParser.h.cvs (original)
+++ llvm/trunk/utils/TableGen/FileParser.h.cvs Mon Sep 17 12:40:48 2007
@@ -1,101 +1,4 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- 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, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- INT = 258,
- BIT = 259,
- STRING = 260,
- BITS = 261,
- LIST = 262,
- CODE = 263,
- DAG = 264,
- CLASS = 265,
- DEF = 266,
- MULTICLASS = 267,
- DEFM = 268,
- FIELD = 269,
- LET = 270,
- IN = 271,
- SHLTOK = 272,
- SRATOK = 273,
- SRLTOK = 274,
- STRCONCATTOK = 275,
- INTVAL = 276,
- ID = 277,
- VARNAME = 278,
- STRVAL = 279,
- CODEFRAGMENT = 280
- };
-#endif
-/* Tokens. */
-#define INT 258
-#define BIT 259
-#define STRING 260
-#define BITS 261
-#define LIST 262
-#define CODE 263
-#define DAG 264
-#define CLASS 265
-#define DEF 266
-#define MULTICLASS 267
-#define DEFM 268
-#define FIELD 269
-#define LET 270
-#define IN 271
-#define SHLTOK 272
-#define SRATOK 273
-#define SRLTOK 274
-#define STRCONCATTOK 275
-#define INTVAL 276
-#define ID 277
-#define VARNAME 278
-#define STRVAL 279
-#define CODEFRAGMENT 280
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
-{
+typedef union {
std::string* StrVal;
int IntVal;
llvm::RecTy* Ty;
@@ -107,14 +10,31 @@
SubClassRefTy* SubClassRef;
std::vector* SubClassList;
std::vector >* DagValueList;
-}
-/* Line 1529 of yacc.c. */
-#line 113 "FileParser.tab.h"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+} YYSTYPE;
+#define INT 257
+#define BIT 258
+#define STRING 259
+#define BITS 260
+#define LIST 261
+#define CODE 262
+#define DAG 263
+#define CLASS 264
+#define DEF 265
+#define MULTICLASS 266
+#define DEFM 267
+#define FIELD 268
+#define LET 269
+#define IN 270
+#define CONCATTOK 271
+#define SHLTOK 272
+#define SRATOK 273
+#define SRLTOK 274
+#define STRCONCATTOK 275
+#define INTVAL 276
+#define ID 277
+#define VARNAME 278
+#define STRVAL 279
+#define CODEFRAGMENT 280
-extern YYSTYPE Filelval;
+extern YYSTYPE Filelval;
From evan.cheng at apple.com Mon Sep 17 12:42:53 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 17:42:53 -0000
Subject: [llvm-commits] [llvm] r42037 -
/llvm/trunk/lib/Target/X86/X86ISelLowering.h
Message-ID: <200709171742.l8HHgroa021929@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Sep 17 12:42:53 2007
New Revision: 42037
URL: http://llvm.org/viewvc/llvm-project?rev=42037&view=rev
Log:
X86ISD::TEST is dead.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.h
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Sep 17 12:42:53 2007
@@ -116,7 +116,7 @@
RDTSC_DAG,
/// X86 compare and logical compare instructions.
- CMP, TEST, COMI, UCOMI,
+ CMP, COMI, UCOMI,
/// X86 SetCC. Operand 1 is condition code, and operand 2 is the flag
/// operand produced by a CMP instruction.
From djg at cray.com Mon Sep 17 12:44:31 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 17:44:31 -0000
Subject: [llvm-commits] [llvm] r42038 -
/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
Message-ID: <200709171744.l8HHiW1h022064@zion.cs.uiuc.edu>
Author: djg
Date: Mon Sep 17 12:44:31 2007
New Revision: 42038
URL: http://llvm.org/viewvc/llvm-project?rev=42038&view=rev
Log:
Add a utility function to SDOperand for testing if a value is unused.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=42038&r1=42037&r2=42038&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Sep 17 12:44:31 2007
@@ -766,6 +766,10 @@
/// hasOneUse - Return true if there is exactly one operation using this
/// result value of the defining operator.
inline bool hasOneUse() const;
+
+ /// use_empty - Return true if there are no operations using this
+ /// result value of the defining operator.
+ inline bool use_empty() const;
};
@@ -1035,6 +1039,9 @@
inline bool SDOperand::hasOneUse() const {
return Val->hasNUsesOfValue(1, ResNo);
}
+inline bool SDOperand::use_empty() const {
+ return !Val->hasAnyUseOfValue(ResNo);
+}
/// UnarySDNode - This class is used for single-operand SDNodes. This is solely
/// to allow co-allocation of node operands with the node itself.
From evan.cheng at apple.com Mon Sep 17 12:50:59 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 10:50:59 -0700
Subject: [llvm-commits] [llvm] r42029 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
In-Reply-To: <200709171519.l8HFJ8k2010460@zion.cs.uiuc.edu>
References: <200709171519.l8HFJ8k2010460@zion.cs.uiuc.edu>
Message-ID: <00B174F3-F244-4EBD-8CC3-9EF758EA4B52@apple.com>
Doh. Thanks Dan. Was this breaking anything? Seems to me this fix
should be merged into the release branch. What do you say?
Evan
On Sep 17, 2007, at 8:19 AM, Dan Gohman wrote:
> Author: djg
> Date: Mon Sep 17 10:19:08 2007
> New Revision: 42029
>
> URL: http://llvm.org/viewvc/llvm-project?rev=42029&view=rev
> Log:
> Add 64-bit jmp instructions to the list of instructions that
> can terminate a block with no fall-through.
>
> Modified:
> llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=42029&r1=42028&r2=42029&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Sep 17 10:19:08
> 2007
> @@ -582,7 +582,9 @@
> case X86::TAILJMPm:
> case X86::JMP: // Uncond branch.
> case X86::JMP32r: // Indirect branch.
> + case X86::JMP64r: // Indirect branch (64-bit).
> case X86::JMP32m: // Indirect branch through mem.
> + case X86::JMP64m: // Indirect branch through mem (64-bit).
> return true;
> default: return false;
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From dberlin at dberlin.org Mon Sep 17 13:04:21 2007
From: dberlin at dberlin.org (Daniel Berlin)
Date: Mon, 17 Sep 2007 18:04:21 -0000
Subject: [llvm-commits] [llvm] r42039 -
/llvm/trunk/include/llvm/ADT/SparseBitVector.h
Message-ID: <200709171804.l8HI4L5S024079@zion.cs.uiuc.edu>
Author: dannyb
Date: Mon Sep 17 13:04:21 2007
New Revision: 42039
URL: http://llvm.org/viewvc/llvm-project?rev=42039&view=rev
Log:
Fix iterator so it doesn't sometimes report bits that aren't in the bitmap
Modified:
llvm/trunk/include/llvm/ADT/SparseBitVector.h
Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=42039&r1=42038&r2=42039&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Mon Sep 17 13:04:21 2007
@@ -405,6 +405,8 @@
WordNumber = (NextSetBitNumber % ElementSize) / BITWORD_SIZE;
Bits = Iter->word(WordNumber);
Bits >>= NextSetBitNumber % BITWORD_SIZE;
+ BitNumber = Iter->index() * ElementSize;
+ BitNumber += NextSetBitNumber;
}
}
}
From dberlin at dberlin.org Mon Sep 17 13:05:59 2007
From: dberlin at dberlin.org (Daniel Berlin)
Date: Mon, 17 Sep 2007 18:05:59 -0000
Subject: [llvm-commits] [llvm] r42040 -
/llvm/trunk/include/llvm/ADT/SparseBitVector.h
Message-ID: <200709171805.l8HI5xTG024269@zion.cs.uiuc.edu>
Author: dannyb
Date: Mon Sep 17 13:05:59 2007
New Revision: 42040
URL: http://llvm.org/viewvc/llvm-project?rev=42040&view=rev
Log:
That's what i get for using carbon emacs in a terminal
Modified:
llvm/trunk/include/llvm/ADT/SparseBitVector.h
Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=42040&r1=42039&r2=42040&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Mon Sep 17 13:05:59 2007
@@ -405,8 +405,8 @@
WordNumber = (NextSetBitNumber % ElementSize) / BITWORD_SIZE;
Bits = Iter->word(WordNumber);
Bits >>= NextSetBitNumber % BITWORD_SIZE;
- BitNumber = Iter->index() * ElementSize;
- BitNumber += NextSetBitNumber;
+ BitNumber = Iter->index() * ElementSize;
+ BitNumber += NextSetBitNumber;
}
}
}
From evan.cheng at apple.com Mon Sep 17 13:18:19 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 11:18:19 -0700
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 -
in /llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp
varasm.c
In-Reply-To: <200709171059.54888.baldrick@free.fr>
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
<200709171059.54888.baldrick@free.fr>
Message-ID:
On Sep 17, 2007, at 1:59 AM, Duncan Sands wrote:
> Hi Bill,
>
>>>> Alias definitions aren't supported on some platforms. Create a
>>>> flag (TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS) that indicates
>>>> this and stops us from creating aliases.
>>>
>>> is doing this in the front-end really the right approach? If a
>>> target doesn't
>>> support aliases surely it is LLVM codegen that should complain or
>>> ignore the
>>> alias.
>>
>> It's debatable. I'm not 100% familiar with the "emit_alias_to_llvm()"
>> function, but it seems to be modifying the generated LLVM bitcode to
>> point to the new alias.
>
> I've CC'd Anton since he's the one who knows all about this stuff.
> Presumably
Anton CC'd.
>
> when A is an alias for B there are two cases: either this is a "weak
> alias" or
> weakref, meaning that at link time it may turn out that A wasn't an
> alias for
> B after all, or A is a strong alias (a term I just invented) for B,
> meaning that
> this is definitive: you can replace uses of A with uses of B
> everywhere. In the
> first case linker support is required, but not in the second case,
> so presumably
> it is wrong to turn off alias support in the second case. I don't
> know if your
> patch turned this second case off or not.
Hmm. I thought "weak alias" just means "weak" and "alias". It's a
different animal from weakref (which Darwin supports).
> In the first case (weakrefs) we output a special declaration to the
> bitcode
> saying that A is a weak alias for B. I think it is a mistake not to
> output
> this even for platforms like Darwin that don't handle weakrefs: such
> aliases
> may be resolvable by LLVM, for example when linking modules using
> llvm-link.
> Think also of running bitcode under lli. Thus there are some cases
> in which
> weakrefs can work correctly even on Darwin.
I don't think Bill's patch affects weakref. Bill?
>
>
> Instead, I suggest we output a warning in the f-e that aliases are
> not supported,
> but still generate the alias in the bitcode. Then we teach the code
> generators,
> which presumably means the asm printer, to ignore aliases on Darwin.
We are already relying on asm printer too much as it is. I'd like not
to add any more target specific knowledge to asm printer if possible.
Evan
>
>
> On the other hand, not all bitcode is generated by llvm-gcc. It may
> be a bad
> idea to have LLVM quietly ignore aliases on Darwin because of the
> potential
> surprise and trouble it may create for front-end writers who aren't
> aware of
> this.
>
>> If so, then we need to stop it from doing
>> that at that point, which is what my patch does.
>>
>> Also, I don't think there's anything that emits a warning in LLVM
>> after the front-end generates the bitcode. I'm not excited about
>> emitting warnings there now. :-)
>>
>>> Also, how does gcc handle aliases on Darwin? Either it succeeds in
>>> outputting them somehow, in which case llvm-gcc should too, or it
>>> rejects them
>>> in which case there shouldn't be any need for a new flag - the info
>>> that darwin
>>> doesn't support aliases should exist in gcc already.
>>>
>> GCC ignores it. If you look at config/darwin.h, it emits a warning
>> saying that it won't be doing anything with aliases.
>
> Ciao,
>
> Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From sabre at nondot.org Mon Sep 17 13:34:06 2007
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 17 Sep 2007 18:34:06 -0000
Subject: [llvm-commits] [llvm] r42042 - in /llvm/trunk:
docs/ProgrammersManual.html include/llvm/ADT/DenseMap.h
include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/DwarfWriter.cpp
lib/CodeGen/RegAllocBigBlock.cpp lib/Target/TargetData.cpp
lib/Transforms/Scalar/GVN.cpp lib/Transforms/Scalar/GVNPRE.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp lib/VMCore/Constants.cpp
Message-ID: <200709171834.l8HIY6Ir027357@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Sep 17 13:34:04 2007
New Revision: 42042
URL: http://llvm.org/viewvc/llvm-project?rev=42042&view=rev
Log:
Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.
Modified:
llvm/trunk/docs/ProgrammersManual.html
llvm/trunk/include/llvm/ADT/DenseMap.h
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
llvm/trunk/lib/Target/TargetData.cpp
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Mon Sep 17 13:34:04 2007
@@ -1225,7 +1225,7 @@
map. Also, because DenseMap allocates space for a large number of key/value
pairs (it starts with 64 by default), it will waste a lot of space if your keys
or values are large. Finally, you must implement a partial specialization of
-DenseMapKeyInfo for the key that you want, if it isn't already supported. This
+DenseMapInfo for the key that you want, if it isn't already supported. This
is required to tell DenseMap about two special marker values (which can never be
inserted into the map) that it needs internally.
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Sep 17 13:34:04 2007
@@ -22,48 +22,39 @@
namespace llvm {
template
-struct DenseMapKeyInfo {
+struct DenseMapInfo {
//static inline T getEmptyKey();
//static inline T getTombstoneKey();
//static unsigned getHashValue(const T &Val);
+ //static bool isEqual(const T &LHS, const T &RHS);
//static bool isPod()
};
-// Provide DenseMapKeyInfo for all pointers.
+// Provide DenseMapInfo for all pointers.
template
-struct DenseMapKeyInfo {
+struct DenseMapInfo {
static inline T* getEmptyKey() { return reinterpret_cast(-1); }
static inline T* getTombstoneKey() { return reinterpret_cast(-2); }
static unsigned getHashValue(const T *PtrVal) {
return (unsigned(uintptr_t(PtrVal)) >> 4) ^
(unsigned(uintptr_t(PtrVal)) >> 9);
}
- static bool isPod() { return true; }
-};
-
-template
-struct DenseMapValueInfo {
- //static bool isPod()
-};
-
-// Provide DenseMapValueInfo for all pointers.
-template
-struct DenseMapValueInfo {
+ static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
static bool isPod() { return true; }
};
template,
- typename ValueInfoT = DenseMapValueInfo >
+ typename KeyInfoT = DenseMapInfo,
+ typename ValueInfoT = DenseMapInfo >
class DenseMapIterator;
template,
- typename ValueInfoT = DenseMapValueInfo >
+ typename KeyInfoT = DenseMapInfo,
+ typename ValueInfoT = DenseMapInfo >
class DenseMapConstIterator;
template,
- typename ValueInfoT = DenseMapValueInfo >
+ typename KeyInfoT = DenseMapInfo,
+ typename ValueInfoT = DenseMapInfo >
class DenseMap {
typedef std::pair BucketT;
unsigned NumBuckets;
@@ -280,14 +271,14 @@
while (1) {
BucketT *ThisBucket = BucketsPtr + (BucketNo & (NumBuckets-1));
// Found Val's bucket? If so, return it.
- if (ThisBucket->first == Val) {
+ if (KeyInfoT::isEqual(ThisBucket->first, Val)) {
FoundBucket = ThisBucket;
return true;
}
// If we found an empty bucket, the key doesn't exist in the set.
// Insert it and return the default value.
- if (ThisBucket->first == EmptyKey) {
+ if (KeyInfoT::isEqual(ThisBucket->first, EmptyKey)) {
// If we've already seen a tombstone while probing, fill it in instead
// of the empty bucket we eventually probed to.
if (FoundTombstone) ThisBucket = FoundTombstone;
@@ -297,7 +288,7 @@
// If this is a tombstone, remember it. If Val ends up not in the map, we
// prefer to return it than something that would require more probing.
- if (ThisBucket->first == TombstoneKey && !FoundTombstone)
+ if (KeyInfoT::isEqual(ThisBucket->first, TombstoneKey) && !FoundTombstone)
FoundTombstone = ThisBucket; // Remember the first tombstone found.
// Otherwise, it's a hash collision or a tombstone, continue quadratic
@@ -425,7 +416,9 @@
const KeyT Empty = KeyInfoT::getEmptyKey();
const KeyT Tombstone = KeyInfoT::getTombstoneKey();
- while (Ptr != End && (Ptr->first == Empty || Ptr->first == Tombstone))
+ while (Ptr != End &&
+ (KeyInfoT::isEqual(Ptr->first, Empty) ||
+ KeyInfoT::isEqual(Ptr->first, Tombstone)))
++Ptr;
}
};
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Sep 17 13:34:04 2007
@@ -35,7 +35,7 @@
class MachineBasicBlock;
class MachineConstantPoolValue;
class SDNode;
-template struct DenseMapKeyInfo;
+template struct DenseMapInfo;
template struct simplify_type;
template struct ilist_traits;
template class iplist;
@@ -773,13 +773,16 @@
};
-template<> struct DenseMapKeyInfo {
+template<> struct DenseMapInfo {
static inline SDOperand getEmptyKey() { return SDOperand((SDNode*)-1, -1U); }
static inline SDOperand getTombstoneKey() { return SDOperand((SDNode*)-1, 0);}
static unsigned getHashValue(const SDOperand &Val) {
return (unsigned)((uintptr_t)Val.Val >> 4) ^
(unsigned)((uintptr_t)Val.Val >> 9) + Val.ResNo;
}
+ static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return true; }
};
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 17 13:34:04 2007
@@ -2942,6 +2942,7 @@
static inline unsigned getEmptyKey() { return -1U; }
static inline unsigned getTombstoneKey() { return -2U; }
static unsigned getHashValue(const unsigned &Key) { return Key; }
+ static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
static bool isPod() { return true; }
};
Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Mon Sep 17 13:34:04 2007
@@ -63,6 +63,7 @@
struct VRegKeyInfo {
static inline unsigned getEmptyKey() { return -1U; }
static inline unsigned getTombstoneKey() { return -2U; }
+ static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
static unsigned getHashValue(const unsigned &Key) { return Key; }
};
Modified: llvm/trunk/lib/Target/TargetData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Mon Sep 17 13:34:04 2007
@@ -316,9 +316,13 @@
return LayoutKey((TargetData*)(intptr_t)-1, 0);
}
static unsigned getHashValue(const LayoutKey &Val) {
- return DenseMapKeyInfo::getHashValue(Val.first) ^
- DenseMapKeyInfo::getHashValue(Val.second);
+ return DenseMapInfo::getHashValue(Val.first) ^
+ DenseMapInfo::getHashValue(Val.second);
}
+ static bool isEqual(const LayoutKey &LHS, const LayoutKey &RHS) {
+ return LHS == RHS;
+ }
+
static bool isPod() { return true; }
};
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Sep 17 13:34:04 2007
@@ -145,7 +145,7 @@
}
namespace llvm {
-template <> struct DenseMapKeyInfo {
+template <> struct DenseMapInfo {
static inline Expression getEmptyKey() {
return Expression(Expression::EMPTY);
}
@@ -171,6 +171,9 @@
return hash;
}
+ static bool isEqual(const Expression &LHS, const Expression &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return true; }
};
}
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Sep 17 13:34:04 2007
@@ -155,7 +155,7 @@
}
namespace llvm {
-template <> struct DenseMapKeyInfo {
+template <> struct DenseMapInfo {
static inline Expression getEmptyKey() {
return Expression(Expression::EMPTY);
}
@@ -181,6 +181,9 @@
return hash;
}
+ static bool isEqual(const Expression &LHS, const Expression &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return true; }
};
}
Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Mon Sep 17 13:34:04 2007
@@ -39,18 +39,22 @@
STATISTIC(NumDeadAlloca, "Number of dead alloca's removed");
STATISTIC(NumPHIInsert, "Number of PHI nodes inserted");
-// Provide DenseMapKeyInfo for all pointers.
+// Provide DenseMapInfo for all pointers.
namespace llvm {
template<>
-struct DenseMapKeyInfo > {
- static inline std::pair getEmptyKey() {
- return std::make_pair((BasicBlock*)-1, ~0U);
+struct DenseMapInfo > {
+ typedef std::pair EltTy;
+ static inline EltTy getEmptyKey() {
+ return EltTy(reinterpret_cast(-1), ~0U);
}
- static inline std::pair getTombstoneKey() {
- return std::make_pair((BasicBlock*)-2, 0U);
+ static inline EltTy getTombstoneKey() {
+ return EltTy(reinterpret_cast(-2), 0U);
}
static unsigned getHashValue(const std::pair &Val) {
- return DenseMapKeyInfo::getHashValue(Val.first) + Val.second*2;
+ return DenseMapInfo::getHashValue(Val.first) + Val.second*2;
+ }
+ static bool isEqual(const EltTy &LHS, const EltTy &RHS) {
+ return LHS == RHS;
}
static bool isPod() { return true; }
};
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=42042&r1=42041&r2=42042&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Sep 17 13:34:04 2007
@@ -203,9 +203,12 @@
static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), 0); }
static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), 0); }
static unsigned getHashValue(const KeyTy &Key) {
- return DenseMapKeyInfo::getHashValue(Key.type) ^
+ return DenseMapInfo::getHashValue(Key.type) ^
Key.val.getHashValue();
}
+ static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return false; }
};
}
@@ -293,6 +296,9 @@
static unsigned getHashValue(const KeyTy &Key) {
return Key.val.getHashValue();
}
+ static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return false; }
};
}
From djg at cray.com Mon Sep 17 13:37:45 2007
From: djg at cray.com (Dan Gohman)
Date: Mon, 17 Sep 2007 13:37:45 -0500
Subject: [llvm-commits] [llvm] r42029 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Message-ID: <20070917183745.GE10864@village.us.cray.com>
> Doh. Thanks Dan. Was this breaking anything? Seems to me this fix
> should be merged into the release branch. What do you say?
The only in-tree user of BlockHasNoFallThrough appears to be BranchFolding,
and there it's just guarding an optimization.
Dan
--
Dan Gohman, Cray Inc.
From dalej at apple.com Mon Sep 17 13:44:13 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 17 Sep 2007 18:44:13 -0000
Subject: [llvm-commits] [llvm] r42043 - in /llvm/trunk:
include/llvm/ExecutionEngine/GenericValue.h
lib/ExecutionEngine/ExecutionEngine.cpp lib/ExecutionEngine/JIT/JIT.cpp
Message-ID: <200709171844.l8HIiDSH028563@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Sep 17 13:44:13 2007
New Revision: 42043
URL: http://llvm.org/viewvc/llvm-project?rev=42043&view=rev
Log:
Implement x86 long double in jit (not really
complete, but common cases work)
Modified:
llvm/trunk/include/llvm/ExecutionEngine/GenericValue.h
llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/GenericValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/GenericValue.h?rev=42043&r1=42042&r2=42043&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/GenericValue.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/GenericValue.h Mon Sep 17 13:44:13 2007
@@ -31,7 +31,7 @@
struct { unsigned int first; unsigned int second; } UIntPairVal;
unsigned char Untyped[8];
};
- APInt IntVal;
+ APInt IntVal; // also used for long doubles
GenericValue() : DoubleVal(0.0), IntVal(1,0) {}
GenericValue(void *V) : PointerVal(V), IntVal(1,0) { }
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=42043&r1=42042&r2=42043&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Mon Sep 17 13:44:13 2007
@@ -376,11 +376,13 @@
return GV;
}
case Instruction::FPTrunc: {
+ // FIXME long double
GenericValue GV = getConstantValue(Op0);
GV.FloatVal = float(GV.DoubleVal);
return GV;
}
case Instruction::FPExt:{
+ // FIXME long double
GenericValue GV = getConstantValue(Op0);
GV.DoubleVal = double(GV.FloatVal);
return GV;
@@ -389,16 +391,30 @@
GenericValue GV = getConstantValue(Op0);
if (CE->getType() == Type::FloatTy)
GV.FloatVal = float(GV.IntVal.roundToDouble());
- else
+ else if (CE->getType() == Type::DoubleTy)
GV.DoubleVal = GV.IntVal.roundToDouble();
+ else if (CE->getType() == Type::X86_FP80Ty) {
+ const uint64_t zero[] = {0, 0};
+ APFloat apf = APFloat(APInt(80, 2, zero));
+ (void)apf.convertFromInteger(GV.IntVal.getRawData(), 2, false,
+ APFloat::rmTowardZero);
+ GV.IntVal = apf.convertToAPInt();
+ }
return GV;
}
case Instruction::SIToFP: {
GenericValue GV = getConstantValue(Op0);
if (CE->getType() == Type::FloatTy)
GV.FloatVal = float(GV.IntVal.signedRoundToDouble());
- else
+ else if (CE->getType() == Type::DoubleTy)
GV.DoubleVal = GV.IntVal.signedRoundToDouble();
+ else if (CE->getType() == Type::X86_FP80Ty) {
+ const uint64_t zero[] = { 0, 0};
+ APFloat apf = APFloat(APInt(80, 2, zero));
+ (void)apf.convertFromInteger(GV.IntVal.getRawData(), 2, true,
+ APFloat::rmTowardZero);
+ GV.IntVal = apf.convertToAPInt();
+ }
return GV;
}
case Instruction::FPToUI: // double->APInt conversion handles sign
@@ -407,8 +423,16 @@
uint32_t BitWidth = cast(CE->getType())->getBitWidth();
if (Op0->getType() == Type::FloatTy)
GV.IntVal = APIntOps::RoundFloatToAPInt(GV.FloatVal, BitWidth);
- else
+ else if (Op0->getType() == Type::DoubleTy)
GV.IntVal = APIntOps::RoundDoubleToAPInt(GV.DoubleVal, BitWidth);
+ else if (Op0->getType() == Type::X86_FP80Ty) {
+ APFloat apf = APFloat(GV.IntVal);
+ uint64_t v;
+ (void)apf.convertToInteger(&v, BitWidth,
+ CE->getOpcode()==Instruction::FPToSI,
+ APFloat::rmTowardZero);
+ GV.IntVal = v; // endian?
+ }
return GV;
}
case Instruction::PtrToInt: {
@@ -512,6 +536,35 @@
GV.DoubleVal = ::fmod(LHS.DoubleVal,RHS.DoubleVal); break;
}
break;
+ case Type::X86_FP80TyID:
+ case Type::PPC_FP128TyID:
+ case Type::FP128TyID: {
+ APFloat apfLHS = APFloat(LHS.IntVal);
+ switch (CE->getOpcode()) {
+ default: assert(0 && "Invalid long double opcode"); abort();
+ case Instruction::Add:
+ apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
+ GV.IntVal = apfLHS.convertToAPInt();
+ break;
+ case Instruction::Sub:
+ apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
+ GV.IntVal = apfLHS.convertToAPInt();
+ break;
+ case Instruction::Mul:
+ apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
+ GV.IntVal = apfLHS.convertToAPInt();
+ break;
+ case Instruction::FDiv:
+ apfLHS.divide(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
+ GV.IntVal = apfLHS.convertToAPInt();
+ break;
+ case Instruction::FRem:
+ apfLHS.mod(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
+ GV.IntVal = apfLHS.convertToAPInt();
+ break;
+ }
+ }
+ break;
}
return GV;
}
@@ -530,6 +583,11 @@
case Type::DoubleTyID:
Result.DoubleVal = cast(C)->getValueAPF().convertToDouble();
break;
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID:
+ case Type::PPC_FP128TyID:
+ Result.IntVal = cast (C)->getValueAPF().convertToAPInt();
+ break;
case Type::IntegerTyID:
Result.IntVal = cast(C)->getValue();
break;
@@ -583,6 +641,17 @@
case Type::DoubleTyID:
*((double*)Ptr) = Val.DoubleVal;
break;
+ case Type::X86_FP80TyID: {
+ uint16_t *Dest = (uint16_t*)Ptr;
+ const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData();
+ // This is endian dependent, but it will only work on x86 anyway.
+ Dest[0] = Src[4];
+ Dest[1] = Src[0];
+ Dest[2] = Src[1];
+ Dest[3] = Src[2];
+ Dest[4] = Src[3];
+ break;
+ }
case Type::PointerTyID:
*((PointerTy*)Ptr) = Val.PointerVal;
break;
@@ -620,6 +689,17 @@
case Type::PointerTyID:
Result.PointerVal = *((PointerTy*)Ptr);
break;
+ case Type::X86_FP80TyID: {
+ // This is endian dependent, but it will only work on x86 anyway.
+ uint16_t x[8], *p = (uint16_t*)Ptr;
+ x[0] = p[1];
+ x[1] = p[2];
+ x[2] = p[3];
+ x[3] = p[4];
+ x[4] = p[0];
+ Result.IntVal = APInt(80, 2, x);
+ break;
+ }
default:
cerr << "Cannot load value of type " << *Ty << "!\n";
abort();
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=42043&r1=42042&r2=42043&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Mon Sep 17 13:44:13 2007
@@ -178,6 +178,11 @@
case Type::DoubleTyID:
rv.DoubleVal = ((double(*)())(intptr_t)FPtr)();
return rv;
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID:
+ case Type::PPC_FP128TyID:
+ assert(0 && "long double not supported yet");
+ return rv;
case Type::PointerTyID:
return PTOGV(((void*(*)())(intptr_t)FPtr)());
}
@@ -209,7 +214,11 @@
case Type::FloatTyID: C = ConstantFP ::get(ArgTy, APFloat(AV.FloatVal));
break;
case Type::DoubleTyID: C = ConstantFP ::get(ArgTy, APFloat(AV.DoubleVal));
- break;
+ break;
+ case Type::PPC_FP128TyID:
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID: C = ConstantFP ::get(ArgTy, APFloat(AV.IntVal));
+ break;
case Type::PointerTyID:
void *ArgPtr = GVTOP(AV);
if (sizeof(void*) == 4) {
From lauro.venancio at gmail.com Mon Sep 17 13:47:09 2007
From: lauro.venancio at gmail.com (Lauro Ramos Venancio)
Date: Mon, 17 Sep 2007 15:47:09 -0300
Subject: [llvm-commits] Unbreak objc FE compilation on non-darwin
In-Reply-To: <1188512868.10219.21.camel@asl.dorms.spbu.ru>
References: <1188512868.10219.21.camel@asl.dorms.spbu.ru>
Message-ID: <9c10c9f0709171147y110fb188sa03afd90694d4258@mail.gmail.com>
I think a similar patch should be applied to llvm-gcc 4.0.
Lauro
2007/8/30, Anton Korobeynikov :
> Hello, Everyone.
>
> Please find attached patch for unbreaking objc FE for llvm-gcc 4.2. I've
> just fixed couple of "apple local" stuff (some of them were
> "generalized", some - just cleaned).
>
> Ok to commit?
>
> --
> With best regards, Anton Korobeynikov.
>
> Faculty of Mathematics & Mechanics, Saint Petersburg State University.
>
>
> _______________________________________________
> 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 Mon Sep 17 13:47:42 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 11:47:42 -0700
Subject: [llvm-commits] [llvm] r42029 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
In-Reply-To: <20070917183745.GE10864@village.us.cray.com>
References: <20070917183745.GE10864@village.us.cray.com>
Message-ID: <8DD77FE6-A808-4AA1-A3D6-ED6A3E6BB6AC@apple.com>
Ok, then it doesn't need to be merged into 2.1. Thx.
Evan
On Sep 17, 2007, at 11:37 AM, Dan Gohman wrote:
>> Doh. Thanks Dan. Was this breaking anything? Seems to me this fix
>> should be merged into the release branch. What do you say?
>
> The only in-tree user of BlockHasNoFallThrough appears to be
> BranchFolding,
> and there it's just guarding an optimization.
>
> Dan
>
> --
> Dan Gohman, Cray Inc.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From lauro.venancio at gmail.com Mon Sep 17 14:09:16 2007
From: lauro.venancio at gmail.com (Lauro Ramos Venancio)
Date: Mon, 17 Sep 2007 19:09:16 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r42044 -
/llvm-gcc-4.0/trunk/configure.in
Message-ID: <200709171909.l8HJ9Giw031685@zion.cs.uiuc.edu>
Author: laurov
Date: Mon Sep 17 14:09:15 2007
New Revision: 42044
URL: http://llvm.org/viewvc/llvm-project?rev=42044&view=rev
Log:
Readd.
Modified:
llvm-gcc-4.0/trunk/configure.in
Modified: llvm-gcc-4.0/trunk/configure.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/configure.in?rev=42044&r1=42043&r2=42044&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/configure.in (original)
+++ llvm-gcc-4.0/trunk/configure.in Mon Sep 17 14:09:15 2007
@@ -478,6 +478,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"
;;
From lauro.venancio at gmail.com Mon Sep 17 14:09:52 2007
From: lauro.venancio at gmail.com (Lauro Ramos Venancio)
Date: Mon, 17 Sep 2007 19:09:52 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r42045 - /llvm-gcc-4.0/trunk/configure
Message-ID: <200709171909.l8HJ9riY031728@zion.cs.uiuc.edu>
Author: laurov
Date: Mon Sep 17 14:09:51 2007
New Revision: 42045
URL: http://llvm.org/viewvc/llvm-project?rev=42045&view=rev
Log:
Regenerate.
Modified:
llvm-gcc-4.0/trunk/configure
Modified: llvm-gcc-4.0/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/configure?rev=42045&r1=42044&r2=42045&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/configure (original)
+++ llvm-gcc-4.0/trunk/configure Mon Sep 17 14:09:51 2007
@@ -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
From dpatel at apple.com Mon Sep 17 15:03:03 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 17 Sep 2007 20:03:03 -0000
Subject: [llvm-commits] [llvm] r42047 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Message-ID: <200709172003.l8HK33jC005180@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 15:03:03 2007
New Revision: 42047
URL: http://llvm.org/viewvc/llvm-project?rev=42047&view=rev
Log:
This is not ideal but unbreaks build failure.
APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=42047&r1=42046&r2=42047&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 17 15:03:03 2007
@@ -3720,7 +3720,9 @@
cerr << "<" << CSDN->getValueAPF().convertToDouble() << ">";
else {
cerr << "getValueAPF().convertToAPInt().dump();
+#endif
cerr << ")>";
}
} else if (const GlobalAddressSDNode *GADN =
From clattner at apple.com Mon Sep 17 15:06:33 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 17 Sep 2007 13:06:33 -0700
Subject: [llvm-commits] [llvm] r42047 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
In-Reply-To: <200709172003.l8HK33jC005180@zion.cs.uiuc.edu>
References: <200709172003.l8HK33jC005180@zion.cs.uiuc.edu>
Message-ID: <1BADE138-4703-4EA7-8510-3642826D3F97@apple.com>
On Sep 17, 2007, at 1:03 PM, Devang Patel wrote:
> Author: dpatel
> Date: Mon Sep 17 15:03:03 2007
> New Revision: 42047
>
> URL: http://llvm.org/viewvc/llvm-project?rev=42047&view=rev
> Log:
> This is not ideal but unbreaks build failure.
> APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump()
> routines are not.
APInt::dump should be pulled out of the ifdef, it should be
unconditionally available.
-Chris
> Modified:
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/
> SelectionDAG/SelectionDAG.cpp?rev=42047&r1=42046&r2=42047&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 17
> 15:03:03 2007
> @@ -3720,7 +3720,9 @@
> cerr << "<" << CSDN->getValueAPF().convertToDouble() << ">";
> else {
> cerr << " +#ifndef NDEBUG
> CSDN->getValueAPF().convertToAPInt().dump();
> +#endif
> cerr << ")>";
> }
> } else if (const GlobalAddressSDNode *GADN =
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From dpatel at apple.com Mon Sep 17 15:07:41 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 17 Sep 2007 20:07:41 -0000
Subject: [llvm-commits] [llvm] r42048 -
/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
Message-ID: <200709172007.l8HK7fZa005632@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 15:07:40 2007
New Revision: 42048
URL: http://llvm.org/viewvc/llvm-project?rev=42048&view=rev
Log:
Fix comment.
Modified:
llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=42048&r1=42047&r2=42048&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Sep 17 15:07:40 2007
@@ -96,7 +96,7 @@
unsigned NumInsts = 0, NumBlocks = 0;
// Look at the size of the callee. Each basic block counts as 20 units, and
- // each instruction counts as 10.
+ // each instruction counts as 5.
for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
for (BasicBlock::const_iterator II = BB->begin(), E = BB->end();
II != E; ++II) {
From dalej at apple.com Mon Sep 17 15:15:38 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 17 Sep 2007 20:15:38 -0000
Subject: [llvm-commits] [llvm] r42049 - in /llvm/trunk/lib/Target/X86:
X86FloatingPoint.cpp X86RegisterInfo.cpp
Message-ID: <200709172015.l8HKFcWM006191@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Sep 17 15:15:38 2007
New Revision: 42049
URL: http://llvm.org/viewvc/llvm-project?rev=42049&view=rev
Log:
Remove RSTRegClass case from loadRegFromStackSlot
and storeRegToStackSlot. Evan and I concluded this
should never be needed and it appears to be true.
(It if is needed, adjustment would be needed for
long double to work.)
Modified:
llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=42049&r1=42048&r2=42049&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Sep 17 15:15:38 2007
@@ -608,7 +608,7 @@
// If we have one _and_ we don't want to pop the operand, duplicate the value
// on the stack instead of moving it. This ensure that popping the value is
// always ok.
- // Ditto FISTTP16m, FISTTP32m, FISTTP64m.
+ // Ditto FISTTP16m, FISTTP32m, FISTTP64m, ST_FpP80m.
//
if (!KillsSrc &&
(MI->getOpcode() == X86::IST_Fp64m32 ||
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=42049&r1=42048&r2=42049&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Sep 17 15:15:38 2007
@@ -170,9 +170,7 @@
Opc = X86::MOV16_mr;
} else if (RC == &X86::RFP80RegClass) {
Opc = X86::ST_FpP80m; // pops
- } else if (RC == &X86::RFP64RegClass || RC == &X86::RSTRegClass) {
- /// FIXME spilling long double values as 64 bit does not work.
- /// We need RST80, unfortunately.
+ } else if (RC == &X86::RFP64RegClass) {
Opc = X86::ST_Fp64m;
} else if (RC == &X86::RFP32RegClass) {
Opc = X86::ST_Fp32m;
@@ -211,7 +209,7 @@
Opc = X86::MOV16_rm;
} else if (RC == &X86::RFP80RegClass) {
Opc = X86::LD_Fp80m;
- } else if (RC == &X86::RFP64RegClass || RC == &X86::RSTRegClass) {
+ } else if (RC == &X86::RFP64RegClass) {
Opc = X86::LD_Fp64m;
} else if (RC == &X86::RFP32RegClass) {
Opc = X86::LD_Fp32m;
From gordonhenriksen at mac.com Mon Sep 17 15:30:04 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Mon, 17 Sep 2007 20:30:04 -0000
Subject: [llvm-commits] [llvm] r42051 - in /llvm/trunk:
lib/VMCore/Verifier.cpp test/CodeGen/Generic/GC/lower_gcroot.ll
test/Verifier/gcread-ptrptr.ll test/Verifier/gcroot-alloca.ll
test/Verifier/gcroot-meta.ll test/Verifier/gcroot-ptrptr.ll
test/Verifier/gcwrite-ptrptr.ll
Message-ID: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
Author: gordon
Date: Mon Sep 17 15:30:04 2007
New Revision: 42051
URL: http://llvm.org/viewvc/llvm-project?rev=42051&view=rev
Log:
Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:
* @llvm.gcread(*, **)
void @llvm.gcwrite(*, *, **)
And for @llvm.gcroot, the first stack slot is verified to be an alloca or a
bitcast of an alloca.
Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.
Added:
llvm/trunk/test/Verifier/gcread-ptrptr.ll
llvm/trunk/test/Verifier/gcroot-alloca.ll
llvm/trunk/test/Verifier/gcroot-meta.ll
llvm/trunk/test/Verifier/gcroot-ptrptr.ll
llvm/trunk/test/Verifier/gcwrite-ptrptr.ll
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
llvm/trunk/test/CodeGen/Generic/GC/lower_gcroot.ll
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=42051&r1=42050&r2=42051&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 17 15:30:04 2007
@@ -1072,6 +1072,18 @@
InstsInThisBlock.insert(&I);
}
+static bool HasPtrPtrType(Value *Val) {
+ if (const PointerType *PtrTy = dyn_cast(Val->getType()))
+ return isa(PtrTy->getElementType());
+ return false;
+}
+
+static Value *StripBitCasts(Value *Val) {
+ if (BitCastInst *CI = dyn_cast(Val))
+ return StripBitCasts(CI->getOperand(0));
+ return Val;
+}
+
/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
///
void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
@@ -1082,6 +1094,30 @@
#define GET_INTRINSIC_VERIFIER
#include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_VERIFIER
+
+ switch (ID) {
+ default:
+ break;
+ case Intrinsic::gcroot:
+ Assert1(HasPtrPtrType(CI.getOperand(1)),
+ "llvm.gcroot parameter #1 must be a pointer to a pointer.", &CI);
+ Assert1(isa(StripBitCasts(CI.getOperand(1))),
+ "llvm.gcroot parameter #1 must be an alloca (or a bitcast).", &CI);
+ Assert1(isa(CI.getOperand(2)),
+ "llvm.gcroot parameter #2 must be a constant or global.", &CI);
+ break;
+ case Intrinsic::gcwrite:
+ Assert1(CI.getOperand(3)->getType()
+ == PointerType::get(CI.getOperand(1)->getType()),
+ "Call to llvm.gcwrite must be with type 'void (%ty*, %ty2*, %ty**)'.",
+ &CI);
+ break;
+ case Intrinsic::gcread:
+ Assert1(CI.getOperand(2)->getType() == PointerType::get(CI.getType()),
+ "Call to llvm.gcread must be with type '%ty* (%ty2*, %ty**).'",
+ &CI);
+ break;
+ }
}
/// VerifyIntrinsicPrototype - TableGen emits calls to this function into
Modified: llvm/trunk/test/CodeGen/Generic/GC/lower_gcroot.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/GC/lower_gcroot.ll?rev=42051&r1=42050&r2=42051&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/GC/lower_gcroot.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/GC/lower_gcroot.ll Mon Sep 17 15:30:04 2007
@@ -3,7 +3,8 @@
%Env = type opaque*
define void @.main(%Env) {
- call void @llvm.gcroot( %Env* null, %Env null )
+ %Root = alloca %Env
+ call void @llvm.gcroot( %Env* %Root, %Env null )
unreachable
}
Added: llvm/trunk/test/Verifier/gcread-ptrptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/gcread-ptrptr.ll?rev=42051&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/gcread-ptrptr.ll (added)
+++ llvm/trunk/test/Verifier/gcread-ptrptr.ll Mon Sep 17 15:30:04 2007
@@ -0,0 +1,13 @@
+; RUN: not llvm-as < %s
+; PR1633
+
+%meta = type { i8* }
+%obj = type { %meta* }
+
+declare %obj* @llvm.gcread(%obj*, %obj*)
+
+define %obj* @f() {
+entry:
+ %x = call %obj* @llvm.gcread(%obj* null, %obj* null)
+ ret %obj* %x
+}
Added: llvm/trunk/test/Verifier/gcroot-alloca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/gcroot-alloca.ll?rev=42051&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/gcroot-alloca.ll (added)
+++ llvm/trunk/test/Verifier/gcroot-alloca.ll Mon Sep 17 15:30:04 2007
@@ -0,0 +1,14 @@
+; RUN: not llvm-as < %s
+; PR1633
+
+%meta = type { i8* }
+%obj = type { %meta* }
+
+declare void @llvm.gcroot(%obj**, %meta*)
+
+define void @f() {
+entry:
+ call void @llvm.gcroot(%obj** null, %meta* null)
+
+ ret void
+}
Added: llvm/trunk/test/Verifier/gcroot-meta.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/gcroot-meta.ll?rev=42051&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/gcroot-meta.ll (added)
+++ llvm/trunk/test/Verifier/gcroot-meta.ll Mon Sep 17 15:30:04 2007
@@ -0,0 +1,16 @@
+; RUN: not llvm-as < %s
+; PR1633
+
+%meta = type { i8* }
+%obj = type { %meta* }
+
+declare void @llvm.gcroot(%obj**, %meta*)
+
+define void @f() {
+entry:
+ %local.obj = alloca %obj*
+ %local.meta = alloca %meta
+ call void @llvm.gcroot(%obj** %local.obj, %meta* %local.meta)
+
+ ret void
+}
Added: llvm/trunk/test/Verifier/gcroot-ptrptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/gcroot-ptrptr.ll?rev=42051&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/gcroot-ptrptr.ll (added)
+++ llvm/trunk/test/Verifier/gcroot-ptrptr.ll Mon Sep 17 15:30:04 2007
@@ -0,0 +1,14 @@
+; RUN: not llvm-as < %s
+; PR1633
+
+%meta = type { i8* }
+%obj = type { %meta* }
+
+declare void @llvm.gcroot(%obj*, %meta*)
+
+define void @f() {
+entry:
+ %local.obj = alloca %obj
+ call void @llvm.gcroot(%obj* %local.obj, %meta* null)
+ ret void
+}
Added: llvm/trunk/test/Verifier/gcwrite-ptrptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/gcwrite-ptrptr.ll?rev=42051&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/gcwrite-ptrptr.ll (added)
+++ llvm/trunk/test/Verifier/gcwrite-ptrptr.ll Mon Sep 17 15:30:04 2007
@@ -0,0 +1,13 @@
+; RUN: not llvm-as < %s
+; PR1633
+
+%meta = type { i8* }
+%obj = type { %meta* }
+
+declare void @llvm.gcwrite(%obj*, %obj*, %obj*)
+
+define void @f() {
+entry:
+ call void @llvm.gcwrite(%obj* null, %obj* null, %obj* null)
+ ret void
+}
From tonic at nondot.org Mon Sep 17 15:36:18 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 17 Sep 2007 20:36:18 -0000
Subject: [llvm-commits] [llvm] r42052 -
/llvm/branches/release_21/tools/opt/opt.cpp
Message-ID: <200709172036.l8HKaIWi018464@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Sep 17 15:36:17 2007
New Revision: 42052
URL: http://llvm.org/viewvc/llvm-project?rev=42052&view=rev
Log:
Disable LoopIndexSplitting for 2.1
Modified:
llvm/branches/release_21/tools/opt/opt.cpp
Modified: llvm/branches/release_21/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/tools/opt/opt.cpp?rev=42052&r1=42051&r2=42052&view=diff
==============================================================================
--- llvm/branches/release_21/tools/opt/opt.cpp (original)
+++ llvm/branches/release_21/tools/opt/opt.cpp Mon Sep 17 15:36:17 2007
@@ -277,7 +277,8 @@
addPass(PM, createLoopRotatePass());
addPass(PM, createLICMPass()); // Hoist loop invariants
addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
- addPass(PM, createLoopIndexSplitPass()); // Index split loops.
+ // Diable for 2.1
+ //addPass(PM, createLoopIndexSplitPass()); // Index split loops.
addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc
addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars
addPass(PM, createLoopUnrollPass()); // Unroll small loops
From tonic at nondot.org Mon Sep 17 15:37:09 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 17 Sep 2007 20:37:09 -0000
Subject: [llvm-commits] [llvm] r42053 -
/llvm/branches/release_21/tools/opt/opt.cpp
Message-ID: <200709172037.l8HKb9uk018502@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Sep 17 15:37:09 2007
New Revision: 42053
URL: http://llvm.org/viewvc/llvm-project?rev=42053&view=rev
Log:
Spell things correctly.
Modified:
llvm/branches/release_21/tools/opt/opt.cpp
Modified: llvm/branches/release_21/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/tools/opt/opt.cpp?rev=42053&r1=42052&r2=42053&view=diff
==============================================================================
--- llvm/branches/release_21/tools/opt/opt.cpp (original)
+++ llvm/branches/release_21/tools/opt/opt.cpp Mon Sep 17 15:37:09 2007
@@ -277,7 +277,7 @@
addPass(PM, createLoopRotatePass());
addPass(PM, createLICMPass()); // Hoist loop invariants
addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
- // Diable for 2.1
+ // Disable for 2.1
//addPass(PM, createLoopIndexSplitPass()); // Index split loops.
addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc
addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars
From dpatel at apple.com Mon Sep 17 15:39:49 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 17 Sep 2007 20:39:49 -0000
Subject: [llvm-commits] [llvm] r42054 -
/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Message-ID: <200709172039.l8HKdnFL018680@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 15:39:48 2007
New Revision: 42054
URL: http://llvm.org/viewvc/llvm-project?rev=42054&view=rev
Log:
Skeleton for transformations to truncate loop's iteration space.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=42054&r1=42053&r2=42054&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Sep 17 15:39:48 2007
@@ -111,7 +111,14 @@
/// instruction then loop body is executed only for one iteration. In
/// such case eliminate loop structure surrounding this loop body. For
bool processOneIterationLoop(SplitInfo &SD);
-
+
+ void updateLoopBounds(ICmpInst *CI);
+ /// updateLoopIterationSpace - Current loop body is covered by an AND
+ /// instruction whose operands compares induction variables with loop
+ /// invariants. If possible, hoist this check outside the loop by
+ /// updating appropriate start and end values for induction variable.
+ bool updateLoopIterationSpace(SplitInfo &SD);
+
/// If loop header includes loop variant instruction operands then
/// this loop may not be eliminated.
bool safeHeader(SplitInfo &SD, BasicBlock *BB);
@@ -229,7 +236,19 @@
E = SplitData.end(); SI != E;) {
SplitInfo &SD = *SI;
ICmpInst *CI = dyn_cast(SD.SplitCondition);
- if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) {
+ if (SD.SplitCondition->getOpcode() == Instruction::And) {
+ Changed = updateLoopIterationSpace(SD);
+ if (Changed) {
+ ++NumIndexSplit;
+ // If is loop is eliminated then nothing else to do here.
+ return Changed;
+ } else {
+ SmallVector::iterator Delete_SI = SI;
+ ++SI;
+ SplitData.erase(Delete_SI);
+ }
+ }
+ else if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) {
Changed = processOneIterationLoop(SD);
if (Changed) {
++NumIndexSplit;
@@ -391,6 +410,25 @@
if (BR->isUnconditional())
continue;
+ if (Instruction *AndI = dyn_cast(BR->getCondition())) {
+ if (AndI->getOpcode() == Instruction::And) {
+ ICmpInst *Op0 = dyn_cast(AndI->getOperand(0));
+ ICmpInst *Op1 = dyn_cast(AndI->getOperand(1));
+
+ if (!Op0 || !Op1)
+ continue;
+
+ if (!safeICmpInst(Op0, SD))
+ continue;
+ SD.clear();
+ if (!safeICmpInst(Op1, SD))
+ continue;
+ SD.clear();
+ SD.SplitCondition = AndI;
+ SplitData.push_back(SD);
+ continue;
+ }
+ }
ICmpInst *CI = dyn_cast(BR->getCondition());
if (!CI || CI == ExitCondition)
continue;
@@ -662,6 +700,164 @@
return true;
}
+void LoopIndexSplit::updateLoopBounds(ICmpInst *CI) {
+
+ Value *V0 = CI->getOperand(0);
+ Value *V1 = CI->getOperand(1);
+ Value *NV = NULL;
+
+ SCEVHandle SH0 = SE->getSCEV(V0);
+
+ if (SH0->isLoopInvariant(L))
+ NV = V0;
+ else
+ NV = V1;
+
+ switch (CI->getPredicate()) {
+ case ICmpInst::ICMP_ULE:
+ case ICmpInst::ICMP_SLE:
+ // for (i = LB; i < UB; ++i)
+ // if (i <= NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NUB = min (NV+1, UB)
+ // for (i = LB; i < NUB ; ++i)
+ // LOOP_BODY
+ //
+
+
+
+ // for (i = LB; i <= UB; ++i)
+ // if (i <= NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NUB = min (NV, UB)
+ // for (i = LB; i <= NUB ; ++i)
+ // LOOP_BODY
+ //
+ break;
+ case ICmpInst::ICMP_ULT:
+ case ICmpInst::ICMP_SLT:
+ // for (i = LB; i < UB; ++i)
+ // if (i < NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NUB = min (NV, UB)
+ // for (i = LB; i < NUB ; ++i)
+ // LOOP_BODY
+ //
+
+
+
+ // for (i = LB; i <= UB; ++i)
+ // if (i < NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NUB = min (NV -1 , UB)
+ // for (i = LB; i <= NUB ; ++i)
+ // LOOP_BODY
+ //
+ break;
+ case ICmpInst::ICMP_UGE:
+ case ICmpInst::ICMP_SGE:
+ // for (i = LB; i (< or <=) UB; ++i)
+ // if (i >= NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NLB = max (NV, LB)
+ // for (i = NLB; i (< or <=) UB ; ++i)
+ // LOOP_BODY
+ //
+ break;
+ case ICmpInst::ICMP_UGT:
+ case ICmpInst::ICMP_SGT:
+ // for (i = LB; i (< or <=) UB; ++i)
+ // if (i > NV && ...)
+ // LOOP_BODY
+ //
+ // is transformed into
+ // NLB = max (NV+1, LB)
+ // for (i = NLB; i (< or <=) UB ; ++i)
+ // LOOP_BODY
+ //
+ break;
+ default:
+ assert ( 0 && "Unexpected split condition predicate");
+ }
+}
+/// updateLoopIterationSpace - Current loop body is covered by an AND
+/// instruction whose operands compares induction variables with loop
+/// invariants. If possible, hoist this check outside the loop by
+/// updating appropriate start and end values for induction variable.
+bool LoopIndexSplit::updateLoopIterationSpace(SplitInfo &SD) {
+ BasicBlock *Header = L->getHeader();
+ ICmpInst *Op0 = cast(SD.SplitCondition->getOperand(0));
+ ICmpInst *Op1 = cast(SD.SplitCondition->getOperand(1));
+
+ if (Op0->getPredicate() == ICmpInst::ICMP_EQ
+ || Op0->getPredicate() == ICmpInst::ICMP_NE
+ || Op0->getPredicate() == ICmpInst::ICMP_EQ
+ || Op0->getPredicate() == ICmpInst::ICMP_NE)
+ return false;
+
+ // Check if SplitCondition dominates entire loop body
+ // or not.
+
+ // If SplitCondition is not in loop header then this loop is not suitable
+ // for this transformation.
+ if (SD.SplitCondition->getParent() != Header)
+ return false;
+
+ // If loop header includes loop variant instruction operands then
+ // this loop may not be eliminated.
+ Instruction *Terminator = Header->getTerminator();
+ for(BasicBlock::iterator BI = Header->begin(), BE = Header->end();
+ BI != BE; ++BI) {
+ Instruction *I = BI;
+
+ // PHI Nodes are OK.
+ if (isa(I))
+ continue;
+
+ // SplitCondition itself is OK.
+ if (I == SD.SplitCondition)
+ continue;
+ if (I == Op0 || I == Op1)
+ continue;
+
+ // Induction variable is OK.
+ if (I == IndVar)
+ continue;
+
+ // Induction variable increment is OK.
+ if (I == IndVarIncrement)
+ continue;
+
+ // Terminator is also harmless.
+ if (I == Terminator)
+ continue;
+
+ // Otherwise we have a instruction that may not be safe.
+ return false;
+ }
+
+ // If Exiting block includes loop variant instructions then this
+ // loop may not be eliminated.
+ if (!safeExitingBlock(SD, ExitCondition->getParent()))
+ return false;
+
+ updateLoopBounds(Op0);
+ updateLoopBounds(Op1);
+ // Update CFG
+ return true;
+}
+
+
/// removeBlocks - Remove basic block DeadBB and all blocks dominated by DeadBB.
/// This routine is used to remove split condition's dead branch, dominated by
/// DeadBB. LiveBB dominates split conidition's other branch.
From dalej at apple.com Mon Sep 17 15:58:23 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 17 Sep 2007 13:58:23 -0700
Subject: [llvm-commits] x86 long double coming
Message-ID:
I think this has come far enough that I can turn the switch in llvm-
gcc that
makes long doubles 80 bits on x86. There are probably bugs, but quite
a few things work, including all the long doubles in the test suite.
This is an ABI change, so I'm giving notice. I'm planning to do this
sometime
tomorrow morning California time, say 20 hours from now. Let me know
if you
have objections.
From dpatel at apple.com Mon Sep 17 16:01:05 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 17 Sep 2007 21:01:05 -0000
Subject: [llvm-commits] [llvm] r42058 -
/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Message-ID: <200709172101.l8HL15st021582@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 16:01:05 2007
New Revision: 42058
URL: http://llvm.org/viewvc/llvm-project?rev=42058&view=rev
Log:
Do not eliminate loop when it is invalid to do so. For example,
for(int i = 0; i < N; i++) {
if ( i == XYZ) {
A;
else
B;
}
C;
D;
}
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=42058&r1=42057&r2=42058&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Sep 17 16:01:05 2007
@@ -528,6 +528,20 @@
if (!safeExitingBlock(SD, ExitCondition->getParent()))
return false;
+ // If split condition is not safe then do not process this loop.
+ // For example,
+ // for(int i = 0; i < N; i++) {
+ // if ( i == XYZ) {
+ // A;
+ // else
+ // B;
+ // }
+ // C;
+ // D;
+ // }
+ if (!safeSplitCondition(SD))
+ return false;
+
// Update CFG.
// Replace index variable with split value in loop body. Loop body is executed
@@ -956,24 +970,11 @@
bool LoopIndexSplit::safeSplitCondition(SplitInfo &SD) {
BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
-
- // Unable to handle triange loops at the moment.
- // In triangle loop, split condition is in header and one of the
- // the split destination is loop latch. If split condition is EQ
- // then such loops are already handle in processOneIterationLoop().
- BasicBlock *Latch = L->getLoopLatch();
+ BasicBlock *Latch = L->getLoopLatch();
BranchInst *SplitTerminator =
cast(SplitCondBlock->getTerminator());
BasicBlock *Succ0 = SplitTerminator->getSuccessor(0);
BasicBlock *Succ1 = SplitTerminator->getSuccessor(1);
- if (L->getHeader() == SplitCondBlock
- && (Latch == Succ0 || Latch == Succ1))
- return false;
-
- // If split condition branches heads do not have single predecessor,
- // SplitCondBlock, then is not possible to remove inactive branch.
- if (!Succ0->getSinglePredecessor() || !Succ1->getSinglePredecessor())
- return false;
// Finally this split condition is safe only if merge point for
// split condition branch is loop latch. This check along with previous
@@ -1196,6 +1197,26 @@
if (!safeSplitCondition(SD))
return false;
+ BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
+
+ // Unable to handle triange loops at the moment.
+ // In triangle loop, split condition is in header and one of the
+ // the split destination is loop latch. If split condition is EQ
+ // then such loops are already handle in processOneIterationLoop().
+ BasicBlock *Latch = L->getLoopLatch();
+ BranchInst *SplitTerminator =
+ cast(SplitCondBlock->getTerminator());
+ BasicBlock *Succ0 = SplitTerminator->getSuccessor(0);
+ BasicBlock *Succ1 = SplitTerminator->getSuccessor(1);
+ if (L->getHeader() == SplitCondBlock
+ && (Latch == Succ0 || Latch == Succ1))
+ return false;
+
+ // If split condition branches heads do not have single predecessor,
+ // SplitCondBlock, then is not possible to remove inactive branch.
+ if (!Succ0->getSinglePredecessor() || !Succ1->getSinglePredecessor())
+ return false;
+
// After loop is cloned there are two loops.
//
// First loop, referred as ALoop, executes first part of loop's iteration
From tonic at nondot.org Mon Sep 17 16:36:59 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 17 Sep 2007 21:36:59 -0000
Subject: [llvm-commits] [llvm] r42064 -
/llvm/branches/release_21/autoconf/m4/libtool.m4
Message-ID: <200709172136.l8HLax9H026610@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Sep 17 16:36:59 2007
New Revision: 42064
URL: http://llvm.org/viewvc/llvm-project?rev=42064&view=rev
Log:
Fix incorrect default values in help string.
Modified:
llvm/branches/release_21/autoconf/m4/libtool.m4
Modified: llvm/branches/release_21/autoconf/m4/libtool.m4
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/autoconf/m4/libtool.m4?rev=42064&r1=42063&r2=42064&view=diff
==============================================================================
--- llvm/branches/release_21/autoconf/m4/libtool.m4 (original)
+++ llvm/branches/release_21/autoconf/m4/libtool.m4 Mon Sep 17 16:36:59 2007
@@ -1905,7 +1905,7 @@
AC_DEFUN([AC_ENABLE_SHARED],
[define([enable_shared_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@])],
+ AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
@@ -1943,7 +1943,7 @@
AC_DEFUN([AC_ENABLE_STATIC],
[define([enable_static_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@])],
+ AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
@@ -1981,7 +1981,7 @@
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
[define([enable_Fast_install_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@])],
+ AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
From tonic at nondot.org Mon Sep 17 16:37:52 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 17 Sep 2007 21:37:52 -0000
Subject: [llvm-commits] [llvm] r42065 - /llvm/branches/release_21/configure
Message-ID: <200709172137.l8HLbruR026971@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Sep 17 16:37:52 2007
New Revision: 42065
URL: http://llvm.org/viewvc/llvm-project?rev=42065&view=rev
Log:
Regenerated configure script to fix help strings.
Modified:
llvm/branches/release_21/configure
Modified: llvm/branches/release_21/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/configure?rev=42065&r1=42064&r2=42065&view=diff
==============================================================================
--- llvm/branches/release_21/configure (original)
+++ llvm/branches/release_21/configure Mon Sep 17 16:37:52 2007
@@ -1542,12 +1542,12 @@
%a (default is YES)
--enable-ltdl-install install libltdl
--enable-shared[=PKGS] build shared libraries
- [default=enable_shared_default]
+ [default=yes]
--enable-static[=PKGS] build static libraries
- [default=enable_static_default]
+ [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation
- [default=enable_Fast_install_default]
+ [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
Optional Packages:
From tonic at nondot.org Mon Sep 17 16:41:15 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 17 Sep 2007 21:41:15 -0000
Subject: [llvm-commits] [llvm] r42066 - in /llvm/trunk:
autoconf/m4/libtool.m4 configure
Message-ID: <200709172141.l8HLfFg8027609@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Sep 17 16:41:15 2007
New Revision: 42066
URL: http://llvm.org/viewvc/llvm-project?rev=42066&view=rev
Log:
Fix broken default help strings for enable-shared, enable-static, and enable-fast-install. Regenerate configure script.
Modified:
llvm/trunk/autoconf/m4/libtool.m4
llvm/trunk/configure
Modified: llvm/trunk/autoconf/m4/libtool.m4
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/libtool.m4?rev=42066&r1=42065&r2=42066&view=diff
==============================================================================
--- llvm/trunk/autoconf/m4/libtool.m4 (original)
+++ llvm/trunk/autoconf/m4/libtool.m4 Mon Sep 17 16:41:15 2007
@@ -1905,7 +1905,7 @@
AC_DEFUN([AC_ENABLE_SHARED],
[define([enable_shared_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@])],
+ AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
@@ -1943,7 +1943,7 @@
AC_DEFUN([AC_ENABLE_STATIC],
[define([enable_static_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@])],
+ AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
@@ -1981,7 +1981,7 @@
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
[define([enable_Fast_install_default], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@])],
+ AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@]),
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=42066&r1=42065&r2=42066&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Mon Sep 17 16:41:15 2007
@@ -1542,12 +1542,12 @@
%a (default is YES)
--enable-ltdl-install install libltdl
--enable-shared[=PKGS] build shared libraries
- [default=enable_shared_default]
+ [default=yes]
--enable-static[=PKGS] build static libraries
- [default=enable_static_default]
+ [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation
- [default=enable_Fast_install_default]
+ [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
Optional Packages:
From dpatel at apple.com Mon Sep 17 17:24:01 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 17 Sep 2007 22:24:01 -0000
Subject: [llvm-commits] [llvm] r42068 - in /llvm/trunk:
include/llvm/ADT/APInt.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Support/APInt.cpp
Message-ID: <200709172224.l8HMO1g9030208@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 17:24:00 2007
New Revision: 42068
URL: http://llvm.org/viewvc/llvm-project?rev=42068&view=rev
Log:
Do not hide APInt::dump() inside #ifndef NDEBUG.
Modified:
llvm/trunk/include/llvm/ADT/APInt.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/Support/APInt.cpp
Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=42068&r1=42067&r2=42068&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Mon Sep 17 17:24:00 2007
@@ -1160,10 +1160,8 @@
static void tcSetLeastSignificantBits(integerPart *, unsigned int,
unsigned int bits);
-#ifndef NDEBUG
/// @brief debug method
void dump() const;
-#endif
/// @}
};
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=42068&r1=42067&r2=42068&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 17 17:24:00 2007
@@ -3720,9 +3720,7 @@
cerr << "<" << CSDN->getValueAPF().convertToDouble() << ">";
else {
cerr << "getValueAPF().convertToAPInt().dump();
-#endif
cerr << ")>";
}
} else if (const GlobalAddressSDNode *GADN =
Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=42068&r1=42067&r2=42068&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Mon Sep 17 17:24:00 2007
@@ -21,9 +21,7 @@
#include
#include
#include
-#ifndef NDEBUG
#include
-#endif
using namespace llvm;
@@ -1999,7 +1997,6 @@
return result;
}
-#ifndef NDEBUG
void APInt::dump() const
{
cerr << "APInt(" << BitWidth << ")=" << std::setbase(16);
@@ -2011,7 +2008,6 @@
cerr << " U(" << this->toStringUnsigned(10) << ") S("
<< this->toStringSigned(10) << ")" << std::setbase(10);
}
-#endif
// This implements a variety of operations on a representation of
// arbitrary precision, two's-complement, bignum integer values.
From evan.cheng at apple.com Mon Sep 17 17:26:41 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 22:26:41 -0000
Subject: [llvm-commits] [llvm] r42069 -
/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Message-ID: <200709172226.l8HMQflf030402@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Sep 17 17:26:41 2007
New Revision: 42069
URL: http://llvm.org/viewvc/llvm-project?rev=42069&view=rev
Log:
Bug fix and minor clean up of generated code.
Modified:
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=42069&r1=42068&r2=42069&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Sep 17 17:26:41 2007
@@ -2649,7 +2649,6 @@
/// we actually have to build a DAG!
std::vector
EmitResultCode(TreePatternNode *N, std::vector DstRegs,
- bool RetSelected,
bool InFlagDecled, bool ResNodeDecled,
bool LikeLeaf = false, bool isRoot = false) {
// List of arguments of getTargetNode() or SelectNodeTo().
@@ -2867,7 +2866,7 @@
if ((!OperandNode->isSubClassOf("PredicateOperand") &&
!OperandNode->isSubClassOf("OptionalDefOperand")) ||
ISE.getDefaultOperand(OperandNode).DefaultOps.empty()) {
- Ops = EmitResultCode(N->getChild(ChildNo), DstRegs, RetSelected,
+ Ops = EmitResultCode(N->getChild(ChildNo), DstRegs,
InFlagDecled, ResNodeDecled);
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
++ChildNo;
@@ -2877,7 +2876,7 @@
const DAGDefaultOperand &DefaultOp =
ISE.getDefaultOperand(II.OperandList[InstOpNo].Rec);
for (unsigned i = 0, e = DefaultOp.DefaultOps.size(); i != e; ++i) {
- Ops = EmitResultCode(DefaultOp.DefaultOps[i], DstRegs, RetSelected,
+ Ops = EmitResultCode(DefaultOp.DefaultOps[i], DstRegs,
InFlagDecled, ResNodeDecled);
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
NumEAInputs += Ops.size();
@@ -3039,11 +3038,11 @@
if (NodeHasOutFlag) {
if (!InFlagDecled) {
emitCode("SDOperand InFlag(ResNode, " +
- utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
+ utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
InFlagDecled = true;
} else
emitCode("InFlag = SDOperand(ResNode, " +
- utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
+ utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
}
if (FoldedChains.size() > 0) {
@@ -3058,20 +3057,15 @@
if (NodeHasOutFlag) {
emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(NumPatResults + (unsigned)InputHasChain) +"), InFlag);");
+ utostr(NumPatResults + (unsigned)InputHasChain)
+ +"), InFlag);");
NeedReplace = true;
}
- if (NeedReplace) {
- for (unsigned i = 0; i < NumPatResults; i++)
- emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(i) + "), SDOperand(ResNode, " + utostr(i) + "));");
- if (InputHasChain)
- emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(NumPatResults) + "), SDOperand(" + ChainName + ".Val, "
- + ChainName + ".ResNo" + "));");
- } else
- RetSelected = true;
+ if (NeedReplace && InputHasChain)
+ emitCode("ReplaceUses(SDOperand(N.Val, " +
+ utostr(NumPatResults) + "), SDOperand(" + ChainName
+ + ".Val, " + ChainName + ".ResNo" + "));");
// User does not expect the instruction would produce a chain!
if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) {
@@ -3081,18 +3075,11 @@
if (NodeHasOutFlag)
emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(NumPatResults+1) +
"), SDOperand(ResNode, N.ResNo-1));");
- for (unsigned i = 0; i < NumPatResults; ++i)
- emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(i) +
- "), SDOperand(ResNode, " + utostr(i) + "));");
emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(NumPatResults) +
"), " + ChainName + ");");
- RetSelected = false;
}
- if (RetSelected)
- emitCode("return ResNode;");
- else
- emitCode("return NULL;");
+ emitCode("return ResNode;");
} else {
std::string Code = "return CurDAG->SelectNodeTo(N.Val, Opc" +
utostr(OpcNo);
@@ -3133,7 +3120,7 @@
// PatLeaf node - the operand may or may not be a leaf node. But it should
// behave like one.
std::vector Ops =
- EmitResultCode(N->getChild(0), DstRegs, RetSelected, InFlagDecled,
+ EmitResultCode(N->getChild(0), DstRegs, InFlagDecled,
ResNodeDecled, true);
unsigned ResNo = TmpNo++;
emitCode("SDOperand Tmp" + utostr(ResNo) + " = Transform_" + Op->getName()
@@ -3300,7 +3287,7 @@
} while (Emitter.InsertOneTypeCheck(Pat, Pattern.getSrcPattern(), "N", true));
Emitter.EmitResultCode(Pattern.getDstPattern(), Pattern.getDstRegs(),
- false, false, false, false, true);
+ false, false, false, true);
delete Pat;
}
@@ -3957,9 +3944,11 @@
OS << " RemoveKilled();\n";
OS << "}\n";
OS << "void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {\n";
- OS << " unsigned NumVals = F->getNumValues();\n";
- OS << " if (NumVals < T->getNumValues()) {\n";
- OS << " for (unsigned i = 0; i < NumVals; ++i)\n";
+ OS << " unsigned FNumVals = F->getNumValues();\n";
+ OS << " unsigned TNumVals = T->getNumValues();\n";
+ OS << " if (FNumVals != TNumVals) {\n";
+ OS << " for (unsigned i = 0, e = std::min(FNumVals, TNumVals); "
+ << "i < e; ++i)\n";
OS << " CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), "
<< "SDOperand(T, i), ISelKilled);\n";
OS << " } else {\n";
From isanbard at gmail.com Mon Sep 17 17:35:16 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 Sep 2007 15:35:16 -0700
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 - in
/llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp varasm.c
In-Reply-To: <200709171059.54888.baldrick@free.fr>
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
<200709171059.54888.baldrick@free.fr>
Message-ID: <16e5fdf90709171535i6150d80ah452f54ab897289c3@mail.gmail.com>
Hi Duncan (et al),
> I've CC'd Anton since he's the one who knows all about this stuff. Presumably
> when A is an alias for B there are two cases: either this is a "weak alias" or
> weakref, meaning that at link time it may turn out that A wasn't an alias for
> B after all, or A is a strong alias (a term I just invented) for B, meaning that
> this is definitive: you can replace uses of A with uses of B everywhere. In the
> first case linker support is required, but not in the second case, so presumably
> it is wrong to turn off alias support in the second case. I don't know if your
> patch turned this second case off or not.
>
> In the first case (weakrefs) we output a special declaration to the bitcode
> saying that A is a weak alias for B. I think it is a mistake not to output
> this even for platforms like Darwin that don't handle weakrefs: such aliases
> may be resolvable by LLVM, for example when linking modules using llvm-link.
> Think also of running bitcode under lli. Thus there are some cases in which
> weakrefs can work correctly even on Darwin.
>
> Instead, I suggest we output a warning in the f-e that aliases are not supported,
> but still generate the alias in the bitcode. Then we teach the code generators,
> which presumably means the asm printer, to ignore aliases on Darwin.
>
> On the other hand, not all bitcode is generated by llvm-gcc. It may be a bad
> idea to have LLVM quietly ignore aliases on Darwin because of the potential
> surprise and trouble it may create for front-end writers who aren't aware of
> this.
>
Good point. As Evan points out, the asm printer is already doing a lot
of stuff that it shouldn't, but my patch doesn't handle the case where
bitcode is generated by non-llvm-gcc programs or on other platforms.
:-/ I'll check into this more. The macro can stay and we can just emit
the warning, still emit the global aliasing code, but ignore it during
assembly emission.
Evan, does this sound like an okay idea?
-bw
From isanbard at gmail.com Mon Sep 17 17:37:56 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 Sep 2007 15:37:56 -0700
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 - in
/llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp varasm.c
In-Reply-To:
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
<200709171059.54888.baldrick@free.fr>
Message-ID: <16e5fdf90709171537w586bda60l979e1ed37e045943@mail.gmail.com>
On 9/17/07, Evan Cheng wrote:
> I don't think Bill's patch affects weakref. Bill?
>
I don't think so either. But, as pointed out, it will fail for other reasons.
> We are already relying on asm printer too much as it is. I'd like not
> to add any more target specific knowledge to asm printer if possible.
>
There's a PR to address this issue. I think that Duncan's idea is the
best way to go for right now, though.
-bw
From isanbard at gmail.com Mon Sep 17 17:39:32 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 Sep 2007 22:39:32 -0000
Subject: [llvm-commits] [llvm] r42071 - in /llvm/trunk:
include/llvm/Support/Mangler.h lib/VMCore/Mangler.cpp
Message-ID: <200709172239.l8HMdWGA031765@zion.cs.uiuc.edu>
Author: void
Date: Mon Sep 17 17:39:32 2007
New Revision: 42071
URL: http://llvm.org/viewvc/llvm-project?rev=42071&view=rev
Log:
Add support for appending a suffix to the end of a mangled name.
Modified:
llvm/trunk/include/llvm/Support/Mangler.h
llvm/trunk/lib/VMCore/Mangler.cpp
Modified: llvm/trunk/include/llvm/Support/Mangler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=42071&r1=42070&r2=42071&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Mangler.h (original)
+++ llvm/trunk/include/llvm/Support/Mangler.h Mon Sep 17 17:39:32 2007
@@ -94,7 +94,7 @@
/// getValueName - Returns the mangled name of V, an LLVM Value,
/// in the current module.
///
- std::string getValueName(const GlobalValue *V);
+ std::string getValueName(const GlobalValue *V, const char *Suffix = "");
std::string getValueName(const Value *V);
/// makeNameProper - We don't want identifier names with ., space, or
Modified: llvm/trunk/lib/VMCore/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Mangler.cpp?rev=42071&r1=42070&r2=42071&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Mangler.cpp (original)
+++ llvm/trunk/lib/VMCore/Mangler.cpp Mon Sep 17 17:39:32 2007
@@ -126,7 +126,7 @@
}
-std::string Mangler::getValueName(const GlobalValue *GV) {
+std::string Mangler::getValueName(const GlobalValue *GV, const char * Suffix) {
// Check to see whether we've already named V.
std::string &Name = Memo[GV];
if (!Name.empty())
@@ -143,7 +143,7 @@
static unsigned GlobalID = 0;
Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++);
} else if (!MangledGlobals.count(GV)) {
- Name = makeNameProper(GV->getName(), Prefix);
+ Name = makeNameProper(GV->getName() + Suffix, Prefix);
} else {
unsigned TypeUniqueID = getTypeID(GV->getType());
Name = "l" + utostr(TypeUniqueID) + "_" + makeNameProper(GV->getName());
From evan.cheng at apple.com Mon Sep 17 18:09:10 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 Sep 2007 16:09:10 -0700
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 -
in /llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp
varasm.c
In-Reply-To: <16e5fdf90709171535i6150d80ah452f54ab897289c3@mail.gmail.com>
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
<200709171059.54888.baldrick@free.fr>
<16e5fdf90709171535i6150d80ah452f54ab897289c3@mail.gmail.com>
Message-ID: <9FEEC795-7484-47D1-BEAB-01D81EB1B6D1@apple.com>
On Sep 17, 2007, at 3:35 PM, Bill Wendling wrote:
> Hi Duncan (et al),
>
>> I've CC'd Anton since he's the one who knows all about this stuff.
>> Presumably
>> when A is an alias for B there are two cases: either this is a
>> "weak alias" or
>> weakref, meaning that at link time it may turn out that A wasn't an
>> alias for
>> B after all, or A is a strong alias (a term I just invented) for B,
>> meaning that
>> this is definitive: you can replace uses of A with uses of B
>> everywhere. In the
>> first case linker support is required, but not in the second case,
>> so presumably
>> it is wrong to turn off alias support in the second case. I don't
>> know if your
>> patch turned this second case off or not.
>>
>> In the first case (weakrefs) we output a special declaration to the
>> bitcode
>> saying that A is a weak alias for B. I think it is a mistake not
>> to output
>> this even for platforms like Darwin that don't handle weakrefs:
>> such aliases
>> may be resolvable by LLVM, for example when linking modules using
>> llvm-link.
>> Think also of running bitcode under lli. Thus there are some cases
>> in which
>> weakrefs can work correctly even on Darwin.
>>
>> Instead, I suggest we output a warning in the f-e that aliases are
>> not supported,
>> but still generate the alias in the bitcode. Then we teach the
>> code generators,
>> which presumably means the asm printer, to ignore aliases on Darwin.
>>
>> On the other hand, not all bitcode is generated by llvm-gcc. It
>> may be a bad
>> idea to have LLVM quietly ignore aliases on Darwin because of the
>> potential
>> surprise and trouble it may create for front-end writers who aren't
>> aware of
>> this.
>>
> Good point. As Evan points out, the asm printer is already doing a lot
> of stuff that it shouldn't, but my patch doesn't handle the case where
> bitcode is generated by non-llvm-gcc programs or on other platforms.
> :-/ I'll check into this more. The macro can stay and we can just emit
> the warning, still emit the global aliasing code, but ignore it during
> assembly emission.
>
> Evan, does this sound like an okay idea?
I don't really see a clean solution at this point. I guess asm printer
will have to handle bitcode generated for a different target. :-(
Evan
>
>
> -bw
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From isanbard at gmail.com Mon Sep 17 20:47:22 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 Sep 2007 01:47:22 -0000
Subject: [llvm-commits] [llvm] r42074 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
lib/CodeGen/DwarfWriter.cpp test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
Message-ID: <200709180147.l8I1lMX3010148@zion.cs.uiuc.edu>
Author: void
Date: Mon Sep 17 20:47:22 2007
New Revision: 42074
URL: http://llvm.org/viewvc/llvm-project?rev=42074&view=rev
Log:
Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0
.no_dead_strip "_-[NSString(local) isNullOrNil]".eh
The ".eh" should be inside the quotes.
Added:
llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=42074&r1=42073&r2=42074&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Sep 17 20:47:22 2007
@@ -43,6 +43,11 @@
///
unsigned FunctionNumber;
+ /// Cache of mangled exception handling name for current function. This is
+ /// recalculated at the beginning of each call to runOnMachineFunction().
+ ///
+ std::string CurrentFnEHName;
+
protected:
// Necessary for external weak linkage support
std::set ExtWeakSymbols;
@@ -112,6 +117,11 @@
/// Should be overridden if an indirect reference should be used.
virtual void EmitExternalGlobal(const GlobalVariable *GV);
+ /// getCurrentFunctionEHName - Called to return (and cache) the
+ /// CurrentFnEHName.
+ ///
+ const std::string &getCurrentFunctionEHName(const MachineFunction *MF);
+
protected:
/// doInitialization - Set up the AsmPrinter when we are working on a new
/// module. If your pass overrides this, it must make sure to explicitly
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=42074&r1=42073&r2=42074&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Sep 17 20:47:22 2007
@@ -160,6 +160,15 @@
return false;
}
+const std::string &
+AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
+ assert(MF && "No machine function?");
+ if (CurrentFnEHName != "") return CurrentFnEHName;
+ return CurrentFnEHName =
+ Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
+ TAI->getGlobalPrefix());
+}
+
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
// What's my mangled name?
CurrentFnName = Mang->getValueName(MF.getFunction());
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42074&r1=42073&r2=42074&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 17 20:47:22 2007
@@ -2833,13 +2833,13 @@
// Externally visible entry into the functions eh frame info.
if (const char *GlobalDirective = TAI->getGlobalDirective())
- O << GlobalDirective << EHFrameInfo.FnName << ".eh\n";
+ O << GlobalDirective << EHFrameInfo.FnName << "\n";
// If there are no calls then you can't unwind.
if (!EHFrameInfo.hasCalls) {
- O << EHFrameInfo.FnName << ".eh = 0\n";
+ O << EHFrameInfo.FnName << " = 0\n";
} else {
- O << EHFrameInfo.FnName << ".eh:\n";
+ O << EHFrameInfo.FnName << ":\n";
// EH frame header.
EmitDifference("eh_frame_end", EHFrameInfo.Number,
@@ -2887,7 +2887,7 @@
}
if (const char *UsedDirective = TAI->getUsedDirective())
- O << UsedDirective << EHFrameInfo.FnName << ".eh\n\n";
+ O << UsedDirective << EHFrameInfo.FnName << "\n\n";
}
/// EmitExceptionTable - Emit landing pads and actions.
@@ -3321,12 +3321,13 @@
EmitExceptionTable();
// Save EH frame information
- EHFrames.push_back(FunctionEHFrameInfo(getAsm()->CurrentFnName,
- SubprogramCount,
- MMI->getPersonalityIndex(),
- MF->getFrameInfo()->hasCalls(),
- !MMI->getLandingPads().empty(),
- MMI->getFrameMoves()));
+ EHFrames.
+ push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF),
+ SubprogramCount,
+ MMI->getPersonalityIndex(),
+ MF->getFrameInfo()->hasCalls(),
+ !MMI->getLandingPads().empty(),
+ MMI->getFrameMoves()));
}
};
Added: llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll?rev=42074&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll Mon Sep 17 20:47:22 2007
@@ -0,0 +1,65 @@
+; RUN: llvm-as < %s | llc -march=x86 -enable-eh | grep {isNullOrNil].eh"} | wc -l | grep 2
+
+ %struct.NSString = type { }
+ %struct._objc__method_prototype_list = type opaque
+ %struct._objc_category = type { i8*, i8*, %struct._objc_method_list*, %struct._objc_method_list*, %struct._objc_protocol**, i32, %struct._prop_list_t* }
+ %struct._objc_method = type { %struct.objc_selector*, i8*, i8* }
+ %struct._objc_method_list = type opaque
+ %struct._objc_module = type { i32, i32, i8*, %struct._objc_symtab* }
+ %struct._objc_protocol = type { %struct._objc_protocol_extension*, i8*, %struct._objc_protocol**, %struct._objc__method_prototype_list*, %struct._objc__method_prototype_list* }
+ %struct._objc_protocol_extension = type opaque
+ %struct._objc_symtab = type { i32, %struct.objc_selector**, i16, i16, [1 x i8*] }
+ %struct._prop_list_t = type opaque
+ %struct.anon = type { %struct._objc__method_prototype_list*, i32, [1 x %struct._objc_method] }
+ %struct.objc_selector = type opaque
+@"\01L_OBJC_SYMBOLS" = internal global { i32, i32, i16, i16, [1 x %struct._objc_category*] } {
+ i32 0,
+ i32 0,
+ i16 0,
+ i16 1,
+ [1 x %struct._objc_category*] [ %struct._objc_category* bitcast ({ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }* @"\01L_OBJC_CATEGORY_NSString_local" to %struct._objc_category*) ] }, section "__OBJC,__symbols,regular,no_dead_strip" ; <{ i32, i32, i16, i16, [1 x %struct._objc_category*] }*> [#uses=2]
+@"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" = internal global { i32, i32, [1 x %struct._objc_method] } {
+ i32 0,
+ i32 1,
+ [1 x %struct._objc_method] [ %struct._objc_method {
+ %struct.objc_selector* bitcast ([12 x i8]* @"\01L_OBJC_METH_VAR_NAME_0" to %struct.objc_selector*),
+ i8* getelementptr ([7 x i8]* @"\01L_OBJC_METH_VAR_TYPE_0", i32 0, i32 0),
+ i8* bitcast (i8 (%struct.NSString*, %struct.objc_selector*) signext * @"-[NSString(local) isNullOrNil]" to i8*) } ] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip" ; <{ i32, i32, [1 x %struct._objc_method] }*> [#uses=3]
+@"\01L_OBJC_CATEGORY_NSString_local" = internal global { i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 } {
+ i8* getelementptr ([6 x i8]* @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 0),
+ i8* getelementptr ([9 x i8]* @"\01L_OBJC_CLASS_NAME_1", i32 0, i32 0),
+ %struct._objc_method_list* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" to %struct._objc_method_list*),
+ i32 0,
+ i32 0,
+ i32 28,
+ i32 0 }, section "__OBJC,__category,regular,no_dead_strip" ; <{ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }*> [#uses=2]
+@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] zeroinitializer, section "__OBJC,__image_info,regular" ; <[2 x i32]*> [#uses=1]
+@"\01L_OBJC_MODULES" = internal global %struct._objc_module {
+ i32 7,
+ i32 16,
+ i8* getelementptr ([1 x i8]* @"\01L_OBJC_CLASS_NAME_2", i32 0, i32 0),
+ %struct._objc_symtab* bitcast ({ i32, i32, i16, i16, [1 x %struct._objc_category*] }* @"\01L_OBJC_SYMBOLS" to %struct._objc_symtab*) }, section "__OBJC,__module_info,regular,no_dead_strip" ; <%struct._objc_module*> [#uses=1]
+@"\01.objc_class_ref_NSString" = internal global i8* @"\01.objc_class_name_NSString" ; [#uses=0]
+@"\01.objc_class_name_NSString" = external global i8 ; [#uses=1]
+@"\01.objc_category_name_NSString_local" = constant i32 0 ; [#uses=1]
+@"\01L_OBJC_CLASS_NAME_2" = internal global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals" ; <[1 x i8]*> [#uses=2]
+@"\01L_OBJC_CLASS_NAME_1" = internal global [9 x i8] c"NSString\00", section "__TEXT,__cstring,cstring_literals" ; <[9 x i8]*> [#uses=2]
+@"\01L_OBJC_CLASS_NAME_0" = internal global [6 x i8] c"local\00", section "__TEXT,__cstring,cstring_literals" ; <[6 x i8]*> [#uses=2]
+@"\01L_OBJC_METH_VAR_NAME_0" = internal global [12 x i8] c"isNullOrNil\00", section "__TEXT,__cstring,cstring_literals" ; <[12 x i8]*> [#uses=3]
+@"\01L_OBJC_METH_VAR_TYPE_0" = internal global [7 x i8] c"c8 at 0:4\00", section "__TEXT,__cstring,cstring_literals" ; <[7 x i8]*> [#uses=2]
+ at llvm.used = appending global [11 x i8*] [ i8* bitcast ({ i32, i32, i16, i16, [1 x %struct._objc_category*] }* @"\01L_OBJC_SYMBOLS" to i8*), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" to i8*), i8* bitcast ({ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }* @"\01L_OBJC_CATEGORY_NSString_local" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*), i8* bitcast (%struct._objc_module* @"\01L_OBJC_MODULES" to i8*), i8* bitcast (i32* @"\01.objc_category_name_NSString_local" to i8*), i8* getelementptr ([1 x i8]* @"\01L_OBJC_CLASS_NAME_2", i32 0, i32 0), i8* getelementptr ([9 x i8]* @"\01L_OBJC_CLASS_NAME_1", i32 0, i32 0), i8* getelementptr ([6 x i8]* @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 0), i8* getelementptr ([12 x i8]* @"\01L_OBJC_METH_VAR_NAME_0", i32 0, i32 0), i8* getelementptr ([7 x i8]* @"\01L_OBJC_METH_VAR_TYPE_0", i32 0, i32 0) ], section "llvm.metadata" ; <[11 x i8*]*> [#uses=0]
+
+define internal i8 @"-[NSString(local) isNullOrNil]"(%struct.NSString* %self, %struct.objc_selector* %_cmd) signext {
+entry:
+ %self_addr = alloca %struct.NSString* ; <%struct.NSString**> [#uses=1]
+ %_cmd_addr = alloca %struct.objc_selector* ; <%struct.objc_selector**> [#uses=1]
+ %retval = alloca i8, align 1 ; [#uses=1]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ store %struct.NSString* %self, %struct.NSString** %self_addr
+ store %struct.objc_selector* %_cmd, %struct.objc_selector** %_cmd_addr
+ br label %return
+
+return: ; preds = %entry
+ %retval1 = load i8* %retval ; [#uses=1]
+ ret i8 %retval1
+}
From dpatel at apple.com Mon Sep 17 20:54:43 2007
From: dpatel at apple.com (Devang Patel)
Date: Tue, 18 Sep 2007 01:54:43 -0000
Subject: [llvm-commits] [llvm] r42075 - in /llvm/trunk:
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/2007-09-17-PrompteValue.ll
Message-ID: <200709180154.l8I1shCf010621@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Sep 17 20:54:42 2007
New Revision: 42075
URL: http://llvm.org/viewvc/llvm-project?rev=42075&view=rev
Log:
Fix PR1657
Added:
llvm/trunk/test/Transforms/LICM/2007-09-17-PrompteValue.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=42075&r1=42074&r2=42075&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Mon Sep 17 20:54:42 2007
@@ -791,6 +791,14 @@
break;
}
+ // If GEP base is NULL then the calculated address used by Store or
+ // Load instruction is invalid. Do not promote this value because
+ // it may expose load and store instruction that are covered by
+ // condition which may not yet folded.
+ if (GetElementPtrInst *GEP = dyn_cast(V))
+ if (isa(GEP->getOperand(0)))
+ PointerOk = false;
+
if (PointerOk) {
const Type *Ty = cast(V->getType())->getElementType();
AllocaInst *AI = new AllocaInst(Ty, 0, V->getName()+".tmp", FnStart);
Added: llvm/trunk/test/Transforms/LICM/2007-09-17-PrompteValue.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2007-09-17-PrompteValue.ll?rev=42075&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LICM/2007-09-17-PrompteValue.ll (added)
+++ llvm/trunk/test/Transforms/LICM/2007-09-17-PrompteValue.ll Mon Sep 17 20:54:42 2007
@@ -0,0 +1,26 @@
+; ModuleID = 'PR1657.bc'
+; Do not promote getelementptr because it may exposes load from a null pointer
+; and store from a null pointer which are covered by
+; icmp eq %struct.decision* null, null condition.
+; RUN: llvm-as < %s | opt -licm | llvm-dis | not grep promoted
+ %struct.decision = type { i8, %struct.decision* }
+
+define i32 @main() {
+entry:
+ br label %blah.i
+
+blah.i: ; preds = %cond_true.i, %entry
+ %tmp3.i = icmp eq %struct.decision* null, null ; [#uses=1]
+ br i1 %tmp3.i, label %clear_modes.exit, label %cond_true.i
+
+cond_true.i: ; preds = %blah.i
+ %tmp1.i = getelementptr %struct.decision* null, i32 0, i32 0 ; [#uses=1]
+ store i8 0, i8* %tmp1.i
+ br label %blah.i
+
+clear_modes.exit: ; preds = %blah.i
+ call void @exit( i32 0 )
+ unreachable
+}
+
+declare void @exit(i32)
From gordonhenriksen at mac.com Mon Sep 17 21:09:34 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 02:09:34 -0000
Subject: [llvm-commits] [llvm] r42076 - in /llvm/trunk: Xcode/
Xcode/LLVM.xcodeproj/ examples/BrainF/ include/llvm/Module.h
lib/Target/Mips/ test/Transforms/GVN/
Message-ID: <200709180209.l8I29YXl011630@zion.cs.uiuc.edu>
Author: gordon
Date: Mon Sep 17 21:09:34 2007
New Revision: 42076
URL: http://llvm.org/viewvc/llvm-project?rev=42076&view=rev
Log:
Fixing an comment in Module.h that refers to a nonexistent parameter.
Also adding some missing svn:ignores that've been bothering me.
Modified:
llvm/trunk/Xcode/ (props changed)
llvm/trunk/Xcode/LLVM.xcodeproj/ (props changed)
llvm/trunk/examples/BrainF/ (props changed)
llvm/trunk/include/llvm/Module.h
llvm/trunk/lib/Target/Mips/ (props changed)
llvm/trunk/test/Transforms/GVN/ (props changed)
Propchange: llvm/trunk/Xcode/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 17 21:09:34 2007
@@ -0,0 +1 @@
+build
Propchange: llvm/trunk/Xcode/LLVM.xcodeproj/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 17 21:09:34 2007
@@ -0,0 +1,2 @@
+*.perspective
+*.pbxuser
Propchange: llvm/trunk/examples/BrainF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 17 21:09:34 2007
@@ -0,0 +1,2 @@
+Release
+Debug
Modified: llvm/trunk/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=42076&r1=42075&r2=42076&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Module.h (original)
+++ llvm/trunk/include/llvm/Module.h Mon Sep 17 21:09:34 2007
@@ -215,11 +215,9 @@
/// @{
public:
/// getGlobalVariable - Look up the specified global variable in the module
- /// symbol table. If it does not exist, return null. The type argument
- /// should be the underlying type of the global, i.e., it should not have
- /// the top-level PointerType, which represents the address of the global.
- /// If AllowInternal is set to true, this function will return types that
- /// have InternalLinkage. By default, these types are not returned.
+ /// symbol table. If it does not exist, return null. If AllowInternal is set
+ /// to true, this function will return types that have InternalLinkage. By
+ /// default, these types are not returned.
GlobalVariable *getGlobalVariable(const std::string &Name,
bool AllowInternal = false) const;
Propchange: llvm/trunk/lib/Target/Mips/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 17 21:09:34 2007
@@ -0,0 +1,3 @@
+*.inc
+Debug
+Release
Propchange: llvm/trunk/test/Transforms/GVN/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 17 21:09:34 2007
@@ -0,0 +1 @@
+Output
From gordonhenriksen at mac.com Mon Sep 17 22:18:58 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 03:18:58 -0000
Subject: [llvm-commits] [llvm] r42077 - in /llvm/trunk:
include/llvm-c/BitWriter.h include/llvm-c/Core.h include/llvm/CHelpers.h
lib/Bitcode/Writer/BitWriter.cpp lib/VMCore/Core.cpp
Message-ID: <200709180318.l8I3IwM5015598@zion.cs.uiuc.edu>
Author: gordon
Date: Mon Sep 17 22:18:57 2007
New Revision: 42077
URL: http://llvm.org/viewvc/llvm-project?rev=42077&view=rev
Log:
C bindings for libLLVMCore.a and libLLVMBitWriter.a.
- The naming prefix is LLVM.
- All types are represented using opaque references.
- Functions are not named LLVM{Type}{Method}; the names became
unreadable goop. Instead, they are named LLVM{ImperativeSentence}.
- Where an attribute only appears once in the class hierarchy (e.g.,
linkage only applies to values; parameter types only apply to
function types), the class is omitted from identifiers for
brevity. Tastes like methods.
- Strings are C strings or string/length tuples on a case-by-case
basis.
- APIs which give the caller ownership of an object are not mapped
(removeFromParent, certain constructor overloads). This keeps
keep memory management as simple as possible.
For each library with bindings:
llvm-c/.h - Declares the bindings.
lib//.cpp - Implements the bindings.
So just link with the library of your choice and use the C header
instead of the C++ one.
Added:
llvm/trunk/include/llvm-c/BitWriter.h
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/include/llvm/CHelpers.h
llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp
llvm/trunk/lib/VMCore/Core.cpp
Added: llvm/trunk/include/llvm-c/BitWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/BitWriter.h?rev=42077&view=auto
==============================================================================
--- llvm/trunk/include/llvm-c/BitWriter.h (added)
+++ llvm/trunk/include/llvm-c/BitWriter.h Mon Sep 17 22:18:57 2007
@@ -0,0 +1,42 @@
+/*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\
+|* *|
+|* The LLVM Compiler Infrastructure *|
+|* *|
+|* This file was developed by Gordon Henriksen and is distributed under the *|
+|* University of Illinois Open Source License. See LICENSE.TXT for details. *|
+|* *|
+|*===----------------------------------------------------------------------===*|
+|* *|
+|* This header declares the C interface to libLLVMBitWriter.a, which *|
+|* implements output of the LLVM bitcode format. *|
+|* *|
+|* Many exotic languages can interoperate with C code but have a harder time *|
+|* with C++ due to name mangling. So in addition to C, this interface enables *|
+|* tools written in such languages. *|
+|* *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_C_BITCODEWRITER_H
+#define LLVM_C_BITCODEWRITER_H
+
+#include "llvm-c/Core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*===-- Operations on modules ---------------------------------------------===*/
+
+/* Writes a module to an open file descriptor. Returns 0 on success. */
+int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
+
+/* Writes a module to the specified path. Returns 0 on success. */
+int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Added: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=42077&view=auto
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (added)
+++ llvm/trunk/include/llvm-c/Core.h Mon Sep 17 22:18:57 2007
@@ -0,0 +1,221 @@
+/*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
+|* *|
+|* The LLVM Compiler Infrastructure *|
+|* *|
+|* This file was developed by Gordon Henriksen and is distributed under the *|
+|* University of Illinois Open Source License. See LICENSE.TXT for details. *|
+|* *|
+|*===----------------------------------------------------------------------===*|
+|* *|
+|* This header declares the C interface to libLLVMCore.a, which implements *|
+|* the LLVM intermediate representation. *|
+|* *|
+|* LLVM uses a polymorphic type hierarchy which C cannot represent, therefore *|
+|* parameters must be passed as base types. Despite the declared types, most *|
+|* of the functions provided operate only on branches of the type hierarchy. *|
+|* The declared parameter names are descriptive and specify which type is *|
+|* required. Additionally, each type hierarchy is documented along with the *|
+|* functions that operate upon it. For more detail, refer to LLVM's C++ code. *|
+|* If in doubt, refer to Core.cpp, which performs paramter downcasts in the *|
+|* form unwrap(Param). *|
+|* *|
+|* Many exotic languages can interoperate with C code but have a harder time *|
+|* with C++ due to name mangling. So in addition to C, this interface enables *|
+|* tools written in such languages. *|
+|* *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_C_CORE_H
+#define LLVM_C_CORE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Opaque types. */
+typedef struct LLVMOpaqueModule *LLVMModuleRef;
+typedef struct LLVMOpaqueType *LLVMTypeRef;
+typedef struct LLVMOpaqueValue *LLVMValueRef;
+
+typedef enum {
+ LLVMVoidTypeKind = 0, /* type with no size */
+ LLVMFloatTypeKind, /* 32 bit floating point type */
+ LLVMDoubleTypeKind, /* 64 bit floating point type */
+ LLVMX86_FP80TypeKind, /* 80 bit floating point type (X87) */
+ LLVMFP128TypeKind, /* 128 bit floating point type (112-bit mantissa) */
+ LLVMPPC_FP128TypeKind, /* 128 bit floating point type (two 64-bits) */
+ LLVMLabelTypeKind, /* Labels */
+ LLVMIntegerTypeKind, /* Arbitrary bit width integers */
+ LLVMFunctionTypeKind, /* Functions */
+ LLVMStructTypeKind, /* Structures */
+ LLVMArrayTypeKind, /* Arrays */
+ LLVMPointerTypeKind, /* Pointers */
+ LLVMOpaqueTypeKind, /* Opaque: type with unknown structure */
+ LLVMVectorTypeKind /* SIMD 'packed' format, or other vector type */
+} LLVMTypeKind;
+
+typedef enum {
+ LLVMExternalLinkage = 0,/* Externally visible function */
+ LLVMLinkOnceLinkage, /* Keep one copy of function when linking (inline) */
+ LLVMWeakLinkage, /* Keep one copy of function when linking (weak) */
+ LLVMAppendingLinkage, /* Special purpose, only applies to global arrays */
+ LLVMInternalLinkage, /* Rename collisions when linking (static functions)*/
+ LLVMDLLImportLinkage, /* Function to be imported from DLL */
+ LLVMDLLExportLinkage, /* Function to be accessible from DLL */
+ LLVMExternalWeakLinkage,/* ExternalWeak linkage description */
+ LLVMGhostLinkage /* Stand-in functions for streaming fns from bitcode*/
+} LLVMLinkage;
+
+typedef enum {
+ LLVMDefaultVisibility = 0, /* The GV is visible */
+ LLVMHiddenVisibility, /* The GV is hidden */
+ LLVMProtectedVisibility /* The GV is protected */
+} LLVMVisibility;
+
+
+/*===-- Modules -----------------------------------------------------------===*/
+
+/* Create and destroy modules. */
+LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
+void LLVMDisposeModule(LLVMModuleRef M);
+
+/* Same as Module::addTypeName. */
+int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
+int LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
+
+
+/*===-- Types --------------------------------------------------------------===*/
+
+/* LLVM types conform to the following hierarchy:
+ *
+ * types:
+ * integer type
+ * real type
+ * function type
+ * sequence types:
+ * array type
+ * pointer type
+ * vector type
+ * void type
+ * label type
+ * opaque type
+ */
+
+LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
+void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
+
+/* Operations on integer types */
+LLVMTypeRef LLVMInt1Type();
+LLVMTypeRef LLVMInt8Type();
+LLVMTypeRef LLVMInt16Type();
+LLVMTypeRef LLVMInt32Type();
+LLVMTypeRef LLVMInt64Type();
+LLVMTypeRef LLVMCreateIntegerType(unsigned NumBits);
+unsigned LLVMGetIntegerTypeWidth(LLVMTypeRef IntegerTy);
+
+/* Operations on real types */
+LLVMTypeRef LLVMFloatType();
+LLVMTypeRef LLVMDoubleType();
+LLVMTypeRef LLVMX86FP80Type();
+LLVMTypeRef LLVMFP128Type();
+LLVMTypeRef LLVMPPCFP128Type();
+
+/* Operations on function types */
+LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType,
+ LLVMTypeRef *ParamTypes, unsigned ParamCount,
+ int IsVarArg);
+int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
+LLVMTypeRef LLVMGetFunctionReturnType(LLVMTypeRef FunctionTy);
+unsigned LLVMGetFunctionParamCount(LLVMTypeRef FunctionTy);
+void LLVMGetFunctionParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
+
+/* Operations on struct types */
+LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes,
+ unsigned ElementCount, int Packed);
+unsigned LLVMGetStructElementCount(LLVMTypeRef StructTy);
+void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
+int LLVMIsPackedStruct(LLVMTypeRef StructTy);
+
+/* Operations on array, pointer, and vector types (sequence types) */
+LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
+LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType);
+LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount);
+
+LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
+unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
+unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
+
+/* Operations on other types */
+LLVMTypeRef LLVMVoidType();
+LLVMTypeRef LLVMLabelType();
+LLVMTypeRef LLVMCreateOpaqueType();
+
+
+/*===-- Values ------------------------------------------------------------===*/
+
+/* The bulk of LLVM's object model consists of values, which comprise a very
+ * rich type hierarchy.
+ *
+ * values:
+ * constants:
+ * scalar constants
+ * composite contants
+ * globals:
+ * global variable
+ * function
+ * alias
+ */
+
+/* Operations on all values */
+LLVMTypeRef LLVMGetTypeOfValue(LLVMValueRef Val);
+const char *LLVMGetValueName(LLVMValueRef Val);
+void LLVMSetValueName(LLVMValueRef Val, const char *Name);
+
+/* Operations on constants of any type */
+LLVMValueRef LLVMGetNull(LLVMTypeRef Ty); /* all zeroes */
+LLVMValueRef LLVMGetAllOnes(LLVMTypeRef Ty); /* only for int/vector */
+LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
+int LLVMIsNull(LLVMValueRef Val);
+
+/* Operations on scalar constants */
+LLVMValueRef LLVMGetIntConstant(LLVMTypeRef IntTy, unsigned long long N,
+ int SignExtend);
+LLVMValueRef LLVMGetRealConstant(LLVMTypeRef RealTy, double N);
+
+/* Operations on composite constants */
+LLVMValueRef LLVMGetStringConstant(const char *Str, unsigned Length,
+ int DontNullTerminate);
+LLVMValueRef LLVMGetArrayConstant(LLVMTypeRef ArrayTy,
+ LLVMValueRef *ConstantVals, unsigned Length);
+LLVMValueRef LLVMGetStructConstant(LLVMValueRef *ConstantVals, unsigned Count,
+ int packed);
+LLVMValueRef LLVMGetVectorConstant(LLVMValueRef *ScalarConstantVals,
+ unsigned Size);
+
+/* Operations on global variables, functions, and aliases (globals) */
+int LLVMIsDeclaration(LLVMValueRef Global);
+LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
+void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
+const char *LLVMGetSection(LLVMValueRef Global);
+void LLVMSetSection(LLVMValueRef Global, const char *Section);
+LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
+void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
+unsigned LLVMGetAlignment(LLVMValueRef Global);
+void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes);
+
+/* Operations on global variables */
+LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
+void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
+int LLVMHasInitializer(LLVMValueRef GlobalVar);
+LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
+void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
+int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
+void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Added: llvm/trunk/include/llvm/CHelpers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CHelpers.h?rev=42077&view=auto
==============================================================================
--- llvm/trunk/include/llvm/CHelpers.h (added)
+++ llvm/trunk/include/llvm/CHelpers.h Mon Sep 17 22:18:57 2007
@@ -0,0 +1,94 @@
+//===-- Support/CHelpers.h - Utilities for writing C bindings -------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// These opaque reference<-->pointer conversions are shorter and more tightly
+// typed than writing the casts by hand in C bindings. In assert builds, they
+// will do type checking.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_CHELPERS_H
+#define LLVM_SUPPORT_CHELPERS_H
+
+#include "llvm/Module.h"
+#include "llvm/Type.h"
+#include "llvm/Value.h"
+
+typedef struct LLVMOpaqueModule *LLVMModuleRef;
+typedef struct LLVMOpaqueType *LLVMTypeRef;
+typedef struct LLVMOpaqueValue *LLVMValueRef;
+
+namespace llvm {
+ /// Opaque module conversions
+ ///
+ inline Module *unwrap(LLVMModuleRef M) {
+ return reinterpret_cast(M);
+ }
+
+ inline LLVMModuleRef wrap(Module *M) {
+ return reinterpret_cast(M);
+ }
+
+ /// Opaque type conversions
+ ///
+ inline Type *unwrap(LLVMTypeRef Ty) {
+ return reinterpret_cast(Ty);
+ }
+
+ template
+ inline T *unwrap(LLVMTypeRef Ty) {
+ return cast(unwrap(Ty));
+ }
+
+ inline Type **unwrap(LLVMTypeRef* Tys) {
+ return reinterpret_cast(Tys);
+ }
+
+ inline LLVMTypeRef wrap(const Type *Ty) {
+ return reinterpret_cast(const_cast(Ty));
+ }
+
+ inline LLVMTypeRef *wrap(const Type **Tys) {
+ return reinterpret_cast(const_cast(Tys));
+ }
+
+ /// Opaque value conversions
+ ///
+ inline Value *unwrap(LLVMValueRef Val) {
+ return reinterpret_cast(Val);
+ }
+
+ template
+ inline T *unwrap(LLVMValueRef Val) {
+ return cast(unwrap(Val));
+ }
+
+ inline Value **unwrap(LLVMValueRef *Vals) {
+ return reinterpret_cast(Vals);
+ }
+
+ template
+ inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
+ #if DEBUG
+ for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
+ cast(*I);
+ #endif
+ return reinterpret_cast(Vals);
+ }
+
+ inline LLVMValueRef wrap(const Value *Val) {
+ return reinterpret_cast(const_cast(Val));
+ }
+
+ inline LLVMValueRef *wrap(const Value **Vals) {
+ return reinterpret_cast(const_cast(Vals));
+ }
+}
+
+#endif
Added: llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp?rev=42077&view=auto
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp (added)
+++ llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp Mon Sep 17 22:18:57 2007
@@ -0,0 +1,51 @@
+//===-- BitWriter.cpp -----------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm-c/BitWriter.h"
+#include "llvm/CHelpers.h"
+#include "llvm/Bitcode/ReaderWriter.h"
+#include
+
+using namespace llvm;
+
+
+/*===-- Operations on modules ---------------------------------------------===*/
+
+int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
+ std::ofstream OS(Path);
+
+ if (!OS.fail())
+ WriteBitcodeToFile(unwrap(M), OS);
+
+ if (OS.fail())
+ return -1;
+
+ return 0;
+}
+
+#ifdef __GNUC__
+#include
+
+// FIXME: Control this with configure? Provide some portable abstraction in
+// libSystem? As is, the user will just get a linker error if they use this on
+// non-GCC. Some C++ stdlibs even have ofstream::ofstream(int fd).
+int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) {
+ __gnu_cxx::stdio_filebuf Buffer(FileHandle, std::ios_base::out);
+ std::ostream OS(&Buffer);
+
+ if (!OS.fail())
+ WriteBitcodeToFile(unwrap(M), OS);
+
+ if (OS.fail())
+ return -1;
+
+ return 0;
+}
+
+#endif
Added: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=42077&view=auto
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (added)
+++ llvm/trunk/lib/VMCore/Core.cpp Mon Sep 17 22:18:57 2007
@@ -0,0 +1,322 @@
+//===-- Core.cpp ----------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Gordon Henriksen and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the C bindings for libLLVMCore.a, which implements
+// the LLVM intermediate representation.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm-c/Core.h"
+#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/CHelpers.h"
+#include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
+#include "llvm/GlobalVariable.h"
+#include
+#include
+#include
+
+using namespace llvm;
+
+
+/*===-- Operations on modules ---------------------------------------------===*/
+
+LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID) {
+ return wrap(new Module(ModuleID));
+}
+
+void LLVMDisposeModule(LLVMModuleRef M) {
+ delete unwrap(M);
+}
+
+int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty) {
+ return unwrap(M)->addTypeName(Name, unwrap(Ty));
+}
+
+
+/*===-- Operations on types -----------------------------------------------===*/
+
+/*--.. Operations on all types (mostly) ....................................--*/
+
+LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty) {
+ return static_cast(unwrap(Ty)->getTypeID());
+}
+
+void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType){
+ DerivedType *Ty = unwrap(AbstractType);
+ Ty->refineAbstractTypeTo(unwrap(ConcreteType));
+}
+
+/*--.. Operations on integer types .........................................--*/
+
+LLVMTypeRef LLVMInt1Type() { return (LLVMTypeRef) Type::Int1Ty; }
+LLVMTypeRef LLVMInt8Type() { return (LLVMTypeRef) Type::Int8Ty; }
+LLVMTypeRef LLVMInt16Type() { return (LLVMTypeRef) Type::Int16Ty; }
+LLVMTypeRef LLVMInt32Type() { return (LLVMTypeRef) Type::Int32Ty; }
+LLVMTypeRef LLVMInt64Type() { return (LLVMTypeRef) Type::Int64Ty; }
+
+LLVMTypeRef LLVMCreateIntegerType(unsigned NumBits) {
+ return wrap(IntegerType::get(NumBits));
+}
+
+unsigned LLVMGetIntegerTypeWidth(LLVMTypeRef IntegerTy) {
+ return unwrap(IntegerTy)->getBitWidth();
+}
+
+/*--.. Operations on real types ............................................--*/
+
+LLVMTypeRef LLVMFloatType() { return (LLVMTypeRef) Type::FloatTy; }
+LLVMTypeRef LLVMDoubleType() { return (LLVMTypeRef) Type::DoubleTy; }
+LLVMTypeRef LLVMX86FP80Type() { return (LLVMTypeRef) Type::X86_FP80Ty; }
+LLVMTypeRef LLVMFP128Type() { return (LLVMTypeRef) Type::FP128Ty; }
+LLVMTypeRef LLVMPPCFP128Type() { return (LLVMTypeRef) Type::PPC_FP128Ty; }
+
+/*--.. Operations on function types ........................................--*/
+
+LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType,
+ LLVMTypeRef *ParamTypes, unsigned ParamCount,
+ int IsVarArg) {
+ std::vector Tys;
+ for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I)
+ Tys.push_back(unwrap(*I));
+
+ return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0));
+}
+
+int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) {
+ return unwrap(FunctionTy)->isVarArg();
+}
+
+LLVMTypeRef LLVMGetFunctionReturnType(LLVMTypeRef FunctionTy) {
+ return wrap(unwrap(FunctionTy)->getReturnType());
+}
+
+unsigned LLVMGetFunctionParamCount(LLVMTypeRef FunctionTy) {
+ return unwrap(FunctionTy)->getNumParams();
+}
+
+void LLVMGetFunctionParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest) {
+ FunctionType *Ty = unwrap(FunctionTy);
+ for (FunctionType::param_iterator I = Ty->param_begin(),
+ E = Ty->param_end(); I != E; ++I)
+ *Dest++ = wrap(*I);
+}
+
+/*--.. Operations on struct types ..........................................--*/
+
+LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes,
+ unsigned ElementCount, int Packed) {
+ std::vector Tys;
+ for (LLVMTypeRef *I = ElementTypes,
+ *E = ElementTypes + ElementCount; I != E; ++I)
+ Tys.push_back(unwrap(*I));
+
+ return wrap(StructType::get(Tys, Packed != 0));
+}
+
+unsigned LLVMGetStructElementCount(LLVMTypeRef StructTy) {
+ return unwrap(StructTy)->getNumElements();
+}
+
+void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest) {
+ StructType *Ty = unwrap(StructTy);
+ for (FunctionType::param_iterator I = Ty->element_begin(),
+ E = Ty->element_end(); I != E; ++I)
+ *Dest++ = wrap(*I);
+}
+
+int LLVMIsPackedStruct(LLVMTypeRef StructTy) {
+ return unwrap(StructTy)->isPacked();
+}
+
+/*--.. Operations on array, pointer, and vector types (sequence types) .....--*/
+
+LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount){
+ return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
+}
+
+LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType) {
+ return wrap(PointerType::get(unwrap(ElementType)));
+}
+
+LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount){
+ return wrap(VectorType::get(unwrap(ElementType), ElementCount));
+}
+
+LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty) {
+ return wrap(unwrap(Ty)->getElementType());
+}
+
+unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy) {
+ return unwrap(ArrayTy)->getNumElements();
+}
+
+unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy) {
+ return unwrap(VectorTy)->getNumElements();
+}
+
+/*--.. Operations on other types ...........................................--*/
+
+LLVMTypeRef LLVMVoidType() { return (LLVMTypeRef) Type::VoidTy; }
+LLVMTypeRef LLVMLabelType() { return (LLVMTypeRef) Type::LabelTy; }
+
+LLVMTypeRef LLVMCreateOpaqueType() {
+ return wrap(llvm::OpaqueType::get());
+}
+
+
+/*===-- Operations on values ----------------------------------------------===*/
+
+/*--.. Operations on all values ............................................--*/
+
+LLVMTypeRef LLVMGetTypeOfValue(LLVMValueRef Val) {
+ return wrap(unwrap(Val)->getType());
+}
+
+const char *LLVMGetValueName(LLVMValueRef Val) {
+ return unwrap(Val)->getNameStart();
+}
+
+void LLVMSetValueName(LLVMValueRef Val, const char *Name) {
+ unwrap(Val)->setName(Name);
+}
+
+/*--.. Operations on constants of any type .................................--*/
+
+LLVMValueRef LLVMGetNull(LLVMTypeRef Ty) {
+ return wrap(Constant::getNullValue(unwrap(Ty)));
+}
+
+LLVMValueRef LLVMGetAllOnes(LLVMTypeRef Ty) {
+ return wrap(Constant::getAllOnesValue(unwrap(Ty)));
+}
+
+LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty) {
+ return wrap(UndefValue::get(unwrap(Ty)));
+}
+
+int LLVMIsNull(LLVMValueRef Val) {
+ if (Constant *C = dyn_cast(unwrap(Val)))
+ return C->isNullValue();
+ return false;
+}
+
+/*--.. Operations on scalar constants ......................................--*/
+
+LLVMValueRef LLVMGetIntConstant(LLVMTypeRef IntTy, unsigned long long N,
+ int SignExtend) {
+ return wrap(ConstantInt::get(unwrap(IntTy), N, SignExtend != 0));
+}
+
+LLVMValueRef LLVMGetRealConstant(LLVMTypeRef RealTy, double N) {
+ return wrap(ConstantFP::get(unwrap(RealTy), APFloat(N)));
+}
+
+/*--.. Operations on composite constants ...................................--*/
+
+LLVMValueRef LLVMGetStringConstant(const char *Str, unsigned Length,
+ int DontNullTerminate) {
+ /* Inverted the sense of AddNull because ', 0)' is a
+ better mnemonic for null termination than ', 1)'. */
+ return wrap(ConstantArray::get(std::string(Str, Length),
+ DontNullTerminate == 0));
+}
+
+LLVMValueRef LLVMGetArrayConstant(LLVMTypeRef ElementTy,
+ LLVMValueRef *ConstantVals, unsigned Length) {
+ return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length),
+ unwrap(ConstantVals, Length),
+ Length));
+}
+
+LLVMValueRef LLVMGetStructConstant(LLVMValueRef *ConstantVals, unsigned Count,
+ int Packed) {
+ return wrap(ConstantStruct::get(unwrap(ConstantVals, Count),
+ Count, Packed != 0));
+}
+
+LLVMValueRef LLVMGetVectorConstant(LLVMValueRef *ScalarConstantVals,
+ unsigned Size) {
+ return wrap(ConstantVector::get(unwrap(ScalarConstantVals, Size),
+ Size));
+}
+
+/*--.. Operations on global variables, functions, and aliases (globals) ....--*/
+
+int LLVMIsDeclaration(LLVMValueRef Global) {
+ return unwrap(Global)->isDeclaration();
+}
+
+LLVMLinkage LLVMGetLinkage(LLVMValueRef Global) {
+ return static_cast(unwrap(Global)->getLinkage());
+}
+
+void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) {
+ unwrap(Global)
+ ->setLinkage(static_cast(Linkage));
+}
+
+const char *LLVMGetSection(LLVMValueRef Global) {
+ return unwrap(Global)->getSection().c_str();
+}
+
+void LLVMSetSection(LLVMValueRef Global, const char *Section) {
+ unwrap(Global)->setSection(Section);
+}
+
+LLVMVisibility LLVMGetVisibility(LLVMValueRef Global) {
+ return static_cast(
+ unwrap(Global)->getVisibility());
+}
+
+void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz) {
+ unwrap(Global)
+ ->setVisibility(static_cast(Viz));
+}
+
+unsigned LLVMGetAlignment(LLVMValueRef Global) {
+ return unwrap(Global)->getAlignment();
+}
+
+void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes) {
+ unwrap(Global)->setAlignment(Bytes);
+}
+
+/*--.. Operations on global variables ......................................--*/
+
+LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name) {
+ return wrap(new GlobalVariable(unwrap(Ty), false,
+ GlobalValue::ExternalLinkage, 0, Name, unwrap(M)));
+}
+
+void LLVMDeleteGlobal(LLVMValueRef GlobalVar) {
+ unwrap(GlobalVar)->eraseFromParent();
+}
+
+int LLVMHasInitializer(LLVMValueRef GlobalVar) {
+ return unwrap(GlobalVar)->hasInitializer();
+}
+
+LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar) {
+ return wrap(unwrap(GlobalVar)->getInitializer());
+}
+
+void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal) {
+ unwrap(GlobalVar)
+ ->setInitializer(unwrap(ConstantVal));
+}
+
+int LLVMIsThreadLocal(LLVMValueRef GlobalVar) {
+ return unwrap(GlobalVar)->isThreadLocal();
+}
+
+void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal) {
+ unwrap(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
+}
+
From clattner at apple.com Mon Sep 17 23:05:50 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 17 Sep 2007 21:05:50 -0700
Subject: [llvm-commits] [llvm] r42074 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
lib/CodeGen/DwarfWriter.cpp
test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
In-Reply-To: <200709180147.l8I1lMX3010148@zion.cs.uiuc.edu>
References: <200709180147.l8I1lMX3010148@zion.cs.uiuc.edu>
Message-ID: <3DF3BFA7-E693-485A-8F1A-B322EB701E19@apple.com>
On Sep 17, 2007, at 6:47 PM, Bill Wendling wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=42074&view=rev
> Log:
> Objective-C was generating EH frame info like this:
>
> "_-[NSString(local) isNullOrNil]".eh = 0
> .no_dead_strip "_-[NSString(local) isNullOrNil]".eh
> + /// Cache of mangled exception handling name for current
> function. This is
> + /// recalculated at the beginning of each call to
> runOnMachineFunction().
> + ///
> + std::string CurrentFnEHName;
This should be reset to "" at the start or end of the function,
right? We don't want subsequent functions to reuse earlier functions
names.
> +const std::string &
> +AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
> + assert(MF && "No machine function?");
> + if (CurrentFnEHName != "") return CurrentFnEHName;
please use "if (!CurrentFnEHName.empty())".
Thanks Bill,
-Chris
From clattner at apple.com Mon Sep 17 23:09:08 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 17 Sep 2007 21:09:08 -0700
Subject: [llvm-commits] [llvm-gcc-4.0] r41882 -
in /llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp
varasm.c
In-Reply-To: <16e5fdf90709171535i6150d80ah452f54ab897289c3@mail.gmail.com>
References: <200709121855.l8CItFuU000417@zion.cs.uiuc.edu>
<200709151600.40230.baldrick@free.fr>
<200709171059.54888.baldrick@free.fr>
<16e5fdf90709171535i6150d80ah452f54ab897289c3@mail.gmail.com>
Message-ID: <330EB2C5-3B15-4241-B67F-42483D6E0F98@apple.com>
On Sep 17, 2007, at 3:35 PM, Bill Wendling wrote:
>> Instead, I suggest we output a warning in the f-e that aliases are
>> not supported,
>> but still generate the alias in the bitcode. Then we teach the
>> code generators,
>> which presumably means the asm printer, to ignore aliases on Darwin
Will this really work? If the optimizer sees aliases, it could
presumably do something with them, potentially adding dependencies on
them being handled "right".
If nothing else, the alias that will eventually not get emitted can
cause symbol table clashes as link stages are done.
I don't think it's a good idea for targets that don't support aliases
to have aliases in their module.
>>
>> On the other hand, not all bitcode is generated by llvm-gcc. It
>> may be a bad
>> idea to have LLVM quietly ignore aliases on Darwin because of the
>> potential
>> surprise and trouble it may create for front-end writers who
>> aren't aware of
>> this.
>>
> Good point. As Evan points out, the asm printer is already doing a lot
> of stuff that it shouldn't, but my patch doesn't handle the case where
> bitcode is generated by non-llvm-gcc programs or on other platforms.
> :-/ I'll check into this more. The macro can stay and we can just emit
> the warning, still emit the global aliasing code, but ignore it during
> assembly emission.
>
> Evan, does this sound like an okay idea?
I think it is reasonable for the target to tolerate and ignore
aliases if it sees them and they aren't supported, but I think this
is an area where a front-end needs to be "target aware". Maybe
TargetAsmInfo (which is used by the front-end) should have a bool
indicating whether aliases are supported, and maybe we should use
that to control llvm-gcc instead of the GCC macro?
-Chris
From isanbard at gmail.com Tue Sep 18 00:03:45 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 Sep 2007 05:03:45 -0000
Subject: [llvm-commits] [llvm] r42078 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
Message-ID: <200709180503.l8I53jDK021542@zion.cs.uiuc.edu>
Author: void
Date: Tue Sep 18 00:03:44 2007
New Revision: 42078
URL: http://llvm.org/viewvc/llvm-project?rev=42078&view=rev
Log:
The exception handling function info should be reset for each new
function. The information isn't used heavily -- it's only used at the end
of exception handling emission -- so there's no need to cache it.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=42078&r1=42077&r2=42078&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 18 00:03:44 2007
@@ -43,11 +43,6 @@
///
unsigned FunctionNumber;
- /// Cache of mangled exception handling name for current function. This is
- /// recalculated at the beginning of each call to runOnMachineFunction().
- ///
- std::string CurrentFnEHName;
-
protected:
// Necessary for external weak linkage support
std::set ExtWeakSymbols;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=42078&r1=42077&r2=42078&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Tue Sep 18 00:03:44 2007
@@ -163,10 +163,8 @@
const std::string &
AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
assert(MF && "No machine function?");
- if (CurrentFnEHName != "") return CurrentFnEHName;
- return CurrentFnEHName =
- Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
- TAI->getGlobalPrefix());
+ return Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
+ TAI->getGlobalPrefix());
}
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
From isanbard at gmail.com Tue Sep 18 00:28:20 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 Sep 2007 05:28:20 -0000
Subject: [llvm-commits] [llvm] r42079 - /llvm/trunk/CREDITS.TXT
Message-ID: <200709180528.l8I5SKmb023072@zion.cs.uiuc.edu>
Author: void
Date: Tue Sep 18 00:28:19 2007
New Revision: 42079
URL: http://llvm.org/viewvc/llvm-project?rev=42079&view=rev
Log:
Update my entry.
Modified:
llvm/trunk/CREDITS.TXT
Modified: llvm/trunk/CREDITS.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CREDITS.TXT?rev=42079&r1=42078&r2=42079&view=diff
==============================================================================
--- llvm/trunk/CREDITS.TXT (original)
+++ llvm/trunk/CREDITS.TXT Tue Sep 18 00:28:19 2007
@@ -246,6 +246,6 @@
N: Bill Wendling
E: isanbard at gmail.com
W: http://web.mac.com/bwendling/
+D: Darwin exception handling
D: MMX & SSSE3 instructions
D: SPEC2006 support
-
From tonic at nondot.org Tue Sep 18 00:28:53 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 05:28:53 -0000
Subject: [llvm-commits] [llvm] r42080 -
/llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp
Message-ID: <200709180528.l8I5SrWJ023106@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 00:28:53 2007
New Revision: 42080
URL: http://llvm.org/viewvc/llvm-project?rev=42080&view=rev
Log:
Merge from mainline because Owen said so.
Modified:
llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp?rev=42080&r1=42079&r2=42080&view=diff
==============================================================================
--- llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/branches/release_21/lib/Transforms/Scalar/GVN.cpp Tue Sep 18 00:28:53 2007
@@ -673,6 +673,7 @@
void dump(DenseMap& d);
bool iterateOnFunction(Function &F);
Value* CollapsePhi(PHINode* p);
+ bool isSafeReplacement(PHINode* p, Instruction* inst);
};
char GVN::ID = 0;
@@ -731,7 +732,8 @@
if (constVal) {
if (Instruction* inst = dyn_cast(constVal)) {
if (DT.dominates(inst, p))
- return inst;
+ if (isSafeReplacement(p, inst))
+ return inst;
} else {
return constVal;
}
@@ -740,6 +742,19 @@
return 0;
}
+bool GVN::isSafeReplacement(PHINode* p, Instruction* inst) {
+ if (!isa(inst))
+ return true;
+
+ for (Instruction::use_iterator UI = p->use_begin(), E = p->use_end();
+ UI != E; ++UI)
+ if (PHINode* use_phi = dyn_cast(UI))
+ if (use_phi->getParent() == inst->getParent())
+ return false;
+
+ return true;
+}
+
/// GetValueForBlock - Get the value to use within the specified basic block.
/// available values are in Phis.
Value *GVN::GetValueForBlock(BasicBlock *BB, LoadInst* orig,
From tonic at nondot.org Tue Sep 18 01:05:51 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 06:05:51 -0000
Subject: [llvm-commits] [llvm] r42081 - in /llvm/branches/release_21:
include/llvm/Instructions.h lib/Target/CBackend/CBackend.cpp
Message-ID: <200709180605.l8I65q4a024496@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 01:05:51 2007
New Revision: 42081
URL: http://llvm.org/viewvc/llvm-project?rev=42081&view=rev
Log:
Merge from mainline: Fix PR1666, SPASS with the CBE and 254.gap with the CBE.
Modified:
llvm/branches/release_21/include/llvm/Instructions.h
llvm/branches/release_21/lib/Target/CBackend/CBackend.cpp
Modified: llvm/branches/release_21/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/include/llvm/Instructions.h?rev=42081&r1=42080&r2=42081&view=diff
==============================================================================
--- llvm/branches/release_21/include/llvm/Instructions.h (original)
+++ llvm/branches/release_21/include/llvm/Instructions.h Tue Sep 18 01:05:51 2007
@@ -660,7 +660,7 @@
/// @returns true if the predicate of this ICmpInst is signed, false otherwise
/// @brief Determine if this instruction's predicate is signed.
- bool isSignedPredicate() { return isSignedPredicate(getPredicate()); }
+ bool isSignedPredicate() const { return isSignedPredicate(getPredicate()); }
/// @returns true if the predicate provided is signed, false otherwise
/// @brief Determine if the predicate is signed.
Modified: llvm/branches/release_21/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/lib/Target/CBackend/CBackend.cpp?rev=42081&r1=42080&r2=42081&view=diff
==============================================================================
--- llvm/branches/release_21/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/branches/release_21/lib/Target/CBackend/CBackend.cpp Tue Sep 18 01:05:51 2007
@@ -138,7 +138,7 @@
void writeOperandRaw(Value *Operand);
void writeOperandInternal(Value *Operand);
void writeOperandWithCast(Value* Operand, unsigned Opcode);
- void writeOperandWithCast(Value* Operand, ICmpInst::Predicate predicate);
+ void writeOperandWithCast(Value* Operand, const ICmpInst &I);
bool writeInstructionCast(const Instruction &I);
private :
@@ -1245,52 +1245,34 @@
// Write the operand with a cast to another type based on the icmp predicate
// being used.
-void CWriter::writeOperandWithCast(Value* Operand, ICmpInst::Predicate predicate) {
-
- // Extract the operand's type, we'll need it.
- const Type* OpTy = Operand->getType();
-
- // Indicate whether to do the cast or not.
- bool shouldCast = false;
-
- // Indicate whether the cast should be to a signed type or not.
- bool castIsSigned = false;
-
- // Based on the Opcode for which this Operand is being written, determine
- // the new type to which the operand should be casted by setting the value
- // of OpTy. If we change OpTy, also set shouldCast to true.
- switch (predicate) {
- default:
- // for eq and ne, it doesn't matter
- break;
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_ULE:
- shouldCast = true;
- break;
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_SLE:
- shouldCast = true;
- castIsSigned = true;
- break;
- }
+void CWriter::writeOperandWithCast(Value* Operand, const ICmpInst &Cmp) {
+ // This has to do a cast to ensure the operand has the right signedness.
+ // Also, if the operand is a pointer, we make sure to cast to an integer when
+ // doing the comparison both for signedness and so that the C compiler doesn't
+ // optimize things like "p < NULL" to false (p may contain an integer value
+ // f.e.).
+ bool shouldCast = Cmp.isRelational();
// Write out the casted operand if we should, otherwise just write the
// operand.
- if (shouldCast) {
- Out << "((";
- if (OpTy->isInteger() && OpTy != Type::Int1Ty)
- printSimpleType(Out, OpTy, castIsSigned);
- else
- printType(Out, OpTy); // not integer, sign doesn't matter
- Out << ")";
- writeOperand(Operand);
- Out << ")";
- } else
+ if (!shouldCast) {
writeOperand(Operand);
+ return;
+ }
+
+ // Should this be a signed comparison? If so, convert to signed.
+ bool castIsSigned = Cmp.isSignedPredicate();
+
+ // If the operand was a pointer, convert to a large integer type.
+ const Type* OpTy = Operand->getType();
+ if (isa(OpTy))
+ OpTy = TD->getIntPtrType();
+
+ Out << "((";
+ printSimpleType(Out, OpTy, castIsSigned);
+ Out << ")";
+ writeOperand(Operand);
+ Out << ")";
}
// generateCompilerSpecificCode - This is where we add conditional compilation
@@ -2262,7 +2244,7 @@
// Certain icmp predicate require the operand to be forced to a specific type
// so we use writeOperandWithCast here instead of writeOperand. Similarly
// below for operand 1
- writeOperandWithCast(I.getOperand(0), I.getPredicate());
+ writeOperandWithCast(I.getOperand(0), I);
switch (I.getPredicate()) {
case ICmpInst::ICMP_EQ: Out << " == "; break;
@@ -2278,7 +2260,7 @@
default: cerr << "Invalid icmp predicate!" << I; abort();
}
- writeOperandWithCast(I.getOperand(1), I.getPredicate());
+ writeOperandWithCast(I.getOperand(1), I);
if (NeedsClosingParens)
Out << "))";
From tonic at nondot.org Tue Sep 18 01:08:56 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 06:08:56 -0000
Subject: [llvm-commits] [llvm] r42082 -
/llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
Message-ID: <200709180608.l8I68vjf024701@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 01:08:56 2007
New Revision: 42082
URL: http://llvm.org/viewvc/llvm-project?rev=42082&view=rev
Log:
Merge from mainline.
Modified:
llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
Modified: llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp?rev=42082&r1=42081&r2=42082&view=diff
==============================================================================
--- llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp Tue Sep 18 01:08:56 2007
@@ -352,7 +352,7 @@
O << "\n";
- if (MMI) {
+ if (TAI->doesSupportExceptionHandling() && MMI) {
// Add the (possibly multiple) personalities to the set of global values.
const std::vector& Personalities = MMI->getPersonalities();
From tonic at nondot.org Tue Sep 18 01:11:27 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 06:11:27 -0000
Subject: [llvm-commits] [llvm] r42083 -
/llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
Message-ID: <200709180611.l8I6BRAd024858@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 01:11:27 2007
New Revision: 42083
URL: http://llvm.org/viewvc/llvm-project?rev=42083&view=rev
Log:
Merge from mainline.
Modified:
llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
Modified: llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp?rev=42083&r1=42082&r2=42083&view=diff
==============================================================================
--- llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/branches/release_21/lib/Target/X86/X86AsmPrinter.cpp Tue Sep 18 01:11:27 2007
@@ -352,7 +352,7 @@
O << "\n";
- if (TAI->doesSupportExceptionHandling() && MMI) {
+ if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI) {
// Add the (possibly multiple) personalities to the set of global values.
const std::vector& Personalities = MMI->getPersonalities();
From tonic at nondot.org Tue Sep 18 01:15:06 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 06:15:06 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r42084 -
/llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp
Message-ID: <200709180615.l8I6F6rO025106@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 01:15:05 2007
New Revision: 42084
URL: http://llvm.org/viewvc/llvm-project?rev=42084&view=rev
Log:
Merge from mainline.
Modified:
llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp
Modified: llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp?rev=42084&r1=42083&r2=42084&view=diff
==============================================================================
--- llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.0/branches/release_21/gcc/config/i386/llvm-i386.cpp Tue Sep 18 01:15:05 2007
@@ -433,9 +433,15 @@
Result = BuildVector(Ops[0], Ops[1], NULL);
return true;
case IX86_BUILTIN_VEC_INIT_V4HI:
+ // Sometimes G++ promotes arguments to int.
+ for (unsigned i = 0; i != 4; ++i)
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::Int16Ty, false, "tmp");
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3], NULL);
return true;
case IX86_BUILTIN_VEC_INIT_V8QI:
+ // Sometimes G++ promotes arguments to int.
+ for (unsigned i = 0; i != 8; ++i)
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::Int8Ty, false, "tmp");
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3],
Ops[4], Ops[5], Ops[6], Ops[7], NULL);
return true;
From tonic at nondot.org Tue Sep 18 01:22:01 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Tue, 18 Sep 2007 06:22:01 -0000
Subject: [llvm-commits] [llvm] r42085 - in
/llvm/branches/release_21/utils/TableGen: FileLexer.cpp.cvs
FileParser.cpp.cvs FileParser.h.cvs
Message-ID: <200709180622.l8I6M19n025681@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Sep 18 01:22:01 2007
New Revision: 42085
URL: http://llvm.org/viewvc/llvm-project?rev=42085&view=rev
Log:
Merge from mainline.
Modified:
llvm/branches/release_21/utils/TableGen/FileLexer.cpp.cvs
llvm/branches/release_21/utils/TableGen/FileParser.cpp.cvs
llvm/branches/release_21/utils/TableGen/FileParser.h.cvs
Modified: llvm/branches/release_21/utils/TableGen/FileLexer.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/utils/TableGen/FileLexer.cpp.cvs?rev=42085&r1=42084&r2=42085&view=diff
==============================================================================
--- llvm/branches/release_21/utils/TableGen/FileLexer.cpp.cvs (original)
+++ llvm/branches/release_21/utils/TableGen/FileLexer.cpp.cvs Tue Sep 18 01:22:01 2007
@@ -21,7 +21,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header$
+ * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
*/
#define FLEX_SCANNER
@@ -502,7 +502,7 @@
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#define INITIAL 0
/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
//
@@ -520,7 +520,7 @@
#define YY_NEVER_INTERACTIVE 1
#define comment 1
-#line 30 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#include "llvm/Config/config.h"
#include "llvm/Support/Streams.h"
#include "Record.h"
@@ -817,7 +817,7 @@
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 185 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#line 824 "Lexer.cpp"
@@ -913,185 +913,185 @@
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
-#line 187 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 187 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ /* Ignore comments */ }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 189 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ HandleInclude(yytext); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 190 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
return CODEFRAGMENT; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 193 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return INT; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 194 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return BIT; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 195 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 195 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return BITS; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 196 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return STRING; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 197 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return LIST; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 198 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CODE; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 199 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DAG; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 201 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 201 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CLASS; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 202 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DEF; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 203 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return DEFM; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 204 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return MULTICLASS; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 205 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return FIELD; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 206 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 206 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return LET; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 207 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return IN; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 209 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return CONCATTOK; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 210 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRATOK; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 211 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 211 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRLTOK; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 212 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SHLTOK; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 213 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return STRCONCATTOK; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 216 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
return ID; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 218 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
return VARNAME; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 221 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
return STRVAL; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 224 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 226 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ /* Ignore whitespace */ }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 229 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ BEGIN(comment); CommentDepth++; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 230 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat anything that's not a '*' or '/' */
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 231 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up '*'s not followed by '/'s */
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 232 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 232 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ ++CommentDepth; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 233 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up /'s not followed by *'s */
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 234 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 234 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ if (!--CommentDepth) { BEGIN(INITIAL); } }
YY_BREAK
case YY_STATE_EOF(comment):
-#line 235 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 235 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ err() << "Unterminated comment!\n"; exit(1); }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 237 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 237 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return Filetext[0]; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1098 "Lexer.cpp"
@@ -1978,6 +1978,6 @@
return 0;
}
#endif
-#line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
+#line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
Modified: llvm/branches/release_21/utils/TableGen/FileParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/utils/TableGen/FileParser.cpp.cvs?rev=42085&r1=42084&r2=42085&view=diff
==============================================================================
--- llvm/branches/release_21/utils/TableGen/FileParser.cpp.cvs (original)
+++ llvm/branches/release_21/utils/TableGen/FileParser.cpp.cvs Tue Sep 18 01:22:01 2007
@@ -1,134 +1,42 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y
+ by GNU Bison version 1.28 */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+#define YYBISON 1 /* Identify Bison output. */
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton 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.3"
-
-/* 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 Fileparse
-#define yylex Filelex
+#define yylex Filelex
#define yyerror Fileerror
-#define yylval Filelval
-#define yychar Filechar
+#define yylval Filelval
+#define yychar Filechar
#define yydebug Filedebug
#define yynerrs Filenerrs
+#define INT 257
+#define BIT 258
+#define STRING 259
+#define BITS 260
+#define LIST 261
+#define CODE 262
+#define DAG 263
+#define CLASS 264
+#define DEF 265
+#define MULTICLASS 266
+#define DEFM 267
+#define FIELD 268
+#define LET 269
+#define IN 270
+#define CONCATTOK 271
+#define SHLTOK 272
+#define SRATOK 273
+#define SRLTOK 274
+#define STRCONCATTOK 275
+#define INTVAL 276
+#define ID 277
+#define VARNAME 278
+#define STRVAL 279
+#define CODEFRAGMENT 280
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- INT = 258,
- BIT = 259,
- STRING = 260,
- BITS = 261,
- LIST = 262,
- CODE = 263,
- DAG = 264,
- CLASS = 265,
- DEF = 266,
- MULTICLASS = 267,
- DEFM = 268,
- FIELD = 269,
- LET = 270,
- IN = 271,
- SHLTOK = 272,
- SRATOK = 273,
- SRLTOK = 274,
- STRCONCATTOK = 275,
- INTVAL = 276,
- ID = 277,
- VARNAME = 278,
- STRVAL = 279,
- CODEFRAGMENT = 280
- };
-#endif
-/* Tokens. */
-#define INT 258
-#define BIT 259
-#define STRING 260
-#define BITS 261
-#define LIST 262
-#define CODE 263
-#define DAG 264
-#define CLASS 265
-#define DEF 266
-#define MULTICLASS 267
-#define DEFM 268
-#define FIELD 269
-#define LET 270
-#define IN 271
-#define SHLTOK 272
-#define SRATOK 273
-#define SRLTOK 274
-#define STRCONCATTOK 275
-#define INTVAL 276
-#define ID 277
-#define VARNAME 278
-#define STRVAL 279
-#define CODEFRAGMENT 280
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 14 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+#line 14 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
#include "Record.h"
#include "llvm/ADT/StringExtras.h"
@@ -324,29 +232,8 @@
using namespace llvm;
-
-/* 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 union YYSTYPE
-#line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
-{
+#line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+typedef union {
std::string* StrVal;
int IntVal;
llvm::RecTy* Ty;
@@ -358,1195 +245,575 @@
SubClassRefTy* SubClassRef;
std::vector* SubClassList;
std::vector >* DagValueList;
-}
-/* Line 193 of yacc.c. */
-#line 364 "FileParser.tab.c"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+} YYSTYPE;
+#include
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
-/* Copy the second part of user declarations. */
+#define YYFINAL 194
+#define YYFLAG -32768
+#define YYNTBASE 42
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 280 ? yytranslate[x] : 91)
+
+static const 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, 36,
+ 37, 2, 2, 38, 40, 35, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 39, 41, 27,
+ 29, 28, 30, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 33, 2, 34, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 31, 2, 32, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
+};
-/* Line 216 of yacc.c. */
-#line 377 "FileParser.tab.c"
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 6, 11, 13, 18, 20, 22, 24,
+ 25, 27, 28, 31, 33, 35, 37, 39, 41, 43,
+ 47, 52, 57, 61, 65, 70, 75, 82, 89, 96,
+ 103, 110, 111, 114, 117, 122, 123, 125, 127, 131,
+ 134, 138, 144, 149, 151, 152, 156, 157, 159, 161,
+ 165, 170, 173, 180, 181, 184, 186, 190, 192, 197,
+ 199, 203, 204, 207, 209, 213, 217, 218, 220, 222,
+ 223, 225, 227, 229, 230, 234, 235, 236, 243, 247,
+ 249, 251, 254, 256, 257, 258, 267, 268, 275, 277,
+ 279, 281, 283, 288, 290, 294, 295, 300, 305, 308,
+ 310, 313
+};
-#ifdef short
-# undef short
-#endif
+static const short yyrhs[] = { 23,
+ 0, 5, 0, 4, 0, 6, 27, 22, 28, 0,
+ 3, 0, 7, 27, 43, 28, 0, 8, 0, 9,
+ 0, 42, 0, 0, 14, 0, 0, 29, 47, 0,
+ 23, 0, 46, 0, 22, 0, 25, 0, 26, 0,
+ 30, 0, 31, 54, 32, 0, 23, 27, 55, 28,
+ 0, 47, 31, 52, 32, 0, 33, 54, 34, 0,
+ 47, 35, 23, 0, 36, 46, 50, 37, 0, 47,
+ 33, 52, 34, 0, 17, 36, 47, 38, 47, 37,
+ 0, 18, 36, 47, 38, 47, 37, 0, 19, 36,
+ 47, 38, 47, 37, 0, 20, 36, 47, 38, 47,
+ 37, 0, 21, 36, 47, 38, 47, 37, 0, 0,
+ 39, 24, 0, 47, 48, 0, 49, 38, 47, 48,
+ 0, 0, 49, 0, 22, 0, 22, 40, 22, 0,
+ 22, 22, 0, 51, 38, 22, 0, 51, 38, 22,
+ 40, 22, 0, 51, 38, 22, 22, 0, 51, 0,
+ 0, 31, 52, 32, 0, 0, 55, 0, 47, 0,
+ 55, 38, 47, 0, 44, 43, 23, 45, 0, 56,
+ 41, 0, 15, 23, 53, 29, 47, 41, 0, 0,
+ 58, 57, 0, 41, 0, 31, 58, 32, 0, 42,
+ 0, 42, 27, 55, 28, 0, 60, 0, 61, 38,
+ 60, 0, 0, 39, 61, 0, 56, 0, 63, 38,
+ 56, 0, 27, 63, 28, 0, 0, 64, 0, 23,
+ 0, 0, 66, 0, 67, 0, 67, 0, 0, 62,
+ 71, 59, 0, 0, 0, 10, 68, 73, 65, 74,
+ 70, 0, 11, 69, 70, 0, 75, 0, 76, 0,
+ 77, 76, 0, 23, 0, 0, 0, 12, 78, 80,
+ 65, 81, 31, 77, 32, 0, 0, 13, 23, 83,
+ 39, 60, 41, 0, 72, 0, 75, 0, 79, 0,
+ 82, 0, 23, 53, 29, 47, 0, 85, 0, 86,
+ 38, 85, 0, 0, 15, 88, 86, 16, 0, 87,
+ 31, 89, 32, 0, 87, 84, 0, 84, 0, 89,
+ 84, 0, 89, 0
+};
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 246, 268, 270, 272, 274, 276, 278, 280, 282, 286,
+ 286, 288, 288, 290, 313, 315, 317, 320, 323, 325,
+ 338, 366, 373, 376, 383, 386, 394, 396, 398, 400,
+ 402, 406, 409, 413, 418, 424, 427, 430, 433, 446,
+ 460, 462, 475, 491, 493, 493, 497, 499, 503, 506,
+ 510, 527, 529, 535, 535, 536, 536, 538, 540, 544,
+ 549, 554, 557, 561, 564, 569, 570, 570, 572, 572,
+ 574, 581, 599, 624, 638, 643, 645, 647, 651, 661,
+ 675, 678, 682, 693, 695, 697, 702, 702, 776, 776,
+ 777, 777, 779, 784, 784, 787, 787, 790, 793, 797,
+ 797, 799
+};
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-# define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# else
-# define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#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
-
-/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
-#endif
-{
- return i;
-}
+static const char * const yytname[] = { "$","error","$undefined.","INT","BIT",
+"STRING","BITS","LIST","CODE","DAG","CLASS","DEF","MULTICLASS","DEFM","FIELD",
+"LET","IN","CONCATTOK","SHLTOK","SRATOK","SRLTOK","STRCONCATTOK","INTVAL","ID",
+"VARNAME","STRVAL","CODEFRAGMENT","'<'","'>'","'='","'?'","'{'","'}'","'['",
+"']'","'.'","'('","')'","','","':'","'-'","';'","ClassID","Type","OptPrefix",
+"OptValue","IDValue","Value","OptVarName","DagArgListNE","DagArgList","RBitList",
+"BitList","OptBitList","ValueList","ValueListNE","Declaration","BodyItem","BodyList",
+"Body","SubClassRef","ClassListNE","ClassList","DeclListNE","TemplateArgList",
+"OptTemplateArgList","OptID","ObjectName","ClassName","DefName","ObjectBody",
+"@1","ClassInst","@2","@3","DefInst","MultiClassDef","MultiClassBody","MultiClassName",
+"MultiClassInst","@4","@5","DefMInst","@6","Object","LETItem","LETList","LETCommand",
+"@7","ObjectList","File", NULL
+};
#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
-# elif defined __BUILTIN_VA_ARG_INCR
-# include /* INFRINGES ON USER NAME SPACE */
-# elif defined _AIX
-# define YYSTACK_ALLOC __alloca
-# elif defined _MSC_VER
-# include /* INFRINGES ON USER NAME SPACE */
-# define alloca _alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
- && ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
-# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# 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
-{
- yytype_int16 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 (yytype_int16) + 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 (YYID (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 (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 27
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 204
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 41
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 50
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 102
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 188
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 280
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const yytype_uint8 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,
- 35, 36, 2, 2, 37, 39, 34, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 38, 40,
- 26, 28, 27, 29, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 32, 2, 33, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 30, 2, 31, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 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
+static const short yyr1[] = { 0,
+ 42, 43, 43, 43, 43, 43, 43, 43, 43, 44,
+ 44, 45, 45, 46, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 48, 48, 49, 49, 50, 50, 51, 51, 51,
+ 51, 51, 51, 52, 53, 53, 54, 54, 55, 55,
+ 56, 57, 57, 58, 58, 59, 59, 60, 60, 61,
+ 61, 62, 62, 63, 63, 64, 65, 65, 66, 66,
+ 67, 68, 69, 71, 70, 73, 74, 72, 75, 76,
+ 77, 77, 78, 80, 81, 79, 83, 82, 84, 84,
+ 84, 84, 85, 86, 86, 88, 87, 84, 84, 89,
+ 89, 90
};
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint16 yyprhs[] =
-{
- 0, 0, 3, 5, 7, 9, 14, 16, 21, 23,
- 25, 27, 28, 30, 31, 34, 36, 38, 40, 42,
- 44, 46, 50, 55, 60, 64, 68, 73, 78, 85,
- 92, 99, 106, 107, 110, 113, 118, 119, 121, 123,
- 127, 130, 134, 140, 145, 147, 148, 152, 153, 155,
- 157, 161, 166, 169, 176, 177, 180, 182, 186, 188,
- 193, 195, 199, 200, 203, 205, 209, 213, 214, 216,
- 218, 219, 221, 223, 225, 226, 230, 231, 232, 239,
- 243, 245, 247, 250, 252, 253, 254, 263, 264, 271,
- 273, 275, 277, 279, 284, 286, 290, 291, 296, 301,
- 304, 306, 309
+static const short yyr2[] = { 0,
+ 1, 1, 1, 4, 1, 4, 1, 1, 1, 0,
+ 1, 0, 2, 1, 1, 1, 1, 1, 1, 3,
+ 4, 4, 3, 3, 4, 4, 6, 6, 6, 6,
+ 6, 0, 2, 2, 4, 0, 1, 1, 3, 2,
+ 3, 5, 4, 1, 0, 3, 0, 1, 1, 3,
+ 4, 2, 6, 0, 2, 1, 3, 1, 4, 1,
+ 3, 0, 2, 1, 3, 3, 0, 1, 1, 0,
+ 1, 1, 1, 0, 3, 0, 0, 6, 3, 1,
+ 1, 2, 1, 0, 0, 8, 0, 6, 1, 1,
+ 1, 1, 4, 1, 3, 0, 4, 4, 2, 1,
+ 2, 1
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 90, 0, -1, 22, -1, 5, -1, 4, -1, 6,
- 26, 21, 27, -1, 3, -1, 7, 26, 43, 27,
- -1, 8, -1, 9, -1, 42, -1, -1, 14, -1,
- -1, 28, 47, -1, 22, -1, 46, -1, 21, -1,
- 24, -1, 25, -1, 29, -1, 30, 54, 31, -1,
- 22, 26, 55, 27, -1, 47, 30, 52, 31, -1,
- 32, 54, 33, -1, 47, 34, 22, -1, 35, 46,
- 50, 36, -1, 47, 32, 52, 33, -1, 17, 35,
- 47, 37, 47, 36, -1, 18, 35, 47, 37, 47,
- 36, -1, 19, 35, 47, 37, 47, 36, -1, 20,
- 35, 47, 37, 47, 36, -1, -1, 38, 23, -1,
- 47, 48, -1, 49, 37, 47, 48, -1, -1, 49,
- -1, 21, -1, 21, 39, 21, -1, 21, 21, -1,
- 51, 37, 21, -1, 51, 37, 21, 39, 21, -1,
- 51, 37, 21, 21, -1, 51, -1, -1, 30, 52,
- 31, -1, -1, 55, -1, 47, -1, 55, 37, 47,
- -1, 44, 43, 22, 45, -1, 56, 40, -1, 15,
- 22, 53, 28, 47, 40, -1, -1, 58, 57, -1,
- 40, -1, 30, 58, 31, -1, 42, -1, 42, 26,
- 55, 27, -1, 60, -1, 61, 37, 60, -1, -1,
- 38, 61, -1, 56, -1, 63, 37, 56, -1, 26,
- 63, 27, -1, -1, 64, -1, 22, -1, -1, 66,
- -1, 67, -1, 67, -1, -1, 62, 71, 59, -1,
- -1, -1, 10, 68, 73, 65, 74, 70, -1, 11,
- 69, 70, -1, 75, -1, 76, -1, 77, 76, -1,
- 22, -1, -1, -1, 12, 78, 80, 65, 81, 30,
- 77, 31, -1, -1, 13, 22, 83, 38, 60, 40,
- -1, 72, -1, 75, -1, 79, -1, 82, -1, 22,
- 53, 28, 47, -1, 85, -1, 86, 37, 85, -1,
- -1, 15, 88, 86, 16, -1, 87, 30, 89, 31,
- -1, 87, 84, -1, 84, -1, 89, 84, -1, 89,
- -1
+static const short yydefact[] = { 0,
+ 70, 70, 0, 0, 96, 89, 90, 91, 92, 100,
+ 0, 102, 69, 71, 72, 76, 73, 62, 83, 84,
+ 87, 0, 0, 99, 101, 67, 0, 74, 79, 67,
+ 0, 45, 94, 0, 0, 10, 68, 77, 1, 58,
+ 60, 63, 0, 85, 0, 0, 0, 97, 0, 98,
+ 11, 0, 64, 0, 62, 0, 0, 54, 56, 75,
+ 0, 0, 38, 44, 0, 0, 95, 5, 3, 2,
+ 0, 0, 7, 8, 9, 0, 66, 10, 78, 0,
+ 0, 0, 0, 0, 16, 14, 17, 18, 19, 47,
+ 47, 0, 15, 49, 0, 61, 10, 0, 88, 40,
+ 0, 0, 46, 93, 0, 0, 12, 65, 0, 0,
+ 0, 0, 0, 0, 0, 48, 0, 14, 36, 0,
+ 0, 0, 59, 0, 0, 57, 0, 55, 80, 81,
+ 0, 39, 41, 0, 0, 0, 51, 0, 0, 0,
+ 0, 0, 0, 20, 23, 32, 37, 0, 0, 0,
+ 24, 50, 45, 52, 86, 82, 43, 0, 4, 6,
+ 13, 0, 0, 0, 0, 0, 21, 0, 34, 0,
+ 25, 22, 26, 0, 42, 0, 0, 0, 0, 0,
+ 33, 32, 0, 27, 28, 29, 30, 31, 35, 0,
+ 53, 0, 0, 0
};
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
-{
- 0, 246, 246, 268, 270, 272, 274, 276, 278, 280,
- 282, 286, 286, 288, 288, 290, 313, 315, 317, 320,
- 323, 325, 338, 366, 373, 376, 383, 386, 394, 396,
- 398, 400, 404, 407, 411, 416, 422, 425, 428, 431,
- 444, 458, 460, 473, 489, 491, 491, 495, 497, 501,
- 504, 508, 525, 527, 533, 533, 534, 534, 536, 538,
- 542, 547, 552, 555, 559, 562, 567, 568, 568, 570,
- 570, 572, 579, 597, 622, 622, 641, 643, 641, 649,
- 659, 673, 676, 680, 691, 693, 691, 700, 700, 774,
- 774, 775, 775, 777, 782, 782, 785, 785, 788, 791,
- 795, 795, 797
+static const short yydefgoto[] = { 40,
+ 76, 52, 137, 93, 94, 169, 147, 148, 64, 65,
+ 47, 115, 116, 53, 128, 97, 60, 41, 42, 28,
+ 54, 37, 38, 14, 15, 16, 18, 29, 43, 6,
+ 26, 55, 7, 130, 131, 20, 8, 30, 61, 9,
+ 31, 10, 33, 34, 11, 22, 12, 192
};
-#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", "INT", "BIT", "STRING", "BITS", "LIST",
- "CODE", "DAG", "CLASS", "DEF", "MULTICLASS", "DEFM", "FIELD", "LET",
- "IN", "SHLTOK", "SRATOK", "SRLTOK", "STRCONCATTOK", "INTVAL", "ID",
- "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'", "'>'", "'='", "'?'", "'{'",
- "'}'", "'['", "']'", "'.'", "'('", "')'", "','", "':'", "'-'", "';'",
- "$accept", "ClassID", "Type", "OptPrefix", "OptValue", "IDValue",
- "Value", "OptVarName", "DagArgListNE", "DagArgList", "RBitList",
- "BitList", "OptBitList", "ValueList", "ValueListNE", "Declaration",
- "BodyItem", "BodyList", "Body", "SubClassRef", "ClassListNE",
- "ClassList", "DeclListNE", "TemplateArgList", "OptTemplateArgList",
- "OptID", "ObjectName", "ClassName", "DefName", "ObjectBody", "@1",
- "ClassInst", "@2", "@3", "DefInst", "MultiClassDef", "MultiClassBody",
- "MultiClassName", "MultiClassInst", "@4", "@5", "DefMInst", "@6",
- "Object", "LETItem", "LETList", "LETCommand", "@7", "ObjectList", "File", 0
+static const short yypact[] = { 147,
+ -17, -17, 8, 12,-32768,-32768,-32768,-32768,-32768,-32768,
+ 3, 147,-32768,-32768,-32768,-32768,-32768, -13,-32768,-32768,
+-32768, 17, 147,-32768,-32768, 21, 58,-32768,-32768, 21,
+ 45, 55,-32768, -5, -3, 77,-32768,-32768,-32768, 68,
+-32768, 64, -4,-32768, 58, 84, 81,-32768, 17,-32768,
+-32768, 16,-32768, 13, -13, 43, 58,-32768,-32768,-32768,
+ 88, 74, 10, 83, 93, 43,-32768,-32768,-32768,-32768,
+ 100, 104,-32768,-32768,-32768, 110,-32768, 77,-32768, 117,
+ 125, 127, 128, 129,-32768, 139,-32768,-32768,-32768, 43,
+ 43, 132,-32768, 59, 14,-32768, 40, 156,-32768,-32768,
+ 146, 148,-32768, 59, 149, 16, 140,-32768, 43, 43,
+ 43, 43, 43, 43, 141, 134, 142,-32768, 43, 84,
+ 84, 151,-32768, 43, 152,-32768, 136,-32768,-32768,-32768,
+ 6,-32768, 35, 150, 153, 43,-32768, 70, 76, 85,
+ 91, 97, 39,-32768,-32768, 54, 144, 143, 154, 145,
+-32768, 59, 55,-32768,-32768,-32768,-32768, 161,-32768,-32768,
+ 59, 43, 43, 43, 43, 43,-32768, 160,-32768, 43,
+-32768,-32768,-32768, 158,-32768, 103, 106, 111, 114, 119,
+-32768, 54, 43,-32768,-32768,-32768,-32768,-32768,-32768, 47,
+-32768, 185, 188,-32768
};
-#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 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, 60, 62, 61, 63,
- 123, 125, 91, 93, 46, 40, 41, 44, 58, 45,
- 59
+static const short yypgoto[] = { -50,
+ 86,-32768,-32768, 98, -66, 7,-32768,-32768,-32768, -8,
+ 38, 102, -55, -48,-32768,-32768,-32768, 26,-32768,-32768,
+-32768,-32768, 164,-32768, 193,-32768,-32768, 155,-32768,-32768,
+-32768,-32768, -95, 65,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, -7, 157,-32768,-32768,-32768, 174,-32768
};
-# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
- 43, 44, 44, 45, 45, 46, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
- 51, 51, 51, 51, 52, 53, 53, 54, 54, 55,
- 55, 56, 57, 57, 58, 58, 59, 59, 60, 60,
- 61, 61, 62, 62, 63, 63, 64, 65, 65, 66,
- 66, 67, 68, 69, 71, 70, 73, 74, 72, 75,
- 76, 77, 77, 78, 80, 81, 79, 83, 82, 84,
- 84, 84, 84, 85, 86, 86, 88, 87, 84, 84,
- 89, 89, 90
-};
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 1, 1, 4, 1, 4, 1, 1,
- 1, 0, 1, 0, 2, 1, 1, 1, 1, 1,
- 1, 3, 4, 4, 3, 3, 4, 4, 6, 6,
- 6, 6, 0, 2, 2, 4, 0, 1, 1, 3,
- 2, 3, 5, 4, 1, 0, 3, 0, 1, 1,
- 3, 4, 2, 6, 0, 2, 1, 3, 1, 4,
- 1, 3, 0, 2, 1, 3, 3, 0, 1, 1,
- 0, 1, 1, 1, 0, 3, 0, 0, 6, 3,
- 1, 1, 2, 1, 0, 0, 8, 0, 6, 1,
- 1, 1, 1, 4, 1, 3, 0, 4, 4, 2,
- 1, 2, 1
-};
+#define YYLAST 210
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
-{
- 0, 70, 70, 0, 0, 96, 89, 90, 91, 92,
- 100, 0, 102, 0, 69, 71, 72, 76, 73, 62,
- 83, 84, 87, 0, 0, 99, 101, 1, 67, 0,
- 74, 79, 67, 0, 45, 94, 0, 0, 11, 68,
- 77, 2, 58, 60, 63, 0, 85, 0, 0, 0,
- 97, 0, 98, 12, 0, 64, 0, 62, 0, 0,
- 54, 56, 75, 0, 0, 38, 44, 0, 0, 95,
- 6, 4, 3, 0, 0, 8, 9, 10, 0, 66,
- 11, 78, 0, 0, 0, 0, 17, 15, 18, 19,
- 20, 47, 47, 0, 16, 49, 0, 61, 11, 0,
- 88, 40, 0, 0, 46, 93, 0, 0, 13, 65,
- 0, 0, 0, 0, 0, 0, 48, 0, 15, 36,
- 0, 0, 0, 59, 0, 0, 57, 0, 55, 80,
- 81, 0, 39, 41, 0, 0, 0, 51, 0, 0,
- 0, 0, 0, 21, 24, 32, 37, 0, 0, 0,
- 25, 50, 45, 52, 86, 82, 43, 0, 5, 7,
- 14, 0, 0, 0, 0, 22, 0, 34, 0, 26,
- 23, 27, 0, 42, 0, 0, 0, 0, 33, 32,
- 0, 28, 29, 30, 31, 35, 0, 53
-};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 42, 78, 54, 137, 94, 95, 167, 146, 147,
- 66, 67, 49, 115, 116, 55, 128, 98, 62, 43,
- 44, 30, 56, 39, 40, 15, 16, 17, 19, 31,
- 45, 6, 28, 57, 7, 130, 131, 21, 8, 32,
- 63, 9, 33, 10, 35, 36, 11, 23, 12, 13
+static const short yytable[] = { 104,
+ 95, 75, 129, 24, 25, 13, 1, 2, 3, 4,
+ 48, 5, 1, 2, 3, 4, 2, 5, 68, 69,
+ 70, 71, 72, 73, 74, 27, 58, 25, 50, 108,
+ 19, 100, 49, 23, 21, 129, 59, 155, 39, 32,
+ 77, 123, 138, 139, 140, 141, 142, 36, 127, 101,
+ 78, 124, 146, 51, 125, 75, 157, 152, 143, 80,
+ 81, 82, 83, 84, 85, 86, 167, 87, 88, 161,
+ 62, 126, 89, 90, 158, 91, 124, 120, 92, 121,
+ 39, 122, 96, 45, 120, 46, 121, 191, 122, 120,
+ 51, 121, 168, 122, 56, 176, 177, 178, 179, 180,
+ 120, 57, 121, 182, 122, 63, 120, 162, 121, 66,
+ 122, 149, 150, 163, 99, 120, 190, 121, 98, 122,
+ 102, 120, 164, 121, 103, 122, 105, 120, 165, 121,
+ 106, 122, 107, 120, 166, 121, 120, 122, 121, 184,
+ 122, 120, 185, 121, 120, 122, 121, 186, 122, 120,
+ 187, 121, 109, 122, 118, 188, 1, 2, 3, 4,
+ 110, 5, 111, 112, 113, 114, 2, 132, 136, 133,
+ 134, 124, 144, 151, 153, 145, 154, 159, 173, 171,
+ 160, 170, 175, 181, 193, 172, 183, 194, 189, 119,
+ 174, 135, 117, 44, 17, 156, 35, 0, 0, 0,
+ 0, 0, 0, 0, 0, 67, 0, 0, 0, 79
};
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -97
-static const yytype_int16 yypact[] =
-{
- 129, 3, 3, 11, 19, -97, -97, -97, -97, -97,
- -97, 2, 129, 48, -97, -97, -97, -97, -97, 29,
- -97, -97, -97, 31, 129, -97, -97, -97, 43, 56,
- -97, -97, 43, 42, 53, -97, -6, -4, 71, -97,
- -97, -97, 72, -97, 65, 9, -97, 56, 87, 78,
- -97, 31, -97, -97, 15, -97, 13, 29, 41, 56,
- -97, -97, -97, 84, 80, 7, 81, 106, 41, -97,
- -97, -97, -97, 120, 122, -97, -97, -97, 127, -97,
- 71, -97, 115, 116, 117, 118, -97, 128, -97, -97,
- -97, 41, 41, 133, -97, 113, 27, -97, 60, 145,
- -97, -97, 136, 137, -97, 113, 138, 15, 132, -97,
- 41, 41, 41, 41, 41, 130, 125, 131, -97, 41,
- 87, 87, 141, -97, 41, 143, -97, 126, -97, -97,
- -97, 5, -97, 8, 140, 142, 41, -97, 67, 73,
- 79, 85, 45, -97, -97, 54, 134, 139, 146, 135,
- -97, 113, 53, -97, -97, -97, -97, 149, -97, -97,
- 113, 41, 41, 41, 41, -97, 150, -97, 41, -97,
- -97, -97, 144, -97, 91, 94, 99, 102, -97, 54,
- 41, -97, -97, -97, -97, -97, 47, -97
+static const short yycheck[] = { 66,
+ 56, 52, 98, 11, 12, 23, 10, 11, 12, 13,
+ 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
+ 5, 6, 7, 8, 9, 39, 31, 35, 32, 78,
+ 23, 22, 38, 31, 23, 131, 41, 32, 23, 23,
+ 28, 28, 109, 110, 111, 112, 113, 27, 97, 40,
+ 38, 38, 119, 14, 15, 106, 22, 124, 114, 17,
+ 18, 19, 20, 21, 22, 23, 28, 25, 26, 136,
+ 45, 32, 30, 31, 40, 33, 38, 31, 36, 33,
+ 23, 35, 57, 39, 31, 31, 33, 41, 35, 31,
+ 14, 33, 39, 35, 27, 162, 163, 164, 165, 166,
+ 31, 38, 33, 170, 35, 22, 31, 38, 33, 29,
+ 35, 120, 121, 38, 41, 31, 183, 33, 31, 35,
+ 38, 31, 38, 33, 32, 35, 27, 31, 38, 33,
+ 27, 35, 23, 31, 38, 33, 31, 35, 33, 37,
+ 35, 31, 37, 33, 31, 35, 33, 37, 35, 31,
+ 37, 33, 36, 35, 23, 37, 10, 11, 12, 13,
+ 36, 15, 36, 36, 36, 27, 11, 22, 29, 22,
+ 22, 38, 32, 23, 23, 34, 41, 28, 34, 37,
+ 28, 38, 22, 24, 0, 32, 29, 0, 182, 92,
+ 153, 106, 91, 30, 2, 131, 23, -1, -1, -1,
+ -1, -1, -1, -1, -1, 49, -1, -1, -1, 55
};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/share/bison.simple"
+/* This file comes from bison-1.28. */
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int16 yypgoto[] =
-{
- -97, -52, 69, -97, -97, 86, -68, -5, -97, -97,
- -97, -31, 26, 88, -57, -46, -97, -97, -97, -21,
- -97, -97, -97, -97, 151, -97, 179, -97, -97, 147,
- -97, -97, -97, -97, -96, 51, -97, -97, -97, -97,
- -97, -97, -97, -7, 148, -97, -97, -97, 160, -97
-};
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-/* 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 -1
-static const yytype_uint8 yytable[] =
-{
- 105, 96, 77, 129, 25, 26, 1, 2, 3, 4,
- 50, 5, 1, 2, 3, 4, 2, 5, 70, 71,
- 72, 73, 74, 75, 76, 14, 64, 52, 101, 156,
- 26, 51, 24, 20, 109, 129, 154, 41, 97, 60,
- 79, 22, 138, 139, 140, 141, 102, 157, 27, 61,
- 80, 145, 127, 34, 123, 77, 151, 142, 82, 83,
- 84, 85, 86, 87, 124, 88, 89, 29, 160, 38,
- 90, 91, 165, 92, 53, 125, 93, 120, 41, 121,
- 47, 122, 124, 48, 120, 53, 121, 187, 122, 148,
- 149, 126, 166, 174, 175, 176, 177, 120, 58, 121,
- 179, 122, 59, 120, 161, 121, 68, 122, 65, 120,
- 162, 121, 186, 122, 99, 120, 163, 121, 103, 122,
- 100, 120, 164, 121, 120, 122, 121, 181, 122, 120,
- 182, 121, 120, 122, 121, 183, 122, 104, 184, 1,
- 2, 3, 4, 120, 5, 121, 106, 122, 107, 108,
- 110, 111, 112, 113, 114, 118, 2, 132, 133, 134,
- 136, 143, 124, 150, 144, 152, 153, 158, 171, 159,
- 173, 168, 180, 178, 185, 169, 135, 170, 172, 119,
- 117, 18, 155, 46, 37, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,
- 0, 0, 0, 0, 81
-};
+ 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.
-static const yytype_int16 yycheck[] =
-{
- 68, 58, 54, 99, 11, 12, 10, 11, 12, 13,
- 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
- 5, 6, 7, 8, 9, 22, 47, 31, 21, 21,
- 37, 37, 30, 22, 80, 131, 31, 22, 59, 30,
- 27, 22, 110, 111, 112, 113, 39, 39, 0, 40,
- 37, 119, 98, 22, 27, 107, 124, 114, 17, 18,
- 19, 20, 21, 22, 37, 24, 25, 38, 136, 26,
- 29, 30, 27, 32, 14, 15, 35, 30, 22, 32,
- 38, 34, 37, 30, 30, 14, 32, 40, 34, 120,
- 121, 31, 38, 161, 162, 163, 164, 30, 26, 32,
- 168, 34, 37, 30, 37, 32, 28, 34, 21, 30,
- 37, 32, 180, 34, 30, 30, 37, 32, 37, 34,
- 40, 30, 37, 32, 30, 34, 32, 36, 34, 30,
- 36, 32, 30, 34, 32, 36, 34, 31, 36, 10,
- 11, 12, 13, 30, 15, 32, 26, 34, 26, 22,
- 35, 35, 35, 35, 26, 22, 11, 21, 21, 21,
- 28, 31, 37, 22, 33, 22, 40, 27, 33, 27,
- 21, 37, 28, 23, 179, 36, 107, 31, 152, 93,
- 92, 2, 131, 32, 24, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
- -1, -1, -1, -1, 57
-};
+ 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.
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
-{
- 0, 10, 11, 12, 13, 15, 72, 75, 79, 82,
- 84, 87, 89, 90, 22, 66, 67, 68, 67, 69,
- 22, 78, 22, 88, 30, 84, 84, 0, 73, 38,
- 62, 70, 80, 83, 22, 85, 86, 89, 26, 64,
- 65, 22, 42, 60, 61, 71, 65, 38, 30, 53,
- 16, 37, 31, 14, 44, 56, 63, 74, 26, 37,
- 30, 40, 59, 81, 60, 21, 51, 52, 28, 85,
- 3, 4, 5, 6, 7, 8, 9, 42, 43, 27,
- 37, 70, 17, 18, 19, 20, 21, 22, 24, 25,
- 29, 30, 32, 35, 46, 47, 55, 60, 58, 30,
- 40, 21, 39, 37, 31, 47, 26, 26, 22, 56,
- 35, 35, 35, 35, 26, 54, 55, 54, 22, 46,
- 30, 32, 34, 27, 37, 15, 31, 56, 57, 75,
- 76, 77, 21, 21, 21, 43, 28, 45, 47, 47,
- 47, 47, 55, 31, 33, 47, 49, 50, 52, 52,
- 22, 47, 22, 40, 31, 76, 21, 39, 27, 27,
- 47, 37, 37, 37, 37, 27, 38, 48, 37, 36,
- 31, 33, 53, 21, 47, 47, 47, 47, 23, 47,
- 28, 36, 36, 36, 36, 48, 47, 40
-};
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
+#define YYEMPTY -2
#define YYEOF 0
-
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
-
#define YYFAIL goto yyerrlab
-
#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
+#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
goto yybackup; \
} \
else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
#define YYTERROR 1
#define YYERRCODE 256
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (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 (YYID (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
+#ifndef YYPURE
+#define YYLEX yylex()
#endif
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
-# define YYLEX yylex ()
+#define YYLEX yylex(&yylval, &yylloc)
#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 (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
+#define YYLEX yylex(&yylval)
#endif
-{
- if (!yyvaluep)
- return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
+#endif /* not YYLSP_NEEDED */
#endif
-{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
+/* If nonreentrant, generate the variables here */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
+#ifndef YYPURE
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
#endif
-{
- int yynrhs = yyr2[yyrule];
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
- /* The symbols being reduced. */
- for (yyi = 0; yyi < yynrhs; yyi++)
- {
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
- }
-}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
+#define YYINITDEPTH 200
#endif
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
+#define YYMAXDEPTH 10000
#endif
-
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# 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. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
- return yyd - 1;
+ while (i-- > 0)
+ *t++ = *f++;
}
-# 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 == '"')
- {
- YYSIZE_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
+#else /* __cplusplus */
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- 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;
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
- }
+ while (i-- > 0)
+ *t++ = *f++;
}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-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
-{
- YYUSE (yyvaluep);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
+#endif
+#line 217 "/usr/share/bison.simple"
-/* Prevent warnings from -Wmissing-prototypes. */
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
#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;
+#endif
-/* Number of syntax errors so far. */
-int yynerrs;
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-/*----------.
-| yyparse. |
-`----------*/
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
+#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
#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;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `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. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+ int yylen;
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* The number of symbols on the RHS of the reduced rule.
- Keep to zero when no symbol should be popped. */
- int yylen = 0;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
yystate = 0;
yyerrstatus = 0;
@@ -1558,665 +825,676 @@
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss;
+ yyssp = yyss - 1;
yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. So pushing a state here evens the stacks. */
- yyssp++;
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
- yysetstate:
- *yyssp = yystate;
+ *++yyssp = yystate;
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
{
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ int size = yyssp - yyss + 1;
#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *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;
- }
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
/* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
+ if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-
- {
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
#endif /* no yyoverflow */
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
goto yybackup;
+ yybackup:
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
- /* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ /* First try to decide what to do without reference to lookahead token. */
- /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yyn == YYFLAG)
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
yychar = YYLEX;
}
- if (yychar <= YYEOF)
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
{
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
}
else
{
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
}
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
+
yyn = yytable[yyn];
- if (yyn <= 0)
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
+ if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
+ /* Shift the lookahead token. */
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
- /* Discard the shifted token unless it is eof. */
+ /* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
- yystate = yyn;
*++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
- goto yynewstate;
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+ yystate = yyn;
+ goto yynewstate;
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
+/* Do the default action for the current state. */
yydefault:
+
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
- goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
+/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
- /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
- 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];
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 246 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+
+ switch (yyn) {
+
+case 1:
+#line 246 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
if (CurDefmPrefix) {
// If CurDefmPrefix is set, we're parsing a defm, which means that this is
// actually the name of a multiclass.
- MultiClass *MC = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+ MultiClass *MC = MultiClasses[*yyvsp[0].StrVal];
if (MC == 0) {
- err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- (yyval.Rec) = &MC->Rec;
+ yyval.Rec = &MC->Rec;
} else {
- (yyval.Rec) = Records.getClass(*(yyvsp[(1) - (1)].StrVal));
+ yyval.Rec = Records.getClass(*yyvsp[0].StrVal);
}
- if ((yyval.Rec) == 0) {
- err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ if (yyval.Rec == 0) {
+ err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 3:
-#line 268 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // string type
- (yyval.Ty) = new StringRecTy();
- ;}
- break;
-
- case 4:
-#line 270 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // bit type
- (yyval.Ty) = new BitRecTy();
- ;}
- break;
-
- case 5:
-#line 272 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // bits type
- (yyval.Ty) = new BitsRecTy((yyvsp[(3) - (4)].IntVal));
- ;}
- break;
-
- case 6:
-#line 274 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // int type
- (yyval.Ty) = new IntRecTy();
- ;}
- break;
-
- case 7:
-#line 276 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // list type
- (yyval.Ty) = new ListRecTy((yyvsp[(3) - (4)].Ty));
- ;}
- break;
-
- case 8:
-#line 278 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // code type
- (yyval.Ty) = new CodeRecTy();
- ;}
- break;
-
- case 9:
-#line 280 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // dag type
- (yyval.Ty) = new DagRecTy();
- ;}
- break;
-
- case 10:
-#line 282 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { // Record Type
- (yyval.Ty) = new RecordRecTy((yyvsp[(1) - (1)].Rec));
- ;}
- break;
-
- case 11:
-#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.IntVal) = 0; ;}
- break;
-
- case 12:
-#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.IntVal) = 1; ;}
- break;
-
- case 13:
-#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.Initializer) = 0; ;}
- break;
-
- case 14:
-#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.Initializer) = (yyvsp[(2) - (2)].Initializer); ;}
- break;
-
- case 15:
-#line 290 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if (const RecordVal *RV = (CurRec ? CurRec->getValue(*(yyvsp[(1) - (1)].StrVal)) : 0)) {
- (yyval.Initializer) = new VarInit(*(yyvsp[(1) - (1)].StrVal), RV->getType());
- } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal))) {
- const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal));
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 2:
+#line 268 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // string type
+ yyval.Ty = new StringRecTy();
+ ;
+ break;}
+case 3:
+#line 270 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // bit type
+ yyval.Ty = new BitRecTy();
+ ;
+ break;}
+case 4:
+#line 272 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // bits type
+ yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
+ ;
+ break;}
+case 5:
+#line 274 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // int type
+ yyval.Ty = new IntRecTy();
+ ;
+ break;}
+case 6:
+#line 276 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // list type
+ yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
+ ;
+ break;}
+case 7:
+#line 278 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // code type
+ yyval.Ty = new CodeRecTy();
+ ;
+ break;}
+case 8:
+#line 280 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // dag type
+ yyval.Ty = new DagRecTy();
+ ;
+ break;}
+case 9:
+#line 282 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ // Record Type
+ yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
+ ;
+ break;}
+case 10:
+#line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.IntVal = 0; ;
+ break;}
+case 11:
+#line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.IntVal = 1; ;
+ break;}
+case 12:
+#line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.Initializer = 0; ;
+ break;}
+case 13:
+#line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.Initializer = yyvsp[0].Initializer; ;
+ break;}
+case 14:
+#line 290 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
+ yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
+ } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*yyvsp[0].StrVal)) {
+ const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*yyvsp[0].StrVal);
assert(RV && "Template arg doesn't exist??");
- (yyval.Initializer) = new VarInit(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal), RV->getType());
+ yyval.Initializer = new VarInit(CurRec->getName()+":"+*yyvsp[0].StrVal, RV->getType());
} else if (CurMultiClass &&
- CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal))) {
- std::string Name = CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal);
+ CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal)) {
+ std::string Name = CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal;
const RecordVal *RV = CurMultiClass->Rec.getValue(Name);
assert(RV && "Template arg doesn't exist??");
- (yyval.Initializer) = new VarInit(Name, RV->getType());
- } else if (Record *D = Records.getDef(*(yyvsp[(1) - (1)].StrVal))) {
- (yyval.Initializer) = new DefInit(D);
+ yyval.Initializer = new VarInit(Name, RV->getType());
+ } else if (Record *D = Records.getDef(*yyvsp[0].StrVal)) {
+ yyval.Initializer = new DefInit(D);
} else {
- err() << "Variable not defined: '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+ err() << "Variable not defined: '" << *yyvsp[0].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 16:
-#line 313 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (yyvsp[(1) - (1)].Initializer);
- ;}
- break;
-
- case 17:
-#line 315 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new IntInit((yyvsp[(1) - (1)].IntVal));
- ;}
- break;
-
- case 18:
-#line 317 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new StringInit(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 19:
-#line 320 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new CodeInit(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- ;}
- break;
-
- case 20:
-#line 323 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new UnsetInit();
- ;}
- break;
-
- case 21:
-#line 325 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- BitsInit *Init = new BitsInit((yyvsp[(2) - (3)].FieldList)->size());
- for (unsigned i = 0, e = (yyvsp[(2) - (3)].FieldList)->size(); i != e; ++i) {
- struct Init *Bit = (*(yyvsp[(2) - (3)].FieldList))[i]->convertInitializerTo(new BitRecTy());
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 15:
+#line 313 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = yyvsp[0].Initializer;
+ ;
+ break;}
+case 16:
+#line 315 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new IntInit(yyvsp[0].IntVal);
+ ;
+ break;}
+case 17:
+#line 317 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 18:
+#line 320 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 19:
+#line 323 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new UnsetInit();
+ ;
+ break;}
+case 20:
+#line 325 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
+ for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
+ struct Init *Bit = (*yyvsp[-1].FieldList)[i]->convertInitializerTo(new BitRecTy());
if (Bit == 0) {
- err() << "Element #" << i << " (" << *(*(yyvsp[(2) - (3)].FieldList))[i]
+ err() << "Element #" << i << " (" << *(*yyvsp[-1].FieldList)[i]
<< ") is not convertable to a bit!\n";
exit(1);
}
- Init->setBit((yyvsp[(2) - (3)].FieldList)->size()-i-1, Bit);
+ Init->setBit(yyvsp[-1].FieldList->size()-i-1, Bit);
}
- (yyval.Initializer) = Init;
- delete (yyvsp[(2) - (3)].FieldList);
- ;}
- break;
-
- case 22:
-#line 338 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ yyval.Initializer = Init;
+ delete yyvsp[-1].FieldList;
+ ;
+ break;}
+case 21:
+#line 338 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// This is a CLASS expression. This is supposed to synthesize
// a new anonymous definition, deriving from CLASS with no
// body.
- Record *Class = Records.getClass(*(yyvsp[(1) - (4)].StrVal));
+ Record *Class = Records.getClass(*yyvsp[-3].StrVal);
if (!Class) {
- err() << "Expected a class, got '" << *(yyvsp[(1) - (4)].StrVal) << "'!\n";
+ err() << "Expected a class, got '" << *yyvsp[-3].StrVal << "'!\n";
exit(1);
}
- delete (yyvsp[(1) - (4)].StrVal);
+ delete yyvsp[-3].StrVal;
static unsigned AnonCounter = 0;
Record *OldRec = CurRec; // Save CurRec.
// Create the new record, set it as CurRec temporarily.
CurRec = new Record("anonymous.val."+utostr(AnonCounter++));
- addSubClass(Class, *(yyvsp[(3) - (4)].FieldList)); // Add info about the subclass to CurRec.
- delete (yyvsp[(3) - (4)].FieldList); // Free up the template args.
+ addSubClass(Class, *yyvsp[-1].FieldList); // Add info about the subclass to CurRec.
+ delete yyvsp[-1].FieldList; // Free up the template args.
CurRec->resolveReferences();
Records.addDef(CurRec);
// The result of the expression is a reference to the new record.
- (yyval.Initializer) = new DefInit(CurRec);
+ yyval.Initializer = new DefInit(CurRec);
// Restore the old CurRec
CurRec = OldRec;
- ;}
- break;
-
- case 23:
-#line 366 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitializerBitRange(*(yyvsp[(3) - (4)].BitList));
- if ((yyval.Initializer) == 0) {
- err() << "Invalid bit range for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+ ;
+ break;}
+case 22:
+#line 366 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
+ if (yyval.Initializer == 0) {
+ err() << "Invalid bit range for value '" << *yyvsp[-3].Initializer << "'!\n";
exit(1);
}
- delete (yyvsp[(3) - (4)].BitList);
- ;}
- break;
-
- case 24:
-#line 373 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new ListInit(*(yyvsp[(2) - (3)].FieldList));
- delete (yyvsp[(2) - (3)].FieldList);
- ;}
- break;
-
- case 25:
-#line 376 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if (!(yyvsp[(1) - (3)].Initializer)->getFieldType(*(yyvsp[(3) - (3)].StrVal))) {
- err() << "Cannot access field '" << *(yyvsp[(3) - (3)].StrVal) << "' of value '" << *(yyvsp[(1) - (3)].Initializer) << "!\n";
+ delete yyvsp[-1].BitList;
+ ;
+ break;}
+case 23:
+#line 373 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
+ delete yyvsp[-1].FieldList;
+ ;
+ break;}
+case 24:
+#line 376 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
+ err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
exit(1);
}
- (yyval.Initializer) = new FieldInit((yyvsp[(1) - (3)].Initializer), *(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
- ;}
- break;
-
- case 26:
-#line 383 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = new DagInit((yyvsp[(2) - (4)].Initializer), *(yyvsp[(3) - (4)].DagValueList));
- delete (yyvsp[(3) - (4)].DagValueList);
- ;}
- break;
-
- case 27:
-#line 386 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- std::reverse((yyvsp[(3) - (4)].BitList)->begin(), (yyvsp[(3) - (4)].BitList)->end());
- (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitListSlice(*(yyvsp[(3) - (4)].BitList));
- if ((yyval.Initializer) == 0) {
- err() << "Invalid list slice for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+ yyval.Initializer = new FieldInit(yyvsp[-2].Initializer, *yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 25:
+#line 383 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = new DagInit(yyvsp[-2].Initializer, *yyvsp[-1].DagValueList);
+ delete yyvsp[-1].DagValueList;
+ ;
+ break;}
+case 26:
+#line 386 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
+ yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
+ if (yyval.Initializer == 0) {
+ err() << "Invalid list slice for value '" << *yyvsp[-3].Initializer << "'!\n";
exit(1);
}
- delete (yyvsp[(3) - (4)].BitList);
- ;}
- break;
-
- case 28:
-#line 394 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SHL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 29:
-#line 396 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SRA, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 30:
-#line 398 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::SRL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 31:
-#line 400 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Initializer) = (new BinOpInit(BinOpInit::STRCONCAT, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
- ;}
- break;
-
- case 32:
-#line 404 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.StrVal) = new std::string();
- ;}
- break;
-
- case 33:
-#line 407 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
- ;}
- break;
-
- case 34:
-#line 411 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.DagValueList) = new std::vector >();
- (yyval.DagValueList)->push_back(std::make_pair((yyvsp[(1) - (2)].Initializer), *(yyvsp[(2) - (2)].StrVal)));
- delete (yyvsp[(2) - (2)].StrVal);
- ;}
- break;
-
- case 35:
-#line 416 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(1) - (4)].DagValueList)->push_back(std::make_pair((yyvsp[(3) - (4)].Initializer), *(yyvsp[(4) - (4)].StrVal)));
- delete (yyvsp[(4) - (4)].StrVal);
- (yyval.DagValueList) = (yyvsp[(1) - (4)].DagValueList);
- ;}
- break;
-
- case 36:
-#line 422 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.DagValueList) = new std::vector >();
- ;}
- break;
-
- case 37:
-#line 425 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.DagValueList) = (yyvsp[(1) - (1)].DagValueList); ;}
- break;
-
- case 38:
-#line 428 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.BitList) = new std::vector();
- (yyval.BitList)->push_back((yyvsp[(1) - (1)].IntVal));
- ;}
- break;
-
- case 39:
-#line 431 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if ((yyvsp[(1) - (3)].IntVal) < 0 || (yyvsp[(3) - (3)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(1) - (3)].IntVal) << "-" << (yyvsp[(3) - (3)].IntVal) << "!\n";
+ delete yyvsp[-1].BitList;
+ ;
+ break;}
+case 27:
+#line 394 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::CONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 28:
+#line 396 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SHL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 29:
+#line 398 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SRA, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 30:
+#line 400 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::SRL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 31:
+#line 402 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Initializer = (new BinOpInit(BinOpInit::STRCONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
+ ;
+ break;}
+case 32:
+#line 406 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.StrVal = new std::string();
+ ;
+ break;}
+case 33:
+#line 409 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.StrVal = yyvsp[0].StrVal;
+ ;
+ break;}
+case 34:
+#line 413 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.DagValueList = new std::vector >();
+ yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
+ delete yyvsp[0].StrVal;
+ ;
+ break;}
+case 35:
+#line 418 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
+ delete yyvsp[0].StrVal;
+ yyval.DagValueList = yyvsp[-3].DagValueList;
+ ;
+ break;}
+case 36:
+#line 424 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.DagValueList = new std::vector >();
+ ;
+ break;}
+case 37:
+#line 427 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.DagValueList = yyvsp[0].DagValueList; ;
+ break;}
+case 38:
+#line 430 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.BitList = new std::vector();
+ yyval.BitList->push_back(yyvsp[0].IntVal);
+ ;
+ break;}
+case 39:
+#line 433 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = new std::vector();
- if ((yyvsp[(1) - (3)].IntVal) < (yyvsp[(3) - (3)].IntVal)) {
- for (int i = (yyvsp[(1) - (3)].IntVal); i <= (yyvsp[(3) - (3)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = new std::vector();
+ if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(1) - (3)].IntVal); i >= (yyvsp[(3) - (3)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 40:
-#line 444 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(2) - (2)].IntVal) = -(yyvsp[(2) - (2)].IntVal);
- if ((yyvsp[(1) - (2)].IntVal) < 0 || (yyvsp[(2) - (2)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(1) - (2)].IntVal) << "-" << (yyvsp[(2) - (2)].IntVal) << "!\n";
+ ;
+ break;}
+case 40:
+#line 446 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[0].IntVal = -yyvsp[0].IntVal;
+ if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = new std::vector();
- if ((yyvsp[(1) - (2)].IntVal) < (yyvsp[(2) - (2)].IntVal)) {
- for (int i = (yyvsp[(1) - (2)].IntVal); i <= (yyvsp[(2) - (2)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = new std::vector();
+ if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(1) - (2)].IntVal); i >= (yyvsp[(2) - (2)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 41:
-#line 458 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.BitList)=(yyvsp[(1) - (3)].BitList))->push_back((yyvsp[(3) - (3)].IntVal));
- ;}
- break;
-
- case 42:
-#line 460 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- if ((yyvsp[(3) - (5)].IntVal) < 0 || (yyvsp[(5) - (5)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(3) - (5)].IntVal) << "-" << (yyvsp[(5) - (5)].IntVal) << "!\n";
+ ;
+ break;}
+case 41:
+#line 460 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
+ ;
+ break;}
+case 42:
+#line 462 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = (yyvsp[(1) - (5)].BitList);
- if ((yyvsp[(3) - (5)].IntVal) < (yyvsp[(5) - (5)].IntVal)) {
- for (int i = (yyvsp[(3) - (5)].IntVal); i <= (yyvsp[(5) - (5)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = yyvsp[-4].BitList;
+ if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(3) - (5)].IntVal); i >= (yyvsp[(5) - (5)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 43:
-#line 473 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyvsp[(4) - (4)].IntVal) = -(yyvsp[(4) - (4)].IntVal);
- if ((yyvsp[(3) - (4)].IntVal) < 0 || (yyvsp[(4) - (4)].IntVal) < 0) {
- err() << "Invalid range: " << (yyvsp[(3) - (4)].IntVal) << "-" << (yyvsp[(4) - (4)].IntVal) << "!\n";
+ ;
+ break;}
+case 43:
+#line 475 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyvsp[0].IntVal = -yyvsp[0].IntVal;
+ if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
+ err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
exit(1);
}
- (yyval.BitList) = (yyvsp[(1) - (4)].BitList);
- if ((yyvsp[(3) - (4)].IntVal) < (yyvsp[(4) - (4)].IntVal)) {
- for (int i = (yyvsp[(3) - (4)].IntVal); i <= (yyvsp[(4) - (4)].IntVal); ++i)
- (yyval.BitList)->push_back(i);
+ yyval.BitList = yyvsp[-3].BitList;
+ if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
+ for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
+ yyval.BitList->push_back(i);
} else {
- for (int i = (yyvsp[(3) - (4)].IntVal); i >= (yyvsp[(4) - (4)].IntVal); --i)
- (yyval.BitList)->push_back(i);
+ for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
+ yyval.BitList->push_back(i);
}
- ;}
- break;
-
- case 44:
-#line 489 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = (yyvsp[(1) - (1)].BitList); std::reverse((yyvsp[(1) - (1)].BitList)->begin(), (yyvsp[(1) - (1)].BitList)->end()); ;}
- break;
-
- case 45:
-#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = 0; ;}
- break;
-
- case 46:
-#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.BitList) = (yyvsp[(2) - (3)].BitList); ;}
- break;
-
- case 47:
-#line 495 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = new std::vector();
- ;}
- break;
-
- case 48:
-#line 497 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = (yyvsp[(1) - (1)].FieldList);
- ;}
- break;
-
- case 49:
-#line 501 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.FieldList) = new std::vector();
- (yyval.FieldList)->push_back((yyvsp[(1) - (1)].Initializer));
- ;}
- break;
-
- case 50:
-#line 504 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.FieldList) = (yyvsp[(1) - (3)].FieldList))->push_back((yyvsp[(3) - (3)].Initializer));
- ;}
- break;
-
- case 51:
-#line 508 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- std::string DecName = *(yyvsp[(3) - (4)].StrVal);
+ ;
+ break;}
+case 44:
+#line 491 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;
+ break;}
+case 45:
+#line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = 0; ;
+ break;}
+case 46:
+#line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.BitList = yyvsp[-1].BitList; ;
+ break;}
+case 47:
+#line 497 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = new std::vector();
+ ;
+ break;}
+case 48:
+#line 499 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = yyvsp[0].FieldList;
+ ;
+ break;}
+case 49:
+#line 503 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.FieldList = new std::vector();
+ yyval.FieldList->push_back(yyvsp[0].Initializer);
+ ;
+ break;}
+case 50:
+#line 506 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
+ ;
+ break;}
+case 51:
+#line 510 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ std::string DecName = *yyvsp[-1].StrVal;
if (ParsingTemplateArgs) {
if (CurRec) {
DecName = CurRec->getName() + ":" + DecName;
@@ -2227,119 +1505,104 @@
DecName = CurMultiClass->Rec.getName() + "::" + DecName;
}
- addValue(RecordVal(DecName, (yyvsp[(2) - (4)].Ty), (yyvsp[(1) - (4)].IntVal)));
- setValue(DecName, 0, (yyvsp[(4) - (4)].Initializer));
- (yyval.StrVal) = new std::string(DecName);
-;}
- break;
-
- case 52:
-#line 525 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- delete (yyvsp[(1) - (2)].StrVal);
-;}
- break;
-
- case 53:
-#line 527 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- setValue(*(yyvsp[(2) - (6)].StrVal), (yyvsp[(3) - (6)].BitList), (yyvsp[(5) - (6)].Initializer));
- delete (yyvsp[(2) - (6)].StrVal);
- delete (yyvsp[(3) - (6)].BitList);
-;}
- break;
-
- case 58:
-#line 536 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (1)].Rec), new std::vector());
- ;}
- break;
-
- case 59:
-#line 538 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (4)].Rec), (yyvsp[(3) - (4)].FieldList));
- ;}
- break;
-
- case 60:
-#line 542 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = new std::vector();
- (yyval.SubClassList)->push_back(*(yyvsp[(1) - (1)].SubClassRef));
- delete (yyvsp[(1) - (1)].SubClassRef);
- ;}
- break;
-
- case 61:
-#line 547 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- ((yyval.SubClassList)=(yyvsp[(1) - (3)].SubClassList))->push_back(*(yyvsp[(3) - (3)].SubClassRef));
- delete (yyvsp[(3) - (3)].SubClassRef);
- ;}
- break;
-
- case 62:
-#line 552 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = new std::vector();
- ;}
- break;
-
- case 63:
-#line 555 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.SubClassList) = (yyvsp[(2) - (2)].SubClassList);
- ;}
- break;
-
- case 64:
-#line 559 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- getActiveRec()->addTemplateArg(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 65:
-#line 562 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- getActiveRec()->addTemplateArg(*(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
-;}
- break;
-
- case 66:
-#line 567 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 69:
-#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
- break;
-
- case 70:
-#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { (yyval.StrVal) = new std::string(); ;}
- break;
-
- case 71:
-#line 572 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ addValue(RecordVal(DecName, yyvsp[-2].Ty, yyvsp[-3].IntVal));
+ setValue(DecName, 0, yyvsp[0].Initializer);
+ yyval.StrVal = new std::string(DecName);
+;
+ break;}
+case 52:
+#line 527 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ delete yyvsp[-1].StrVal;
+;
+ break;}
+case 53:
+#line 529 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer);
+ delete yyvsp[-4].StrVal;
+ delete yyvsp[-3].BitList;
+;
+ break;}
+case 58:
+#line 538 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector());
+ ;
+ break;}
+case 59:
+#line 540 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList);
+ ;
+ break;}
+case 60:
+#line 544 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = new std::vector();
+ yyval.SubClassList->push_back(*yyvsp[0].SubClassRef);
+ delete yyvsp[0].SubClassRef;
+ ;
+ break;}
+case 61:
+#line 549 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef);
+ delete yyvsp[0].SubClassRef;
+ ;
+ break;}
+case 62:
+#line 554 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = new std::vector();
+ ;
+ break;}
+case 63:
+#line 557 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.SubClassList = yyvsp[0].SubClassList;
+ ;
+ break;}
+case 64:
+#line 561 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 65:
+#line 564 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 66:
+#line 569 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 69:
+#line 572 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.StrVal = yyvsp[0].StrVal; ;
+ break;}
+case 70:
+#line 572 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ yyval.StrVal = new std::string(); ;
+ break;}
+case 71:
+#line 574 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
static unsigned AnonCounter = 0;
- if ((yyvsp[(1) - (1)].StrVal)->empty())
- *(yyvsp[(1) - (1)].StrVal) = "anonymous."+utostr(AnonCounter++);
- (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 72:
-#line 579 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ if (yyvsp[0].StrVal->empty())
+ *yyvsp[0].StrVal = "anonymous."+utostr(AnonCounter++);
+ yyval.StrVal = yyvsp[0].StrVal;
+;
+ break;}
+case 72:
+#line 581 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// If a class of this name already exists, it must be a forward ref.
- if ((CurRec = Records.getClass(*(yyvsp[(1) - (1)].StrVal)))) {
+ if ((CurRec = Records.getClass(*yyvsp[0].StrVal))) {
// If the body was previously defined, this is an error.
if (!CurRec->getValues().empty() ||
!CurRec->getSuperClasses().empty() ||
@@ -2349,18 +1612,17 @@
}
} else {
// If this is the first reference to this class, create and add it.
- CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
+ CurRec = new Record(*yyvsp[0].StrVal);
Records.addClass(CurRec);
}
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 73:
-#line 597 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 73:
+#line 599 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ CurRec = new Record(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
if (!CurMultiClass) {
// Top-level def definition.
@@ -2381,18 +1643,17 @@
}
CurMultiClass->DefPrototypes.push_back(CurRec);
}
-;}
- break;
-
- case 74:
-#line 622 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- for (unsigned i = 0, e = (yyvsp[(1) - (1)].SubClassList)->size(); i != e; ++i) {
- addSubClass((*(yyvsp[(1) - (1)].SubClassList))[i].first, *(*(yyvsp[(1) - (1)].SubClassList))[i].second);
+;
+ break;}
+case 74:
+#line 624 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) {
+ addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second);
// Delete the template arg values for the class
- delete (*(yyvsp[(1) - (1)].SubClassList))[i].second;
+ delete (*yyvsp[0].SubClassList)[i].second;
}
- delete (yyvsp[(1) - (1)].SubClassList); // Delete the class list.
+ delete yyvsp[0].SubClassList; // Delete the class list.
// Process any variables on the let stack.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
@@ -2400,129 +1661,115 @@
setValue(LetStack[i][j].Name,
LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
LetStack[i][j].Value);
- ;}
- break;
-
- case 75:
-#line 636 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = CurRec;
+ ;
+ break;}
+case 75:
+#line 638 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = CurRec;
CurRec = 0;
- ;}
- break;
-
- case 76:
-#line 641 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 76:
+#line 643 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = true;
- ;}
- break;
-
- case 77:
-#line 643 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 77:
+#line 645 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = false;
- ;}
- break;
-
- case 78:
-#line 645 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = (yyvsp[(6) - (6)].Rec);
- ;}
- break;
-
- case 79:
-#line 649 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 78:
+#line 647 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = yyvsp[0].Rec;
+ ;
+ break;}
+case 79:
+#line 651 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
- (yyvsp[(3) - (3)].Rec)->resolveReferences();
+ yyvsp[0].Rec->resolveReferences();
// If ObjectBody has template arguments, it's an error.
- assert((yyvsp[(3) - (3)].Rec)->getTemplateArgs().empty() && "How'd this get template args?");
- (yyval.Rec) = (yyvsp[(3) - (3)].Rec);
-;}
- break;
-
- case 80:
-#line 659 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.Rec) = (yyvsp[(1) - (1)].Rec);
+ assert(yyvsp[0].Rec->getTemplateArgs().empty() && "How'd this get template args?");
+ yyval.Rec = yyvsp[0].Rec;
+;
+ break;}
+case 80:
+#line 661 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.Rec = yyvsp[0].Rec;
// Copy the template arguments for the multiclass into the def.
const std::vector &TArgs = CurMultiClass->Rec.getTemplateArgs();
for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
const RecordVal *RV = CurMultiClass->Rec.getValue(TArgs[i]);
assert(RV && "Template arg doesn't exist?");
- (yyval.Rec)->addValue(*RV);
+ yyval.Rec->addValue(*RV);
}
-;}
- break;
-
- case 81:
-#line 673 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.RecList) = new std::vector();
- (yyval.RecList)->push_back((yyvsp[(1) - (1)].Rec));
-;}
- break;
-
- case 82:
-#line 676 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- (yyval.RecList)->push_back((yyvsp[(2) - (2)].Rec));
-;}
- break;
-
- case 83:
-#line 680 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- MultiClass *&MCE = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+;
+ break;}
+case 81:
+#line 675 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.RecList = new std::vector();
+ yyval.RecList->push_back(yyvsp[0].Rec);
+;
+ break;}
+case 82:
+#line 678 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ yyval.RecList->push_back(yyvsp[0].Rec);
+;
+ break;}
+case 83:
+#line 682 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ MultiClass *&MCE = MultiClasses[*yyvsp[0].StrVal];
if (MCE) {
- err() << "multiclass '" << *(yyvsp[(1) - (1)].StrVal) << "' already defined!\n";
+ err() << "multiclass '" << *yyvsp[0].StrVal << "' already defined!\n";
exit(1);
}
- MCE = CurMultiClass = new MultiClass(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
-;}
- break;
-
- case 84:
-#line 691 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ MCE = CurMultiClass = new MultiClass(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+;
+ break;}
+case 84:
+#line 693 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = true;
- ;}
- break;
-
- case 85:
-#line 693 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 85:
+#line 695 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
ParsingTemplateArgs = false;
- ;}
- break;
-
- case 86:
-#line 695 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 86:
+#line 697 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
CurMultiClass = 0;
-;}
- break;
-
- case 87:
-#line 700 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { CurDefmPrefix = (yyvsp[(2) - (2)].StrVal); ;}
- break;
-
- case 88:
-#line 700 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+;
+ break;}
+case 87:
+#line 702 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ CurDefmPrefix = yyvsp[0].StrVal; ;
+ break;}
+case 88:
+#line 702 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
// To instantiate a multiclass, we need to first get the multiclass, then
// instantiate each def contained in the multiclass with the SubClassRef
// template parameters.
- MultiClass *MC = MultiClasses[(yyvsp[(5) - (6)].SubClassRef)->first->getName()];
+ MultiClass *MC = MultiClasses[yyvsp[-1].SubClassRef->first->getName()];
assert(MC && "Didn't lookup multiclass correctly?");
- std::vector &TemplateVals = *(yyvsp[(5) - (6)].SubClassRef)->second;
- delete (yyvsp[(5) - (6)].SubClassRef);
+ std::vector &TemplateVals = *yyvsp[-1].SubClassRef->second;
+ delete yyvsp[-1].SubClassRef;
// Verify that the correct number of template arguments were specified.
const std::vector &TArgs = MC->Rec.getTemplateArgs();
@@ -2537,7 +1784,7 @@
// Add the suffix to the defm name to get the new name.
assert(CurRec == 0 && "A def is current?");
- CurRec = new Record(*(yyvsp[(2) - (6)].StrVal) + DefProto->getName());
+ CurRec = new Record(*yyvsp[-4].StrVal + DefProto->getName());
addSubClass(DefProto, std::vector());
@@ -2573,7 +1820,7 @@
// Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined, "
- << "instantiating defm '" << *(yyvsp[(2) - (6)].StrVal) << "' with subdef '"
+ << "instantiating defm '" << *yyvsp[-4].StrVal << "' with subdef '"
<< DefProto->getName() << "'!\n";
exit(1);
}
@@ -2585,279 +1832,275 @@
}
delete &TemplateVals;
- delete (yyvsp[(2) - (6)].StrVal);
+ delete yyvsp[-4].StrVal;
CurDefmPrefix = 0;
-;}
- break;
-
- case 89:
-#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 90:
-#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 93:
-#line 777 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
- LetStack.back().push_back(LetRecord(*(yyvsp[(1) - (4)].StrVal), (yyvsp[(2) - (4)].BitList), (yyvsp[(4) - (4)].Initializer)));
- delete (yyvsp[(1) - (4)].StrVal); delete (yyvsp[(2) - (4)].BitList);
-;}
- break;
-
- case 96:
-#line 785 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- { LetStack.push_back(std::vector()); ;}
- break;
-
- case 98:
-#line 788 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+;
+ break;}
+case 89:
+#line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 90:
+#line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 93:
+#line 779 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
+ LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
+ delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
+;
+ break;}
+case 96:
+#line 787 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{ LetStack.push_back(std::vector()); ;
+ break;}
+case 98:
+#line 790 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
LetStack.pop_back();
- ;}
- break;
-
- case 99:
-#line 791 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {
+ ;
+ break;}
+case 99:
+#line 793 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{
LetStack.pop_back();
- ;}
- break;
-
- case 100:
-#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
- case 101:
-#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
- {;}
- break;
-
+ ;
+ break;}
+case 100:
+#line 797 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+case 101:
+#line 797 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+{;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/usr/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
-/* Line 1267 of yacc.c. */
-#line 2643 "FileParser.tab.c"
- default: break;
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
}
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
+#endif
*++yyvsp = yyval;
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
+yyerrlab: /* here on detecting error */
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
{
++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
-#else
- {
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
- }
-#endif
- }
-
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
+ if (yyn > YYFLAG && yyn < YYLAST)
{
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
}
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
}
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
-/*---------------------------------------------------.
-| 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 (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
- yystate = *yyssp;
- goto yyerrlab1;
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
- for (;;)
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
{
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
+yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
- yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
- YYPOPSTACK (1);
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
- *++yyvsp = yylval;
-
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
yystate = yyn;
goto yynewstate;
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- YYPOPSTACK (yylen);
- YY_STACK_PRINT (yyss, yyssp);
- while (yyssp != yyss)
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
{
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK (1);
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ }
+ return 1;
}
-
-
-#line 799 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+#line 801 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
int yyerror(const char *ErrorMsg) {
err() << "Error parsing: " << ErrorMsg << "\n";
exit(1);
}
-
Modified: llvm/branches/release_21/utils/TableGen/FileParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_21/utils/TableGen/FileParser.h.cvs?rev=42085&r1=42084&r2=42085&view=diff
==============================================================================
--- llvm/branches/release_21/utils/TableGen/FileParser.h.cvs (original)
+++ llvm/branches/release_21/utils/TableGen/FileParser.h.cvs Tue Sep 18 01:22:01 2007
@@ -1,101 +1,4 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- 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, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- INT = 258,
- BIT = 259,
- STRING = 260,
- BITS = 261,
- LIST = 262,
- CODE = 263,
- DAG = 264,
- CLASS = 265,
- DEF = 266,
- MULTICLASS = 267,
- DEFM = 268,
- FIELD = 269,
- LET = 270,
- IN = 271,
- SHLTOK = 272,
- SRATOK = 273,
- SRLTOK = 274,
- STRCONCATTOK = 275,
- INTVAL = 276,
- ID = 277,
- VARNAME = 278,
- STRVAL = 279,
- CODEFRAGMENT = 280
- };
-#endif
-/* Tokens. */
-#define INT 258
-#define BIT 259
-#define STRING 260
-#define BITS 261
-#define LIST 262
-#define CODE 263
-#define DAG 264
-#define CLASS 265
-#define DEF 266
-#define MULTICLASS 267
-#define DEFM 268
-#define FIELD 269
-#define LET 270
-#define IN 271
-#define SHLTOK 272
-#define SRATOK 273
-#define SRLTOK 274
-#define STRCONCATTOK 275
-#define INTVAL 276
-#define ID 277
-#define VARNAME 278
-#define STRVAL 279
-#define CODEFRAGMENT 280
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
-{
+typedef union {
std::string* StrVal;
int IntVal;
llvm::RecTy* Ty;
@@ -107,14 +10,31 @@
SubClassRefTy* SubClassRef;
std::vector* SubClassList;
std::vector >* DagValueList;
-}
-/* Line 1529 of yacc.c. */
-#line 113 "FileParser.tab.h"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+} YYSTYPE;
+#define INT 257
+#define BIT 258
+#define STRING 259
+#define BITS 260
+#define LIST 261
+#define CODE 262
+#define DAG 263
+#define CLASS 264
+#define DEF 265
+#define MULTICLASS 266
+#define DEFM 267
+#define FIELD 268
+#define LET 269
+#define IN 270
+#define CONCATTOK 271
+#define SHLTOK 272
+#define SRATOK 273
+#define SRLTOK 274
+#define STRCONCATTOK 275
+#define INTVAL 276
+#define ID 277
+#define VARNAME 278
+#define STRVAL 279
+#define CODEFRAGMENT 280
-extern YYSTYPE Filelval;
+extern YYSTYPE Filelval;
From baldrick at free.fr Tue Sep 18 03:52:29 2007
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 Sep 2007 10:52:29 +0200
Subject: [llvm-commits] [llvm] r42076 - in /llvm/trunk: Xcode/
Xcode/LLVM.xcodeproj/ examples/BrainF/ include/llvm/Module.h
lib/Target/Mips/ test/Transforms/GVN/
In-Reply-To: <200709180209.l8I29YXl011630@zion.cs.uiuc.edu>
References: <200709180209.l8I29YXl011630@zion.cs.uiuc.edu>
Message-ID: <200709181052.29690.baldrick@free.fr>
Hi Gordon, I don't know what xcode is, but I was surprised to see these:
> +*.perspective
> +*.pbxuser
are they right?
Thanks,
Duncan.
From baldrick at free.fr Tue Sep 18 03:49:18 2007
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 Sep 2007 10:49:18 +0200
Subject: [llvm-commits] [llvm] r42051 - in /llvm/trunk:
lib/VMCore/Verifier.cpp test/CodeGen/Generic/GC/lower_gcroot.ll
test/Verifier/gcread-ptrptr.ll test/Verifier/gcroot-alloca.ll
test/Verifier/gcroot-meta.ll test/Verifier/gcroot-ptrptr.ll
test/Verifier/gcwrite-ptrptr.ll
In-Reply-To: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
References: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
Message-ID: <200709181049.21273.baldrick@free.fr>
Hi Gordon,
> +static bool HasPtrPtrType(Value *Val) {
I think hasPtrPtrType would be more in keeping with the LLVM naming rules
(whatever they are).
> +static Value *StripBitCasts(Value *Val) {
how about using IntrinsicInst::StripPointerCasts instead?
> + "llvm.gcroot parameter #1 must be an alloca (or a bitcast).", &CI);
"(or a bitcast)" -> "(or a bitcast of one)"
> + "llvm.gcroot parameter #2 must be a constant or global.", &CI);
how about dropping " or global" since it seems redundant.
Ciao,
Duncan.
From gordonhenriksen at mac.com Tue Sep 18 04:35:56 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 05:35:56 -0400
Subject: [llvm-commits] [llvm] r42076 - in /llvm/trunk: Xcode/
Xcode/LLVM.xcodeproj/ examples/BrainF/ include/llvm/Module.h
lib/Target/Mips/ test/Transforms/GVN/
In-Reply-To: <200709181052.29690.baldrick@free.fr>
References: <200709180209.l8I29YXl011630@zion.cs.uiuc.edu>
<200709181052.29690.baldrick@free.fr>
Message-ID: <23603B64-C53D-47D6-B4A9-A39FFEB790E9@mac.com>
On Sep 18, 2007, at 04:52, Duncan Sands wrote:
> Hi Gordon, I don't know what xcode is, but I was surprised to see
> these:
>
>> +*.perspective
>> +*.pbxuser
>
> are they right?
These are user-specific files created by Apple's IDE (http://
www.apple.com/macosx/features/xcode/). They contain critical
information such as window positions. :)
? Gordon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070918/010b8ad3/attachment.html
From isanbard at gmail.com Tue Sep 18 04:10:17 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 Sep 2007 09:10:17 -0000
Subject: [llvm-commits] [llvm] r42086 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
Message-ID: <200709180910.l8I9AHpD002949@zion.cs.uiuc.edu>
Author: void
Date: Tue Sep 18 04:10:16 2007
New Revision: 42086
URL: http://llvm.org/viewvc/llvm-project?rev=42086&view=rev
Log:
Don't pass back a reference to a temporary.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=42086&r1=42085&r2=42086&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 18 04:10:16 2007
@@ -115,7 +115,7 @@
/// getCurrentFunctionEHName - Called to return (and cache) the
/// CurrentFnEHName.
///
- const std::string &getCurrentFunctionEHName(const MachineFunction *MF);
+ std::string getCurrentFunctionEHName(const MachineFunction *MF);
protected:
/// doInitialization - Set up the AsmPrinter when we are working on a new
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=42086&r1=42085&r2=42086&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Tue Sep 18 04:10:16 2007
@@ -160,8 +160,7 @@
return false;
}
-const std::string &
-AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
+std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
assert(MF && "No machine function?");
return Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
TAI->getGlobalPrefix());
From gordonhenriksen at mac.com Tue Sep 18 05:14:31 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 10:14:31 -0000
Subject: [llvm-commits] [llvm] r42087 - /llvm/trunk/lib/VMCore/Verifier.cpp
Message-ID: <200709181014.l8IAEVVr005355@zion.cs.uiuc.edu>
Author: gordon
Date: Tue Sep 18 05:14:30 2007
New Revision: 42087
URL: http://llvm.org/viewvc/llvm-project?rev=42087&view=rev
Log:
Incorporating review feedback for GC verifier patch.
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=42087&r1=42086&r2=42087&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Sep 18 05:14:30 2007
@@ -49,8 +49,7 @@
#include "llvm/ParameterAttributes.h"
#include "llvm/DerivedTypes.h"
#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/CodeGen/ValueTypes.h"
@@ -1078,12 +1077,6 @@
return false;
}
-static Value *StripBitCasts(Value *Val) {
- if (BitCastInst *CI = dyn_cast(Val))
- return StripBitCasts(CI->getOperand(0));
- return Val;
-}
-
/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
///
void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
@@ -1101,10 +1094,11 @@
case Intrinsic::gcroot:
Assert1(HasPtrPtrType(CI.getOperand(1)),
"llvm.gcroot parameter #1 must be a pointer to a pointer.", &CI);
- Assert1(isa(StripBitCasts(CI.getOperand(1))),
- "llvm.gcroot parameter #1 must be an alloca (or a bitcast).", &CI);
+ Assert1(isa(IntrinsicInst::StripPointerCasts(CI.getOperand(1))),
+ "llvm.gcroot parameter #1 must be an alloca (or a bitcast of one).",
+ &CI);
Assert1(isa(CI.getOperand(2)),
- "llvm.gcroot parameter #2 must be a constant or global.", &CI);
+ "llvm.gcroot parameter #2 must be a constant.", &CI);
break;
case Intrinsic::gcwrite:
Assert1(CI.getOperand(3)->getType()
From gordonhenriksen at mac.com Tue Sep 18 05:17:00 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 06:17:00 -0400
Subject: [llvm-commits] [llvm] r42051 - in /llvm/trunk:
lib/VMCore/Verifier.cpp test/CodeGen/Generic/GC/lower_gcroot.ll
test/Verifier/gcread-ptrptr.ll test/Verifier/gcroot-alloca.ll
test/Verifier/gcroot-meta.ll test/Verifier/gcroot-ptrptr.ll
test/Verifier/gcwrite-ptrptr.ll
In-Reply-To: <200709181049.21273.baldrick@free.fr>
References: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
<200709181049.21273.baldrick@free.fr>
Message-ID: <7E45917A-52D7-4AC4-8882-B0B6E3F9FCA5@mac.com>
On Sep 18, 2007, at 04:49, Duncan Sands wrote:
> Hi Gordon,
>
>> +static bool HasPtrPtrType(Value *Val) {
>
> I think hasPtrPtrType would be more in keeping with the LLVM naming
> rules (whatever they are).
Do you think so? The convention I had gleaned is that local, private,
or static (in the C sense) identifiers were usually distinguished by
InitialCaps.
>> +static Value *StripBitCasts(Value *Val) {
>
> how about using IntrinsicInst::StripPointerCasts instead?
Done. Note that, although there's tantalizing GEP-0 handling in
StripPointerCasts, it's still not really possible to use gcroot
without bitcasts:
%class.Object = { %vtable* }
%class.Derived = { %class.Object, ... }
declare void @llvm.gcroot(%class.Object* %root, i8* %meta)
define void @look_ma_no_casts() {
entry:
%x_addr = alloca %class.Derived*
%tmp0 = getelementptr %x_addr, i32 0, i32 0 ; Invalid! But nice try...
call void @llvm.gcroot(%class.Obj* %tmp0, i8* null)
ret void
}
>> + "llvm.gcroot parameter #1 must be an alloca (or a
>> bitcast).", &CI);
>
> "(or a bitcast)" -> "(or a bitcast of one)"
Done.
>> + "llvm.gcroot parameter #2 must be a constant or
>> global.", &CI);
>
> how about dropping " or global" since it seems redundant.
I agree. The manual used that phrasing, I think for clarity to those
not quite so familiar with LLVM's type system. Done.
Thanks Duncan.
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
Mon-20070917/053633.html
? Gordon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070918/cf5aeca0/attachment.html
From baldrick at free.fr Tue Sep 18 06:44:02 2007
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 Sep 2007 13:44:02 +0200
Subject: [llvm-commits] [llvm] r42051 - in /llvm/trunk:
lib/VMCore/Verifier.cpp test/CodeGen/Generic/GC/lower_gcroot.ll
test/Verifier/gcread-ptrptr.ll test/Verifier/gcroot-alloca.ll
test/Verifier/gcroot-meta.ll test/Verifier/gcroot-ptrptr.ll
test/Verifier/gcwrite-ptrptr.ll
In-Reply-To: <7E45917A-52D7-4AC4-8882-B0B6E3F9FCA5@mac.com>
References: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
<200709181049.21273.baldrick@free.fr>
<7E45917A-52D7-4AC4-8882-B0B6E3F9FCA5@mac.com>
Message-ID: <200709181344.04203.baldrick@free.fr>
Hi,
> >> +static Value *StripBitCasts(Value *Val) {
> >
> > how about using IntrinsicInst::StripPointerCasts instead?
>
> Done. Note that, although there's tantalizing GEP-0 handling in
> StripPointerCasts, it's still not really possible to use gcroot
> without bitcasts:
the reason for the GEP handling, is that if you have a constant
pointer P to a struct S for which the first field is of type T,
and you constant bitcast P to a T*, then the optimizers will turn
this into a GEP-0 instead of a bitcast. Thus it is unwise to assume
you'll always see a bitcast - it might be that you get passed a
GEP instead.
> %x_addr = alloca %class.Derived*
> %tmp0 = getelementptr %x_addr, i32 0, i32 0 ; Invalid! But nice try...
If x_addr pointed to a global variable rather than a local variable, this (or
something like it) should be valid. Just to be clear: I'm not suggesting that you
can get rid of bitcasts - I'm pointing out that in obscure circumstances you
may be passed a GEP rather than a bitcast, even if you always generate bitcasts
in the front-end. So you need to handle that, eg by using StripPointerCasts.
Ciao,
Duncan.
From gordonhenriksen at mac.com Tue Sep 18 07:26:18 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 12:26:18 -0000
Subject: [llvm-commits] [llvm] r42090 - in /llvm/trunk: Makefile.config.in
bindings/ bindings/ocaml/ bindings/ocaml/Makefile.ocaml test/Makefile
Message-ID: <200709181226.l8ICQKvM010467@zion.cs.uiuc.edu>
Author: gordon
Date: Tue Sep 18 07:26:17 2007
New Revision: 42090
URL: http://llvm.org/viewvc/llvm-project?rev=42090&view=rev
Log: (empty)
Added:
llvm/trunk/bindings/
llvm/trunk/bindings/ocaml/
llvm/trunk/bindings/ocaml/Makefile.ocaml
Modified:
llvm/trunk/Makefile.config.in
llvm/trunk/test/Makefile
Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=42090&r1=42089&r2=42090&view=diff
==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Tue Sep 18 07:26:17 2007
@@ -156,6 +156,8 @@
ETAGSFLAGS := @ETAGSFLAGS@
GROFF := @GROFF@
GZIP := @GZIP@
+OCAMLC := @OCAMLC@
+OCAMLOPT := @OCAMLOPT@
POD2HTML := @POD2HTML@
POD2MAN := @POD2MAN@
RUNTEST := @RUNTEST@
Added: llvm/trunk/bindings/ocaml/Makefile.ocaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/Makefile.ocaml?rev=42090&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/Makefile.ocaml (added)
+++ llvm/trunk/bindings/ocaml/Makefile.ocaml Tue Sep 18 07:26:17 2007
@@ -0,0 +1,265 @@
+##===- tools/ml/Makefile -----------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file was developed by Gordon Henriksen and is distributed under the
+# University of Illinois Open Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+#
+# An ocaml library is a unique project type in the context of LLVM, so rules are
+# here rather than in Makefile.rules.
+#
+##===----------------------------------------------------------------------===##
+
+include $(LEVEL)/Makefile.config
+
+# Find the ocaml stdlib root. /usr/local/lib/ocaml is the default when built
+# from source; distros use something like /usr/lib/ocaml/3.10.0.
+ifndef OCAML_LIBDIR
+OCAML_LIBDIR := $(shell $(OCAMLC) -where)
+endif
+
+# CFLAGS needs to be set before Makefile.rules is included. Yes, ocaml puts its
+# includes under its libdir.
+CFLAGS += -I$(OCAML_LIBDIR)
+
+include $(LEVEL)/Makefile.common
+
+# Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the
+# user can override this with OCAML_LIBDIR.
+PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
+OcamlDir := $(LibDir)/ocaml
+
+# Info from llvm-config and similar
+ifdef UsedComponents
+UsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
+UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
+endif
+
+# Tools
+OCAMLCFLAGS += -I $(OcamlDir)
+OCAMLAFLAGS += $(patsubst %,-cclib %, \
+ $(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
+ $(UsedLibs) -l$(LIBRARYNAME))
+
+Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o)
+Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o)
+Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) -o)
+
+Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) -o)
+Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) -o)
+
+# Source files
+OcamlSources := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
+OcamlHeaders := $(OcamlSources:.ml=.mli)
+
+# Output and intermediate files
+# The .cmo files are the only intermediates; all others get installed.
+BareLibraryA := lib$(LIBRARYNAME).a
+LibraryA := $(OcamlDir)/$(BareLibraryA)
+LibraryCMA := $(OcamlDir)/$(LIBRARYNAME).cma
+LibraryCMXA := $(OcamlDir)/$(LIBRARYNAME).cmxa
+ObjectsCMI := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/%.cmi)
+ObjectsCMO := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(ObjDir)/%.cmo)
+ObjectsCMX := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/%.cmx)
+
+# Dependencies
+# Punting on ocamldep, since its output is only suitable for builds where
+# objects are placed directly adjacent to sources, which is not us.
+# Unfortunately, this is subtly incorrect and leads to occasional problems.
+# ocamlc/ocamlopt really need an option akin to gcc -M or gcc -MD.
+$(ObjectsCMO): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
+$(ObjectsCMX): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
+
+# Installation targets
+DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
+DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
+DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
+
+
+##===- Build static library from C sources --------------------------------===##
+
+all-local:: $(LibraryA)
+clean-local:: clean-a
+install-local:: install-a
+uninstall-local:: uninstall-a
+
+$(LibraryA): $(ObjectsO) $(OcamlDir)/.dir
+ $(Echo) "Building $(BuildMode) $(notdir $@)"
+ -$(Verb) $(RM) -f $@
+ $(Verb) $(Archive) $@ $(ObjectsO)
+ $(Verb) $(Ranlib) $@
+
+clean-a::
+ -$(Verb) $(RM) -f $(LibraryA)
+
+install-a:: $(LibraryA)
+ $(Echo) "Installing $(BuildMode) $(DestA)"
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) $(LTInstall) $(LibraryA) $(DestA)
+ $(Verb)
+
+uninstall-a::
+ $(Echo) "Uninstalling $(DestA)"
+ -$(Verb) $(RM) -f $(DestA)
+
+
+##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
+
+all-local:: build-cmis
+clean-local:: clean-cmis
+install-local:: install-cmis
+uninstall-local:: uninstall-cmis
+
+build-cmis: $(ObjectsCMI)
+
+$(OcamlDir)/%.cmi: $(PROJ_SRC_DIR)/%.mli $(OcamlDir)/.dir
+ $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
+ $(Verb) $(Compile.CMI) $@ $<
+
+clean-cmis::
+ -$(Verb) $(RM) -f $(ObjectsCMI)
+
+# Also install the .mli's (headers) as documentation.
+install-cmis: $(ObjectsCMI)
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
+ $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
+ $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
+ done
+ $(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders)); do \
+ $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
+ $(DataInstall) $(PROJ_SRC_DIR)/$$i "$(PROJ_libocamldir)/$$i"; \
+ done
+
+uninstall-cmis::
+ $(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
+ $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
+ $(RM) -f "$(PROJ_libocamldir)/$$i"; \
+ done
+ $(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders)); do \
+ $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
+ $(RM) -f "$(PROJ_libocamldir)/$$i"; \
+ done
+
+
+##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
+
+all-local:: $(LibraryCMA)
+clean-local:: clean-cma
+install-local:: install-cma
+uninstall-local:: uninstall-cma
+
+$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
+ $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
+ $(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
+ $(Verb) for i in $(UsedLibNames); do \
+ ln -sf "$(LibDir)/$$i" "$(OcamlDir)/$$i"; \
+ done
+
+$(ObjDir)/%.cmo: $(PROJ_SRC_DIR)/%.ml $(OcamlDir)/.dir
+ $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
+ $(Verb) $(Compile.CMO) $@ $<
+
+clean-cma::
+ $(Verb) $(RM) -f $(LibraryCMA)
+
+install-cma:: $(LibraryCMA)
+ $(Echo) "Installing $(BuildMode) $(DestCMA)"
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) $(DataInstall) $(LibraryCMA) "$(DestCMA)"
+ $(Verb) for i in $(UsedLibNames); do \
+ $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
+ ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
+ done
+
+uninstall-cma::
+ $(Echo) "Uninstalling $(DestCMA)"
+ -$(Verb) $(RM) -f $(DestCMA)
+ $(Verb) for i in $(UsedLibNames); do \
+ $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
+ $(RM) -f "$(PROJ_libocamldir)/$$i"; \
+ done
+
+
+##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
+
+# The ocamlopt compiler is supported on a set of targets disjoint from LLVM's.
+# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
+ifdef OCAMLOPT
+
+all-local:: $(LibraryCMXA)
+clean-local:: clean-cmxa
+install-local:: install-cmxa
+uninstall-local:: uninstall-cmxa
+
+$(LibraryCMXA): $(ObjectsCMX)
+ $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
+ $(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
+ $(Verb) $(RM) -f $(@:.cmxa=.o)
+
+$(OcamlDir)/%.cmx: $(PROJ_SRC_DIR)/%.ml
+ $(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
+ $(Verb) $(Compile.CMX) $@ $<
+
+clean-cmxa::
+ $(Verb) $(RM) -f $(LibraryCMXA) $(LibraryCMXA:.cmxa=.o) \
+ $(LibraryCMXA:.cmxa=.a) $(ObjectsCMX)
+
+install-cmxa:: $(LibraryCMXA)
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Echo) "Installing $(BuildMode) $(DestCMXA)"
+ $(Verb) $(DataInstall) $(LibraryCMXA) $(DestCMXA)
+ $(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
+ $(Verb) $(DataInstall) $(LibraryCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
+ $(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
+ $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
+ $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
+ done
+
+uninstall-cmxa:: $(LibraryCMXA)
+ $(Echo) "Uninstalling $(DestCMXA)"
+ $(Verb) $(RM) -f $(DestCMXA)
+ $(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
+ $(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
+ $(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
+ $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
+ $(RM) -f $(PROJ_libocamldir)/$$i; \
+ done
+
+endif
+
+
+##===- Debugging gunk -----------------------------------------------------===##
+printvars:: printcamlvars
+
+printcamlvars::
+ $(Echo) "LLVM_CONFIG : " '$(LLVM_CONFIG)'
+ $(Echo) "OCAMLCFLAGS : " '$(OCAMLCFLAGS)'
+ $(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
+ $(Echo) "OCAMLC : " '$(OCAMLC)'
+ $(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
+ $(Echo) "Compile.CMI : " '$(Compile.CMI)'
+ $(Echo) "Compile.CMO : " '$(Compile.CMO)'
+ $(Echo) "Archive.CMA : " '$(Archive.CMA)'
+ $(Echo) "Compile.CMX : " '$(Compile.CMX)'
+ $(Echo) "Archive.CMXA : " '$(Archive.CMXA)'
+ $(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
+ $(Echo) "LibraryCMA : " '$(LibraryCMA)'
+ $(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
+ $(Echo) "OcamlSources : " '$(OcamlSources)'
+ $(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
+ $(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
+ $(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
+ $(Echo) "OCAML_LIBDIR : " '$(OCAML_LIBDIR)'
+ $(Echo) "DestA : " '$(DestA)'
+ $(Echo) "DestCMA : " '$(DestCMA)'
+ $(Echo) "DestCMXA : " '$(DestCMXA)'
+ $(Echo) "UsedLibs : " '$(UsedLibs)'
+ $(Echo) "UsedLibNames : " '$(UsedLibNames)'
+
+.PHONY: printcamlvars build-cmis \
+ clean-a clean-cmis clean-cma clean-cmxa \
+ install-a install-cmis install-cma install-cmxa \
+ uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa
Modified: llvm/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=42090&r1=42089&r2=42090&view=diff
==============================================================================
--- llvm/trunk/test/Makefile (original)
+++ llvm/trunk/test/Makefile Tue Sep 18 07:26:17 2007
@@ -28,8 +28,18 @@
RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
endif
+IGNORE_TESTS :=
+
ifndef RUNLLVM2CPP
-RUNTESTFLAGS += --ignore llvm2cpp.exp
+IGNORE_TESTS += llvm2cpp.exp
+endif
+
+ifndef OCAMLC
+IGNORE_TESTS += ocaml.exp
+endif
+
+ifdef IGNORE_TESTS
+RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
endif
ifneq ($(RUNTEST),)
@@ -89,6 +99,7 @@
@echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
@echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
@echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
+ @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
@echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
@test ! -f site.exp || \
sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
From gordonhenriksen at mac.com Tue Sep 18 07:27:00 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 12:27:00 -0000
Subject: [llvm-commits] [llvm] r42091 - /llvm/trunk/autoconf/configure.ac
Message-ID: <200709181227.l8ICR0lk010496@zion.cs.uiuc.edu>
Author: gordon
Date: Tue Sep 18 07:26:59 2007
New Revision: 42091
URL: http://llvm.org/viewvc/llvm-project?rev=42091&view=rev
Log: (empty)
Modified:
llvm/trunk/autoconf/configure.ac
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=42091&r1=42090&r2=42091&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Tue Sep 18 07:26:59 2007
@@ -532,6 +532,8 @@
AC_PATH_PROG(RUNTEST,[runtest],[echo "Skipped: runtest not found"])
DJ_AC_PATH_TCLSH
AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
+AC_PATH_PROG(OCAMLC,[ocamlc],[echo "Skipped: ocamlc not found"])
+AC_PATH_PROG(OCAMLOPT,[ocamlopt],[echo "Skipped: ocamlopt not found"])
dnl Determine if the linker supports the -R option.
AC_LINK_USE_R
From gordonhenriksen at mac.com Tue Sep 18 07:27:14 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 12:27:14 -0000
Subject: [llvm-commits] [llvm] r42092 - /llvm/trunk/configure
Message-ID: <200709181227.l8ICRFkI010517@zion.cs.uiuc.edu>
Author: gordon
Date: Tue Sep 18 07:27:13 2007
New Revision: 42092
URL: http://llvm.org/viewvc/llvm-project?rev=42092&view=rev
Log:
Regenerate.
Modified:
llvm/trunk/configure
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=42092&r1=42091&r2=42092&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Tue Sep 18 07:27:13 2007
@@ -883,6 +883,8 @@
RUNTEST
TCLSH
ZIP
+OCAMLC
+OCAMLOPT
INSTALL_LTDL_TRUE
INSTALL_LTDL_FALSE
CONVENIENCE_LTDL_TRUE
@@ -7912,6 +7914,88 @@
fi
+# Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_OCAMLC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $OCAMLC in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_OCAMLC="$OCAMLC" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_OCAMLC="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_OCAMLC" && ac_cv_path_OCAMLC="echo "Skipped: ocamlc not found""
+ ;;
+esac
+fi
+OCAMLC=$ac_cv_path_OCAMLC
+if test -n "$OCAMLC"; then
+ { echo "$as_me:$LINENO: result: $OCAMLC" >&5
+echo "${ECHO_T}$OCAMLC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+# Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_OCAMLOPT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $OCAMLOPT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_OCAMLOPT" && ac_cv_path_OCAMLOPT="echo "Skipped: ocamlopt not found""
+ ;;
+esac
+fi
+OCAMLOPT=$ac_cv_path_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+ { echo "$as_me:$LINENO: result: $OCAMLOPT" >&5
+echo "${ECHO_T}$OCAMLOPT" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
{ echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5
echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6; }
@@ -10374,7 +10458,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 12605 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -14236,11 +14320,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:14239: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14323: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14243: \$? = $ac_status" >&5
+ echo "$as_me:14327: \$? = $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.
@@ -14504,11 +14588,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:14507: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14591: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14511: \$? = $ac_status" >&5
+ echo "$as_me:14595: \$? = $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.
@@ -14608,11 +14692,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:14611: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14695: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14615: \$? = $ac_status" >&5
+ echo "$as_me:14699: \$? = $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
@@ -17060,7 +17144,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:19615: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:19535: \$? = $ac_status" >&5
+ echo "$as_me:19619: \$? = $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.
@@ -19632,11 +19716,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:19635: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19719: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19639: \$? = $ac_status" >&5
+ echo "$as_me:19723: \$? = $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
@@ -21202,11 +21286,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:21205: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21289: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21209: \$? = $ac_status" >&5
+ echo "$as_me:21293: \$? = $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.
@@ -21306,11 +21390,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:21309: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21393: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21313: \$? = $ac_status" >&5
+ echo "$as_me:21397: \$? = $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
@@ -23541,11 +23625,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:23544: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23628: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:23548: \$? = $ac_status" >&5
+ echo "$as_me:23632: \$? = $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.
@@ -23809,11 +23893,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:23812: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23896: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:23816: \$? = $ac_status" >&5
+ echo "$as_me:23900: \$? = $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.
@@ -23913,11 +23997,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:23916: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:24000: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:23920: \$? = $ac_status" >&5
+ echo "$as_me:24004: \$? = $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
@@ -34869,6 +34953,8 @@
RUNTEST!$RUNTEST$ac_delim
TCLSH!$TCLSH$ac_delim
ZIP!$ZIP$ac_delim
+OCAMLC!$OCAMLC$ac_delim
+OCAMLOPT!$OCAMLOPT$ac_delim
INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim
INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim
CONVENIENCE_LTDL_TRUE!$CONVENIENCE_LTDL_TRUE$ac_delim
@@ -34912,7 +34998,7 @@
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 73; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
From gordonhenriksen at mac.com Tue Sep 18 07:29:26 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 08:29:26 -0400
Subject: [llvm-commits] [llvm] r42090 - in /llvm/trunk:
Makefile.config.in bindings/ bindings/ocaml/
bindings/ocaml/Makefile.ocaml test/Makefile
In-Reply-To: <200709181226.l8ICQKvM010467@zion.cs.uiuc.edu>
References: <200709181226.l8ICQKvM010467@zion.cs.uiuc.edu>
Message-ID:
On Sep 18, 2007, at 08:26, Gordon Henriksen wrote:
> Author: gordon
> Date: Tue Sep 18 07:26:17 2007
> New Revision: 42090
>
> URL: http://llvm.org/viewvc/llvm-project?rev=42090&view=rev
> Log: (empty)
Oops, forgot to safe my commit message file. I intended to write:
Adding ocaml to build infrastructure.
- configure tries to find ocamlc and ocamlopt.
- Makefile rules for ocaml libs. I put them in a separate file,
though.
- Tests using ocaml.exp are ignored if ocamlc was not found.
- Tests may reference %ocamlc, which expands to something like
ocamlc -cc g++ -I llvm/Release/lib/ocaml
- Ocaml libs install direct into ocaml's stdlib, found using
ocamlc -where,
ignoring --prefix. This perhaps should be configurable, but that
requires
bigger configure cojones than mine.
> Added:
> llvm/trunk/bindings/
> llvm/trunk/bindings/ocaml/
> llvm/trunk/bindings/ocaml/Makefile.ocaml
> Modified:
> llvm/trunk/Makefile.config.in
> llvm/trunk/test/Makefile
>
> Modified: llvm/trunk/Makefile.config.in
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/
> Makefile.config.in?rev=42090&r1=42089&r2=42090&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/Makefile.config.in (original)
> +++ llvm/trunk/Makefile.config.in Tue Sep 18 07:26:17 2007
> @@ -156,6 +156,8 @@
> ETAGSFLAGS := @ETAGSFLAGS@
> GROFF := @GROFF@
> GZIP := @GZIP@
> +OCAMLC := @OCAMLC@
> +OCAMLOPT := @OCAMLOPT@
> POD2HTML := @POD2HTML@
> POD2MAN := @POD2MAN@
> RUNTEST := @RUNTEST@
>
> Added: llvm/trunk/bindings/ocaml/Makefile.ocaml
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/
> Makefile.ocaml?rev=42090&view=auto
>
> ======================================================================
> ========
> --- llvm/trunk/bindings/ocaml/Makefile.ocaml (added)
> +++ llvm/trunk/bindings/ocaml/Makefile.ocaml Tue Sep 18 07:26:17 2007
> @@ -0,0 +1,265 @@
> +##===- tools/ml/Makefile -----------------------------------*-
> Makefile -*-===##
> +#
> +# The LLVM Compiler Infrastructure
> +#
> +# This file was developed by Gordon Henriksen and is distributed
> under the
> +# University of Illinois Open Source License. See LICENSE.TXT for
> details.
> +#
> +##===----------------------------------------------------------------
> ------===##
> +#
> +# An ocaml library is a unique project type in the context of
> LLVM, so rules are
> +# here rather than in Makefile.rules.
> +#
> +##===----------------------------------------------------------------
> ------===##
> +
> +include $(LEVEL)/Makefile.config
> +
> +# Find the ocaml stdlib root. /usr/local/lib/ocaml is the default
> when built
> +# from source; distros use something like /usr/lib/ocaml/3.10.0.
> +ifndef OCAML_LIBDIR
> +OCAML_LIBDIR := $(shell $(OCAMLC) -where)
> +endif
> +
> +# CFLAGS needs to be set before Makefile.rules is included. Yes,
> ocaml puts its
> +# includes under its libdir.
> +CFLAGS += -I$(OCAML_LIBDIR)
> +
> +include $(LEVEL)/Makefile.common
> +
> +# Intentionally ignore PROJ_prefix here. We want the ocaml stdlib.
> However, the
> +# user can override this with OCAML_LIBDIR.
> +PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
> +OcamlDir := $(LibDir)/ocaml
> +
> +# Info from llvm-config and similar
> +ifdef UsedComponents
> +UsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
> +UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
> +endif
> +
> +# Tools
> +OCAMLCFLAGS += -I $(OcamlDir)
> +OCAMLAFLAGS += $(patsubst %,-cclib %, \
> + $(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --
> ldflags)) \
> + $(UsedLibs) -l$(LIBRARYNAME))
> +
> +Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o)
> +Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o)
> +Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) -o)
> +
> +Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) -o)
> +Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) -o)
> +
> +# Source files
> +OcamlSources := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
> +OcamlHeaders := $(OcamlSources:.ml=.mli)
> +
> +# Output and intermediate files
> +# The .cmo files are the only intermediates; all others get
> installed.
> +BareLibraryA := lib$(LIBRARYNAME).a
> +LibraryA := $(OcamlDir)/$(BareLibraryA)
> +LibraryCMA := $(OcamlDir)/$(LIBRARYNAME).cma
> +LibraryCMXA := $(OcamlDir)/$(LIBRARYNAME).cmxa
> +ObjectsCMI := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/
> %.cmi)
> +ObjectsCMO := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(ObjDir)/%.cmo)
> +ObjectsCMX := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/
> %.cmx)
> +
> +# Dependencies
> +# Punting on ocamldep, since its output is only suitable for
> builds where
> +# objects are placed directly adjacent to sources, which is not us.
> +# Unfortunately, this is subtly incorrect and leads to
> occasional problems.
> +# ocamlc/ocamlopt really need an option akin to gcc -M or gcc -MD.
> +$(ObjectsCMO): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
> +$(ObjectsCMX): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
> +
> +# Installation targets
> +DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
> +DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
> +DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
> +
> +
> +##===- Build static library from C sources
> --------------------------------===##
> +
> +all-local:: $(LibraryA)
> +clean-local:: clean-a
> +install-local:: install-a
> +uninstall-local:: uninstall-a
> +
> +$(LibraryA): $(ObjectsO) $(OcamlDir)/.dir
> + $(Echo) "Building $(BuildMode) $(notdir $@)"
> + -$(Verb) $(RM) -f $@
> + $(Verb) $(Archive) $@ $(ObjectsO)
> + $(Verb) $(Ranlib) $@
> +
> +clean-a::
> + -$(Verb) $(RM) -f $(LibraryA)
> +
> +install-a:: $(LibraryA)
> + $(Echo) "Installing $(BuildMode) $(DestA)"
> + $(Verb) $(MKDIR) $(PROJ_libocamldir)
> + $(Verb) $(LTInstall) $(LibraryA) $(DestA)
> + $(Verb)
> +
> +uninstall-a::
> + $(Echo) "Uninstalling $(DestA)"
> + -$(Verb) $(RM) -f $(DestA)
> +
> +
> +##===- Build ocaml interfaces (.mli's -> .cmi's)
> --------------------------===##
> +
> +all-local:: build-cmis
> +clean-local:: clean-cmis
> +install-local:: install-cmis
> +uninstall-local:: uninstall-cmis
> +
> +build-cmis: $(ObjectsCMI)
> +
> +$(OcamlDir)/%.cmi: $(PROJ_SRC_DIR)/%.mli $(OcamlDir)/.dir
> + $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
> + $(Verb) $(Compile.CMI) $@ $<
> +
> +clean-cmis::
> + -$(Verb) $(RM) -f $(ObjectsCMI)
> +
> +# Also install the .mli's (headers) as documentation.
> +install-cmis: $(ObjectsCMI)
> + $(Verb) $(MKDIR) $(PROJ_libocamldir)
> + $(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
> + $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
> + $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
> + done
> + $(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders));
> do \
> + $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
> + $(DataInstall) $(PROJ_SRC_DIR)/$$i "$(PROJ_libocamldir)/$$i"; \
> + done
> +
> +uninstall-cmis::
> + $(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
> + $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
> + $(RM) -f "$(PROJ_libocamldir)/$$i"; \
> + done
> + $(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders));
> do \
> + $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
> + $(RM) -f "$(PROJ_libocamldir)/$$i"; \
> + done
> +
> +
> +##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma)
> -------------===##
> +
> +all-local:: $(LibraryCMA)
> +clean-local:: clean-cma
> +install-local:: install-cma
> +uninstall-local:: uninstall-cma
> +
> +$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
> + $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
> + $(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
> + $(Verb) for i in $(UsedLibNames); do \
> + ln -sf "$(LibDir)/$$i" "$(OcamlDir)/$$i"; \
> + done
> +
> +$(ObjDir)/%.cmo: $(PROJ_SRC_DIR)/%.ml $(OcamlDir)/.dir
> + $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
> + $(Verb) $(Compile.CMO) $@ $<
> +
> +clean-cma::
> + $(Verb) $(RM) -f $(LibraryCMA)
> +
> +install-cma:: $(LibraryCMA)
> + $(Echo) "Installing $(BuildMode) $(DestCMA)"
> + $(Verb) $(MKDIR) $(PROJ_libocamldir)
> + $(Verb) $(DataInstall) $(LibraryCMA) "$(DestCMA)"
> + $(Verb) for i in $(UsedLibNames); do \
> + $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
> + ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
> + done
> +
> +uninstall-cma::
> + $(Echo) "Uninstalling $(DestCMA)"
> + -$(Verb) $(RM) -f $(DestCMA)
> + $(Verb) for i in $(UsedLibNames); do \
> + $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
> + $(RM) -f "$(PROJ_libocamldir)/$$i"; \
> + done
> +
> +
> +##===- Build optimized ocaml archive (.ml's -> .cmx's -
> > .cmxa, .a) -------===##
> +
> +# The ocamlopt compiler is supported on a set of targets disjoint
> from LLVM's.
> +# If unavailable, 'configure' will not define OCAMLOPT in
> Makefile.config.
> +ifdef OCAMLOPT
> +
> +all-local:: $(LibraryCMXA)
> +clean-local:: clean-cmxa
> +install-local:: install-cmxa
> +uninstall-local:: uninstall-cmxa
> +
> +$(LibraryCMXA): $(ObjectsCMX)
> + $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
> + $(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
> + $(Verb) $(RM) -f $(@:.cmxa=.o)
> +
> +$(OcamlDir)/%.cmx: $(PROJ_SRC_DIR)/%.ml
> + $(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
> + $(Verb) $(Compile.CMX) $@ $<
> +
> +clean-cmxa::
> + $(Verb) $(RM) -f $(LibraryCMXA) $(LibraryCMXA:.cmxa=.o) \
> + $(LibraryCMXA:.cmxa=.a) $(ObjectsCMX)
> +
> +install-cmxa:: $(LibraryCMXA)
> + $(Verb) $(MKDIR) $(PROJ_libocamldir)
> + $(Echo) "Installing $(BuildMode) $(DestCMXA)"
> + $(Verb) $(DataInstall) $(LibraryCMXA) $(DestCMXA)
> + $(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
> + $(Verb) $(DataInstall) $(LibraryCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
> + $(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
> + $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
> + $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
> + done
> +
> +uninstall-cmxa:: $(LibraryCMXA)
> + $(Echo) "Uninstalling $(DestCMXA)"
> + $(Verb) $(RM) -f $(DestCMXA)
> + $(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
> + $(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
> + $(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
> + $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
> + $(RM) -f $(PROJ_libocamldir)/$$i; \
> + done
> +
> +endif
> +
> +
> +##===- Debugging gunk
> -----------------------------------------------------===##
> +printvars:: printcamlvars
> +
> +printcamlvars::
> + $(Echo) "LLVM_CONFIG : " '$(LLVM_CONFIG)'
> + $(Echo) "OCAMLCFLAGS : " '$(OCAMLCFLAGS)'
> + $(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
> + $(Echo) "OCAMLC : " '$(OCAMLC)'
> + $(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
> + $(Echo) "Compile.CMI : " '$(Compile.CMI)'
> + $(Echo) "Compile.CMO : " '$(Compile.CMO)'
> + $(Echo) "Archive.CMA : " '$(Archive.CMA)'
> + $(Echo) "Compile.CMX : " '$(Compile.CMX)'
> + $(Echo) "Archive.CMXA : " '$(Archive.CMXA)'
> + $(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
> + $(Echo) "LibraryCMA : " '$(LibraryCMA)'
> + $(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
> + $(Echo) "OcamlSources : " '$(OcamlSources)'
> + $(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
> + $(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
> + $(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
> + $(Echo) "OCAML_LIBDIR : " '$(OCAML_LIBDIR)'
> + $(Echo) "DestA : " '$(DestA)'
> + $(Echo) "DestCMA : " '$(DestCMA)'
> + $(Echo) "DestCMXA : " '$(DestCMXA)'
> + $(Echo) "UsedLibs : " '$(UsedLibs)'
> + $(Echo) "UsedLibNames : " '$(UsedLibNames)'
> +
> +.PHONY: printcamlvars build-cmis \
> + clean-a clean-cmis clean-cma clean-cmxa \
> + install-a install-cmis install-cma install-cmxa \
> + uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa
>
> Modified: llvm/trunk/test/Makefile
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?
> rev=42090&r1=42089&r2=42090&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/test/Makefile (original)
> +++ llvm/trunk/test/Makefile Tue Sep 18 07:26:17 2007
> @@ -28,8 +28,18 @@
> RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
> endif
>
> +IGNORE_TESTS :=
> +
> ifndef RUNLLVM2CPP
> -RUNTESTFLAGS += --ignore llvm2cpp.exp
> +IGNORE_TESTS += llvm2cpp.exp
> +endif
> +
> +ifndef OCAMLC
> +IGNORE_TESTS += ocaml.exp
> +endif
> +
> +ifdef IGNORE_TESTS
> +RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
> endif
>
> ifneq ($(RUNTEST),)
> @@ -89,6 +99,7 @@
> @echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
> @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
> @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
> + @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >>
> site.tmp
> @echo '## All variables above are generated by configure. Do Not
> Edit ## ' >>site.tmp
> @test ! -f site.exp || \
> sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
? Gordon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070918/f1e07315/attachment.html
From gordonhenriksen at mac.com Tue Sep 18 07:49:41 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 12:49:41 -0000
Subject: [llvm-commits] [llvm] r42093 - in /llvm/trunk: ./ bindings/
bindings/ocaml/ bindings/ocaml/bitwriter/ bindings/ocaml/llvm/
test/Bindings/ test/Bindings/Ocaml/ test/lib/
Message-ID: <200709181249.l8ICngqE011236@zion.cs.uiuc.edu>
Author: gordon
Date: Tue Sep 18 07:49:39 2007
New Revision: 42093
URL: http://llvm.org/viewvc/llvm-project?rev=42093&view=rev
Log:
Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
built atop the C language bindings, and user programs can link with them as
such:
# Bytecode
ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
# Native
ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml
The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:
$ cat example.ml
(* example.ml *)
open Llvm
open Llvm_bitwriter
let _ =
let filename = Sys.argv.(1) in
let m = create_module filename in
let v = make_int_constant i32_type 42 false in
let g = define_global "hello_world" v m in
if not (write_bitcode_file m filename) then exit 1;
dispose_module m;
$ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
File "example.ml", line 11, characters 6-7:
Warning Y: unused variable g.
$ ./example example.bc
$ llvm-dis < example.bc
; ModuleID = ''
@hello_world = global i32 42 ; [#uses=0]
The ocaml test cases provide effective tests for the C interfaces.
Added:
llvm/trunk/bindings/Makefile
llvm/trunk/bindings/README.txt
llvm/trunk/bindings/ocaml/Makefile
llvm/trunk/bindings/ocaml/bitwriter/
llvm/trunk/bindings/ocaml/bitwriter/Makefile
llvm/trunk/bindings/ocaml/bitwriter/bitwriter_ocaml.c
llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.ml
llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.mli
llvm/trunk/bindings/ocaml/llvm/
llvm/trunk/bindings/ocaml/llvm/Makefile
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/test/Bindings/
llvm/trunk/test/Bindings/Ocaml/ (with props)
llvm/trunk/test/Bindings/Ocaml/bitwriter.ml
llvm/trunk/test/Bindings/Ocaml/ocaml.exp
llvm/trunk/test/Bindings/Ocaml/vmcore.ml
Modified:
llvm/trunk/Makefile
llvm/trunk/test/lib/llvm.exp
Modified: llvm/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=42093&r1=42092&r2=42093&view=diff
==============================================================================
--- llvm/trunk/Makefile (original)
+++ llvm/trunk/Makefile Tue Sep 18 07:49:39 2007
@@ -20,7 +20,7 @@
DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
tools runtime docs
-OPTIONAL_DIRS := examples projects
+OPTIONAL_DIRS := examples projects bindings
EXTRA_DIST := test llvm.spec include win32 Xcode
include $(LEVEL)/Makefile.config
@@ -46,7 +46,7 @@
# build LLVM.
ifeq ($(MAKECMDGOALS),install)
DIRS := $(filter-out utils, $(DIRS))
- OPTIONAL_DIRS :=
+ OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
endif
# Include the main makefile machinery.
Added: llvm/trunk/bindings/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/Makefile?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/Makefile (added)
+++ llvm/trunk/bindings/Makefile Tue Sep 18 07:49:39 2007
@@ -0,0 +1,18 @@
+##===- bindings/Makefile -----------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file was developed by Gordon Henriksen and is distributed under the
+# University of Illinois Open Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL := ..
+
+include $(LEVEL)/Makefile.config
+
+ifdef OCAMLC
+PARALLEL_DIRS += ocaml
+endif
+
+include $(LEVEL)/Makefile.common
Added: llvm/trunk/bindings/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/README.txt?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/README.txt (added)
+++ llvm/trunk/bindings/README.txt Tue Sep 18 07:49:39 2007
@@ -0,0 +1,3 @@
+This directory contains bindings for the LLVM compiler infrastructure to allow
+programs written in languages other than C or C++ to take advantage of the LLVM
+infrastructure--for instance, a self-hosted compiler front-end.
Added: llvm/trunk/bindings/ocaml/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/Makefile?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/Makefile (added)
+++ llvm/trunk/bindings/ocaml/Makefile Tue Sep 18 07:49:39 2007
@@ -0,0 +1,13 @@
+##===- bindings/ocaml/Makefile -----------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file was developed by Gordon Henriksen and is distributed under the
+# University of Illinois Open Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL := ../..
+DIRS = llvm bitwriter
+
+include $(LEVEL)/Makefile.common
Added: llvm/trunk/bindings/ocaml/bitwriter/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitwriter/Makefile?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/bitwriter/Makefile (added)
+++ llvm/trunk/bindings/ocaml/bitwriter/Makefile Tue Sep 18 07:49:39 2007
@@ -0,0 +1,23 @@
+##===- bindings/ocaml/llvm/Makefile ------------------------*- Makefile -*-===##
+#
+# 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 is the makefile for the llvm-ml interface. Reference materials on
+# installing ocaml libraries:
+#
+# https://fedoraproject.org/wiki/Packaging/OCaml
+# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL := ../../..
+LIBRARYNAME := llvm_bitwriter
+DONT_BUILD_RELINKED := 1
+UsedComponents := bitwriter
+
+include ../Makefile.ocaml
Added: llvm/trunk/bindings/ocaml/bitwriter/bitwriter_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitwriter/bitwriter_ocaml.c?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/bitwriter/bitwriter_ocaml.c (added)
+++ llvm/trunk/bindings/ocaml/bitwriter/bitwriter_ocaml.c Tue Sep 18 07:49:39 2007
@@ -0,0 +1,31 @@
+/*===-- bitwriter_ocaml.c - LLVM Ocaml Glue ---------------------*- C++ -*-===*\
+|* *|
+|* The LLVM Compiler Infrastructure *|
+|* *|
+|* This file was developed by Gordon Henriksen and is distributed under the *|
+|* University of Illinois Open Source License. See LICENSE.TXT for details. *|
+|* *|
+|*===----------------------------------------------------------------------===*|
+|* *|
+|* This file glues LLVM's ocaml interface to its C interface. These functions *|
+|* are by and large transparent wrappers to the corresponding C functions. *|
+|* *|
+|* Note that these functions intentionally take liberties with the CAMLparamX *|
+|* macros, since most of the parameters are not GC heap objects. *|
+|* *|
+\*===----------------------------------------------------------------------===*/
+
+#include "llvm-c/BitWriter.h"
+#include "llvm-c/Core.h"
+#include "caml/alloc.h"
+#include "caml/mlvalues.h"
+#include "caml/memory.h"
+
+/*===-- Modules -----------------------------------------------------------===*/
+
+/* Llvm.llmodule -> string -> bool */
+CAMLprim value llvm_write_bitcode_file(value M, value Path) {
+ CAMLparam1(Path);
+ int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
+ CAMLreturn(Val_bool(res == 0));
+}
Added: llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.ml?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.ml (added)
+++ llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.ml Tue Sep 18 07:49:39 2007
@@ -0,0 +1,18 @@
+(*===-- llvm_bitwriter.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file was developed by Gordon Henriksen and is distributed under the
+ * University of Illinois Open Source License. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===
+ *
+ * This interface provides an ocaml API for the LLVM intermediate
+ * representation, the classes in the VMCore library.
+ *
+ *===----------------------------------------------------------------------===*)
+
+
+(* Writes the bitcode for module the given path. Returns true if successful. *)
+external write_bitcode_file : Llvm.llmodule -> string -> bool
+ = "llvm_write_bitcode_file"
Added: llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.mli?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.mli (added)
+++ llvm/trunk/bindings/ocaml/bitwriter/llvm_bitwriter.mli Tue Sep 18 07:49:39 2007
@@ -0,0 +1,18 @@
+(*===-- llvm_bitwriter.mli - LLVM Ocaml Interface ---------------*- C++ -*-===*
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file was developed by Gordon Henriksen and is distributed under the
+ * University of Illinois Open Source License. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===
+ *
+ * This interface provides an ocaml API for the LLVM bitcode writer, the
+ * classes in the classes in the Bitwriter library.
+ *
+ *===----------------------------------------------------------------------===*)
+
+
+(* Writes the bitcode for module the given path. Returns true if successful. *)
+external write_bitcode_file : Llvm.llmodule -> string -> bool
+ = "llvm_write_bitcode_file"
Added: llvm/trunk/bindings/ocaml/llvm/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/Makefile?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/Makefile (added)
+++ llvm/trunk/bindings/ocaml/llvm/Makefile Tue Sep 18 07:49:39 2007
@@ -0,0 +1,24 @@
+##===- bindings/ocaml/bitwriter/Makefile -------------------*- Makefile -*-===##
+#
+# 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 is the makefile for the llvm-ml interface. Reference materials on
+# installing ocaml libraries:
+#
+# https://fedoraproject.org/wiki/Packaging/OCaml
+# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL := ../../..
+LIBRARYNAME := llvm
+DONT_BUILD_RELINKED := 1
+UsedComponents := core
+UsedOcamLibs := llvm
+
+include ../Makefile.ocaml
Added: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (added)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Tue Sep 18 07:49:39 2007
@@ -0,0 +1,228 @@
+(*===-- tools/ml/llvm.ml - LLVM Ocaml Interface ---------------------------===*
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file was developed by Gordon Henriksen and is distributed under the
+ * University of Illinois Open Source License. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===
+ *
+ * This interface provides an ocaml API for the LLVM intermediate
+ * representation, the classes in the VMCore library.
+ *
+ *===----------------------------------------------------------------------===*)
+
+
+(* These abstract types correlate directly to the LLVM VMCore classes. *)
+type llmodule
+type lltype
+type llvalue
+
+type type_kind =
+ Void_type
+| Float_type
+| Double_type
+| X86fp80_type
+| Fp128_type
+| Ppc_fp128_type
+| Label_type
+| Integer_type
+| Function_type
+| Struct_type
+| Array_type
+| Pointer_type
+| Opaque_type
+| Vector_type
+
+type linkage =
+ External_linkage
+| Link_once_linkage
+| Weak_linkage
+| Appending_linkage
+| Internal_linkage
+| Dllimport_linkage
+| Dllexport_linkage
+| External_weak_linkage
+| Ghost_linkage
+
+type visibility =
+ Default_visibility
+| Hidden_visibility
+| Protected_visibility
+
+
+(*===-- Modules -----------------------------------------------------------===*)
+
+(* Creates a module with the supplied module ID. Modules are not garbage
+ collected; it is mandatory to call dispose_module to free memory. *)
+external create_module : string -> llmodule = "llvm_create_module"
+
+(* Disposes a module. All references to subordinate objects are invalidated;
+ referencing them will invoke undefined behavior. *)
+external dispose_module : llmodule -> unit = "llvm_dispose_module"
+
+(* Adds a named type to the module's symbol table. Returns true if successful.
+ If such a name already exists, then no entry is added and returns false. *)
+external add_type_name : string -> lltype -> llmodule -> bool
+ = "llvm_add_type_name"
+
+
+(*===-- Types -------------------------------------------------------------===*)
+
+external classify_type : lltype -> type_kind = "llvm_classify_type"
+external refine_abstract_type : lltype -> lltype -> unit
+ = "llvm_refine_abstract_type"
+
+(*--... Operations on integer types ........................................--*)
+external _i1_type : unit -> lltype = "llvm_i1_type"
+external _i8_type : unit -> lltype = "llvm_i8_type"
+external _i16_type : unit -> lltype = "llvm_i16_type"
+external _i32_type : unit -> lltype = "llvm_i32_type"
+external _i64_type : unit -> lltype = "llvm_i64_type"
+
+let i1_type = _i1_type ()
+let i8_type = _i8_type ()
+let i16_type = _i16_type ()
+let i32_type = _i32_type ()
+let i64_type = _i64_type ()
+
+external make_integer_type : int -> lltype = "llvm_make_integer_type"
+external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth"
+
+(*--... Operations on real types ...........................................--*)
+external _float_type : unit -> lltype = "llvm_float_type"
+external _double_type : unit -> lltype = "llvm_double_type"
+external _x86fp80_type : unit -> lltype = "llvm_x86fp80_type"
+external _fp128_type : unit -> lltype = "llvm_fp128_type"
+external _ppc_fp128_type : unit -> lltype = "llvm_ppc_fp128_type"
+
+let float_type = _float_type ()
+let double_type = _double_type ()
+let x86fp80_type = _x86fp80_type ()
+let fp128_type = _fp128_type ()
+let ppc_fp128_type = _ppc_fp128_type ()
+
+(*--... Operations on function types .......................................--*)
+(* FIXME: handle parameter attributes *)
+external make_function_type : lltype -> lltype array -> bool -> lltype
+ = "llvm_make_function_type"
+external is_var_arg : lltype -> bool = "llvm_is_var_arg"
+external return_type : lltype -> lltype = "llvm_return_type"
+external param_types : lltype -> lltype array = "llvm_param_types"
+
+(*--... Operations on struct types .........................................--*)
+external make_struct_type : lltype array -> bool -> lltype
+ = "llvm_make_struct_type"
+external element_types : lltype -> lltype array = "llvm_element_types"
+external is_packed : lltype -> bool = "llvm_is_packed"
+
+(*--... Operations on pointer, vector, and array types .....................--*)
+external make_array_type : lltype -> int -> lltype = "llvm_make_array_type"
+external make_pointer_type : lltype -> lltype = "llvm_make_pointer_type"
+external make_vector_type : lltype -> int -> lltype = "llvm_make_vector_type"
+
+external element_type : lltype -> lltype = "llvm_element_type"
+external array_length : lltype -> int = "llvm_array_length"
+external vector_size : lltype -> int = "llvm_vector_size"
+
+(*--... Operations on other types ..........................................--*)
+external make_opaque_type : unit -> lltype = "llvm_make_opaque_type"
+external _void_type : unit -> lltype = "llvm_void_type"
+external _label_type : unit -> lltype = "llvm_label_type"
+
+let void_type = _void_type ()
+let label_type = _label_type ()
+
+
+(*===-- Values ------------------------------------------------------------===*)
+
+external type_of : llvalue -> lltype = "llvm_type_of"
+external value_name : llvalue -> string = "llvm_value_name"
+external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
+
+(*--... Operations on constants of (mostly) any type .......................--*)
+external make_null : lltype -> llvalue = "llvm_make_null"
+external make_all_ones : lltype -> llvalue = "llvm_make_all_ones"
+external make_undef : lltype -> llvalue = "llvm_make_undef"
+external is_null : llvalue -> bool = "llvm_is_null"
+
+(*--... Operations on scalar constants .....................................--*)
+external make_int_constant : lltype -> int -> bool -> llvalue
+ = "llvm_make_int_constant"
+external make_real_constant : lltype -> float -> llvalue
+ = "llvm_make_real_constant"
+
+(*--... Operations on composite constants ..................................--*)
+external make_string_constant : string -> bool -> llvalue
+ = "llvm_make_string_constant"
+external make_array_constant : lltype -> llvalue array -> llvalue
+ = "llvm_make_array_constant"
+external make_struct_constant : llvalue array -> bool -> llvalue
+ = "llvm_make_struct_constant"
+external make_vector_constant : llvalue array -> llvalue
+ = "llvm_make_vector_constant"
+
+(*--... Operations on global variables, functions, and aliases (globals) ...--*)
+external is_declaration : llvalue -> bool = "llvm_is_declaration"
+external linkage : llvalue -> linkage = "llvm_linkage"
+external set_linkage : linkage -> llvalue -> unit = "llvm_set_linkage"
+external section : llvalue -> string = "llvm_section"
+external set_section : string -> llvalue -> unit = "llvm_set_section"
+external visibility : llvalue -> visibility = "llvm_visibility"
+external set_visibility : visibility -> llvalue -> unit = "llvm_set_visibility"
+external alignment : llvalue -> int = "llvm_alignment"
+external set_alignment : int -> llvalue -> unit = "llvm_set_alignment"
+
+(*--... Operations on global variables .....................................--*)
+external declare_global : lltype -> string -> llmodule -> llvalue
+ = "llvm_declare_global"
+external define_global : string -> llvalue -> llmodule -> llvalue
+ = "llvm_define_global"
+external delete_global : llvalue -> unit = "llvm_delete_global"
+external global_initializer : llvalue -> llvalue = "llvm_global_initializer"
+external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer"
+external remove_initializer : llvalue -> unit = "llvm_remove_initializer"
+external is_thread_local : llvalue -> bool = "llvm_is_thread_local"
+external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local"
+
+
+(*===-- Non-Externs -------------------------------------------------------===*)
+(* These functions are built using the externals, so must be declared late. *)
+
+let concat2 sep arr =
+ let s = ref "" in
+ if 0 < Array.length arr then begin
+ s := !s ^ arr.(0);
+ for i = 1 to (Array.length arr) - 1 do
+ s := !s ^ sep ^ arr.(i)
+ done
+ end;
+ !s
+
+let rec string_of_lltype ty =
+ match classify_type ty with
+ Integer_type -> "i" ^ string_of_int (integer_bitwidth ty)
+ | Pointer_type -> (string_of_lltype (element_type ty)) ^ "*"
+ | Struct_type ->
+ let s = "{ " ^ (concat2 ", " (
+ Array.map string_of_lltype (element_types ty)
+ )) ^ " }" in
+ if is_packed ty
+ then "<" ^ s ^ ">"
+ else s
+ | Array_type -> "[" ^ (string_of_int (array_length ty)) ^
+ " x " ^ (string_of_lltype (element_type ty)) ^ "]"
+ | Vector_type -> "<" ^ (string_of_int (vector_size ty)) ^
+ " x " ^ (string_of_lltype (element_type ty)) ^ ">"
+ | Opaque_type -> "opaque"
+ | Function_type -> string_of_lltype (return_type ty) ^
+ " (" ^ (concat2 ", " (
+ Array.map string_of_lltype (param_types ty)
+ )) ^ ")"
+ | Label_type -> "label"
+ | Ppc_fp128_type -> "ppc_fp128"
+ | Fp128_type -> "fp128"
+ | X86fp80_type -> "x86_fp80"
+ | Double_type -> "double"
+ | Float_type -> "float"
+ | Void_type -> "void"
Added: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (added)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Tue Sep 18 07:49:39 2007
@@ -0,0 +1,170 @@
+(*===-- tools/ml/llvm.ml - LLVM Ocaml Interface ---------------------------===*
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file was developed by Gordon Henriksen and is distributed under the
+ * University of Illinois Open Source License. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===
+ *
+ * This interface provides an ocaml API for the LLVM intermediate
+ * representation, the classes in the VMCore library.
+ *
+ *===----------------------------------------------------------------------===*)
+
+
+(* These abstract types correlate directly to the LLVM VMCore classes. *)
+type llmodule
+type lltype
+type llvalue
+
+type type_kind =
+ Void_type
+| Float_type
+| Double_type
+| X86fp80_type
+| Fp128_type
+| Ppc_fp128_type
+| Label_type
+| Integer_type
+| Function_type
+| Struct_type
+| Array_type
+| Pointer_type
+| Opaque_type
+| Vector_type
+
+type linkage =
+ External_linkage
+| Link_once_linkage
+| Weak_linkage
+| Appending_linkage
+| Internal_linkage
+| Dllimport_linkage
+| Dllexport_linkage
+| External_weak_linkage
+| Ghost_linkage
+
+type visibility =
+ Default_visibility
+| Hidden_visibility
+| Protected_visibility
+
+
+(*===-- Modules -----------------------------------------------------------===*)
+
+(* Creates a module with the supplied module ID. Modules are not garbage
+ collected; it is mandatory to call dispose_module to free memory. *)
+external create_module : string -> llmodule = "llvm_create_module"
+
+(* Disposes a module. All references to subordinate objects are invalidated;
+ referencing them will invoke undefined behavior. *)
+external dispose_module : llmodule -> unit = "llvm_dispose_module"
+
+(* Adds a named type to the module's symbol table. Returns true if successful.
+ If such a name already exists, then no entry is added and returns false. *)
+external add_type_name : string -> lltype -> llmodule -> bool
+ = "llvm_add_type_name"
+
+
+(*===-- Types -------------------------------------------------------------===*)
+external classify_type : lltype -> type_kind = "llvm_classify_type"
+external refine_abstract_type : lltype -> lltype -> unit
+ = "llvm_refine_abstract_type"
+val string_of_lltype : lltype -> string
+
+(*--... Operations on integer types ........................................--*)
+val i1_type : lltype
+val i8_type : lltype
+val i16_type : lltype
+val i32_type : lltype
+val i64_type : lltype
+external make_integer_type : int -> lltype = "llvm_make_integer_type"
+external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth"
+
+(*--... Operations on real types ...........................................--*)
+val float_type : lltype
+val double_type : lltype
+val x86fp80_type : lltype
+val fp128_type : lltype
+val ppc_fp128_type : lltype
+
+(*--... Operations on function types .......................................--*)
+(* FIXME: handle parameter attributes *)
+external make_function_type : lltype -> lltype array -> bool -> lltype
+ = "llvm_make_function_type"
+external is_var_arg : lltype -> bool = "llvm_is_var_arg"
+external return_type : lltype -> lltype = "llvm_return_type"
+external param_types : lltype -> lltype array = "llvm_param_types"
+
+(*--... Operations on struct types .........................................--*)
+external make_struct_type : lltype array -> bool -> lltype
+ = "llvm_make_struct_type"
+external element_types : lltype -> lltype array = "llvm_element_types"
+external is_packed : lltype -> bool = "llvm_is_packed"
+
+(*--... Operations on pointer, vector, and array types .....................--*)
+external make_array_type : lltype -> int -> lltype = "llvm_make_array_type"
+external make_pointer_type : lltype -> lltype = "llvm_make_pointer_type"
+external make_vector_type : lltype -> int -> lltype = "llvm_make_vector_type"
+
+external element_type : lltype -> lltype = "llvm_element_type"
+external array_length : lltype -> int = "llvm_array_length"
+external vector_size : lltype -> int = "llvm_vector_size"
+
+(*--... Operations on other types ..........................................--*)
+external make_opaque_type : unit -> lltype = "llvm_make_opaque_type"
+val void_type : lltype
+val label_type : lltype
+
+
+(*===-- Values ------------------------------------------------------------===*)
+external type_of : llvalue -> lltype = "llvm_type_of"
+external value_name : llvalue -> string = "llvm_value_name"
+external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
+
+(*--... Operations on constants of (mostly) any type .......................--*)
+external make_null : lltype -> llvalue = "llvm_make_null"
+external make_all_ones : lltype -> llvalue = "llvm_make_all_ones"
+external make_undef : lltype -> llvalue = "llvm_make_undef"
+external is_null : llvalue -> bool = "llvm_is_null"
+
+(*--... Operations on scalar constants .....................................--*)
+external make_int_constant : lltype -> int -> bool -> llvalue
+ = "llvm_make_int_constant"
+external make_real_constant : lltype -> float -> llvalue
+ = "llvm_make_real_constant"
+
+(*--... Operations on composite constants ..................................--*)
+external make_string_constant : string -> bool -> llvalue
+ = "llvm_make_string_constant"
+external make_array_constant : lltype -> llvalue array -> llvalue
+ = "llvm_make_array_constant"
+external make_struct_constant : llvalue array -> bool -> llvalue
+ = "llvm_make_struct_constant"
+external make_vector_constant : llvalue array -> llvalue
+ = "llvm_make_vector_constant"
+
+(*--... Operations on global variables, functions, and aliases (globals) ...--*)
+external is_declaration : llvalue -> bool = "llvm_is_declaration"
+external linkage : llvalue -> linkage = "llvm_linkage"
+external set_linkage : linkage -> llvalue -> unit = "llvm_set_linkage"
+external section : llvalue -> string = "llvm_section"
+external set_section : string -> llvalue -> unit = "llvm_set_section"
+external visibility : llvalue -> visibility = "llvm_visibility"
+external set_visibility : visibility -> llvalue -> unit = "llvm_set_visibility"
+external alignment : llvalue -> int = "llvm_alignment"
+external set_alignment : int -> llvalue -> unit = "llvm_set_alignment"
+
+(*--... Operations on global variables .....................................--*)
+external declare_global : lltype -> string -> llmodule -> llvalue
+ = "llvm_declare_global"
+external define_global : string -> llvalue -> llmodule -> llvalue
+ = "llvm_define_global"
+external delete_global : llvalue -> unit = "llvm_delete_global"
+external global_initializer : llvalue -> llvalue = "llvm_global_initializer"
+external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer"
+external remove_initializer : llvalue -> unit = "llvm_remove_initializer"
+external is_thread_local : llvalue -> bool = "llvm_is_thread_local"
+external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local"
+
Added: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=42093&view=auto
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (added)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Tue Sep 18 07:49:39 2007
@@ -0,0 +1,410 @@
+/*===-- llvm_ocaml.h - LLVM Ocaml Glue --------------------------*- C++ -*-===*\
+|* *|
+|* The LLVM Compiler Infrastructure *|
+|* *|
+|* This file was developed by Gordon Henriksen and is distributed under the *|
+|* University of Illinois Open Source License. See LICENSE.TXT for details. *|
+|* *|
+|*===----------------------------------------------------------------------===*|
+|* *|
+|* This file glues LLVM's ocaml interface to its C interface. These functions *|
+|* are by and large transparent wrappers to the corresponding C functions. *|
+|* *|
+|* Note that these functions intentionally take liberties with the CAMLparamX *|
+|* macros, since most of the parameters are not GC heap objects. *|
+|* *|
+\*===----------------------------------------------------------------------===*/
+
+#include "llvm-c/Core.h"
+#include "caml/alloc.h"
+#include "caml/mlvalues.h"
+#include "caml/memory.h"
+#include "stdio.h"
+
+
+/*===-- Modules -----------------------------------------------------------===*/
+
+/* string -> llmodule */
+CAMLprim value llvm_create_module(value ModuleID) {
+ return (value) LLVMModuleCreateWithName(String_val(ModuleID));
+}
+
+/* llmodule -> unit */
+CAMLprim value llvm_dispose_module(value M) {
+ LLVMDisposeModule((LLVMModuleRef) M);
+ return Val_unit;
+}
+
+/* string -> lltype -> llmodule -> bool */
+CAMLprim value llvm_add_type_name(value Name, value Ty, value M) {
+ int res = LLVMAddTypeName((LLVMModuleRef) M,
+ String_val(Name), (LLVMTypeRef) Ty);
+ return Val_bool(res == 0);
+}
+
+
+/*===-- Types -------------------------------------------------------------===*/
+
+/* lltype -> type_kind */
+CAMLprim value llvm_classify_type(value Ty) {
+ return Val_int(LLVMGetTypeKind((LLVMTypeRef) Ty));
+}
+
+/* lltype -> lltype -> unit */
+CAMLprim value llvm_refine_abstract_type(value ConcreteTy, value AbstractTy) {
+ LLVMRefineAbstractType((LLVMTypeRef) AbstractTy, (LLVMTypeRef) ConcreteTy);
+ return (value) Val_unit;
+}
+
+/*--... Operations on integer types ........................................--*/
+
+/* unit -> lltype */
+CAMLprim value llvm_i1_type (value Unit) { return (value) LLVMInt1Type(); }
+CAMLprim value llvm_i8_type (value Unit) { return (value) LLVMInt8Type(); }
+CAMLprim value llvm_i16_type(value Unit) { return (value) LLVMInt16Type(); }
+CAMLprim value llvm_i32_type(value Unit) { return (value) LLVMInt32Type(); }
+CAMLprim value llvm_i64_type(value Unit) { return (value) LLVMInt64Type(); }
+
+/* int -> lltype */
+CAMLprim value llvm_make_integer_type(value Width) {
+ return (value) LLVMCreateIntegerType(Int_val(Width));
+}
+
+/* lltype -> int */
+CAMLprim value llvm_integer_bitwidth(value IntegerTy) {
+ return Val_int(LLVMGetIntegerTypeWidth((LLVMTypeRef) IntegerTy));
+}
+
+/*--... Operations on real types ...........................................--*/
+
+/* unit -> lltype */
+CAMLprim value llvm_float_type(value Unit) {
+ return (value) LLVMFloatType();
+}
+
+/* unit -> lltype */
+CAMLprim value llvm_double_type(value Unit) {
+ return (value) LLVMDoubleType();
+}
+
+/* unit -> lltype */
+CAMLprim value llvm_x86fp80_type(value Unit) {
+ return (value) LLVMX86FP80Type();
+}
+
+/* unit -> lltype */
+CAMLprim value llvm_fp128_type(value Unit) {
+ return (value) LLVMFP128Type();
+}
+
+/* unit -> lltype */
+CAMLprim value llvm_ppc_fp128_type(value Unit) {
+ return (value) LLVMPPCFP128Type();
+}
+
+/*--... Operations on function types .......................................--*/
+
+/* lltype -> lltype array -> bool -> lltype */
+CAMLprim value llvm_make_function_type(value RetTy, value ParamTys,
+ value IsVarArg) {
+ return (value) LLVMCreateFunctionType((LLVMTypeRef) RetTy,
+ (LLVMTypeRef *) ParamTys,
+ Wosize_val(ParamTys),
+ Bool_val(IsVarArg));
+}
+
+/* lltype -> bool */
+CAMLprim value llvm_is_var_arg(value FunTy) {
+ return Val_bool(LLVMIsFunctionVarArg((LLVMTypeRef) FunTy));
+}
+
+/* lltype -> lltype */
+CAMLprim value llvm_return_type(value FunTy) {
+ return (value) LLVMGetFunctionReturnType((LLVMTypeRef) FunTy);
+}
+
+/* lltype -> lltype array */
+CAMLprim value llvm_param_types(value FunTy) {
+ unsigned Count = LLVMGetFunctionParamCount((LLVMTypeRef) FunTy);
+ LLVMTypeRef *FunTys = alloca(Count * sizeof(LLVMTypeRef));
+
+ /* copy into an ocaml array */
+ unsigned i;
+ value ParamTys = caml_alloc(Count, 0);
+
+ LLVMGetFunctionParamTypes((LLVMTypeRef) FunTy, FunTys);
+ for (i = 0; i != Count; ++i)
+ Store_field(ParamTys, i, (value) FunTys[i]);
+
+ return ParamTys;
+}
+
+/*--... Operations on struct types .........................................--*/
+
+/* lltype array -> bool -> lltype */
+CAMLprim value llvm_make_struct_type(value ElementTypes, value Packed) {
+ return (value) LLVMCreateStructType((LLVMTypeRef *) ElementTypes,
+ Wosize_val(ElementTypes),
+ Bool_val(Packed));
+}
+
+/* lltype -> lltype array */
+CAMLprim value llvm_element_types(value StructTy) {
+ unsigned Count = LLVMGetStructElementCount((LLVMTypeRef) StructTy);
+ LLVMTypeRef *Tys = alloca(Count * sizeof(LLVMTypeRef));
+
+ /* copy into an ocaml array */
+ unsigned i;
+ value ElementTys = caml_alloc(Count, 0);
+
+ LLVMGetStructElementTypes((LLVMTypeRef) StructTy, Tys);
+ for (i = 0; i != Count; ++i)
+ Store_field(ElementTys, i, (value) Tys[i]);
+
+ return ElementTys;
+}
+
+CAMLprim value llvm_is_packed(value StructTy) {
+ return Val_bool(LLVMIsPackedStruct((LLVMTypeRef) StructTy));
+}
+
+/*--... Operations on array, pointer, and vector types .....................--*/
+
+/* lltype -> int -> lltype */
+CAMLprim value llvm_make_array_type(value ElementTy, value Count) {
+ return (value) LLVMCreateArrayType((LLVMTypeRef) ElementTy, Int_val(Count));
+}
+
+/* lltype -> lltype */
+CAMLprim value llvm_make_pointer_type(value ElementTy) {
+ return (value) LLVMCreatePointerType((LLVMTypeRef) ElementTy);
+}
+
+/* lltype -> int -> lltype */
+CAMLprim value llvm_make_vector_type(value ElementTy, value Count) {
+ return (value) LLVMCreateVectorType((LLVMTypeRef) ElementTy, Int_val(Count));
+}
+
+/* lltype -> lltype */
+CAMLprim value llvm_element_type(value Ty) {
+ return (value) LLVMGetElementType((LLVMTypeRef) Ty);
+}
+
+/* lltype -> int */
+CAMLprim value llvm_array_length(value ArrayTy) {
+ return Val_int(LLVMGetArrayLength((LLVMTypeRef) ArrayTy));
+}
+
+/* lltype -> int */
+CAMLprim value llvm_vector_size(value VectorTy) {
+ return Val_int(LLVMGetVectorSize((LLVMTypeRef) VectorTy));
+}
+
+/*--... Operations on other types ..........................................--*/
+
+/* unit -> lltype */
+CAMLprim value llvm_void_type (value Unit) { return (value) LLVMVoidType(); }
+CAMLprim value llvm_label_type(value Unit) { return (value) LLVMLabelType(); }
+
+/* unit -> lltype */
+CAMLprim value llvm_make_opaque_type(value Unit) {
+ return (value) LLVMCreateOpaqueType();
+}
+
+
+/*===-- VALUES ------------------------------------------------------------===*/
+
+/* llvalue -> lltype */
+CAMLprim value llvm_type_of(value Val) {
+ return (value) LLVMGetTypeOfValue((LLVMValueRef) Val);
+}
+
+/* llvalue -> string */
+CAMLprim value llvm_value_name(value Val) {
+ return caml_copy_string(LLVMGetValueName((LLVMValueRef) Val));
+}
+
+/* string -> llvalue -> unit */
+CAMLprim value llvm_set_value_name(value Name, value Val) {
+ LLVMSetValueName((LLVMValueRef) Val, String_val(Name));
+ return Val_unit;
+}
+
+/*--... Operations on constants of (mostly) any type .......................--*/
+
+/* lltype -> llvalue */
+CAMLprim value llvm_make_null(value Ty) {
+ return (value) LLVMGetNull((LLVMTypeRef) Ty);
+}
+
+/* lltype -> llvalue */
+CAMLprim value llvm_make_all_ones(value Ty) {
+ return (value) LLVMGetAllOnes((LLVMTypeRef) Ty);
+}
+
+/* lltype -> llvalue */
+CAMLprim value llvm_make_undef(value Ty) {
+ return (value) LLVMGetUndef((LLVMTypeRef) Ty);
+}
+
+/* llvalue -> bool */
+CAMLprim value llvm_is_null(value Val) {
+ return Val_bool(LLVMIsNull((LLVMValueRef) Val));
+}
+
+/*--... Operations on scalar constants .....................................--*/
+
+/* lltype -> int -> bool -> llvalue */
+CAMLprim value llvm_make_int_constant(value IntTy, value N, value SExt) {
+ /* GCC warns if we use the ternary operator. */
+ unsigned long long N2;
+ if (Bool_val(SExt))
+ N2 = (intnat) Int_val(N);
+ else
+ N2 = (uintnat) Int_val(N);
+
+ return (value) LLVMGetIntConstant((LLVMTypeRef) IntTy, N2, Bool_val(SExt));
+}
+
+/* lltype -> float -> llvalue */
+CAMLprim value llvm_make_real_constant(value RealTy, value N) {
+ return (value) LLVMGetRealConstant((LLVMTypeRef) RealTy, Double_val(N));
+}
+
+/*--... Operations on composite constants ..................................--*/
+
+/* string -> bool -> llvalue */
+CAMLprim value llvm_make_string_constant(value Str, value NullTerminate) {
+ return (value) LLVMGetStringConstant(String_val(Str),
+ Wosize_val(Str),
+ Bool_val(NullTerminate) == 0);
+}
+
+/* lltype -> llvalue array -> llvalue */
+CAMLprim value llvm_make_array_constant(value ElementTy, value ElementVals) {
+ return (value) LLVMGetArrayConstant((LLVMTypeRef) ElementTy,
+ (LLVMValueRef*) Op_val(ElementVals),
+ Wosize_val(ElementVals));
+}
+
+/* llvalue array -> bool -> llvalue */
+CAMLprim value llvm_make_struct_constant(value ElementVals, value Packed) {
+ return (value) LLVMGetStructConstant((LLVMValueRef*) Op_val(ElementVals),
+ Wosize_val(ElementVals),
+ Bool_val(Packed));
+}
+
+/* llvalue array -> llvalue */
+CAMLprim value llvm_make_vector_constant(value ElementVals) {
+ return (value) LLVMGetVectorConstant((LLVMValueRef*) Op_val(ElementVals),
+ Wosize_val(ElementVals));
+}
+
+/*--... Operations on global variables, functions, and aliases (globals) ...--*/
+
+/* llvalue -> bool */
+CAMLprim value llvm_is_declaration(value Global) {
+ return Val_bool(LLVMIsDeclaration((LLVMValueRef) Global));
+}
+
+/* llvalue -> linkage */
+CAMLprim value llvm_linkage(value Global) {
+ return Val_int(LLVMGetLinkage((LLVMValueRef) Global));
+}
+
+/* linkage -> llvalue -> unit */
+CAMLprim value llvm_set_linkage(value Linkage, value Global) {
+ LLVMSetLinkage((LLVMValueRef) Global, Int_val(Linkage));
+ return Val_unit;
+}
+
+/* llvalue -> string */
+CAMLprim value llvm_section(value Global) {
+ return caml_copy_string(LLVMGetSection((LLVMValueRef) Global));
+}
+
+/* string -> llvalue -> unit */
+CAMLprim value llvm_set_section(value Section, value Global) {
+ LLVMSetSection((LLVMValueRef) Global, String_val(Section));
+ return Val_unit;
+}
+
+/* llvalue -> visibility */
+CAMLprim value llvm_visibility(value Global) {
+ return Val_int(LLVMGetVisibility((LLVMValueRef) Global));
+}
+
+/* visibility -> llvalue -> unit */
+CAMLprim value llvm_set_visibility(value Viz, value Global) {
+ LLVMSetVisibility((LLVMValueRef) Global, Int_val(Viz));
+ return Val_unit;
+}
+
+/* llvalue -> int */
+CAMLprim value llvm_alignment(value Global) {
+ return Val_int(LLVMGetAlignment((LLVMValueRef) Global));
+}
+
+/* int -> llvalue -> unit */
+CAMLprim value llvm_set_alignment(value Bytes, value Global) {
+ LLVMSetAlignment((LLVMValueRef) Global, Int_val(Bytes));
+ return Val_unit;
+}
+
+/*--... Operations on global variables .....................................--*/
+
+/* lltype -> string -> llmodule -> llvalue */
+CAMLprim value llvm_add_global(value Ty, value Name, value M) {
+ return (value) LLVMAddGlobal((LLVMModuleRef) M,
+ (LLVMTypeRef) Ty, String_val(Name));
+}
+
+/* lltype -> string -> llmodule -> llvalue */
+CAMLprim value llvm_declare_global(value Ty, value Name, value M) {
+ return (value) LLVMAddGlobal((LLVMModuleRef) M,
+ (LLVMTypeRef) Ty, String_val(Name));
+}
+
+/* string -> llvalue -> llmodule -> llvalue */
+CAMLprim value llvm_define_global(value Name, value ConstantVal, value M) {
+ LLVMValueRef Initializer = (LLVMValueRef) ConstantVal;
+ LLVMValueRef GlobalVar = LLVMAddGlobal((LLVMModuleRef) M,
+ LLVMGetTypeOfValue(Initializer),
+ String_val(Name));
+ LLVMSetInitializer(GlobalVar, Initializer);
+ return (value) GlobalVar;
+}
+
+/* llvalue -> unit */
+CAMLprim value llvm_delete_global(value GlobalVar) {
+ LLVMDeleteGlobal((LLVMValueRef) GlobalVar);
+ return Val_unit;
+}
+
+/* llvalue -> llvalue */
+CAMLprim value llvm_global_initializer(value GlobalVar) {
+ return (value) LLVMGetInitializer((LLVMValueRef) GlobalVar);
+}
+
+/* llvalue -> llvalue -> unit */
+CAMLprim value llvm_set_initializer(value ConstantVal, value GlobalVar) {
+ LLVMSetInitializer((LLVMValueRef) GlobalVar, (LLVMValueRef) ConstantVal);
+ return Val_unit;
+}
+
+/* llvalue -> unit */
+CAMLprim value llvm_remove_initializer(value GlobalVar) {
+ LLVMSetInitializer((LLVMValueRef) GlobalVar, NULL);
+ return Val_unit;
+}
+
+/* llvalue -> bool */
+CAMLprim value llvm_is_thread_local(value GlobalVar) {
+ return Val_bool(LLVMIsThreadLocal((LLVMValueRef) GlobalVar));
+}
+
+/* bool -> llvalue -> unit */
+CAMLprim value llvm_set_thread_local(value IsThreadLocal, value GlobalVar) {
+ LLVMSetThreadLocal((LLVMValueRef) GlobalVar, Bool_val(IsThreadLocal));
+ return Val_unit;
+}
Propchange: llvm/trunk/test/Bindings/Ocaml/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Sep 18 07:49:39 2007
@@ -0,0 +1,3 @@
+Output
+*.cmi
+*.cmo
Added: llvm/trunk/test/Bindings/Ocaml/bitwriter.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/bitwriter.ml?rev=42093&view=auto
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/bitwriter.ml (added)
+++ llvm/trunk/test/Bindings/Ocaml/bitwriter.ml Tue Sep 18 07:49:39 2007
@@ -0,0 +1,16 @@
+(* RUN: %ocamlc llvm.cma llvm_bitwriter.cma %s -o %t
+ * RUN: ./%t %t.bc
+ * RUN: llvm-dis < %t.bc | grep caml_int_ty
+ *)
+
+(* Note that this takes a moment to link, so it's best to keep the number of
+ individual tests low. *)
+
+let test x = if not x then exit 1 else ()
+
+let _ =
+ let m = Llvm.create_module "ocaml_test_module" in
+
+ ignore (Llvm.add_type_name "caml_int_ty" Llvm.i32_type m);
+
+ test (Llvm_bitwriter.write_bitcode_file m Sys.argv.(1))
Added: llvm/trunk/test/Bindings/Ocaml/ocaml.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/ocaml.exp?rev=42093&view=auto
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/ocaml.exp (added)
+++ llvm/trunk/test/Bindings/Ocaml/ocaml.exp Tue Sep 18 07:49:39 2007
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr,ml}]]
Added: llvm/trunk/test/Bindings/Ocaml/vmcore.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=42093&view=auto
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (added)
+++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Tue Sep 18 07:49:39 2007
@@ -0,0 +1,233 @@
+(* RUN: %ocamlc llvm.cma llvm_bitwriter.cma %s -o %t
+ * RUN: ./%t %t.bc
+ * RUN: llvm-dis < %t.bc > %t.ll
+ *)
+
+(* Note: It takes several seconds for ocamlc to link an executable with
+ libLLVMCore.a, so it's better to write a big test than a bunch of
+ little ones. *)
+
+open Llvm
+open Llvm_bitwriter
+
+
+(* Tiny unit test framework *)
+let exit_status = ref 0
+let case_num = ref 0
+
+let all_done () =
+ prerr_endline "";
+ exit !exit_status
+
+let group name =
+ prerr_endline "";
+ case_num := 0;
+ prerr_string (" " ^ name ^ "... ")
+
+let insist cond =
+ incr case_num;
+ prerr_char ' ';
+ if not cond then begin
+ exit_status := 10;
+ prerr_char '!'
+ end;
+ prerr_int !case_num
+
+let suite name f =
+ prerr_endline (name ^ ":");
+ f ()
+
+
+(*===-- Fixture -----------------------------------------------------------===*)
+
+let filename = Sys.argv.(1)
+let m = create_module filename
+
+
+(*===-- Types -------------------------------------------------------------===*)
+
+let test_types () =
+ (* RUN: grep {Ty01.*void} < %t.ll
+ *)
+ group "void";
+ insist (add_type_name "Ty01" void_type m);
+ insist (Void_type == classify_type void_type);
+
+ (* RUN: grep {Ty02.*i1} < %t.ll
+ *)
+ group "i1";
+ insist (add_type_name "Ty02" i1_type m);
+ insist (Integer_type == classify_type i1_type);
+
+ (* RUN: grep {Ty03.*i32} < %t.ll
+ *)
+ group "i32";
+ insist (add_type_name "Ty03" i32_type m);
+
+ (* RUN: grep {Ty04.*i42} < %t.ll
+ *)
+ group "i42";
+ let ty = make_integer_type 42 in
+ insist (add_type_name "Ty04" ty m);
+
+ (* RUN: grep {Ty05.*float} < %t.ll
+ *)
+ group "float";
+ insist (add_type_name "Ty05" float_type m);
+ insist (Float_type == classify_type float_type);
+
+ (* RUN: grep {Ty06.*double} < %t.ll
+ *)
+ group "double";
+ insist (add_type_name "Ty06" double_type m);
+ insist (Double_type == classify_type double_type);
+
+ (* RUN: grep {Ty07.*i32.*i1, double} < %t.ll
+ *)
+ group "function";
+ let ty = make_function_type i32_type [| i1_type; double_type |] false in
+ insist (add_type_name "Ty07" ty m);
+ insist (Function_type = classify_type ty);
+ insist (not (is_var_arg ty));
+ insist (i32_type == return_type ty);
+ insist (double_type == (param_types ty).(1));
+
+ (* RUN: grep {Ty08.*\.\.\.} < %t.ll
+ *)
+ group "vararg";
+ let ty = make_function_type void_type [| i32_type |] true in
+ insist (add_type_name "Ty08" ty m);
+ insist (is_var_arg ty);
+
+ (* RUN: grep {Ty09.*\\\[7 x i8\\\]} < %t.ll
+ *)
+ group "array";
+ let ty = make_array_type i8_type 7 in
+ insist (add_type_name "Ty09" ty m);
+ insist (7 = array_length ty);
+ insist (i8_type == element_type ty);
+ insist (Array_type == classify_type ty);
+
+ (* RUN: grep {Ty10.*float\*} < %t.ll
+ *)
+ group "pointer";
+ let ty = make_pointer_type float_type in
+ insist (add_type_name "Ty10" ty m);
+ insist (float_type == element_type ty);
+ insist (Pointer_type == classify_type ty);
+
+ (* RUN: grep {Ty11.*\<4 x i16\>} < %t.ll
+ *)
+ group "vector";
+ let ty = make_vector_type i16_type 4 in
+ insist (add_type_name "Ty11" ty m);
+ insist (i16_type == element_type ty);
+ insist (4 = vector_size ty);
+
+ (* RUN: grep {Ty12.*opaque} < %t.ll
+ *)
+ group "opaque";
+ let ty = make_opaque_type () in
+ insist (add_type_name "Ty12" ty m);
+ insist (ty == ty);
+ insist (ty <> make_opaque_type ())
+
+
+(*===-- Global Values -----------------------------------------------------===*)
+
+let test_global_values () =
+ let (++) x f = f x; x in
+ let zero32 = make_null i32_type in
+
+ (* RUN: grep {GVal01} < %t.ll
+ *)
+ group "naming";
+ let g = define_global "TEMPORARY" zero32 m in
+ prerr_endline "";
+ prerr_endline (value_name g);
+ insist ("TEMPORARY" = value_name g);
+ set_value_name "GVal01" g;
+ insist ("GVal01" = value_name g);
+
+ (* RUN: grep {GVal02.*linkonce} < %t.ll
+ *)
+ group "linkage";
+ let g = define_global "GVal02" zero32 m ++
+ set_linkage Link_once_linkage in
+ insist (Link_once_linkage = linkage g);
+
+ (* RUN: grep {GVal03.*Hanalei} < %t.ll
+ *)
+ group "section";
+ let g = define_global "GVal03" zero32 m ++
+ set_section "Hanalei" in
+ insist ("Hanalei" = section g);
+
+ (* RUN: grep {GVal04.*hidden} < %t.ll
+ *)
+ group "visibility";
+ let g = define_global "GVal04" zero32 m ++
+ set_visibility Hidden_visibility in
+ insist (Hidden_visibility = visibility g);
+
+ (* RUN: grep {GVal05.*align 128} < %t.ll
+ *)
+ group "alignment";
+ let g = define_global "GVal05" zero32 m ++
+ set_alignment 128 in
+ insist (128 = alignment g)
+
+
+(*===-- Global Variables --------------------------------------------------===*)
+
+let test_global_variables () =
+ let (++) x f = f x; x in
+ let fourty_two32 = make_int_constant i32_type 42 false in
+
+ (* RUN: grep {GVar01.*external} < %t.ll
+ *)
+ group "declarations";
+ let g = declare_global i32_type "GVar01" m in
+ insist (is_declaration g);
+
+ (* RUN: grep {GVar02.*42} < %t.ll
+ * RUN: grep {GVar03.*42} < %t.ll
+ *)
+ group "definitions";
+ let g = define_global "GVar02" fourty_two32 m in
+ let g2 = declare_global i32_type "GVar03" m ++
+ set_initializer fourty_two32 in
+ insist (not (is_declaration g));
+ insist (not (is_declaration g2));
+ insist ((global_initializer g) == (global_initializer g2));
+
+ (* RUN: grep {GVar04.*thread_local} < %t.ll
+ *)
+ group "threadlocal";
+ let g = define_global "GVar04" fourty_two32 m ++
+ set_thread_local true in
+ insist (is_thread_local g);
+
+ (* RUN: grep -v {GVar05} < %t.ll
+ *)
+ let g = define_global "GVar05" fourty_two32 m in
+ delete_global g
+
+
+(*===-- Writer ------------------------------------------------------------===*)
+
+let test_writer () =
+ group "writer";
+ insist (write_bitcode_file m filename);
+
+ dispose_module m
+
+
+(*===-- Driver ------------------------------------------------------------===*)
+
+let _ =
+ suite "types" test_types;
+ suite "global values" test_global_values;
+ suite "global variables" test_global_variables;
+ suite "writer" test_writer;
+ all_done ()
Modified: llvm/trunk/test/lib/llvm.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm.exp?rev=42093&r1=42092&r2=42093&view=diff
==============================================================================
--- llvm/trunk/test/lib/llvm.exp (original)
+++ llvm/trunk/test/lib/llvm.exp Tue Sep 18 07:49:39 2007
@@ -43,7 +43,7 @@
# cases.
proc substitute { line test tmpFile } {
global srcroot objroot srcdir objdir subdir target_triplet prcontext
- global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers
+ global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc
global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir
set path [file join $srcdir $subdir]
@@ -64,6 +64,8 @@
regsub -all {%link} $new_line "$link" new_line
#replace %shlibext with shared library extension
regsub -all {%shlibext} $new_line "$shlibext" new_line
+ #replace %ocamlc with ocaml compiler command
+ regsub -all {%ocamlc} $new_line "$ocamlc" new_line
#replace %llvmlibsdir with configure library directory
regsub -all {%llvmlibsdir} $new_line "$llvmlibsdir" new_line
#replace %p with path to source,
From gordonhenriksen at mac.com Tue Sep 18 08:54:49 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Tue, 18 Sep 2007 09:54:49 -0400
Subject: [llvm-commits] [llvm] r42051 - in /llvm/trunk:
lib/VMCore/Verifier.cpp test/CodeGen/Generic/GC/lower_gcroot.ll
test/Verifier/gcread-ptrptr.ll test/Verifier/gcroot-alloca.ll
test/Verifier/gcroot-meta.ll test/Verifier/gcroot-ptrptr.ll
test/Verifier/gcwrite-ptrptr.ll
In-Reply-To: <200709181344.04203.baldrick@free.fr>
References: <200709172030.l8HKU4QG008512@zion.cs.uiuc.edu>
<200709181049.21273.baldrick@free.fr>
<7E45917A-52D7-4AC4-8882-B0B6E3F9FCA5@mac.com>
<200709181344.04203.baldrick@free.fr>
Message-ID:
On Sep 18, 2007, at 07:44, Duncan Sands wrote:
> Hi,
>
>>>> +static Value *StripBitCasts(Value *Val) {
>>>
>>> how about using IntrinsicInst::StripPointerCasts instead?
>>
>> Done. Note that, although there's tantalizing GEP-0 handling in
>> StripPointerCasts, it's still not really possible to use gcroot
>> without bitcasts:
>
> the reason for the GEP handling, is that if you have a constant
> pointer P to a struct S for which the first field is of type T, and
> you constant bitcast P to a T*, then the optimizers will turn this
> into a GEP-0 instead of a bitcast. Thus it is unwise to assume
> you'll always see a bitcast - it might be that you get passed a GEP
> instead.
This can never occur. This is a pointer to a pointer type, so gep 0
can't be used for casts.
>> %x_addr = alloca %class.Derived*
>> %tmp0 = getelementptr %x_addr, i32 0, i32 0 ; Invalid! But nice
>> try...
>
> If x_addr pointed to a global variable rather than a local
> variable, this (or something like it) should be valid. Just to be
> clear: I'm not suggesting that you can get rid of bitcasts - I'm
> pointing out that in obscure circumstances you may be passed a GEP
> rather than a bitcast, even if you always generate bitcasts in the
> front-end. So you need to handle that, eg by using StripPointerCasts.
Since gcroot is an annotation of a pointer alloca, this is not
applicable. Although gep %alloca, 0 is now accepted, it is also
necessarily redundant, and gep %alloca, 0, 0 is invalid by the
definition.
Thanks,
Gordon
From djg at cray.com Tue Sep 18 09:02:12 2007
From: djg at cray.com (Dan Gohman)
Date: Tue, 18 Sep 2007 09:02:12 -0500
Subject: [llvm-commits] [llvm] r42075 - in /llvm/trunk:
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/2007-09-17-PrompteValue.ll
Message-ID: <20070918140212.GI10864@village.us.cray.com>
> + // If GEP base is NULL then the calculated address used by Store or
> + // Load instruction is invalid. Do not promote this value because
> + // it may expose load and store instruction that are covered by
> + // condition which may not yet folded.
> + if (GetElementPtrInst *GEP = dyn_cast(V))
> + if (isa(GEP->getOperand(0)))
> + PointerOk = false;
> +
It looks like there's a larger problem here. The testcase's loop body
may never be executed, so it isn't safe for LICM to hoist/sink
anything out to an unguarded location, null pointer constants or
otherwise.
Dan
--
Dan Gohman, Cray Inc.
From djg at cray.com Tue Sep 18 09:59:15 2007
From: djg at cray.com (Dan Gohman)
Date: Tue, 18 Sep 2007 14:59:15 -0000
Subject: [llvm-commits] [llvm] r42094 -
/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Message-ID: <200709181459.l8IExFpO015513@zion.cs.uiuc.edu>
Author: djg
Date: Tue Sep 18 09:59:14 2007
New Revision: 42094
URL: http://llvm.org/viewvc/llvm-project?rev=42094&view=rev
Log:
Move the entries for 64-bit CMP, IMUL, and a few others into the correct
tables so that they are eligible for reload/remat folding. And add
entries for JMP and CALL.
Modified:
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=42094&r1=42093&r2=42094&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Sep 18 09:59:14 2007
@@ -629,10 +629,14 @@
}
static const TableEntry OpcodeTable[] = {
+ { X86::CALL32r, X86::CALL32m },
+ { X86::CALL64r, X86::CALL64m },
{ X86::CMP16ri, X86::CMP16mi },
{ X86::CMP16ri8, X86::CMP16mi8 },
{ X86::CMP32ri, X86::CMP32mi },
{ X86::CMP32ri8, X86::CMP32mi8 },
+ { X86::CMP64ri32, X86::CMP64mi32 },
+ { X86::CMP64ri8, X86::CMP64mi8 },
{ X86::CMP8ri, X86::CMP8mi },
{ X86::DIV16r, X86::DIV16m },
{ X86::DIV32r, X86::DIV32m },
@@ -648,6 +652,8 @@
{ X86::IMUL32r, X86::IMUL32m },
{ X86::IMUL64r, X86::IMUL64m },
{ X86::IMUL8r, X86::IMUL8m },
+ { X86::JMP32r, X86::JMP32m },
+ { X86::JMP64r, X86::JMP64m },
{ X86::MOV16ri, X86::MOV16mi },
{ X86::MOV16rr, X86::MOV16mr },
{ X86::MOV32ri, X86::MOV32mi },
@@ -671,6 +677,9 @@
{ X86::MUL32r, X86::MUL32m },
{ X86::MUL64r, X86::MUL64m },
{ X86::MUL8r, X86::MUL8m },
+ { X86::PSHUFDri, X86::PSHUFDmi },
+ { X86::PSHUFHWri, X86::PSHUFHWmi },
+ { X86::PSHUFLWri, X86::PSHUFLWmi },
{ X86::SETAEr, X86::SETAEm },
{ X86::SETAr, X86::SETAm },
{ X86::SETBEr, X86::SETBEm },
@@ -685,6 +694,7 @@
{ X86::SETNSr, X86::SETNSm },
{ X86::SETPr, X86::SETPm },
{ X86::SETSr, X86::SETSm },
+ { X86::TAILJMPr, X86::TAILJMPm },
{ X86::TEST16ri, X86::TEST16mi },
{ X86::TEST32ri, X86::TEST32mi },
{ X86::TEST64ri32, X86::TEST64mi32 },
@@ -702,8 +712,6 @@
static const TableEntry OpcodeTable[] = {
{ X86::CMP16rr, X86::CMP16rm },
{ X86::CMP32rr, X86::CMP32rm },
- { X86::CMP64ri32, X86::CMP64mi32 },
- { X86::CMP64ri8, X86::CMP64mi8 },
{ X86::CMP64rr, X86::CMP64rm },
{ X86::CMP8rr, X86::CMP8rm },
{ X86::CMPPDrri, X86::CMPPDrmi },
@@ -726,7 +734,6 @@
{ X86::IMUL16rri8, X86::IMUL16rmi8 },
{ X86::IMUL32rri, X86::IMUL32rmi },
{ X86::IMUL32rri8, X86::IMUL32rmi8 },
- { X86::IMUL64rr, X86::IMUL64rm },
{ X86::IMUL64rri32, X86::IMUL64rmi32 },
{ X86::IMUL64rri8, X86::IMUL64rmi8 },
{ X86::Int_CMPSDrr, X86::Int_CMPSDrm },
@@ -787,9 +794,6 @@
{ X86::MOVZX32rr8, X86::MOVZX32rm8 },
{ X86::MOVZX64rr16, X86::MOVZX64rm16 },
{ X86::MOVZX64rr8, X86::MOVZX64rm8 },
- { X86::PSHUFDri, X86::PSHUFDmi },
- { X86::PSHUFHWri, X86::PSHUFHWmi },
- { X86::PSHUFLWri, X86::PSHUFLWmi },
{ X86::PsMOVZX64rr32, X86::PsMOVZX64rm32 },
{ X86::TEST16rr, X86::TEST16rm },
{ X86::TEST32rr, X86::TEST32rm },
@@ -881,6 +885,7 @@
{ X86::HSUBPSrr, X86::HSUBPSrm },
{ X86::IMUL16rr, X86::IMUL16rm },
{ X86::IMUL32rr, X86::IMUL32rm },
+ { X86::IMUL64rr, X86::IMUL64rm },
{ X86::MAXPDrr, X86::MAXPDrm },
{ X86::MAXPDrr_Int, X86::MAXPDrm_Int },
{ X86::MAXPSrr, X86::MAXPSrm },
From dalej at apple.com Tue Sep 18 12:33:57 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 18 Sep 2007 17:33:57 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r42095 -
/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Message-ID: <200709181733.l8IHXvBg020815@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Sep 18 12:33:56 2007
New Revision: 42095
URL: http://llvm.org/viewvc/llvm-project?rev=42095&view=rev
Log:
Enhance assertion to allow x86 long double.
Modified:
llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=42095&r1=42094&r2=42095&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Tue Sep 18 12:33:56 2007
@@ -73,8 +73,13 @@
// Note down LLVM type for GCC tree node.
static const Type * llvm_set_type(tree Tr, const Type *Ty) {
- assert(!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) ||
- getInt64(TYPE_SIZE(Tr), true) == getTargetData().getTypeSizeInBits(Ty)
+ // For x86 long double, llvm records the size of the data (80) while
+ // gcc's TYPE_SIZE including alignment padding. Compensate.
+ assert((!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) ||
+ getInt64(TYPE_SIZE(Tr), true) == getTargetData().getTypeSizeInBits(Ty) ||
+ (getTargetData().getTypeSizeInBits(Ty) == 80 &&
+ (getInt64(TYPE_SIZE(Tr), true) == 96 ||
+ getInt64(TYPE_SIZE(Tr), true) == 128)))
&& "LLVM type size doesn't match GCC type size!");
unsigned &TypeSlot = LTypesMap[Ty];
From dalej at apple.com Tue Sep 18 12:34:30 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 18 Sep 2007 17:34:30 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r42096 -
/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Message-ID: <200709181734.l8IHYVw6020867@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Sep 18 12:34:30 2007
New Revision: 42096
URL: http://llvm.org/viewvc/llvm-project?rev=42096&view=rev
Log:
Enhance assertion to permit x86 long double.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=42096&r1=42095&r2=42096&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Sep 18 12:34:30 2007
@@ -73,8 +73,13 @@
// Note down LLVM type for GCC tree node.
static const Type * llvm_set_type(tree Tr, const Type *Ty) {
- assert(!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) ||
- getInt64(TYPE_SIZE(Tr), true) == getTargetData().getTypeSizeInBits(Ty)
+ // For x86 long double, llvm records the size of the data (80) while
+ // gcc's TYPE_SIZE including alignment padding. Compensate.
+ assert((!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) ||
+ getInt64(TYPE_SIZE(Tr), true) == getTargetData().getTypeSizeInBits(Ty) ||
+ (getTargetData().getTypeSizeInBits(Ty) == 80 &&
+ (getInt64(TYPE_SIZE(Tr), true) == 96 ||
+ getInt64(TYPE_SIZE(Tr), true) == 128)))
&& "LLVM type size doesn't match GCC type size!");
unsigned &TypeSlot = LTypesMap[Ty];
From dpatel at apple.com Tue Sep 18 12:42:54 2007
From: dpatel at apple.com (Devang Patel)
Date: Tue, 18 Sep 2007 10:42:54 -0700
Subject: [llvm-commits] [llvm] r42075 - in /llvm/trunk:
lib/Transforms/Scalar/LICM.cpp test/Transforms/LICM/2007-09-17-PrompteValue.ll
In-Reply-To: <20070918140212.GI10864@village.us.cray.com>
References: <20070918140212.GI10864@village.us.cray.com>
Message-ID: