From evan.cheng at apple.com Mon Nov 12 00:35:12 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 12 Nov 2007 06:35:12 -0000
Subject: [llvm-commits] [llvm] r44010 - in /llvm/trunk:
include/llvm/CodeGen/LiveIntervalAnalysis.h
lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegAllocLinearScan.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp
Message-ID: <200711120635.lAC6ZCQn004681@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Nov 12 00:35:08 2007
New Revision: 44010
URL: http://llvm.org/viewvc/llvm-project?rev=44010&view=rev
Log:
Refactor some code.
Modified:
llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=44010&r1=44009&r2=44010&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Nov 12 00:35:08 2007
@@ -32,6 +32,7 @@
class LiveVariables;
class MRegisterInfo;
+ class SSARegMap;
class TargetInstrInfo;
class TargetRegisterClass;
class VirtRegMap;
@@ -102,6 +103,10 @@
return getBaseIndex(index) + InstrSlots::STORE;
}
+ static float getSpillWeight(const MachineOperand &mop, unsigned loopDepth) {
+ return (mop.isUse()+mop.isDef()) * powf(10.0F, (float)loopDepth);
+ }
+
typedef Reg2IntervalMap::iterator iterator;
typedef Reg2IntervalMap::const_iterator const_iterator;
const_iterator begin() const { return r2iMap_.begin(); }
@@ -182,9 +187,6 @@
return I->second;
}
- std::vector addIntervalsForSpills(const LiveInterval& i,
- VirtRegMap& vrm, unsigned reg);
-
// Interval removal
void removeInterval(unsigned Reg) {
@@ -223,6 +225,11 @@
if (O) print(*O, M);
}
+ /// addIntervalsForSpills - Create new intervals for spilled defs / uses of
+ /// the given interval.
+ std::vector
+ addIntervalsForSpills(const LiveInterval& i, VirtRegMap& vrm);
+
private:
/// computeIntervals - Compute live intervals.
void computeIntervals();
@@ -267,6 +274,23 @@
MachineInstr *DefMI, unsigned index, unsigned i,
bool isSS, int slot, unsigned reg);
+ /// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper functions
+ /// for addIntervalsForSpills to rewrite uses / defs for the given live range.
+ void rewriteInstructionForSpills(const LiveInterval &li,
+ unsigned id, unsigned index, unsigned end, MachineInstr *MI,
+ MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
+ bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
+ VirtRegMap &vrm, SSARegMap *RegMap, const TargetRegisterClass* rc,
+ SmallVector &ReMatIds,
+ std::vector &NewLIs);
+ void rewriteInstructionsForSpills(const LiveInterval &li,
+ LiveInterval::Ranges::const_iterator &I,
+ MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
+ bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
+ VirtRegMap &vrm, SSARegMap *RegMap, const TargetRegisterClass* rc,
+ SmallVector &ReMatIds,
+ std::vector &NewLIs);
+
static LiveInterval createInterval(unsigned Reg);
void printRegName(unsigned reg) const;
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44010&r1=44009&r2=44010&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Nov 12 00:35:08 2007
@@ -153,298 +153,6 @@
}
}
-/// isReMaterializable - Returns true if the definition MI of the specified
-/// val# of the specified interval is re-materializable.
-bool LiveIntervals::isReMaterializable(const LiveInterval &li,
- const VNInfo *ValNo, MachineInstr *MI) {
- if (DisableReMat)
- return false;
-
- if (tii_->isTriviallyReMaterializable(MI))
- return true;
-
- int FrameIdx = 0;
- if (!tii_->isLoadFromStackSlot(MI, FrameIdx) ||
- !mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx))
- return false;
-
- // This is a load from fixed stack slot. It can be rematerialized unless it's
- // re-defined by a two-address instruction.
- for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
- i != e; ++i) {
- const VNInfo *VNI = *i;
- if (VNI == ValNo)
- continue;
- unsigned DefIdx = VNI->def;
- if (DefIdx == ~1U)
- continue; // Dead val#.
- MachineInstr *DefMI = (DefIdx == ~0u)
- ? NULL : getInstructionFromIndex(DefIdx);
- if (DefMI && DefMI->isRegReDefinedByTwoAddr(li.reg))
- return false;
- }
- return true;
-}
-
-/// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
-/// slot / to reg or any rematerialized load into ith operand of specified
-/// MI. If it is successul, MI is updated with the newly created MI and
-/// returns true.
-bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
- MachineInstr *DefMI,
- unsigned index, unsigned i,
- bool isSS, int slot, unsigned reg) {
- MachineInstr *fmi = isSS
- ? mri_->foldMemoryOperand(MI, i, slot)
- : mri_->foldMemoryOperand(MI, i, DefMI);
- if (fmi) {
- // Attempt to fold the memory reference into the instruction. If
- // we can do this, we don't need to insert spill code.
- if (lv_)
- lv_->instructionChanged(MI, fmi);
- MachineBasicBlock &MBB = *MI->getParent();
- vrm.virtFolded(reg, MI, i, fmi);
- mi2iMap_.erase(MI);
- i2miMap_[index/InstrSlots::NUM] = fmi;
- mi2iMap_[fmi] = index;
- MI = MBB.insert(MBB.erase(MI), fmi);
- ++numFolded;
- return true;
- }
- return false;
-}
-
-std::vector LiveIntervals::
-addIntervalsForSpills(const LiveInterval &li, VirtRegMap &vrm, unsigned reg) {
- // since this is called after the analysis is done we don't know if
- // LiveVariables is available
- lv_ = getAnalysisToUpdate();
-
- std::vector added;
-
- assert(li.weight != HUGE_VALF &&
- "attempt to spill already spilled interval!");
-
- DOUT << "\t\t\t\tadding intervals for spills for interval: ";
- li.print(DOUT, mri_);
- DOUT << '\n';
-
- SSARegMap *RegMap = mf_->getSSARegMap();
- const TargetRegisterClass* rc = RegMap->getRegClass(li.reg);
-
- unsigned NumValNums = li.getNumValNums();
- SmallVector ReMatDefs;
- ReMatDefs.resize(NumValNums, NULL);
- SmallVector ReMatOrigDefs;
- ReMatOrigDefs.resize(NumValNums, NULL);
- SmallVector ReMatIds;
- ReMatIds.resize(NumValNums, VirtRegMap::MAX_STACK_SLOT);
- BitVector ReMatDelete(NumValNums);
- unsigned slot = VirtRegMap::MAX_STACK_SLOT;
-
- bool NeedStackSlot = false;
- for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
- i != e; ++i) {
- const VNInfo *VNI = *i;
- unsigned VN = VNI->id;
- unsigned DefIdx = VNI->def;
- if (DefIdx == ~1U)
- continue; // Dead val#.
- // Is the def for the val# rematerializable?
- MachineInstr *DefMI = (DefIdx == ~0u)
- ? NULL : getInstructionFromIndex(DefIdx);
- if (DefMI && isReMaterializable(li, VNI, DefMI)) {
- // Remember how to remat the def of this val#.
- ReMatOrigDefs[VN] = DefMI;
- // Original def may be modified so we have to make a copy here. vrm must
- // delete these!
- ReMatDefs[VN] = DefMI = DefMI->clone();
- vrm.setVirtIsReMaterialized(reg, DefMI);
-
- bool CanDelete = true;
- for (unsigned j = 0, ee = VNI->kills.size(); j != ee; ++j) {
- unsigned KillIdx = VNI->kills[j];
- MachineInstr *KillMI = (KillIdx & 1)
- ? NULL : getInstructionFromIndex(KillIdx);
- // Kill is a phi node, not all of its uses can be rematerialized.
- // It must not be deleted.
- if (!KillMI) {
- CanDelete = false;
- // Need a stack slot if there is any live range where uses cannot be
- // rematerialized.
- NeedStackSlot = true;
- break;
- }
- }
-
- if (CanDelete)
- ReMatDelete.set(VN);
- } else {
- // Need a stack slot if there is any live range where uses cannot be
- // rematerialized.
- NeedStackSlot = true;
- }
- }
-
- // One stack slot per live interval.
- if (NeedStackSlot)
- slot = vrm.assignVirt2StackSlot(reg);
-
- for (LiveInterval::Ranges::const_iterator
- I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
- MachineInstr *DefMI = ReMatDefs[I->valno->id];
- MachineInstr *OrigDefMI = ReMatOrigDefs[I->valno->id];
- bool DefIsReMat = DefMI != NULL;
- bool CanDelete = ReMatDelete[I->valno->id];
- int LdSlot = 0;
- bool isLoadSS = DefIsReMat && tii_->isLoadFromStackSlot(DefMI, LdSlot);
- bool isLoad = isLoadSS ||
- (DefIsReMat && (DefMI->getInstrDescriptor()->Flags & M_LOAD_FLAG));
- unsigned index = getBaseIndex(I->start);
- unsigned end = getBaseIndex(I->end-1) + InstrSlots::NUM;
- for (; index != end; index += InstrSlots::NUM) {
- // skip deleted instructions
- while (index != end && !getInstructionFromIndex(index))
- index += InstrSlots::NUM;
- if (index == end) break;
-
- MachineInstr *MI = getInstructionFromIndex(index);
-
- RestartInstruction:
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& mop = MI->getOperand(i);
- if (!mop.isRegister())
- continue;
- unsigned Reg = mop.getReg();
- unsigned RegI = Reg;
- if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg))
- continue;
- bool isSubReg = RegMap->isSubRegister(Reg);
- unsigned SubIdx = 0;
- if (isSubReg) {
- SubIdx = RegMap->getSubRegisterIndex(Reg);
- Reg = RegMap->getSuperRegister(Reg);
- }
- if (Reg != li.reg)
- continue;
-
- bool TryFold = !DefIsReMat;
- bool FoldSS = true;
- int FoldSlot = slot;
- if (DefIsReMat) {
- // If this is the rematerializable definition MI itself and
- // all of its uses are rematerialized, simply delete it.
- if (MI == OrigDefMI && CanDelete) {
- RemoveMachineInstrFromMaps(MI);
- MI->eraseFromParent();
- break;
- }
-
- // If def for this use can't be rematerialized, then try folding.
- TryFold = !OrigDefMI || (OrigDefMI && (MI == OrigDefMI || isLoad));
- if (isLoad) {
- // Try fold loads (from stack slot, constant pool, etc.) into uses.
- FoldSS = isLoadSS;
- FoldSlot = LdSlot;
- }
- }
-
- // FIXME: fold subreg use
- if (!isSubReg && TryFold &&
- tryFoldMemoryOperand(MI, vrm, DefMI, index, i, FoldSS, FoldSlot, Reg))
- // Folding the load/store can completely change the instruction in
- // unpredictable ways, rescan it from the beginning.
- goto RestartInstruction;
-
- // Create a new virtual register for the spill interval.
- unsigned NewVReg = RegMap->createVirtualRegister(rc);
- if (isSubReg)
- RegMap->setIsSubRegister(NewVReg, NewVReg, SubIdx);
-
- // Scan all of the operands of this instruction rewriting operands
- // to use NewVReg instead of li.reg as appropriate. We do this for
- // two reasons:
- //
- // 1. If the instr reads the same spilled vreg multiple times, we
- // want to reuse the NewVReg.
- // 2. If the instr is a two-addr instruction, we are required to
- // keep the src/dst regs pinned.
- //
- // Keep track of whether we replace a use and/or def so that we can
- // create the spill interval with the appropriate range.
- mop.setReg(NewVReg);
-
- bool HasUse = mop.isUse();
- bool HasDef = mop.isDef();
- for (unsigned j = i+1, e = MI->getNumOperands(); j != e; ++j) {
- if (!MI->getOperand(j).isRegister())
- continue;
- unsigned RegJ = MI->getOperand(j).getReg();
- if (RegJ == 0 || MRegisterInfo::isPhysicalRegister(RegJ))
- continue;
- if (RegJ == RegI) {
- MI->getOperand(j).setReg(NewVReg);
- HasUse |= MI->getOperand(j).isUse();
- HasDef |= MI->getOperand(j).isDef();
- }
- }
-
- vrm.grow();
- if (DefIsReMat) {
- vrm.setVirtIsReMaterialized(NewVReg, DefMI/*, CanDelete*/);
- if (ReMatIds[I->valno->id] == VirtRegMap::MAX_STACK_SLOT) {
- // Each valnum may have its own remat id.
- ReMatIds[I->valno->id] = vrm.assignVirtReMatId(NewVReg);
- } else {
- vrm.assignVirtReMatId(NewVReg, ReMatIds[I->valno->id]);
- }
- if (!CanDelete || (HasUse && HasDef)) {
- // If this is a two-addr instruction then its use operands are
- // rematerializable but its def is not. It should be assigned a
- // stack slot.
- vrm.assignVirt2StackSlot(NewVReg, slot);
- }
- } else {
- vrm.assignVirt2StackSlot(NewVReg, slot);
- }
-
- // create a new register interval for this spill / remat.
- LiveInterval &nI = getOrCreateInterval(NewVReg);
- assert(nI.empty());
-
- // the spill weight is now infinity as it
- // cannot be spilled again
- nI.weight = HUGE_VALF;
-
- if (HasUse) {
- LiveRange LR(getLoadIndex(index), getUseIndex(index)+1,
- nI.getNextValue(~0U, 0, VNInfoAllocator));
- DOUT << " +" << LR;
- nI.addRange(LR);
- }
- if (HasDef) {
- LiveRange LR(getDefIndex(index), getStoreIndex(index),
- nI.getNextValue(~0U, 0, VNInfoAllocator));
- DOUT << " +" << LR;
- nI.addRange(LR);
- }
-
- added.push_back(&nI);
-
- // update live variables if it is available
- if (lv_)
- lv_->addVirtualRegisterKilled(NewVReg, MI);
-
- DOUT << "\t\t\t\tadded new interval: ";
- nI.print(DOUT, mri_);
- DOUT << '\n';
- }
- }
- }
-
- return added;
-}
-
/// conflictsWithPhysRegDef - Returns true if the specified register
/// is defined during the duration of the specified interval.
bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li,
@@ -874,3 +582,330 @@
HUGE_VALF : 0.0F;
return LiveInterval(reg, Weight);
}
+
+
+//===----------------------------------------------------------------------===//
+// Register allocator hooks.
+//
+
+/// isReMaterializable - Returns true if the definition MI of the specified
+/// val# of the specified interval is re-materializable.
+bool LiveIntervals::isReMaterializable(const LiveInterval &li,
+ const VNInfo *ValNo, MachineInstr *MI) {
+ if (DisableReMat)
+ return false;
+
+ if (tii_->isTriviallyReMaterializable(MI))
+ return true;
+
+ int FrameIdx = 0;
+ if (!tii_->isLoadFromStackSlot(MI, FrameIdx) ||
+ !mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx))
+ return false;
+
+ // This is a load from fixed stack slot. It can be rematerialized unless it's
+ // re-defined by a two-address instruction.
+ for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
+ i != e; ++i) {
+ const VNInfo *VNI = *i;
+ if (VNI == ValNo)
+ continue;
+ unsigned DefIdx = VNI->def;
+ if (DefIdx == ~1U)
+ continue; // Dead val#.
+ MachineInstr *DefMI = (DefIdx == ~0u)
+ ? NULL : getInstructionFromIndex(DefIdx);
+ if (DefMI && DefMI->isRegReDefinedByTwoAddr(li.reg))
+ return false;
+ }
+ return true;
+}
+
+/// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
+/// slot / to reg or any rematerialized load into ith operand of specified
+/// MI. If it is successul, MI is updated with the newly created MI and
+/// returns true.
+bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
+ MachineInstr *DefMI,
+ unsigned index, unsigned i,
+ bool isSS, int slot, unsigned reg) {
+ MachineInstr *fmi = isSS
+ ? mri_->foldMemoryOperand(MI, i, slot)
+ : mri_->foldMemoryOperand(MI, i, DefMI);
+ if (fmi) {
+ // Attempt to fold the memory reference into the instruction. If
+ // we can do this, we don't need to insert spill code.
+ if (lv_)
+ lv_->instructionChanged(MI, fmi);
+ MachineBasicBlock &MBB = *MI->getParent();
+ vrm.virtFolded(reg, MI, i, fmi);
+ mi2iMap_.erase(MI);
+ i2miMap_[index/InstrSlots::NUM] = fmi;
+ mi2iMap_[fmi] = index;
+ MI = MBB.insert(MBB.erase(MI), fmi);
+ ++numFolded;
+ return true;
+ }
+ return false;
+}
+
+/// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper functions
+/// for addIntervalsForSpills to rewrite uses / defs for the given live range.
+void LiveIntervals::
+rewriteInstructionForSpills(const LiveInterval &li,
+ unsigned id, unsigned index, unsigned end,
+ MachineInstr *MI, MachineInstr *OrigDefMI, MachineInstr *DefMI,
+ unsigned Slot, int LdSlot,
+ bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
+ VirtRegMap &vrm, SSARegMap *RegMap,
+ const TargetRegisterClass* rc,
+ SmallVector &ReMatIds,
+ std::vector &NewLIs) {
+ RestartInstruction:
+ for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
+ MachineOperand& mop = MI->getOperand(i);
+ if (!mop.isRegister())
+ continue;
+ unsigned Reg = mop.getReg();
+ unsigned RegI = Reg;
+ if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg))
+ continue;
+ bool isSubReg = RegMap->isSubRegister(Reg);
+ unsigned SubIdx = 0;
+ if (isSubReg) {
+ SubIdx = RegMap->getSubRegisterIndex(Reg);
+ Reg = RegMap->getSuperRegister(Reg);
+ }
+ if (Reg != li.reg)
+ continue;
+
+ bool TryFold = !DefIsReMat;
+ bool FoldSS = true;
+ int FoldSlot = Slot;
+ if (DefIsReMat) {
+ // If this is the rematerializable definition MI itself and
+ // all of its uses are rematerialized, simply delete it.
+ if (MI == OrigDefMI && CanDelete) {
+ RemoveMachineInstrFromMaps(MI);
+ MI->eraseFromParent();
+ break;
+ }
+
+ // If def for this use can't be rematerialized, then try folding.
+ TryFold = !OrigDefMI || (OrigDefMI && (MI == OrigDefMI || isLoad));
+ if (isLoad) {
+ // Try fold loads (from stack slot, constant pool, etc.) into uses.
+ FoldSS = isLoadSS;
+ FoldSlot = LdSlot;
+ }
+ }
+
+ // FIXME: fold subreg use
+ if (!isSubReg && TryFold &&
+ tryFoldMemoryOperand(MI, vrm, DefMI, index, i, FoldSS, FoldSlot, Reg))
+ // Folding the load/store can completely change the instruction in
+ // unpredictable ways, rescan it from the beginning.
+ goto RestartInstruction;
+
+ // Create a new virtual register for the spill interval.
+ unsigned NewVReg = RegMap->createVirtualRegister(rc);
+ vrm.grow();
+ if (isSubReg)
+ RegMap->setIsSubRegister(NewVReg, NewVReg, SubIdx);
+
+ // Scan all of the operands of this instruction rewriting operands
+ // to use NewVReg instead of li.reg as appropriate. We do this for
+ // two reasons:
+ //
+ // 1. If the instr reads the same spilled vreg multiple times, we
+ // want to reuse the NewVReg.
+ // 2. If the instr is a two-addr instruction, we are required to
+ // keep the src/dst regs pinned.
+ //
+ // Keep track of whether we replace a use and/or def so that we can
+ // create the spill interval with the appropriate range.
+ mop.setReg(NewVReg);
+
+ bool HasUse = mop.isUse();
+ bool HasDef = mop.isDef();
+ for (unsigned j = i+1, e = MI->getNumOperands(); j != e; ++j) {
+ if (!MI->getOperand(j).isRegister())
+ continue;
+ unsigned RegJ = MI->getOperand(j).getReg();
+ if (RegJ == 0 || MRegisterInfo::isPhysicalRegister(RegJ))
+ continue;
+ if (RegJ == RegI) {
+ MI->getOperand(j).setReg(NewVReg);
+ HasUse |= MI->getOperand(j).isUse();
+ HasDef |= MI->getOperand(j).isDef();
+ }
+ }
+
+ if (DefIsReMat) {
+ vrm.setVirtIsReMaterialized(NewVReg, DefMI/*, CanDelete*/);
+ if (ReMatIds[id] == VirtRegMap::MAX_STACK_SLOT) {
+ // Each valnum may have its own remat id.
+ ReMatIds[id] = vrm.assignVirtReMatId(NewVReg);
+ } else {
+ vrm.assignVirtReMatId(NewVReg, ReMatIds[id]);
+ }
+ if (!CanDelete || (HasUse && HasDef)) {
+ // If this is a two-addr instruction then its use operands are
+ // rematerializable but its def is not. It should be assigned a
+ // stack slot.
+ vrm.assignVirt2StackSlot(NewVReg, Slot);
+ }
+ } else {
+ vrm.assignVirt2StackSlot(NewVReg, Slot);
+ }
+
+ // create a new register interval for this spill / remat.
+ LiveInterval &nI = getOrCreateInterval(NewVReg);
+ assert(nI.empty());
+ NewLIs.push_back(&nI);
+
+ // the spill weight is now infinity as it
+ // cannot be spilled again
+ nI.weight = HUGE_VALF;
+
+ if (HasUse) {
+ LiveRange LR(getLoadIndex(index), getUseIndex(index)+1,
+ nI.getNextValue(~0U, 0, VNInfoAllocator));
+ DOUT << " +" << LR;
+ nI.addRange(LR);
+ }
+ if (HasDef) {
+ LiveRange LR(getDefIndex(index), getStoreIndex(index),
+ nI.getNextValue(~0U, 0, VNInfoAllocator));
+ DOUT << " +" << LR;
+ nI.addRange(LR);
+ }
+
+ // update live variables if it is available
+ if (lv_)
+ lv_->addVirtualRegisterKilled(NewVReg, MI);
+
+ DOUT << "\t\t\t\tAdded new interval: ";
+ nI.print(DOUT, mri_);
+ DOUT << '\n';
+ }
+}
+
+void LiveIntervals::
+rewriteInstructionsForSpills(const LiveInterval &li,
+ LiveInterval::Ranges::const_iterator &I,
+ MachineInstr *OrigDefMI, MachineInstr *DefMI,
+ unsigned Slot, int LdSlot,
+ bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
+ VirtRegMap &vrm, SSARegMap *RegMap,
+ const TargetRegisterClass* rc,
+ SmallVector &ReMatIds,
+ std::vector &NewLIs) {
+ unsigned index = getBaseIndex(I->start);
+ unsigned end = getBaseIndex(I->end-1) + InstrSlots::NUM;
+ for (; index != end; index += InstrSlots::NUM) {
+ // skip deleted instructions
+ while (index != end && !getInstructionFromIndex(index))
+ index += InstrSlots::NUM;
+ if (index == end) break;
+
+ MachineInstr *MI = getInstructionFromIndex(index);
+ rewriteInstructionForSpills(li, I->valno->id, index, end, MI,
+ OrigDefMI, DefMI, Slot, LdSlot, isLoad,
+ isLoadSS, DefIsReMat, CanDelete, vrm,
+ RegMap, rc, ReMatIds, NewLIs);
+ }
+}
+
+std::vector LiveIntervals::
+addIntervalsForSpills(const LiveInterval &li, VirtRegMap &vrm) {
+ // Since this is called after the analysis is done we don't know if
+ // LiveVariables is available
+ lv_ = getAnalysisToUpdate();
+
+ assert(li.weight != HUGE_VALF &&
+ "attempt to spill already spilled interval!");
+
+ DOUT << "\t\t\t\tadding intervals for spills for interval: ";
+ li.print(DOUT, mri_);
+ DOUT << '\n';
+
+ std::vector NewLIs;
+ SSARegMap *RegMap = mf_->getSSARegMap();
+ const TargetRegisterClass* rc = RegMap->getRegClass(li.reg);
+
+ unsigned NumValNums = li.getNumValNums();
+ SmallVector ReMatDefs;
+ ReMatDefs.resize(NumValNums, NULL);
+ SmallVector ReMatOrigDefs;
+ ReMatOrigDefs.resize(NumValNums, NULL);
+ SmallVector ReMatIds;
+ ReMatIds.resize(NumValNums, VirtRegMap::MAX_STACK_SLOT);
+ BitVector ReMatDelete(NumValNums);
+ unsigned Slot = VirtRegMap::MAX_STACK_SLOT;
+
+ bool NeedStackSlot = false;
+ for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
+ i != e; ++i) {
+ const VNInfo *VNI = *i;
+ unsigned VN = VNI->id;
+ unsigned DefIdx = VNI->def;
+ if (DefIdx == ~1U)
+ continue; // Dead val#.
+ // Is the def for the val# rematerializable?
+ MachineInstr *DefMI = (DefIdx == ~0u) ? 0 : getInstructionFromIndex(DefIdx);
+ if (DefMI && isReMaterializable(li, VNI, DefMI)) {
+ // Remember how to remat the def of this val#.
+ ReMatOrigDefs[VN] = DefMI;
+ // Original def may be modified so we have to make a copy here. vrm must
+ // delete these!
+ ReMatDefs[VN] = DefMI = DefMI->clone();
+ vrm.setVirtIsReMaterialized(li.reg, DefMI);
+
+ bool CanDelete = true;
+ for (unsigned j = 0, ee = VNI->kills.size(); j != ee; ++j) {
+ unsigned KillIdx = VNI->kills[j];
+ MachineInstr *KillMI = (KillIdx & 1)
+ ? NULL : getInstructionFromIndex(KillIdx);
+ // Kill is a phi node, not all of its uses can be rematerialized.
+ // It must not be deleted.
+ if (!KillMI) {
+ CanDelete = false;
+ // Need a stack slot if there is any live range where uses cannot be
+ // rematerialized.
+ NeedStackSlot = true;
+ break;
+ }
+ }
+
+ if (CanDelete)
+ ReMatDelete.set(VN);
+ } else {
+ // Need a stack slot if there is any live range where uses cannot be
+ // rematerialized.
+ NeedStackSlot = true;
+ }
+ }
+
+ // One stack slot per live interval.
+ if (NeedStackSlot)
+ Slot = vrm.assignVirt2StackSlot(li.reg);
+
+ // Create new intervals and rewrite defs and uses.
+ for (LiveInterval::Ranges::const_iterator
+ I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
+ MachineInstr *DefMI = ReMatDefs[I->valno->id];
+ MachineInstr *OrigDefMI = ReMatOrigDefs[I->valno->id];
+ bool DefIsReMat = DefMI != NULL;
+ bool CanDelete = ReMatDelete[I->valno->id];
+ int LdSlot = 0;
+ bool isLoadSS = DefIsReMat && tii_->isLoadFromStackSlot(DefMI, LdSlot);
+ bool isLoad = isLoadSS ||
+ (DefIsReMat && (DefMI->getInstrDescriptor()->Flags & M_LOAD_FLAG));
+ rewriteInstructionsForSpills(li, I, OrigDefMI, DefMI, Slot, LdSlot,
+ isLoad, isLoadSS, DefIsReMat, CanDelete,
+ vrm, RegMap, rc, ReMatIds, NewLIs);
+ }
+
+ return NewLIs;
+}
Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=44010&r1=44009&r2=44010&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Mon Nov 12 00:35:08 2007
@@ -685,7 +685,7 @@
if (cur->weight != HUGE_VALF && cur->weight <= minWeight) {
DOUT << "\t\t\tspilling(c): " << *cur << '\n';
std::vector added =
- li_->addIntervalsForSpills(*cur, *vrm_, cur->reg);
+ li_->addIntervalsForSpills(*cur, *vrm_);
if (added.empty())
return; // Early exit if all spills were folded.
@@ -737,7 +737,7 @@
DOUT << "\t\t\tspilling(a): " << *i->first << '\n';
earliestStart = std::min(earliestStart, i->first->beginNumber());
std::vector newIs =
- li_->addIntervalsForSpills(*i->first, *vrm_, reg);
+ li_->addIntervalsForSpills(*i->first, *vrm_);
std::copy(newIs.begin(), newIs.end(), std::back_inserter(added));
spilled.insert(reg);
}
@@ -750,7 +750,7 @@
DOUT << "\t\t\tspilling(i): " << *i->first << '\n';
earliestStart = std::min(earliestStart, i->first->beginNumber());
std::vector newIs =
- li_->addIntervalsForSpills(*i->first, *vrm_, reg);
+ li_->addIntervalsForSpills(*i->first, *vrm_);
std::copy(newIs.begin(), newIs.end(), std::back_inserter(added));
spilled.insert(reg);
}
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=44010&r1=44009&r2=44010&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Nov 12 00:35:08 2007
@@ -1460,8 +1460,7 @@
if (UniqueUses.count(reg) != 0)
continue;
LiveInterval &RegInt = li_->getInterval(reg);
- float w = (mop.isUse()+mop.isDef()) * powf(10.0F, (float)loopDepth);
- RegInt.weight += w;
+ RegInt.weight += li_->getSpillWeight(mop, loopDepth);
UniqueUses.insert(reg);
}
}
From isanbard at gmail.com Mon Nov 12 00:59:55 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 12 Nov 2007 06:59:55 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44011 -
/llvm-gcc-4.0/trunk/gcc/Makefile.in
Message-ID: <200711120659.lAC6xtoO005666@zion.cs.uiuc.edu>
Author: void
Date: Mon Nov 12 00:59:54 2007
New Revision: 44011
URL: http://llvm.org/viewvc/llvm-project?rev=44011&view=rev
Log:
Small hack to get llvm-config to work when it's moded to a different directory
Modified:
llvm-gcc-4.0/trunk/gcc/Makefile.in
Modified: llvm-gcc-4.0/trunk/gcc/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/Makefile.in?rev=44011&r1=44010&r2=44011&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/Makefile.in (original)
+++ llvm-gcc-4.0/trunk/gcc/Makefile.in Mon Nov 12 00:59:54 2007
@@ -234,7 +234,18 @@
# Use llvm-config to get the srcdir that LLVM was configured with, to support
# srcdir != objdir builds.
-LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root)
+### FIXME: Relying upon llvm-config doesn't work if we built LLVM in one placed,
+### moved it to another place, and then built LLVM-GCC. If the directory doesn't
+### exist, then use LLVMOBJDIR.
+#LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root)
+LLVMSRCDIR := $(shell \
+ P=`$(LLVMBINPATH)/llvm-config --src-root`; \
+ if [ `pwd` == $$P ]; then \
+ echo "$(LLVMOBJDIR)"; \
+ else \
+ echo "$$P"; \
+ fi);
+LLVMSRCDIR := $(shell echo "$(LLVMSRCDIR)" | sed -e 's,;,,')
endif
ifdef LLVM_VERSION_INFO
@@ -1129,7 +1140,7 @@
libllvmgcc$(LLVM_STAGE).dylib: llvm-linker-hack.cpp $(LLVMLIBFILES)
echo $(LLVMLIBFILES)
$(CXX) $(DYLIB_COMPILE_FLAGS) $(INCLUDES) -o $@ \
- $< $(LLVMLIBFILES) -dynamiclib -single_module \
+ $< $(LLVMLIBFILES) -L/usr/lib/gcc/$(build)/4.0.1/ -dynamiclib -single_module \
-install_name @executable_path/$@
LLVMBACKENDFILES := libllvmgcc$(LLVM_STAGE).dylib
@@ -1394,7 +1405,7 @@
cc1-exported-symbol-list.txt:
echo "_main" > $@
LIBDEPS += cc1-exported-symbol-list.txt
-LINKCC += -dead_strip -exported_symbols_list cc1-exported-symbol-list.txt
+LINKCC += -dead_strip -exported_symbols_list cc1-exported-symbol-list.txt -L/usr/lib/gcc/$(build)/4.0.1/
endif
else
LINKCC := $(CC)
@@ -1825,7 +1836,6 @@
$(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
$(STAMP) s-options
-
options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk
$(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \
-v header_name="options.h" < $< > $@
@@ -3206,7 +3216,7 @@
# working directory in object files (-g absent, or -fno-working-dir
# present), and build and host are the same, fixincl for the host will
# build after fixincl for the build machine, getting a cache hit,
-# thereby updating the timestamp of fixincl.o in the the host tree.
+# thereby updating the timestamp of fixincl.o in the host tree.
# Because of CCACHE_HARDLINK, this will also update the timestamp in
# the build tree, and so fixincl in the build tree will appear to be
# out of date. Yuck.
From resistor at mac.com Mon Nov 12 01:39:42 2007
From: resistor at mac.com (Owen Anderson)
Date: Mon, 12 Nov 2007 07:39:42 -0000
Subject: [llvm-commits] [llvm] r44012 - in /llvm/trunk:
include/llvm/Target/TargetInstrInfo.h lib/Target/ARM/ARMInstrInfo.td
lib/Target/Alpha/AlphaInstrInfo.td lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/Target.td lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrX86-64.td utils/TableGen/CodeGenInstruction.h
utils/TableGen/CodeGenTarget.cpp utils/TableGen/InstrInfoEmitter.cpp
Message-ID: <200711120739.lAC7dhCh007932@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Nov 12 01:39:39 2007
New Revision: 44012
URL: http://llvm.org/viewvc/llvm-project?rev=44012&view=rev
Log:
Add a flag for indirect branch instructions.
Target maintainers: please check that the instructions for your target are correctly marked.
Modified:
llvm/trunk/include/llvm/Target/TargetInstrInfo.h
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
llvm/trunk/lib/Target/Target.td
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/lib/Target/X86/X86InstrX86-64.td
llvm/trunk/utils/TableGen/CodeGenInstruction.h
llvm/trunk/utils/TableGen/CodeGenTarget.cpp
llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Nov 12 01:39:39 2007
@@ -48,6 +48,7 @@
const unsigned M_DELAY_SLOT_FLAG = 1 << 4;
const unsigned M_LOAD_FLAG = 1 << 5;
const unsigned M_STORE_FLAG = 1 << 6;
+const unsigned M_INDIRECT_FLAG = 1 << 7;
// M_CONVERTIBLE_TO_3_ADDR - This is a 2-address instruction which can be
// changed into a 3-address instruction if the first two operands cannot be
@@ -237,6 +238,10 @@
return get(Opcode).Flags & M_BRANCH_FLAG;
}
+ bool isIndirectBranch(MachineOpCode Opcode) const {
+ return get(Opcode).Flags & M_INDIRECT_FLAG;
+ }
+
/// isBarrier - Returns true if the specified instruction stops control flow
/// from executing the instruction immediately following it. Examples include
/// unconditional branches and return instructions.
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 12 01:39:39 2007
@@ -773,7 +773,7 @@
def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b $target",
[(br bb:$target)]>;
- let isNotDuplicable = 1 in {
+ let isNotDuplicable = 1, isIndirectBranch = 1 in {
def BR_JTr : JTI<0x0, (outs), (ins GPR:$target, jtblock_operand:$jt, i32imm:$id),
"mov pc, $target \n$jt",
[(ARMbrjt GPR:$target, tjumptable:$jt, imm:$id)]>;
Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Mon Nov 12 01:39:39 2007
@@ -374,8 +374,7 @@
def RETDAGp : MbrpForm< 0x1A, 0x02, (ops), "ret $$31,($$26),1", [(retflag)], s_jsr>; //Return from subroutine
}
-let isBranch = 1, isTerminator = 1, isBarrier = 1,
-Ra = 31, disp = 0 in
+let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1, Ra = 31, disp = 0 in
def JMP : MbrpForm< 0x1A, 0x00, (ops GPRC:$RS), "jmp $$31,($RS),0",
[(brind GPRC:$RS)], s_jsr>; //Jump
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Mon Nov 12 01:39:39 2007
@@ -369,7 +369,8 @@
def BLR : XLForm_2_br<19, 16, 0, (outs), (ins pred:$p),
"b${p:cc}lr ${p:reg}", BrB,
[(retflag)]>;
- def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>;
+ let isBranch = 1, isIndirectBranch = 1 in
+ def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>;
}
Modified: llvm/trunk/lib/Target/Target.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Target.td?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Target.td (original)
+++ llvm/trunk/lib/Target/Target.td Mon Nov 12 01:39:39 2007
@@ -187,6 +187,7 @@
// instruction.
bit isReturn = 0; // Is this instruction a return instruction?
bit isBranch = 0; // Is this instruction a branch instruction?
+ bit isIndirectBranch = 0; // Is this instruction an indirect branch?
bit isBarrier = 0; // Can control flow fall through this instruction?
bit isCall = 0; // Is this instruction a call instruction?
bit isLoad = 0; // Is this instruction a load instruction?
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Nov 12 01:39:39 2007
@@ -294,11 +294,11 @@
class IBr opcode, dag ins, string asm, list pattern> :
I;
-// Indirect branches
let isBranch = 1, isBarrier = 1 in
def JMP : IBr<0xE9, (ins brtarget:$dst), "jmp\t$dst", [(br bb:$dst)]>;
-let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
+// Indirect branches
+let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
def JMP32r : I<0xFF, MRM4r, (outs), (ins GR32:$dst), "jmp{l}\t{*}$dst",
[(brind GR32:$dst)]>;
def JMP32m : I<0xFF, MRM4m, (outs), (ins i32mem:$dst), "jmp{l}\t{*}$dst",
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=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrX86-64.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrX86-64.td Mon Nov 12 01:39:39 2007
@@ -120,7 +120,7 @@
[]>;
// Branches
-let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
+let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
def JMP64r : I<0xFF, MRM4r, (outs), (ins GR64:$dst), "jmp{q}\t{*}$dst",
[(brind GR64:$dst)]>;
def JMP64m : I<0xFF, MRM4m, (outs), (ins i64mem:$dst), "jmp{q}\t{*}$dst",
Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Mon Nov 12 01:39:39 2007
@@ -87,6 +87,7 @@
// Various boolean values we track for the instruction.
bool isReturn;
bool isBranch;
+ bool isIndirectBranch;
bool isBarrier;
bool isCall;
bool isLoad;
Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Mon Nov 12 01:39:39 2007
@@ -379,6 +379,7 @@
isReturn = R->getValueAsBit("isReturn");
isBranch = R->getValueAsBit("isBranch");
+ isIndirectBranch = R->getValueAsBit("isIndirectBranch");
isBarrier = R->getValueAsBit("isBarrier");
isCall = R->getValueAsBit("isCall");
isLoad = R->getValueAsBit("isLoad");
Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=44012&r1=44011&r2=44012&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Mon Nov 12 01:39:39 2007
@@ -237,6 +237,7 @@
// Emit all of the target indepedent flags...
if (Inst.isReturn) OS << "|M_RET_FLAG";
if (Inst.isBranch) OS << "|M_BRANCH_FLAG";
+ if (Inst.isIndirectBranch) OS << "|M_INDIRECT_FLAG";
if (Inst.isBarrier) OS << "|M_BARRIER_FLAG";
if (Inst.hasDelaySlot) OS << "|M_DELAY_SLOT_FLAG";
if (Inst.isCall) OS << "|M_CALL_FLAG";
From asl at math.spbu.ru Mon Nov 12 01:43:23 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Mon, 12 Nov 2007 10:43:23 +0300
Subject: [llvm-commits] [llvm] r43998 - /llvm/trunk/lib/Target/Target.td
In-Reply-To: <084097C7-BF31-4E90-8C99-4164353040D6.SS2097SS@apple.com>
References: <200711111953.lABJrohN002580@zion.cs.uiuc.edu>
<084097C7-BF31-4E90-8C99-4164353040D6.SS2097SS@apple.com>
Message-ID: <1194853403.10807.128.camel@asl.dorms.spbu.ru>
Hello, Evan.
> Why do we want to refer to gcc source for these numbers?
This was here for ages. However, I think it's ok to have this reference,
because gcc sources looks likes the only place, where such stuff can be
found.
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From baldrick at free.fr Mon Nov 12 07:43:24 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 12 Nov 2007 13:43:24 -0000
Subject: [llvm-commits] [llvm] r44013 -
/llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h
Message-ID: <200711121343.lACDhOor000455@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Nov 12 07:43:23 2007
New Revision: 44013
URL: http://llvm.org/viewvc/llvm-project?rev=44013&view=rev
Log:
Compile fix.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h
Modified: llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h?rev=44013&r1=44012&r2=44013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h Mon Nov 12 07:43:23 2007
@@ -22,6 +22,7 @@
#include
#include
+#include
namespace llvm {
From gordonhenriksen at mac.com Mon Nov 12 07:46:21 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Mon, 12 Nov 2007 13:46:21 -0000
Subject: [llvm-commits] [llvm] r44014 -
/llvm/trunk/docs/tutorial/LangImpl5.html
Message-ID: <200711121346.lACDkM9X000563@zion.cs.uiuc.edu>
Author: gordon
Date: Mon Nov 12 07:46:21 2007
New Revision: 44014
URL: http://llvm.org/viewvc/llvm-project?rev=44014&view=rev
Log:
Typo fix in the tutorial.
Modified:
llvm/trunk/docs/tutorial/LangImpl5.html
Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=44014&r1=44013&r2=44014&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Mon Nov 12 07:46:21 2007
@@ -659,8 +659,8 @@
Now we get to the good part: the LLVM IR we want to generate for this thing.
-With the simple example above, we get this LLVM IR (note that I generated this
-dump is generated with optimizations disabled for clarity):
+With the simple example above, we get this LLVM IR (note that this dump is
+generated with optimizations disabled for clarity):
From criswell at uiuc.edu Mon Nov 12 10:57:56 2007
From: criswell at uiuc.edu (John Criswell)
Date: Mon, 12 Nov 2007 16:57:56 -0000
Subject: [llvm-commits] [llvm] r44018 -
/llvm/branches/SVA/docs/WritingAnLLVMPass.html
Message-ID: <200711121657.lACGvuhv009634@zion.cs.uiuc.edu>
Author: criswell
Date: Mon Nov 12 10:57:56 2007
New Revision: 44018
URL: http://llvm.org/viewvc/llvm-project?rev=44018&view=rev
Log:
Fix typo.
Modified:
llvm/branches/SVA/docs/WritingAnLLVMPass.html
Modified: llvm/branches/SVA/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/SVA/docs/WritingAnLLVMPass.html?rev=44018&r1=44017&r2=44018&view=diff
==============================================================================
--- llvm/branches/SVA/docs/WritingAnLLVMPass.html (original)
+++ llvm/branches/SVA/docs/WritingAnLLVMPass.html Mon Nov 12 10:57:56 2007
@@ -1065,7 +1065,7 @@
-
Now that we understand the basics of how passes are defined, how the are
+
Now that we understand the basics of how passes are defined, how they are
used, and how they are required from other passes, it's time to get a little bit
fancier. All of the pass relationships that we have seen so far are very
simple: one pass depends on one other specific pass to be run before it can run.
From resistor at mac.com Mon Nov 12 11:27:28 2007
From: resistor at mac.com (Owen Anderson)
Date: Mon, 12 Nov 2007 17:27:28 -0000
Subject: [llvm-commits] [llvm] r44019 -
/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Message-ID: <200711121727.lACHRSSD011431@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Nov 12 11:27:27 2007
New Revision: 44019
URL: http://llvm.org/viewvc/llvm-project?rev=44019&view=rev
Log:
Break critical edges coming into blocks with PHI nodes.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=44019&r1=44018&r2=44019&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon Nov 12 11:27:27 2007
@@ -93,6 +93,7 @@
void processBlock(MachineBasicBlock* MBB);
std::vector computeDomForest(std::set& instrs);
+ void breakCriticalEdges(MachineFunction &Fn);
};
@@ -295,7 +296,32 @@
}
}
+void StrongPHIElimination::breakCriticalEdges(MachineFunction &Fn) {
+ typedef std::pair MBB_pair;
+
+ MachineDominatorTree& MDT = getAnalysis();
+ //LiveVariables& LV = getAnalysis();
+
+ std::vector criticals;
+ for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
+ if (!I->empty() &&
+ I->begin()->getOpcode() == TargetInstrInfo::PHI &&
+ I->pred_size() > 1)
+ for (MachineBasicBlock::pred_iterator PI = I->pred_begin(),
+ PE = I->pred_end(); PI != PE; ++PI)
+ if ((*PI)->succ_size() > 1)
+ criticals.push_back(std::make_pair(*PI, I));
+
+ for (std::vector::iterator I = criticals.begin(),
+ E = criticals.end(); I != E; ++I) {
+ SplitCriticalMachineEdge(I->first, I->second);
+
+ MDT.splitBlock(I->first);
+ }
+}
+
bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
+ breakCriticalEdges(Fn);
computeDFS(Fn);
for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
From baldrick at free.fr Mon Nov 12 12:48:55 2007
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 12 Nov 2007 19:48:55 +0100
Subject: [llvm-commits] [llvm] r43988 - in /llvm/trunk:
lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td
utils/TableGen/CallingConvEmitter.cpp
In-Reply-To:
References: <200711102207.lAAM7Gtr010958@zion.cs.uiuc.edu>
<200711111225.21834.baldrick@free.fr>
Message-ID: <200711121948.55740.baldrick@free.fr>
Hi Dale,
> I.e., I'm looking at it one level up, where you have
>
> CCIfType<[f80], CCAssignToStackABISizeAlign<0>>
>
> So I like it this way (except for the annoying wart of the "ignored"
> argument, maybe somebody knows a way around that?)
supposing it is possible to get rid of the wart, how about the
following: rename CCAssignToStack to CCAssignToStackSizeAlign,
rename CCAssignToStackABISizeAlign to CCAssignToStack, go through
all the uses of CCAssignToStackSizeAlign and if the size and
alignment are just the ABI sizes and alignment (which presumably
all of them are - this is almost the definition of the ABI size/
alignment), drop the arguments and call CCAssignToStack instead.
Why? Because repeating the ABI size/alignment in all these CC
calls is fragile and error prone (as proved by the long double
trouble), so why do it?
Ciao,
Duncan.
From dalej at apple.com Mon Nov 12 13:01:45 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 12 Nov 2007 11:01:45 -0800
Subject: [llvm-commits] [llvm] r43988 - in /llvm/trunk:
lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td
utils/TableGen/CallingConvEmitter.cpp
In-Reply-To: <200711121948.55740.baldrick@free.fr>
References: <200711102207.lAAM7Gtr010958@zion.cs.uiuc.edu>
<200711111225.21834.baldrick@free.fr>
<200711121948.55740.baldrick@free.fr>
Message-ID: <4F3C2091-7FA9-4ABE-AD4C-B848E26C9037@apple.com>
On Nov 12, 2007, at 10:48 AM, Duncan Sands wrote:
> Hi Dale,
>
>> I.e., I'm looking at it one level up, where you have
>>
>> CCIfType<[f80], CCAssignToStackABISizeAlign<0>>
>>
>> So I like it this way (except for the annoying wart of the "ignored"
>> argument, maybe somebody knows a way around that?)
>
> supposing it is possible to get rid of the wart, how about the
> following: rename CCAssignToStack to CCAssignToStackSizeAlign,
> rename CCAssignToStackABISizeAlign to CCAssignToStack, go through
> all the uses of CCAssignToStackSizeAlign and if the size and
> alignment are just the ABI sizes and alignment (which presumably
> all of them are - this is almost the definition of the ABI size/
> alignment), drop the arguments and call CCAssignToStack instead.
I have no particular opinion on the renaming, except that
interchanging the
names of two existing functions will create Confusion. But yes,
almost all
uses of CCAssignToStack could be replaced with the new 'function', and
IMO this would be a good idea. I am not, however, planning to do it;
the danger of introducing a bug on some target I can't test outweighs
the benefits IMO. I'd rather leave this to target maintainers.
(Also, there are a few exceptions, such as doubles on Sparc, which
are normally 8-byte aligned, but 4-byte aligned as arguments. There
needs to be an override mechanism.)
> Why? Because repeating the ABI size/alignment in all these CC
> calls is fragile and error prone (as proved by the long double
> trouble), so why do it?
From kremenek at apple.com Mon Nov 12 13:11:16 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 12 Nov 2007 19:11:16 -0000
Subject: [llvm-commits] [llvm] r44021 - in /llvm/trunk:
include/llvm/Bitcode/Deserialize.h lib/Bitcode/Reader/Deserialize.cpp
Message-ID: <200711121911.lACJBGsM015906@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Nov 12 13:11:15 2007
New Revision: 44021
URL: http://llvm.org/viewvc/llvm-project?rev=44021&view=rev
Log:
Added versions of ReadPtr that takes an explicit SerializedPtrID. This allows
clients of the Deserializer to read the pointer ID before they are ready
to deserialize the object (which can mean registering a pointer reference
with the backpatcher).
Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference). This is to accommodate a future
revision of SerializedPtrID where it may be much fatter than an unsigned
integer.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44021&r1=44020&r2=44021&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Mon Nov 12 13:11:15 2007
@@ -240,10 +240,28 @@
ReadPtr(const_cast(PtrRef), AllowBackpatch);
}
+
+ template
+ void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID, bool AllowBackpatch = true) {
+ ReadUIntPtr(reinterpret_cast(PtrRef), PtrID, AllowBackpatch);
+ }
+
+ template
+ void ReadPtr(const T*& PtrRef, const SerializedPtrID& PtrID,
+ bool AllowBackpatch = true) {
+
+ ReadPtr(const_cast(PtrRef), PtrID, AllowBackpatch);
+ }
+
template
T* ReadPtr() { T* x; ReadPtr(x,false); return x; }
- void ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch = true);
+ void ReadUIntPtr(uintptr_t& PtrRef, const SerializedPtrID& PtrID,
+ bool AllowBackpatch = true);
+
+ void ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch = true) {
+ ReadUIntPtr(PtrRef,ReadPtrID(),AllowBackpatch);
+ }
template
T& ReadRef() {
@@ -251,7 +269,7 @@
return *p;
}
- void RegisterPtr(SerializedPtrID PtrId, const void* Ptr);
+ void RegisterPtr(const SerializedPtrID& PtrID, const void* Ptr);
void RegisterPtr(const void* Ptr) {
RegisterPtr(ReadPtrID(),Ptr);
@@ -263,7 +281,7 @@
}
template
- void RegisterRef(SerializedPtrID PtrID, const T& x) {
+ void RegisterRef(const SerializedPtrID& PtrID, const T& x) {
RegisterPtr(PtrID,&x);
}
Modified: llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp?rev=44021&r1=44020&r2=44021&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp Mon Nov 12 13:11:15 2007
@@ -324,7 +324,9 @@
buff.push_back('\0');
}
-void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
+void Deserializer::RegisterPtr(const SerializedPtrID& PtrId,
+ const void* Ptr) {
+
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
assert (!HasFinalPtr(E) && "Pointer already registered.");
@@ -336,9 +338,9 @@
SetPtr(E,Ptr);
}
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
- SerializedPtrID PtrId = ReadPtrID();
-
+void Deserializer::ReadUIntPtr(uintptr_t& PtrRef,
+ const SerializedPtrID& PtrId,
+ bool AllowBackpatch) {
if (PtrId == 0) {
PtrRef = 0;
return;
From bruno.cardoso at gmail.com Mon Nov 12 13:49:57 2007
From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes)
Date: Mon, 12 Nov 2007 19:49:57 -0000
Subject: [llvm-commits] [llvm] r44024 - in /llvm/trunk/lib/Target/Mips:
MipsAsmPrinter.cpp MipsISelDAGToDAG.cpp MipsISelLowering.cpp
MipsISelLowering.h MipsInstrInfo.td MipsTargetAsmInfo.cpp
Message-ID: <200711121949.lACJnvc5017846@zion.cs.uiuc.edu>
Author: bruno
Date: Mon Nov 12 13:49:57 2007
New Revision: 44024
URL: http://llvm.org/viewvc/llvm-project?rev=44024&view=rev
Log:
Added JumpTable support
Fixed some AsmPrinter issues
Added GLOBAL_OFFSET_TABLE Node handle.
Modified:
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.h
llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Nov 12 13:49:57 2007
@@ -29,6 +29,7 @@
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/SetVector.h"
@@ -237,9 +238,8 @@
const Function *F = MF.getFunction();
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
- // On Mips GAS, if .align #n is present, #n means the number of bits
- // to be cleared. So, if we want 4 byte alignment, we must have .align 2
- EmitAlignment(1, F);
+ // 2 bits aligned
+ EmitAlignment(2, F);
O << "\t.globl\t" << CurrentFnName << "\n";
O << "\t.ent\t" << CurrentFnName << "\n";
@@ -280,6 +280,9 @@
// Print out constants referenced by the function
EmitConstantPool(MF.getConstantPool());
+ // Print out jump tables referenced by the function
+ EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
+
O << "\n\n";
// What's my mangled name?
@@ -388,6 +391,11 @@
O << MO.getSymbolName();
break;
+ case MachineOperand::MO_JumpTableIndex:
+ O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
+ << '_' << MO.getJumpTableIndex();
+ break;
+
// FIXME: Verify correct
case MachineOperand::MO_ConstantPoolIndex:
O << TAI->getPrivateGlobalPrefix() << "CPI"
@@ -450,19 +458,30 @@
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPrefTypeAlignment(C->getType());
+ unsigned Align = TD->getPreferredAlignmentLog(I);
+ // Is this correct ?
if (C->isNullValue() && (I->hasLinkOnceLinkage() ||
- I->hasInternalLinkage() || I->hasWeakLinkage()
- /* FIXME: Verify correct */)) {
-
- SwitchToDataSection(".data", I);
- if (I->hasInternalLinkage())
- O << "\t.local " << name << "\n";
-
- O << "\t.comm " << name << ","
- << TD->getABITypeSize(C->getType())
- << "," << Align << "\n";
+ I->hasInternalLinkage() || I->hasWeakLinkage()))
+ {
+ if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
+
+ if (!NoZerosInBSS && TAI->getBSSSection())
+ SwitchToDataSection(TAI->getBSSSection(), I);
+ else
+ SwitchToDataSection(TAI->getDataSection(), I);
+
+ if (I->hasInternalLinkage()) {
+ if (TAI->getLCOMMDirective())
+ O << TAI->getLCOMMDirective() << name << "," << Size;
+ else
+ O << "\t.local\t" << name << "\n";
+ } else {
+ O << TAI->getCOMMDirective() << name << "," << Size;
+ // The .comm alignment in bytes.
+ if (TAI->getCOMMDirectiveTakesAlignment())
+ O << "," << (1 << Align);
+ }
} else {
@@ -483,24 +502,37 @@
// something. For now, just emit them as external.
case GlobalValue::ExternalLinkage:
// If external or appending, declare as a global symbol
- O << "\t.globl " << name << "\n";
+ O << TAI->getGlobalDirective() << name << "\n";
+ // Fall Through
case GlobalValue::InternalLinkage:
- if (C->isNullValue())
- SwitchToDataSection(".bss", I);
- else
- SwitchToDataSection(".data", I);
+ // FIXME: special handling for ".ctors" & ".dtors" sections
+ if (I->hasSection() && (I->getSection() == ".ctors" ||
+ I->getSection() == ".dtors")) {
+ std::string SectionName = ".section " + I->getSection();
+ SectionName += ",\"aw\",%progbits";
+ SwitchToDataSection(SectionName.c_str());
+ } else {
+ if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
+ SwitchToDataSection(TAI->getBSSSection(), I);
+ else if (!I->isConstant())
+ SwitchToDataSection(TAI->getDataSection(), I);
+ else {
+ // Read-only data.
+ if (TAI->getReadOnlySection())
+ SwitchToDataSection(TAI->getReadOnlySection(), I);
+ else
+ SwitchToDataSection(TAI->getDataSection(), I);
+ }
+ }
break;
case GlobalValue::GhostLinkage:
- cerr << "Should not have any"
- << "unmaterialized functions!\n";
+ cerr << "Should not have any unmaterialized functions!\n";
abort();
case GlobalValue::DLLImportLinkage:
- cerr << "DLLImport linkage is"
- << "not supported by this target!\n";
+ cerr << "DLLImport linkage is not supported by this target!\n";
abort();
case GlobalValue::DLLExportLinkage:
- cerr << "DLLExport linkage is"
- << "not supported by this target!\n";
+ cerr << "DLLExport linkage is not supported by this target!\n";
abort();
default:
assert(0 && "Unknown linkage type!");
Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Mon Nov 12 13:49:57 2007
@@ -78,6 +78,7 @@
// Include the pieces autogenerated from the target description.
#include "MipsGenDAGISel.inc"
+ SDOperand getGlobalBaseReg();
SDNode *Select(SDOperand N);
// Complex Pattern.
@@ -124,6 +125,23 @@
ScheduleAndEmitDAG(SD);
}
+/// getGlobalBaseReg - Output the instructions required to put the
+/// GOT address into a register.
+SDOperand MipsDAGToDAGISel::getGlobalBaseReg()
+{
+ MachineFunction* MF = BB->getParent();
+ unsigned GP = 0;
+ for(MachineFunction::livein_iterator ii = MF->livein_begin(),
+ ee = MF->livein_end(); ii != ee; ++ii)
+ if (ii->first == Mips::GP) {
+ GP = ii->second;
+ break;
+ }
+ assert(GP && "GOT PTR not in liveins");
+ return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
+ GP, MVT::i32);
+}
+
/// ComplexPattern used on MipsInstrInfo
/// Used on Mips Load/Store instructions
bool MipsDAGToDAGISel::
@@ -138,7 +156,8 @@
// on PIC code Load GA
if (TM.getRelocationModel() == Reloc::PIC_) {
- if (Addr.getOpcode() == ISD::TargetGlobalAddress) {
+ if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
+ (Addr.getOpcode() == ISD::TargetJumpTable)){
Base = CurDAG->getRegister(Mips::GP, MVT::i32);
Offset = Addr;
return true;
@@ -253,6 +272,13 @@
return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, MFInFlag);
}
+ // Get target GOT address.
+ case ISD::GLOBAL_OFFSET_TABLE: {
+ SDOperand Result = getGlobalBaseReg();
+ ReplaceUses(N, Result);
+ return NULL;
+ }
+
/// Handle direct and indirect calls when using PIC. On PIC, when
/// GOT is smaller than about 64k (small code) the GA target is
/// loaded with only one instruction. Otherwise GA's target must
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Nov 12 13:49:57 2007
@@ -55,6 +55,9 @@
setSetCCResultType(MVT::i32);
setSetCCResultContents(ZeroOrOneSetCCResult);
+ // JumpTable targets must use GOT when using PIC_
+ setUsesGlobalOffsetTable(true);
+
// Set up the register classes
addRegisterClass(MVT::i32, Mips::CPURegsRegisterClass);
@@ -62,6 +65,7 @@
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
setOperationAction(ISD::RET, MVT::Other, Custom);
+ setOperationAction(ISD::JumpTable, MVT::i32, Custom);
// Load extented operations for i1 types must be promoted
setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
@@ -119,6 +123,7 @@
case ISD::RET: return LowerRET(Op, DAG);
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
+ case ISD::JumpTable: return LowerJumpTable(Op, DAG);
}
return SDOperand();
}
@@ -175,6 +180,29 @@
assert(0 && "TLS not implemented for MIPS.");
}
+SDOperand MipsTargetLowering::
+LowerJumpTable(SDOperand Op, SelectionDAG &DAG)
+{
+ SDOperand ResNode;
+ SDOperand HiPart;
+
+ MVT::ValueType PtrVT = Op.getValueType();
+ JumpTableSDNode *JT = cast(Op);
+ SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
+
+ if (getTargetMachine().getRelocationModel() != Reloc::PIC_) {
+ const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::i32);
+ SDOperand Ops[] = { JTI };
+ HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1);
+ } else // Emit Load from Global Pointer
+ HiPart = DAG.getLoad(MVT::i32, DAG.getEntryNode(), JTI, NULL, 0);
+
+ SDOperand Lo = DAG.getNode(MipsISD::Lo, MVT::i32, JTI);
+ ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo);
+
+ return ResNode;
+}
+
//===----------------------------------------------------------------------===//
// Calling Convention Implementation
//
@@ -346,13 +374,11 @@
// location is used on function prologue to save GP and also after all
// emited CALL's to restore GP.
if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
-
// Function can have an arbitrary number of calls, so
// hold the LastStackLoc with the biggest offset.
int FI;
MipsFunctionInfo *MipsFI = MF.getInfo();
if (LastStackLoc >= MipsFI->getGPStackOffset()) {
-
LastStackLoc = (!LastStackLoc) ? (16) : (LastStackLoc+4);
// Create the frame index only once. SPOffset here can be anything
// (this will be fixed on processFunctionBeforeFrameFinalized)
@@ -363,7 +389,6 @@
MipsFI->setGPStackOffset(LastStackLoc);
}
-
// Reload GP value.
FI = MipsFI->getGPFI();
SDOperand FIN = DAG.getFrameIndex(FI,getPointerTy());
@@ -455,6 +480,10 @@
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
+ // GP holds the GOT address on PIC calls.
+ if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
+ AddLiveIn(MF, Mips::GP, Mips::CPURegsRegisterClass);
+
// Assign locations to all of the incoming arguments.
SmallVector ArgLocs;
CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Mon Nov 12 13:49:57 2007
@@ -76,6 +76,7 @@
SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
+ SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG);
// Inline asm support
ConstraintType getConstraintType(const std::string &Constraint) const;
Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Nov 12 13:49:57 2007
@@ -274,13 +274,13 @@
(outs),
(ins CPURegs:$target),
!strconcat(instr_asm, " $target"),
- [], IIBranch>;
+ [(brind CPURegs:$target)], IIBranch>;
// Jump and Link (Call)
let isCall=1, hasDelaySlot=1,
// All calls clobber the non-callee saved registers...
Defs = [AT, V0, V1, A0, A1, A2, A3, T0, T1, T2,
- T3, T4, T5, T6, T7, T8, T9, K0, K1] in {
+ T3, T4, T5, T6, T7, T8, T9, K0, K1], Uses = [GP] in {
class JumpLink op, string instr_asm>:
FJ< op,
(outs),
@@ -518,6 +518,10 @@
def : Pat<(MipsLo tglobaladdr:$in), (ADDiu ZERO, tglobaladdr:$in)>;
def : Pat<(add CPURegs:$hi, (MipsLo tglobaladdr:$lo)),
(ADDiu CPURegs:$hi, tglobaladdr:$lo)>;
+def : Pat<(MipsHi tjumptable:$in), (LUi tjumptable:$in)>;
+def : Pat<(MipsLo tjumptable:$in), (ADDiu ZERO, tjumptable:$in)>;
+def : Pat<(add CPURegs:$hi, (MipsLo tjumptable:$lo)),
+ (ADDiu CPURegs:$hi, tjumptable:$lo)>;
// Mips does not have not, so we increase the operation
def : Pat<(not CPURegs:$in),
Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=44024&r1=44023&r2=44024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Nov 12 13:49:57 2007
@@ -12,11 +12,27 @@
//===----------------------------------------------------------------------===//
#include "MipsTargetAsmInfo.h"
+#include "MipsTargetMachine.h"
using namespace llvm;
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) {
- Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
- CommentString = "#";
+ AlignmentIsInBytes = false;
+ Data16bitsDirective = "\t.half\t";
+ Data32bitsDirective = "\t.word\t";
+ PrivateGlobalPrefix = "$";
+ JumpTableDataSection = "\t.rdata";
+ CommentString = "#";
+ ReadOnlySection = "\t.rdata";
+ ZeroDirective = "\t.space\t";
+ BSSSection = "\t.section\t.bss";
+ GlobalDirective = "\t.globl\t";
+ LCOMMDirective = "\t.lcomm\t";
+
+ if (TM.getRelocationModel() == Reloc::Static)
+ JumpTableDirective = "\t.word\t";
+ else
+ JumpTableDirective = "\t.gpword\t";
+
+ COMMDirectiveTakesAlignment = true;
}
From asl at math.spbu.ru Mon Nov 12 16:46:56 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 13 Nov 2007 01:46:56 +0300
Subject: [llvm-commits] [llvm-gcc-4.2] r43930 -
in /llvm-gcc-4.2/trunk/gcc/config/arm:
darwin-libgcc.10.4.ver darwin-libgcc.10.5.ver darwin.h
darwin.opt t-darwin
In-Reply-To:
References: <200711090719.lA97JlZn024582@zion.cs.uiuc.edu>
<59FAB353-DE7F-4631-96FF-A7325FEB8DF0@apple.com>
<852DBF4E-378E-454F-9F6F-FDC5A2711336@apple.com>
Message-ID: <1194907616.10807.134.camel@asl.dorms.spbu.ru>
Dale,
> You are right, sorry. Now, the bootstrap fails with the message I'm
> seeing in the testsuite. Bill, did you bootstrap this merge before
> checking in? I'm on x86-32.
I'm getting exactly same message during 4.2 bootstrap on x86-32/linux
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From echristo at apple.com Mon Nov 12 16:56:30 2007
From: echristo at apple.com (Eric Christopher)
Date: Mon, 12 Nov 2007 14:56:30 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To: <47367BA1.6030403@mxc.ca>
References: <47367BA1.6030403@mxc.ca>
Message-ID:
On Nov 10, 2007, at 7:48 PM, Nick Lewycky wrote:
> This patch to llvm-gcc 4.0 allows it to compile on PPC/Linux. This
> is a combination of patchs from myself, Dale Johannesen, and the
> fact that a GTY can't be declared in an #ifdef from Andrew Pinski.
>
> I'd appreciate some testing. More importantly to make sure that this
> doesn't break Darwin on PPC, but also anyone else who's interested
> in running LLVM on their PPC Linux boxes.
>
> The second attachment is the result of a nightly test on PPC/Linux,
> after applying this patch.
Index: gcc/config/rs6000/linux.h
===================================================================
--- gcc/config/rs6000/linux.h (revision 43975)
+++ gcc/config/rs6000/linux.h (working copy)
@@ -110,3 +110,13 @@
#define TARGET_HAS_F_SETLKW
#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
+
+#undef ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
+ (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
+ (((COMPUTED) == RS6000_VECTOR_ALIGNMENT) \
+ ? RS6000_VECTOR_ALIGNMENT \
+ : (MIN ((COMPUTED), \
+ (TARGET_ALIGN_MAC68K ? 16 \
+ : ((FIRST_FIELD_P) ? (COMPUTED) \
+ : 32))))))
I don't think this part can possibly be correct, there's no mac68k
alignment for ppc linux. The proper version of ADJUST_FIELD_ALIGN is
in 4.2 and is:
/* An expression for the alignment of a structure field FIELD if the
alignment computed in the usual way is COMPUTED. */
#define ADJUST_FIELD_ALIGN(FIELD,
COMPUTED) \
((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) ==
VECTOR_TYPE) \
? 128 : COMPUTED)
(note that there's a different one for ppc64-linux)
-eric
From dalej at apple.com Mon Nov 12 17:17:14 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 12 Nov 2007 15:17:14 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To:
References: <47367BA1.6030403@mxc.ca>
Message-ID: <203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
On Nov 12, 2007, at 2:56 PM, Eric Christopher wrote:
>
> On Nov 10, 2007, at 7:48 PM, Nick Lewycky wrote:
>
>> This patch to llvm-gcc 4.0 allows it to compile on PPC/Linux. This
>> is a combination of patchs from myself, Dale Johannesen, and the
>> fact that a GTY can't be declared in an #ifdef from Andrew Pinski.
>>
>> I'd appreciate some testing. More importantly to make sure that this
>> doesn't break Darwin on PPC, but also anyone else who's interested
>> in running LLVM on their PPC Linux boxes.
>>
>> The second attachment is the result of a nightly test on PPC/Linux,
>> after applying this patch.
>
> Index: gcc/config/rs6000/linux.h
>
> I don't think this part can possibly be correct, there's no mac68k
> alignment for ppc linux. The proper version of ADJUST_FIELD_ALIGN is
> in 4.2 and is:
>
> /* An expression for the alignment of a structure field FIELD if the
> alignment computed in the usual way is COMPUTED. */
> #define ADJUST_FIELD_ALIGN(FIELD,
> COMPUTED) \
> ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) ==
> VECTOR_TYPE) \
> ? 128 : COMPUTED)
>
> (note that there's a different one for ppc64-linux)
However proper that may be, it will not work. llvm-gcc-4.0 is based on
Apple's 4.0, and ADJUST_FIELD_ALIGN has 3 arguments.
I am testing Nick's patch on ppc32 Darwin and plan to check in if it
looks like that was not broken.
From echristo at apple.com Mon Nov 12 17:18:11 2007
From: echristo at apple.com (Eric Christopher)
Date: Mon, 12 Nov 2007 15:18:11 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To: <203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
References: <47367BA1.6030403@mxc.ca>
<203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
Message-ID: <8B22EA9D-5234-4DEB-8B60-3D1D2E649F54@apple.com>
>
> However proper that may be, it will not work. llvm-gcc-4.0 is based
> on
> Apple's 4.0, and ADJUST_FIELD_ALIGN has 3 arguments.
>
Sure, but you can simply ignore the 3rd argument.
> I am testing Nick's patch on ppc32 Darwin and plan to check in if it
> looks like that was not broken.
>
I would very much suggest that you not check in the 32-bit linux part,
as it
isn't the correct fix.
-eric
From dalej at apple.com Mon Nov 12 17:32:11 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 12 Nov 2007 15:32:11 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To: <8B22EA9D-5234-4DEB-8B60-3D1D2E649F54@apple.com>
References: <47367BA1.6030403@mxc.ca>
<203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
<8B22EA9D-5234-4DEB-8B60-3D1D2E649F54@apple.com>
Message-ID: <4FF887A7-E1DA-40C5-B9C1-5F1BF1A55D41@apple.com>
On Nov 12, 2007, at 3:18 PM, Eric Christopher wrote:
>>
>> However proper that may be, it will not work. llvm-gcc-4.0 is based
>> on
>> Apple's 4.0, and ADJUST_FIELD_ALIGN has 3 arguments.
>>
>
> Sure, but you can simply ignore the 3rd argument.
Create still another version of it, you mean.
>> I am testing Nick's patch on ppc32 Darwin and plan to check in if it
>> looks like that was not broken.
>
> I would very much suggest that you not check in the 32-bit linux part,
> as it
> isn't the correct fix.
This community is less obsessed than gcc'ers about finding "the
correct" fix, which speeds things up tremendously. In this case
ppc32 Linux didn't work before and does now; that's enough of a gain
to check something in IMO. If you want to improve it, you can.
That said, it's true TARGET_ALIGN_MAC68K should be always false on
Linux, and the macro could be simplified.
From asl at math.spbu.ru Mon Nov 12 17:36:13 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Mon, 12 Nov 2007 23:36:13 -0000
Subject: [llvm-commits] [llvm] r44029 -
/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
Message-ID: <200711122336.lACNaDoZ029865@zion.cs.uiuc.edu>
Author: asl
Date: Mon Nov 12 17:36:13 2007
New Revision: 44029
URL: http://llvm.org/viewvc/llvm-project?rev=44029&view=rev
Log:
Completely forgot, that we have some debug information emission on PPC. This should fix
some regressions on ppc nightly tests.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=44029&r1=44028&r2=44029&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Nov 12 17:36:13 2007
@@ -1278,8 +1278,8 @@
}
int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
- assert(0 && "What is the dwarf register number");
- return -1;
+ // FIXME: Most probably dwarf numbers differs for Linux and Darwin
+ return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
#include "PPCGenRegisterInfo.inc"
From echristo at apple.com Mon Nov 12 17:39:48 2007
From: echristo at apple.com (Eric Christopher)
Date: Mon, 12 Nov 2007 15:39:48 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To: <4FF887A7-E1DA-40C5-B9C1-5F1BF1A55D41@apple.com>
References: <47367BA1.6030403@mxc.ca>
<203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
<8B22EA9D-5234-4DEB-8B60-3D1D2E649F54@apple.com>
<4FF887A7-E1DA-40C5-B9C1-5F1BF1A55D41@apple.com>
Message-ID:
>>
> Create still another version of it, you mean.
Well sure. It's a one line change as opposed to mucking with how
structures
are supposed to be laid out.
>>> I am testing Nick's patch on ppc32 Darwin and plan to check in if it
>>> looks like that was not broken.
>>
>> I would very much suggest that you not check in the 32-bit linux
>> part,
>> as it
>> isn't the correct fix.
>
> This community is less obsessed than gcc'ers about finding "the
> correct" fix, which speeds things up tremendously. In this case
> ppc32 Linux didn't work before and does now; that's enough of a gain
> to check something in IMO. If you want to improve it, you can.
>
In this case, Nick already asked me to check in a fix for it so I'll
do that when
I get a chance. I'll disagree that checking in something known to be
wrong when
there's an easy fix speeds anything up at all.
> That said, it's true TARGET_ALIGN_MAC68K should be always false on
> Linux, and the macro could be simplified.
It's not even just that, it's a change to how the structure alignment
is supposed
to be. The two platforms are different in this way.
-eric
From dpatel at apple.com Mon Nov 12 17:53:43 2007
From: dpatel at apple.com (Devang Patel)
Date: Mon, 12 Nov 2007 23:53:43 -0000
Subject: [llvm-commits] [llvm] r44030 - /llvm/trunk/utils/buildit/build_llvm
Message-ID: <200711122353.lACNrhKh030639@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Nov 12 17:53:43 2007
New Revision: 44030
URL: http://llvm.org/viewvc/llvm-project?rev=44030&view=rev
Log:
Build universal llvm.
Modified:
llvm/trunk/utils/buildit/build_llvm
Modified: llvm/trunk/utils/buildit/build_llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=44030&r1=44029&r2=44030&view=diff
==============================================================================
--- llvm/trunk/utils/buildit/build_llvm (original)
+++ llvm/trunk/utils/buildit/build_llvm Mon Nov 12 17:53:43 2007
@@ -3,23 +3,19 @@
set -x
-# -arch arguments are different than configure arguments. We need to
-# translate them.
-
-TRANSLATE_ARCH="sed -e s/ppc/powerpc/ -e s/i386/i686/"
-
# Build LLVM the "Apple way".
# Parameters:
# The first parameter is a space-separated list of the architectures the
# compilers will run on. For instance, "ppc i386". If the current machine
# isn't in the list, it will (effectively) be added.
-HOSTS=`echo $1 | $TRANSLATE_ARCH `
+# FIXME: HOSTS is not used in this script. Use it or Remove it.
+HOSTS="$1"
# The second parameter is a space-separated list of the architectures the
# compilers will generate code for. If the current machine isn't in the list, a
# compiler for it will get built anyway, but won't be installed.
-TARGETS=`echo $2 | $TRANSLATE_ARCH`
+TARGETS="$2"
# The third parameter is the path to the compiler sources. There should be a
# shell script named 'configure' in this directory. This script makes a copy...
@@ -102,7 +98,7 @@
# Note: Don't pass -jN here. Building universal already has parallelism and we
# don't want to make the builders hit swap by firing off too many gcc's at the
# same time.
-make $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \
+make $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
if ! test $? == 0 ; then
From isanbard at gmail.com Mon Nov 12 17:55:19 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 12 Nov 2007 23:55:19 -0000
Subject: [llvm-commits] [llvm] r44031 - /llvm/trunk/utils/buildit/build_llvm
Message-ID: <200711122355.lACNtJ2Z030716@zion.cs.uiuc.edu>
Author: void
Date: Mon Nov 12 17:55:19 2007
New Revision: 44031
URL: http://llvm.org/viewvc/llvm-project?rev=44031&view=rev
Log:
Move SYSCTL stuff close to where it's used.
Modified:
llvm/trunk/utils/buildit/build_llvm
Modified: llvm/trunk/utils/buildit/build_llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=44031&r1=44030&r2=44031&view=diff
==============================================================================
--- llvm/trunk/utils/buildit/build_llvm (original)
+++ llvm/trunk/utils/buildit/build_llvm Mon Nov 12 17:55:19 2007
@@ -106,21 +106,6 @@
exit 1
fi
-# Figure out how many make processes to run.
-SYSCTL=`sysctl -n hw.activecpu`
-
-# hw.activecpu only available in 10.2.6 and later
-if [ -z "$SYSCTL" ]; then
- SYSCTL=`sysctl -n hw.ncpu`
-fi
-
-# sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot. Builders
-# can default to 2, since even if they are single processor, nothing else is
-# running on the machine.
-if [ -z "$SYSCTL" ]; then
- SYSCTL=2
-fi
-
################################################################################
# Construct the actual destination root, by copying stuff from $DIR/dst-* to
# $DEST_DIR, with occasional 'lipo' commands.
@@ -184,6 +169,21 @@
################################################################################
# Create SYM_DIR with information required for debugging.
+# Figure out how many make processes to run.
+SYSCTL=`sysctl -n hw.activecpu`
+
+# hw.activecpu only available in 10.2.6 and later
+if [ -z "$SYSCTL" ]; then
+ SYSCTL=`sysctl -n hw.ncpu`
+fi
+
+# sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot. Builders
+# can default to 2, since even if they are single processor, nothing else is
+# running on the machine.
+if [ -z "$SYSCTL" ]; then
+ SYSCTL=2
+fi
+
cd $SYM_DIR || exit 1
# Clean out SYM_DIR in case -noclean was passed to buildit.
From kremenek at apple.com Mon Nov 12 18:13:57 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Tue, 13 Nov 2007 00:13:57 -0000
Subject: [llvm-commits] [llvm] r44032 - in /llvm/trunk/include/llvm/Bitcode:
Deserialize.h Serialize.h
Message-ID: <200711130013.lAD0DvlK031505@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Nov 12 18:13:57 2007
New Revision: 44032
URL: http://llvm.org/viewvc/llvm-project?rev=44032&view=rev
Log:
Fixed bug with inconsistent serialization/deserialization in matching
calls to BatchEmitOwnedPtrs and BatchReadOwnedPtrs.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
llvm/trunk/include/llvm/Bitcode/Serialize.h
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44032&r1=44031&r2=44032&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Mon Nov 12 18:13:57 2007
@@ -228,6 +228,37 @@
Ptrs[i] = p;
}
+ }
+
+ template
+ void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs,
+ T2*& P2, T3*& P3,
+ bool A1=true, bool A2=true, bool A3=true) {
+
+ BatchIDVec.clear();
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ BatchIDVec.push_back(ReadPtrID());
+
+ SerializedPtrID ID2 = ReadPtrID();
+ SerializedPtrID ID3 = ReadPtrID();
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i) {
+ SerializedPtrID& PtrID = BatchIDVec[i];
+
+ T1* p = PtrID ? SerializeTrait::Materialize(*this) : NULL;
+
+ if (PtrID && A1)
+ RegisterPtr(PtrID,p);
+
+ Ptrs[i] = p;
+ }
+
+ P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
+ if (ID2 && A2) RegisterPtr(ID2,P2);
+
+ P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
+ if (ID3 && A3) RegisterPtr(ID3,P3);
}
template
Modified: llvm/trunk/include/llvm/Bitcode/Serialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialize.h?rev=44032&r1=44031&r2=44032&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Serialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Serialize.h Mon Nov 12 18:13:57 2007
@@ -93,6 +93,23 @@
for (unsigned i = 0; i < NumPtrs; ++i)
if (Ptrs[i]) SerializeTrait::Emit(*this,*Ptrs[i]);
}
+
+ template
+ void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs,
+ T2* p2, T3* p3) {
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ EmitPtr(Ptrs[i]);
+
+ EmitPtr(p2);
+ EmitPtr(p3);
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ if (Ptrs[i]) SerializeTrait::Emit(*this,*Ptrs[i]);
+
+ if (p2) SerializeTrait::Emit(*this,*p2);
+ if (p3) SerializeTrait::Emit(*this,*p3);
+ }
bool isRegistered(const void* p) const;
From kremenek at apple.com Mon Nov 12 18:25:09 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Tue, 13 Nov 2007 00:25:09 -0000
Subject: [llvm-commits] [llvm] r44034 - in /llvm/trunk/include/llvm/Bitcode:
Deserialize.h Serialization.h
Message-ID: <200711130025.lAD0P9QQ032004@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Nov 12 18:25:08 2007
New Revision: 44034
URL: http://llvm.org/viewvc/llvm-project?rev=44034&view=rev
Log:
Renamed serialization method "Materialize" to "Create". This is an API change.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
llvm/trunk/include/llvm/Bitcode/Serialization.h
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44034&r1=44033&r2=44034&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Mon Nov 12 18:25:08 2007
@@ -152,8 +152,8 @@
}
template
- inline T* Materialize() {
- return SerializeTrait::Materialize(*this);
+ inline T* Create() {
+ return SerializeTrait::Create(*this);
}
char* ReadCStr(char* cstr = NULL, unsigned MaxLen=0, bool isNullTerm=true);
@@ -166,7 +166,7 @@
if (!PtrID)
return NULL;
- T* x = SerializeTrait::Materialize(*this);
+ T* x = SerializeTrait::Create(*this);
if (AutoRegister)
RegisterPtr(PtrID,x);
@@ -186,10 +186,10 @@
SerializedPtrID ID1 = ReadPtrID();
SerializedPtrID ID2 = ReadPtrID();
- P1 = (ID1) ? SerializeTrait::Materialize(*this) : NULL;
+ P1 = (ID1) ? SerializeTrait::Create(*this) : NULL;
if (ID1 && A1) RegisterPtr(ID1,P1);
- P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
+ P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
if (ID2 && A2) RegisterPtr(ID2,P2);
}
@@ -201,13 +201,13 @@
SerializedPtrID ID2 = ReadPtrID();
SerializedPtrID ID3 = ReadPtrID();
- P1 = (ID1) ? SerializeTrait::Materialize(*this) : NULL;
+ P1 = (ID1) ? SerializeTrait::Create(*this) : NULL;
if (ID1 && A1) RegisterPtr(ID1,P1);
- P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
+ P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
if (ID2 && A2) RegisterPtr(ID2,P2);
- P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
+ P3 = (ID3) ? SerializeTrait::Create(*this) : NULL;
if (ID3 && A3) RegisterPtr(ID3,P3);
}
@@ -221,7 +221,7 @@
for (unsigned i = 0; i < NumPtrs; ++i) {
SerializedPtrID& PtrID = BatchIDVec[i];
- T* p = PtrID ? SerializeTrait::Materialize(*this) : NULL;
+ T* p = PtrID ? SerializeTrait::Create(*this) : NULL;
if (PtrID && AutoRegister)
RegisterPtr(PtrID,p);
@@ -246,7 +246,7 @@
for (unsigned i = 0; i < NumT1Ptrs; ++i) {
SerializedPtrID& PtrID = BatchIDVec[i];
- T1* p = PtrID ? SerializeTrait::Materialize(*this) : NULL;
+ T1* p = PtrID ? SerializeTrait::Create(*this) : NULL;
if (PtrID && A1)
RegisterPtr(PtrID,p);
@@ -254,10 +254,10 @@
Ptrs[i] = p;
}
- P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
+ P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
if (ID2 && A2) RegisterPtr(ID2,P2);
- P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
+ P3 = (ID3) ? SerializeTrait::Create(*this) : NULL;
if (ID3 && A3) RegisterPtr(ID3,P3);
}
@@ -273,7 +273,8 @@
template
- void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID, bool AllowBackpatch = true) {
+ void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID,
+ bool AllowBackpatch = true) {
ReadUIntPtr(reinterpret_cast(PtrRef), PtrID, AllowBackpatch);
}
Modified: llvm/trunk/include/llvm/Bitcode/Serialization.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialization.h?rev=44034&r1=44033&r2=44034&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Serialization.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Serialization.h Mon Nov 12 18:25:08 2007
@@ -37,7 +37,7 @@
struct SerializeTrait {
static inline void Emit(Serializer& S, const T& X) { X.Emit(S); }
static inline void Read(Deserializer& D, T& X) { X.Read(D); }
- static inline T* Materialize(Deserializer& D) { return T::Materialize(D); }
+ static inline T* Create(Deserializer& D) { return T::Create(D); }
};
#define SERIALIZE_INT_TRAIT(TYPE)\
From isanbard at gmail.com Mon Nov 12 18:44:26 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 00:44:26 -0000
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/
lib/Target/Alpha/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/
lib/Target/Sparc/ lib/Target/X86/
Message-ID: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
Author: void
Date: Mon Nov 12 18:44:25 2007
New Revision: 44037
URL: http://llvm.org/viewvc/llvm-project?rev=44037&view=rev
Log:
Unify CALLSEQ_{START,END}. They take 4 parameters: the chain, two stack
adjustment fields, and an optional flag. If there is a "dynamic_stackalloc" in
the code, make sure that it's bracketed by CALLSEQ_START and CALLSEQ_END. If
not, then there is the potential for the stack to be changed while the stack's
being used by another instruction (like a call).
This can only result in tears...
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp
llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86InstrInfo.td
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Nov 12 18:44:25 2007
@@ -275,6 +275,20 @@
return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
}
+ /// getCALLSEQ_END - Return a new CALLSEQ_END node, which always must have a
+ /// flag result (to ensure it's not CSE'd).
+ SDOperand getCALLSEQ_END(SDOperand Chain, SDOperand Op1, SDOperand Op2,
+ SDOperand InFlag) {
+ SDVTList NodeTys = getVTList(MVT::Other, MVT::Flag);
+ SmallVector Ops;
+ Ops.push_back(Chain);
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(InFlag);
+ return getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0],
+ Ops.size() - (InFlag.Val == 0 ? 1 : 0));
+ }
+
/// getNode - Gets or creates the specified node.
///
SDOperand getNode(unsigned Opcode, MVT::ValueType VT);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 12 18:44:25 2007
@@ -1142,12 +1142,20 @@
// The only option for this is to custom lower it.
Tmp3 = TLI.LowerOperation(Result.getValue(0), DAG);
assert(Tmp3.Val && "Target didn't custom lower this node!");
- assert(Tmp3.Val->getNumValues() == Result.Val->getNumValues() &&
+
+ // The number of incoming and outgoing values should match; unless the final
+ // outgoing value is a flag.
+ assert((Tmp3.Val->getNumValues() == Result.Val->getNumValues() ||
+ (Tmp3.Val->getNumValues() == Result.Val->getNumValues() + 1 &&
+ Tmp3.Val->getValueType(Tmp3.Val->getNumValues() - 1) ==
+ MVT::Flag)) &&
"Lowering call/formal_arguments produced unexpected # results!");
// Since CALL/FORMAL_ARGUMENTS nodes produce multiple values, make sure to
// remember that we legalized all of them, so it doesn't get relegalized.
for (unsigned i = 0, e = Tmp3.Val->getNumValues(); i != e; ++i) {
+ if (Tmp3.Val->getValueType(i) == MVT::Flag)
+ continue;
Tmp1 = LegalizeOp(Tmp3.getValue(i));
if (Op.ResNo == i)
Tmp2 = Tmp1;
@@ -1472,6 +1480,12 @@
assert(SPReg && "Target cannot require DYNAMIC_STACKALLOC expansion and"
" not tell us which reg is the stack pointer!");
SDOperand Chain = Tmp1.getOperand(0);
+
+ // Chain the dynamic stack allocation so that it doesn't modify the stack
+ // pointer when other instructions are using the stack.
+ Chain = DAG.getCALLSEQ_START(Chain,
+ DAG.getConstant(0, TLI.getPointerTy()));
+
SDOperand Size = Tmp2.getOperand(1);
SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, VT);
Chain = SP.getValue(1);
@@ -1482,7 +1496,14 @@
SP = DAG.getNode(ISD::AND, VT, SP,
DAG.getConstant(-(uint64_t)Align, VT));
Tmp1 = DAG.getNode(ISD::SUB, VT, SP, Size); // Value
- Tmp2 = DAG.getCopyToReg(Chain, SPReg, Tmp1); // Output chain
+ Chain = DAG.getCopyToReg(Chain, SPReg, Tmp1); // Output chain
+
+ Tmp2 =
+ DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(0, TLI.getPointerTy()),
+ DAG.getConstant(0, TLI.getPointerTy()),
+ SDOperand());
+
Tmp1 = LegalizeOp(Tmp1);
Tmp2 = LegalizeOp(Tmp2);
break;
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -605,10 +605,10 @@
Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
InFlag = Chain.getValue(1);
- SDOperand CSOps[] = { Chain, DAG.getConstant(NumBytes, MVT::i32), InFlag };
- Chain = DAG.getNode(ISD::CALLSEQ_END,
- DAG.getNodeValueTypes(MVT::Other, MVT::Flag),
- ((RetVT != MVT::Other) ? 2 : 1), CSOps, 3);
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, MVT::i32),
+ DAG.getConstant(0, MVT::i32),
+ InFlag);
if (RetVT != MVT::Other)
InFlag = Chain.getValue(1);
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 12 18:44:25 2007
@@ -17,7 +17,9 @@
//
// Type profiles.
-def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
+def SDT_ARMCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
+def SDT_ARMCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
@@ -45,10 +47,10 @@
def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
-def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq,
+def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq_start,
[SDNPHasChain, SDNPOutFlag]>;
-def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
+def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq_end,
+ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def ARMcall : SDNode<"ARMISD::CALL", SDT_ARMcall,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
@@ -663,9 +665,9 @@
let Defs = [SP], Uses = [SP] in {
def ADJCALLSTACKUP :
-PseudoInst<(outs), (ins i32imm:$amt, pred:$p),
- "@ ADJCALLSTACKUP $amt",
- [(ARMcallseq_end imm:$amt)]>;
+PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2, pred:$p),
+ "@ ADJCALLSTACKUP $amt1",
+ [(ARMcallseq_end imm:$amt1, imm:$amt2)]>;
def ADJCALLSTACKDOWN :
PseudoInst<(outs), (ins i32imm:$amt, pred:$p),
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Mon Nov 12 18:44:25 2007
@@ -162,9 +162,9 @@
let Defs = [SP], Uses = [SP] in {
def tADJCALLSTACKUP :
-PseudoInst<(outs), (ins i32imm:$amt),
- "@ tADJCALLSTACKUP $amt",
- [(ARMcallseq_end imm:$amt)]>, Requires<[IsThumb]>;
+PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2),
+ "@ tADJCALLSTACKUP $amt1",
+ [(ARMcallseq_end imm:$amt1, imm:$amt2)]>, Requires<[IsThumb]>;
def tADJCALLSTACKDOWN :
PseudoInst<(outs), (ins i32imm:$amt),
Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Mon Nov 12 18:44:25 2007
@@ -769,10 +769,13 @@
bool isThumb = AFI->isThumbFunction();
ARMCC::CondCodes Pred = isThumb
? ARMCC::AL : (ARMCC::CondCodes)Old->getOperand(1).getImmedValue();
- unsigned PredReg = isThumb ? 0 : Old->getOperand(2).getReg();
if (Opc == ARM::ADJCALLSTACKDOWN || Opc == ARM::tADJCALLSTACKDOWN) {
+ // Note: PredReg is operand 2 for ADJCALLSTACKDOWN.
+ unsigned PredReg = isThumb ? 0 : Old->getOperand(2).getReg();
emitSPUpdate(MBB, I, -Amount, Pred, PredReg, isThumb, TII);
} else {
+ // Note: PredReg is operand 3 for ADJCALLSTACKUP.
+ unsigned PredReg = isThumb ? 0 : Old->getOperand(3).getReg();
assert(Opc == ARM::ADJCALLSTACKUP || Opc == ARM::tADJCALLSTACKUP);
emitSPUpdate(MBB, I, Amount, Pred, PredReg, isThumb, TII);
}
Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -374,8 +374,10 @@
Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end());
SDOperand TheCall = DAG.getNode(AlphaISD::CALL, RetVals, &Ops[0], Ops.size());
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(NumBytes, getPointerTy()));
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()),
+ DAG.getConstant(0, getPointerTy()),
+ SDOperand());
SDOperand RetVal = TheCall;
if (RetTyVT != ActualRetTyVT) {
Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Mon Nov 12 18:44:25 2007
@@ -30,11 +30,14 @@
[SDNPHasChain, SDNPOptInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_AlphaCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i64> ]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AlphaCallSeq,
+def SDT_AlphaCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i64> ]>;
+def SDT_AlphaCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i64>,
+ SDTCisVT<1, i64> ]>;
+
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AlphaCallSeq_start,
[SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AlphaCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AlphaCallSeq_end,
+ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
//********************
//Paterns for matching
@@ -148,11 +151,14 @@
def WTF : PseudoInstAlpha<(outs), (ins variable_ops), "#wtf", [], s_pseudo>;
let isLoad = 1, hasCtrlDep = 1, Defs = [R30], Uses = [R30] in {
-def ADJUSTSTACKUP : PseudoInstAlpha<(outs), (ins s64imm:$amt), "; ADJUP $amt",
+def ADJUSTSTACKUP : PseudoInstAlpha<(outs), (ins s64imm:$amt),
+ "; ADJUP $amt",
[(callseq_start imm:$amt)], s_pseudo>;
-def ADJUSTSTACKDOWN : PseudoInstAlpha<(outs), (ins s64imm:$amt), "; ADJDOWN $amt",
- [(callseq_end imm:$amt)], s_pseudo>;
+def ADJUSTSTACKDOWN : PseudoInstAlpha<(outs), (ins s64imm:$amt1, s64imm:$amt2),
+ "; ADJDOWN $amt1",
+ [(callseq_end imm:$amt1, imm:$amt2)], s_pseudo>;
}
+
def ALTENT : PseudoInstAlpha<(outs), (ins s64imm:$TARGET), "$$$TARGET..ng:\n", [], s_pseudo>;
def PCLABEL : PseudoInstAlpha<(outs), (ins s64imm:$num), "PCMARKER_$num:\n",[], s_pseudo>;
def MEMLABEL : PseudoInstAlpha<(outs), (ins s64imm:$i, s64imm:$j, s64imm:$k, s64imm:$m),
Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -535,9 +535,10 @@
}
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(NumBytes, getPointerTy()));
-
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()),
+ DAG.getConstant(0, getPointerTy()),
+ SDOperand());
return std::make_pair(RetVal, Chain);
}
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -399,12 +399,10 @@
}
// Create the CALLSEQ_END node.
- NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- Ops.clear();
- Ops.push_back(Chain);
- Ops.push_back(DAG.getConstant(NumBytes, getPointerTy()));
- Ops.push_back(InFlag);
- Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], Ops.size());
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()),
+ DAG.getConstant(0, getPointerTy()),
+ InFlag);
InFlag = Chain.getValue(1);
// Handle result values, copying them out of physregs into vregs that we
Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Nov 12 18:44:25 2007
@@ -34,11 +34,14 @@
SDNPOptInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_MipsCallSeq : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_MipsCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeq,
+def SDT_MipsCallSeq_start : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
+def SDT_MipsCallSeq_end : SDTypeProfile<0, 2, [SDTCisVT<0, i32>,
+ SDTCisVT<1, i32>]>;
+
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_MipsCallSeq_start,
[SDNPHasChain, SDNPOutFlag]>;
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeq_end,
+ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
//===----------------------------------------------------------------------===//
// Mips Instruction Predicate Definitions.
@@ -348,9 +351,9 @@
def ADJCALLSTACKDOWN : PseudoInstMips<(outs), (ins uimm16:$amt),
"!ADJCALLSTACKDOWN $amt",
[(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : PseudoInstMips<(outs), (ins uimm16:$amt),
- "!ADJCALLSTACKUP $amt",
- [(callseq_end imm:$amt)]>;
+def ADJCALLSTACKUP : PseudoInstMips<(outs), (ins uimm16:$amt1, uimm16:$amt2),
+ "!ADJCALLSTACKUP $amt1",
+ [(callseq_end imm:$amt1, imm:$amt2)]>;
}
def IMPLICIT_DEF_CPURegs : PseudoInstMips<(outs CPURegs:$dst), (ins),
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -1816,6 +1816,13 @@
Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
InFlag = Chain.getValue(1);
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, PtrVT),
+ DAG.getConstant(0, PtrVT),
+ InFlag);
+ if (Op.Val->getValueType(0) != MVT::Other)
+ InFlag = Chain.getValue(1);
+
SDOperand ResultVals[3];
unsigned NumResults = 0;
NodeTys.clear();
@@ -1878,8 +1885,6 @@
break;
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(NumBytes, PtrVT));
NodeTys.push_back(MVT::Other);
// If the function returns void, just return the chain.
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Mon Nov 12 18:44:25 2007
@@ -23,8 +23,9 @@
def SDT_PPCShiftOp : SDTypeProfile<1, 2, [ // PPCshl, PPCsra, PPCsrl
SDTCisVT<0, i32>, SDTCisVT<1, i32>, SDTCisVT<2, i32>
]>;
-def SDT_PPCCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-
+def SDT_PPCCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
+def SDT_PPCCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
def SDT_PPCvperm : SDTypeProfile<1, 3, [
SDTCisVT<3, v16i8>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>
]>;
@@ -90,10 +91,10 @@
def PPCstd_32 : SDNode<"PPCISD::STD_32" , SDTStore, [SDNPHasChain]>;
// These are target-independent nodes, but have target-specific formats.
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq,
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq_start,
[SDNPHasChain, SDNPOutFlag]>;
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq_end,
+ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
def PPCcall_Macho : SDNode<"PPCISD::CALL_Macho", SDT_PPCCall,
@@ -318,9 +319,9 @@
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins u16imm:$amt),
"${:comment} ADJCALLSTACKDOWN",
[(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm:$amt),
+def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm:$amt1, u16imm:$amt2),
"${:comment} ADJCALLSTACKUP",
- [(callseq_end imm:$amt)]>;
+ [(callseq_end imm:$amt1, imm:$amt2)]>;
}
def UPDATE_VRSAVE : Pseudo<(outs GPRC:$rD), (ins GPRC:$rS),
Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Mon Nov 12 18:44:25 2007
@@ -675,9 +675,10 @@
}
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(ArgsSize, getPointerTy()));
-
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(ArgsSize, getPointerTy()),
+ DAG.getConstant(0, getPointerTy()),
+ SDOperand());
return std::make_pair(RetVal, Chain);
}
Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Mon Nov 12 18:44:25 2007
@@ -114,11 +114,14 @@
def SPselectfcc : SDNode<"SPISD::SELECT_FCC", SDTSPselectcc, [SDNPInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_SPCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPCallSeq,
+def SDT_SPCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
+def SDT_SPCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
+
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPCallSeq_start,
[SDNPHasChain, SDNPOutFlag]>;
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPCallSeq_end,
+ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def SDT_SPCall : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
def call : SDNode<"SPISD::CALL", SDT_SPCall,
@@ -205,9 +208,9 @@
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt),
"!ADJCALLSTACKDOWN $amt",
[(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt),
- "!ADJCALLSTACKUP $amt",
- [(callseq_end imm:$amt)]>;
+def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
+ "!ADJCALLSTACKUP $amt1",
+ [(callseq_end imm:$amt1, imm:$amt2)]>;
}
def IMPLICIT_DEF_Int : Pseudo<(outs IntRegs:$dst), (ins),
"!IMPLICIT_DEF $dst",
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Nov 12 18:44:25 2007
@@ -1131,14 +1131,12 @@
// This is common for Darwin/X86, Linux & Mingw32 targets.
NumBytesForCalleeToPush = isSRet ? 4 : 0;
}
-
- NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- Ops.clear();
- Ops.push_back(Chain);
- Ops.push_back(DAG.getConstant(NumBytes, getPointerTy()));
- Ops.push_back(DAG.getConstant(NumBytesForCalleeToPush, getPointerTy()));
- Ops.push_back(InFlag);
- Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], Ops.size());
+
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()),
+ DAG.getConstant(NumBytesForCalleeToPush,
+ getPointerTy()),
+ InFlag);
InFlag = Chain.getValue(1);
// Handle result values, copying them out of physregs into vregs that we
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=44037&r1=44036&r2=44037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Nov 12 18:44:25 2007
@@ -253,7 +253,8 @@
// Pessimistically assume ADJCALLSTACKDOWN / ADJCALLSTACKUP will become sub / add
// which can clobber EFLAGS.
let Defs = [ESP, EFLAGS], Uses = [ESP] in {
-def ADJCALLSTACKDOWN : I<0, Pseudo, (outs), (ins i32imm:$amt), "#ADJCALLSTACKDOWN",
+def ADJCALLSTACKDOWN : I<0, Pseudo, (outs), (ins i32imm:$amt),
+ "#ADJCALLSTACKDOWN",
[(X86callseq_start imm:$amt)]>;
def ADJCALLSTACKUP : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2),
"#ADJCALLSTACKUP",
From evan.cheng at apple.com Mon Nov 12 19:23:47 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 12 Nov 2007 17:23:47 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/
lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/
lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/
lib/Target/X86/
In-Reply-To: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
Message-ID: <8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
On Nov 12, 2007, at 4:44 PM, Bill Wendling wrote:
>
> ======================================================================
> ========
> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 12 18:44:25 2007
> @@ -17,7 +17,9 @@
> //
>
> // Type profiles.
> -def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
> +def SDT_ARMCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
> +def SDT_ARMCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
> + SDTCisVT<1, i32> ]>;
>
> def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
>
> @@ -45,10 +47,10 @@
> def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
> def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
>
> -def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq,
> +def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START",
> SDT_ARMCallSeq_start,
> [SDNPHasChain, SDNPOutFlag]>;
> -def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq,
> - [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
> +def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END",
> SDT_ARMCallSeq_end,
> + [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
>
Please unify these as well by adding callseq_start / callseq_down to
TargetSelectionDAG.td and use those instead.
Also, where are the test case(s)? :-)
Evan
From isanbard at gmail.com Mon Nov 12 19:35:02 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 12 Nov 2007 17:35:02 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/
lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/
lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/
lib/Target/X86/
In-Reply-To: <8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
Message-ID: <16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
On Nov 12, 2007 5:23 PM, Evan Cheng wrote:
>
> On Nov 12, 2007, at 4:44 PM, Bill Wendling wrote:
>
> > // Type profiles.
> > -def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
> > +def SDT_ARMCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
> > +def SDT_ARMCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
> > + SDTCisVT<1, i32> ]>;
> >
> > def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
> >
> > @@ -45,10 +47,10 @@
> > def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
> > def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
> >
> > -def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq,
> > +def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START",
> > SDT_ARMCallSeq_start,
> > [SDNPHasChain, SDNPOutFlag]>;
> > -def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq,
> > - [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
> > +def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END",
> > SDT_ARMCallSeq_end,
> > + [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
> >
>
> Please unify these as well by adding callseq_start / callseq_down to
> TargetSelectionDAG.td and use those instead.
>
Okay.
> Also, where are the test case(s)? :-)
>
I knew someone would ask that. :-)
It's hard to come up with a testcase because I need to check multiple
lines of output to make sure that the stack pointer isn't modified
while a call is taking place. Does anyone know how to do this?
-bw
From dalej at apple.com Mon Nov 12 19:45:31 2007
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 12 Nov 2007 17:45:31 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/
lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/
lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/
lib/Target/Sparc/ lib/Target/X86/
In-Reply-To: <16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
<16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
Message-ID:
On Nov 12, 2007, at 5:35 PM, Bill Wendling wrote:
> On Nov 12, 2007 5:23 PM, Evan Cheng wrote:
>
>> Also, where are the test case(s)? :-)
>>
> I knew someone would ask that. :-)
>
> It's hard to come up with a testcase because I need to check multiple
> lines of output to make sure that the stack pointer isn't modified
> while a call is taking place. Does anyone know how to do this?
dejagnu is traditionally deficient here (it's hard to test for
scheduler bugs, too).
You might do something with grep -n, which prints line numbers, but
that's fragile
and I don't know how portable it is.
From isanbard at gmail.com Mon Nov 12 19:50:18 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 01:50:18 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44040 - in /llvm-gcc-4.2/trunk:
GNUmakefile build_gcc
Message-ID: <200711130150.lAD1oIoJ004157@zion.cs.uiuc.edu>
Author: void
Date: Mon Nov 12 19:50:18 2007
New Revision: 44040
URL: http://llvm.org/viewvc/llvm-project?rev=44040&view=rev
Log:
Sync with 4.0 branch
Modified:
llvm-gcc-4.2/trunk/GNUmakefile
llvm-gcc-4.2/trunk/build_gcc
Modified: llvm-gcc-4.2/trunk/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/GNUmakefile?rev=44040&r1=44039&r2=44040&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/GNUmakefile (original)
+++ llvm-gcc-4.2/trunk/GNUmakefile Mon Nov 12 19:50:18 2007
@@ -39,7 +39,7 @@
ifndef DISABLE_LLVM
ENABLE_LLVM = true
# LLVM gets installed into /usr/local, not /usr.
-PREFIX = /usr/local/llvm-gcc-install
+PREFIX = /Developer/usr/llvm-gcc-4.2
else
ENABLE_LLVM = false
endif
Modified: llvm-gcc-4.2/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=44040&r1=44039&r2=44040&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/build_gcc (original)
+++ llvm-gcc-4.2/trunk/build_gcc Mon Nov 12 19:50:18 2007
@@ -68,9 +68,8 @@
# The nineth parameter is the subversion number of the submission, e.g. 03.
LLVM_GCC_SUBMIT_SUBVERSION="$9"
-# LLVM_INSTALL_PREFIX - This is the prefix where LLVM tools/headers/libraries
-# and the llvm-gcc/llvm-g++ symlinks get installed.
-LLVM_INSTALL_PREFIX=/usr/local
+# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
+LLVM_BIN_DIR=/Developer/usr/bin
# The current working directory is where the build will happen.
@@ -90,13 +89,6 @@
# to be built. It's VERS but only up to the second '.' (if there is one).
MAJ_VERS=`echo $VERS | sed 's/\([0-9]*\.[0-9]*\)[.-].*/\1/'`
-# LLVM LOCAL begin
-if [ "$ENABLE_LLVM" == true ]; then
- # Add suffix.
- MAJ_VERS="${MAJ_VERS}-llvm"
-fi
-# LLVM LOCAL end
-
# This is the libstdc++ version to use.
LIBSTDCXX_VERSION=4.0.0
@@ -127,7 +119,8 @@
--prefix=$DEST_ROOT \
--mandir=\${prefix}/share/man \
--enable-languages=c,objc,c++,obj-c++ \
- --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
+ --program-prefix=llvm- \
+ --program-suffix=-$MAJ_VERS \
--with-gxx-include-dir=/usr/include/c++/$LIBSTDCXX_VERSION \
--with-slibdir=/usr/lib \
--build=$BUILD-apple-darwin$DARWIN_VERS"
@@ -335,10 +328,10 @@
$DIR/dst-*-$TARG0$DEST_ROOT/bin/*gcov* || exit 1
# The fully-named drivers, which have the same target on every host.
for t in $TARGETS ; do
- lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS -create \
- $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1
- lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-$VERS -create \
- $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++* || exit 1
+ lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS -create \
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1
+ lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS -create \
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1
done
# lib
@@ -413,47 +406,47 @@
# Add extra man page symlinks for 'c++' and for arch-specific names.
MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
-ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/c++-$MAJ_VERS.1 || exit 1
+ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/llvm-c++-$MAJ_VERS.1 || exit 1
for t in $TARGETS ; do
- ln -f $MDIR/gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcc-$VERS.1 \
+ ln -f $MDIR/llvm-gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS.1 \
|| exit 1
- ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-g++-$VERS.1 \
+ ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS.1 \
|| exit 1
done
# Build driver-driver using fully-named drivers
for h in $HOSTS ; do
- $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
+ $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS \
$ORIG_SRC_DIR/driverdriver.c \
- -DPDN="\"-apple-darwin$DARWIN_VERS-gcc-$VERS\"" \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
-I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
-L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
-L$DIR/obj-$h-$BUILD/libiberty/ \
- -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gcc-$MAJ_VERS || exit 1
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcc-$MAJ_VERS || exit 1
- $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
+ $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS \
$ORIG_SRC_DIR/driverdriver.c \
- -DPDN="\"-apple-darwin$DARWIN_VERS-g++-$VERS\"" \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
-I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
-L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
-L$DIR/obj-$h-$BUILD/libiberty/ \
- -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-g++-$MAJ_VERS || exit 1
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-g++-$MAJ_VERS || exit 1
done
-lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-$MAJ_VERS -create \
- $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
+lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-gcc-$MAJ_VERS -create \
+ $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
-lipo -output $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS -create \
- $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS -create \
+ $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
-ln -f $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/c++-$MAJ_VERS || exit 1
+ln -f $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/llvm-c++-$MAJ_VERS || exit 1
-rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
-rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
+rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
########################################
# Create SYM_DIR with information required for debugging.
@@ -482,8 +475,33 @@
find $DEST_DIR -perm -0111 \! -name fixinc.sh \
\! -name mkheaders \! -name libstdc++.dylib -type f -print \
| xargs strip || exit 1
-find $DEST_DIR -name \*.a -print | xargs strip -SX || exit 1
-find $DEST_DIR -name \*.a -print | xargs ranlib || exit 1
+# APPLE LOCAL begin LLVM - Strip with -Sx instead of -SX
+find $DEST_DIR \( -name \*.a -or -name \*.dylib \) \
+ \! -name libgcc_s.10.*.dylib -type f -print \
+ | xargs strip -SX || exit 1
+# APPLE LOCAL end LLVM - Strip with -Sx instead of -SX
+find $DEST_DIR -name \*.a -type f -print \
+ | xargs ranlib || exit 1
+
+# APPLE LOCAL begin LLVM
+# Set up the llvm-gcc/llvm-g++ symlinks.
+mkdir -p $DEST_DIR$LLVM_BIN_DIR
+cd $DEST_DIR$LLVM_BIN_DIR
+ln -s -f ../../../$DEST_ROOT/bin/llvm-gcc-$MAJ_VERS llvm-gcc-$MAJ_VERS || exit 1
+ln -s -f ../../../$DEST_ROOT/bin/llvm-g++-$MAJ_VERS llvm-g++-$MAJ_VERS || exit 1
+
+ # Copy one of the libllvmgcc.dylib's up to libexec/gcc.
+cp $DEST_DIR/$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS/libllvmgcc.dylib \
+ $DEST_DIR/$DEST_ROOT/libexec/gcc/
+
+ # Replace the installed ones with symlinks to the common one.
+for t in $TARGETS ; do
+ cd $DEST_DIR/$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/
+ rm libllvmgcc.dylib
+ ln -s ../../libllvmgcc.dylib
+done
+# APPLE LOCAL end LLVM
+
find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1
chgrp -h -R wheel $DEST_DIR
chgrp -R wheel $DEST_DIR
From isanbard at gmail.com Mon Nov 12 21:00:56 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 12 Nov 2007 19:00:56 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/
lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/
lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/
lib/Target/Sparc/ lib/Target/X86/
In-Reply-To:
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
<16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
Message-ID: <8F189F78-1B37-4AF1-8E7C-AB3F7FAD917A@gmail.com>
On Nov 12, 2007, at 5:45 PM, Dale Johannesen wrote:
>
> On Nov 12, 2007, at 5:35 PM, Bill Wendling wrote:
>
>> On Nov 12, 2007 5:23 PM, Evan Cheng wrote:
>>
>>> Also, where are the test case(s)? :-)
>>>
>> I knew someone would ask that. :-)
>>
>> It's hard to come up with a testcase because I need to check multiple
>> lines of output to make sure that the stack pointer isn't modified
>> while a call is taking place. Does anyone know how to do this?
>
> dejagnu is traditionally deficient here (it's hard to test for
> scheduler bugs, too).
> You might do something with grep -n, which prints line numbers, but
> that's fragile
> and I don't know how portable it is.
>
A grep with line numbers was a way I could think to do this also. I
might be able to hack together a script to check that the stack
pointer isn't modified during a function call...it would be a bit
tricky to get correct, though. Maybe I could add something to llvm-
test that would run successfully only when compiled correctly?
-bw
From evan.cheng at apple.com Mon Nov 12 21:20:51 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 12 Nov 2007 19:20:51 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/
lib/Target/Alpha/ lib/Target/IA64/ lib/Target/Mips/
lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/
In-Reply-To: <8F189F78-1B37-4AF1-8E7C-AB3F7FAD917A@gmail.com>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
<16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
<8F189F78-1B37-4AF1-8E7C-AB3F7FAD917A@gmail.com>
Message-ID: <285C1EE1-2E2F-4A60-B732-D6356642DE7D@apple.com>
Can you use prcontext? There are several examples in the current test
suite.
Evan
On Nov 12, 2007, at 7:00 PM, Bill Wendling wrote:
> On Nov 12, 2007, at 5:45 PM, Dale Johannesen wrote:
>
>>
>> On Nov 12, 2007, at 5:35 PM, Bill Wendling wrote:
>>
>>> On Nov 12, 2007 5:23 PM, Evan Cheng wrote:
>>>
>>>> Also, where are the test case(s)? :-)
>>>>
>>> I knew someone would ask that. :-)
>>>
>>> It's hard to come up with a testcase because I need to check
>>> multiple
>>> lines of output to make sure that the stack pointer isn't modified
>>> while a call is taking place. Does anyone know how to do this?
>>
>> dejagnu is traditionally deficient here (it's hard to test for
>> scheduler bugs, too).
>> You might do something with grep -n, which prints line numbers, but
>> that's fragile
>> and I don't know how portable it is.
>>
> A grep with line numbers was a way I could think to do this also. I
> might be able to hack together a script to check that the stack
> pointer isn't modified during a function call...it would be a bit
> tricky to get correct, though. Maybe I could add something to llvm-
> test that would run successfully only when compiled correctly?
>
> -bw
> _______________________________________________
> 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 Nov 12 23:23:00 2007
From: dpatel at apple.com (Devang Patel)
Date: Tue, 13 Nov 2007 05:23:00 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44042 - /llvm-gcc-4.0/trunk/build_gcc
Message-ID: <200711130523.lAD5N0pP022268@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Nov 12 23:22:59 2007
New Revision: 44042
URL: http://llvm.org/viewvc/llvm-project?rev=44042&view=rev
Log:
Fix cross compiler build.
Modified:
llvm-gcc-4.0/trunk/build_gcc
Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=44042&r1=44041&r2=44042&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Mon Nov 12 23:22:59 2007
@@ -157,7 +157,7 @@
--mandir=$DEST_ROOT/share/man \
--enable-languages=c,objc,c++,obj-c++ \
--program-prefix=llvm- \
- --program-suffix=-$MAJ_VERS \
+ --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
$LIBSTDCXX_CONFIG_OPTION \
--with-slibdir=/usr/lib \
--enable-llvm=/usr/local/ \
@@ -211,6 +211,11 @@
make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+# Add the compiler we just built to the path, giving it appropriate names.
+# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT
+D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
+ln -f $D/llvm-gcc $D/gcc || exit 1
+ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT
PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
@@ -370,10 +375,10 @@
for t in $TARGETS ; do
# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT
lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS -create \
- $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc || exit 1
# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT
lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS -create \
- $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++ || exit 1
done
# lib
@@ -418,17 +423,17 @@
# Add extra man page symlinks for 'c++' and for arch-specific names.
MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
-ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/llvm-c++-$MAJ_VERS.1 || exit 1
+ln -f $MDIR/llvm-g++.1 $MDIR/llvm-c++.1 || exit 1
for t in $TARGETS ; do
- ln -f $MDIR/llvm-gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS.1 \
+ ln -f $MDIR/llvm-gcc.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc.1 \
|| exit 1
- ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS.1 \
+ ln -f $MDIR/llvm-g++.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++.1 \
|| exit 1
done
# Build driver-driver using fully-named drivers
for h in $HOSTS ; do
- $h-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS \
+ $h-apple-darwin$DARWIN_VERS-gcc \
$ORIG_SRC_DIR/driverdriver.c \
-DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
@@ -438,7 +443,7 @@
-L$DIR/obj-$h-$BUILD/libiberty/ \
-o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcc-$MAJ_VERS || exit 1
- $h-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS \
+ $h-apple-darwin$DARWIN_VERS-gcc \
$ORIG_SRC_DIR/driverdriver.c \
-DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
From isanbard at gmail.com Tue Nov 13 00:55:53 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 12 Nov 2007 22:55:53 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/
lib/Target/Alpha/ lib/Target/IA64/ lib/Target/Mips/
lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/
In-Reply-To: <285C1EE1-2E2F-4A60-B732-D6356642DE7D@apple.com>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
<16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
<8F189F78-1B37-4AF1-8E7C-AB3F7FAD917A@gmail.com>
<285C1EE1-2E2F-4A60-B732-D6356642DE7D@apple.com>
Message-ID:
On Nov 12, 2007, at 7:20 PM, Evan Cheng wrote:
> Can you use prcontext? There are several examples in the current test
> suite.
>
I think the test would be very fragile.
-bw
From sabre at nondot.org Tue Nov 13 01:06:38 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 13 Nov 2007 07:06:38 -0000
Subject: [llvm-commits] [llvm] r44043 - in /llvm/trunk/docs/tutorial:
LangImpl3.html LangImpl4.html LangImpl5.html
Message-ID: <200711130706.lAD76cxU027471@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Nov 13 01:06:30 2007
New Revision: 44043
URL: http://llvm.org/viewvc/llvm-project?rev=44043&view=rev
Log:
Many typos, grammaro, and wording fixes. Patch by
Kelly Wilson, thanks!
Modified:
llvm/trunk/docs/tutorial/LangImpl3.html
llvm/trunk/docs/tutorial/LangImpl4.html
llvm/trunk/docs/tutorial/LangImpl5.html
Modified: llvm/trunk/docs/tutorial/LangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=44043&r1=44042&r2=44043&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl3.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl3.html Tue Nov 13 01:06:30 2007
@@ -41,7 +41,7 @@
Welcome to Chapter 3 of the "Implementing a language
with LLVM" tutorial. This chapter shows you how to transform the Abstract Syntax Tree built in Chapter 2 into LLVM IR.
+href="LangImpl2.html">Abstract Syntax Tree, built in Chapter 2, into LLVM IR.
This will teach you a little bit about how LLVM does things, as well as
demonstrate how easy it is to use. It's much more work to build a lexer and
parser than it is to generate LLVM IR code. :)
@@ -79,14 +79,14 @@
-
The Codegen() method says to emit IR for that AST node and all things it
+
The Codegen() method says to emit IR for that AST node along with all the things it
depends on, and they all return an LLVM Value object.
"Value" is the class used to represent a "Static Single
Assignment (SSA) register" or "SSA value" in LLVM. The most distinct aspect
of SSA values is that their value is computed as the related instruction
executes, and it does not get a new value until (and if) the instruction
-re-executes. In order words, there is no way to "change" an SSA value. For
+re-executes. In other words, there is no way to "change" an SSA value. For
more information, please read up on Static Single
Assignment - the concepts are really quite natural once you grok them.
@@ -97,7 +97,7 @@
for our purposes, adding a virtual method is simplest.
The
-second thing we want is an "Error" method like we used for parser, which will
+second thing we want is an "Error" method like we used for the parser, which will
be used to report errors found during code generation (for example, use of an
undeclared parameter):
@@ -144,7 +144,7 @@
-
Generating LLVM code for expression nodes is very straight-forward: less
+
Generating LLVM code for expression nodes is very straightforward: less
than 45 lines of commented code for all four of our expression nodes. First,
we'll do numeric literals:
@@ -174,7 +174,7 @@
-
References to variables are also quite simple here. In the simple version
+
References to variables are also quite simple using LLVM. In the simple version
of Kaleidoscope, we assume that the variable has already been emited somewhere
and its value is available. In practice, the only values that can be in the
NamedValues map are function arguments. This
@@ -211,9 +211,9 @@
code, we do a simple switch on the opcode to create the right LLVM instruction.
-
In this example, the LLVM builder class is starting to show its value.
-Because it knows where to insert the newly created instruction, you just have to
-specify what instruction to create (e.g. with CreateAdd), which
+
In the example above, the LLVM builder class is starting to show its value.
+LLVMBuilder knows where to insert the newly created instruction, all you have to
+do is specify what instruction to create (e.g. with CreateAdd), which
operands to use (L and R here) and optionally provide a name
for the generated instruction. One nice thing about LLVM is that the name is
just a hint: if there are multiple additions in a single function, the first
@@ -221,17 +221,16 @@
giving it a name like "addtmp42". Local value names for instructions are purely
optional, but it makes it much easier to read the IR dumps.
-
LLVM instructions are constrained with
+
LLVM instructions are constrained by
strict rules: for example, the Left and Right operators of
-an add instruction have to have the same
-type, and that the result type of the add must match the operand types. Because
+an add instruction must have the same
+type, and the result type of the add must match the operand types. Because
all values in Kaleidoscope are doubles, this makes for very simple code for add,
sub and mul.
On the other hand, LLVM specifies that the fcmp instruction always returns an 'i1' value
-(a one bit integer). However, Kaleidoscope wants the value to be a 0.0 or 1.0
-value. In order to get these semantics, we combine the fcmp instruction with
+(a one bit integer). The problem with this is that Kaleidoscope wants the value to be a 0.0 or 1.0 value. In order to get these semantics, we combine the fcmp instruction with
a uitofp instruction. This instruction
converts its input integer into a floating point value by treating the input
as an unsigned value. In contrast, if we used the
-
Code generation for function calls is quite straight-forward with LLVM. The
-code above first looks the name of the function up in the LLVM Module's symbol
+
Code generation for function calls is quite straightforward with LLVM. The
+code above initially does a function name lookup in the LLVM Module's symbol
table. Recall that the LLVM Module is the container that holds all of the
functions we are JIT'ing. By giving each function the same name as what the
user specifies, we can use the LLVM symbol table to resolve function names for
@@ -271,8 +270,8 @@
Once we have the function to call, we recursively codegen each argument that
is to be passed in, and create an LLVM call
instruction. Note that LLVM uses the native C calling conventions by
-default, allowing these calls to call into standard library functions like
-"sin" and "cos" with no additional effort.
+default, allowing these calls to also call into standard library functions like
+"sin" and "cos", with no additional effort.
This wraps up our handling of the four basic expressions that we have so far
in Kaleidoscope. Feel free to go in and add some more. For example, by
@@ -321,7 +320,7 @@
don't "new" a type, you "get" it.
The final line above actually creates the function that the prototype will
-correspond to. This indicates which type, linkage, and name to use, and which
+correspond to. This indicates the type, linkage and name to use, as well as which
module to insert into. "external linkage"
means that the function may be defined outside the current module and/or that it
is callable by functions outside the module. The Name passed in is the name the
@@ -343,7 +342,7 @@
The Module symbol table works just like the Function symbol table when it
comes to name conflicts: if a new function is created with a name was previously
added to the symbol table, it will get implicitly renamed when added to the
-Module. The code above exploits this fact to tell if there was a previous
+Module. The code above exploits this fact to determine if there was a previous
definition of this function.
In Kaleidoscope, I choose to allow redefinitions of functions in two cases:
@@ -403,7 +402,7 @@
The last bit of code for prototypes loops over all of the arguments in the
-function, setting the name of the LLVM Argument objects to match and registering
+function, setting the name of the LLVM Argument objects to match, and registering
the arguments in the NamedValues map for future use by the
VariableExprAST AST node. Once this is set up, it returns the Function
object to the caller. Note that we don't check for conflicting
@@ -421,8 +420,8 @@
-
Code generation for function definitions starts out simply enough: first we
-codegen the prototype (Proto) and verify that it is ok. We also clear out the
+
Code generation for function definitions starts out simply enough: we just
+codegen the prototype (Proto) and verify that it is ok. We then clear out the
NamedValues map to make sure that there isn't anything in it from the
last function we compiled. Code generation of the prototype ensures that there
is an LLVM Function object that is ready to go for us.
@@ -445,7 +444,7 @@
of functions that define the Control Flow Graph.
Since we don't have any control flow, our functions will only contain one
-block so far. We'll fix this in Chapter 5 :).
+block at this point. We'll fix this in Chapter 5 :).
@@ -465,7 +464,7 @@
compute the expression into the entry block and returns the value that was
computed. Assuming no error, we then create an LLVM ret instruction, which completes the function.
-Once the function is built, we call the verifyFunction function, which
+Once the function is built, we call verifyFunction, which
is provided by LLVM. This function does a variety of consistency checks on the
generated code, to determine if our compiler is doing everything right. Using
this is important: it can catch a lot of bugs. Once the function is finished
@@ -481,13 +480,13 @@
The only piece left here is handling of the error case. For simplicity, we
-simply handle this by deleting the function we produced with the
+handle this by merely deleting the function we produced with the
eraseFromParent method. This allows the user to redefine a function
that they incorrectly typed in before: if we didn't delete it, it would live in
the symbol table, with a body, preventing future redefinition.
-This code does have a bug though. Since the PrototypeAST::Codegen
-can return a previously defined forward declaration, this can actually delete
+
This code does have a bug, though. Since the PrototypeAST::Codegen
+can return a previously defined forward declaration, our code can actually delete
a forward declaration. There are a number of ways to fix this bug, see what you
can come up with! Here is a testcase:
@@ -571,7 +570,7 @@
This shows some function calls. Note that this function will take a long
time to execute if you call it. In the future we'll add conditional control
-flow to make recursion actually be useful :).
+flow to actually make recursion useful :).
@@ -636,7 +635,7 @@
generated. Here you can see the big picture with all the functions referencing
each other.
-This wraps up this chapter of the Kaleidoscope tutorial. Up next we'll
+
This wraps up the third chapter of the Kaleidoscope tutorial. Up next, we'll
describe how to add JIT codegen and optimizer
support to this so we can actually start running code!
Modified: llvm/trunk/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=44043&r1=44042&r2=44043&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl4.html Tue Nov 13 01:06:30 2007
@@ -42,8 +42,8 @@
with LLVM" tutorial. Chapters 1-3 described the implementation of a simple
language and added support for generating LLVM IR. This chapter describes
two new techniques: adding optimizer support to your language, and adding JIT
-compiler support. This shows how to get nice efficient code for your
-language.
+compiler support. These additions will demonstrate how to get nice, efficient code
+for the Kaleidoscope language.
@@ -72,14 +72,13 @@
-This code is a very very literal transcription of the AST built by parsing
-our code, and as such, lacks optimizations like constant folding (we'd like to
-get "add x, 3.0" in the example above) as well as other more important
-optimizations. Constant folding in particular is a very common and very
+
This code is a very, very literal transcription of the AST built by parsing
+the input. As such, this transcription lacks optimizations like constant folding (we'd like to get "add x, 3.0" in the example above) as well as other more important
+optimizations. Constant folding, in particular, is a very common and very
important optimization: so much so that many language implementors implement
constant folding support in their AST representation.
-With LLVM, you don't need to. Since all calls to build LLVM IR go through
+
With LLVM, you don't need this support in the AST. Since all calls to build LLVM IR go through
the LLVM builder, it would be nice if the builder itself checked to see if there
was a constant folding opportunity when you call it. If so, it could just do
the constant fold and return the constant instead of creating an instruction.
@@ -93,9 +92,9 @@
All we did was switch from LLVMBuilder to
-LLVMFoldingBuilder. Though we change no other code, now all of our
-instructions are implicitly constant folded without us having to do anything
-about it. For example, our example above now compiles to:
+LLVMFoldingBuilder. Though we change no other code, we now have all of our
+instructions implicitly constant folded without us having to do anything
+about it. For example, the input above now compiles to:
@@ -153,7 +152,7 @@
-
LLVM provides many optimization passes which do many different sorts of
+
LLVM provides many optimization passes, which do many different sorts of
things and have different tradeoffs. Unlike other systems, LLVM doesn't hold
to the mistaken notion that one set of optimizations is right for all languages
and for all situations. LLVM allows a compiler implementor to make complete
@@ -165,7 +164,7 @@
at link time, this can be a substantial portion of the whole program). It also
supports and includes "per-function" passes which just operate on a single
function at a time, without looking at other functions. For more information
-on passes and how the get run, see the How
+on passes and how they are run, see the How
to Write a Pass document and the List of LLVM
Passes.
@@ -207,13 +206,13 @@
-This code defines two objects, a ExistingModuleProvider and a
+
This code defines two objects, an ExistingModuleProvider and a
FunctionPassManager. The former is basically a wrapper around our
Module that the PassManager requires. It provides certain flexibility
-that we're not going to take advantage of here, so I won't dive into what it is
-all about.
+that we're not going to take advantage of here, so I won't dive into any details
+about it.
-The meat of the matter is the definition of "OurFPM". It
+
The meat of the matter here, is the definition of "OurFPM". It
requires a pointer to the Module (through the ModuleProvider)
to construct itself. Once it is set up, we use a series of "add" calls to add
a bunch of LLVM passes. The first pass is basically boilerplate, it adds a pass
@@ -223,7 +222,7 @@
In this case, we choose to add 4 optimization passes. The passes we chose
here are a pretty standard set of "cleanup" optimizations that are useful for
-a wide variety of code. I won't delve into what they do, but believe me that
+a wide variety of code. I won't delve into what they do but, believe me,
they are a good starting place :).
Once the PassManager is set up, we need to make use of it. We do this by
@@ -247,7 +246,7 @@
-As you can see, this is pretty straight-forward. The
+
As you can see, this is pretty straightforward. The
FunctionPassManager optimizes and updates the LLVM Function* in place,
improving (hopefully) its body. With this in place, we can try our test above
again:
@@ -271,7 +270,7 @@
LLVM provides a wide variety of optimizations that can be used in certain
circumstances. Some documentation about the various
passes is available, but it isn't very complete. Another good source of
-ideas is to look at the passes that llvm-gcc or
+ideas can come from looking at the passes that llvm-gcc or
llvm-ld run to get started. The "opt" tool allows you to
experiment with passes from the command line, so you can see if they do
anything.
@@ -324,7 +323,7 @@
the interpreter.
Once the ExecutionEngine is created, the JIT is ready to be used.
-There are a variety of APIs that are useful, but the most simple one is the
+There are a variety of APIs that are useful, but the simplest one is the
"getPointerToFunction(F)" method. This method JIT compiles the
specified LLVM Function and returns a function pointer to the generated machine
code. In our case, this means that we can change the code that parses a
@@ -353,7 +352,7 @@
function that takes no arguments and returns the computed double. Because the
LLVM JIT compiler matches the native platform ABI, this means that you can just
cast the result pointer to a function pointer of that type and call it directly.
-As such, there is no difference between JIT compiled code and native machine
+This means, there is no difference between JIT compiled code and native machine
code that is statically linked into your application.
With just these two changes, lets see how Kaleidoscope works now!
@@ -372,7 +371,7 @@
Well this looks like it is basically working. The dump of the function
shows the "no argument function that always returns double" that we synthesize
-for each top level expression that is typed it. This demonstrates very basic
+for each top level expression that is typed in. This demonstrates very basic
functionality, but can we do more?
@@ -397,19 +396,19 @@
-This illustrates that we can now call user code, but it is a bit subtle what
-is going on here. Note that we only invoke the JIT on the anonymous functions
-that calls testfunc, but we never invoked it on testfunc
-itself.
+This illustrates that we can now call user code, but there is something a bit subtle
+going on here. Note that we only invoke the JIT on the anonymous functions
+that call testfunc, but we never invoked it on testfunc
+itself.
-What actually happened here is that the anonymous function is
+
What actually happened here is that the anonymous function was
JIT'd when requested. When the Kaleidoscope app calls through the function
pointer that is returned, the anonymous function starts executing. It ends up
making the call to the "testfunc" function, and ends up in a stub that invokes
the JIT, lazily, on testfunc. Once the JIT finishes lazily compiling testfunc,
it returns and the code re-executes the call.
-In summary, the JIT will lazily JIT code on the fly as it is needed. The
+
In summary, the JIT will lazily JIT code, on the fly, as it is needed. The
JIT provides a number of other more advanced interfaces for things like freeing
allocated machine code, rejit'ing functions to update them, etc. However, even
with this simple code, we get some surprisingly powerful capabilities - check
Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=44043&r1=44042&r2=44043&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Tue Nov 13 01:06:30 2007
@@ -55,7 +55,7 @@
Welcome to Chapter 5 of the "Implementing a language
with LLVM" tutorial. Parts 1-4 described the implementation of the simple
-Kaleidoscope language and included support for generating LLVM IR, following by
+Kaleidoscope language and included support for generating LLVM IR, followed by
optimizations and a JIT compiler. Unfortunately, as presented, Kaleidoscope is
mostly useless: it has no control flow other than call and return. This means
that you can't have conditional branches in the code, significantly limiting its
@@ -71,13 +71,13 @@
-Extending Kaleidoscope to support if/then/else is quite straight-forward. It
+Extending Kaleidoscope to support if/then/else is quite straightforward. It
basically requires adding lexer support for this "new" concept to the lexer,
parser, AST, and LLVM code emitter. This example is nice, because it shows how
easy it is to "grow" a language over time, incrementally extending it as new
ideas are discovered.
-
Before we get going on "how" we do this extension, lets talk about what we
+
Before we get going on "how" we add this extension, lets talk about "what" we
want. The basic idea is that we want to be able to write this sort of thing:
@@ -97,7 +97,7 @@
conditional, then return the 'then' or 'else' value based on how the condition
was resolved. This is very similar to the C "?:" expression.
-
The semantics of the if/then/else expression is that it first evaluates the
+
The semantics of the if/then/else expression is that it evaluates the
condition to a boolean equality value: 0.0 is considered to be false and
everything else is considered to be true.
If the condition is true, the first subexpression is evaluated and returned, if
@@ -105,7 +105,7 @@
Since Kaleidoscope allows side-effects, this behavior is important to nail down.
-
Now that we know what we want, lets break this down into its constituent
+
Now that we know what we "want", lets break this down into its constituent
pieces.
@@ -118,7 +118,7 @@
-
The lexer extensions are straight-forward. First we add new enum values
+
The lexer extensions are straightforward. First we add new enum values
for the relevant tokens:
@@ -128,7 +128,7 @@
-
Once we have that, we recognize the new keywords in the lexer, pretty simple
+
Once we have that, we recognize the new keywords in the lexer. This is pretty simple
stuff:
@@ -179,7 +179,7 @@
Now that we have the relevant tokens coming from the lexer and we have the
-AST node to build, our parsing logic is relatively straight-forward. First we
+AST node to build, our parsing logic is relatively straightforward. First we
define a new parsing function:
@@ -296,14 +296,14 @@
inserting actual calls into the code and recompiling or by calling these in the
debugger. LLVM has many nice features for visualizing various graphs.
-
Coming back to the generated code, it is fairly simple: the entry block
+
Getting back to the generated code, it is fairly simple: the entry block
evaluates the conditional expression ("x" in our case here) and compares the
result to 0.0 with the "fcmp one"
instruction ('one' is "Ordered and Not Equal"). Based on the result of this
expression, the code jumps to either the "then" or "else" blocks, which contain
the expressions for the true/false cases.
-
Once the then/else blocks is finished executing, they both branch back to the
+
Once the then/else blocks are finished executing, they both branch back to the
'ifcont' block to execute the code that happens after the if/then/else. In this
case the only thing left to do is to return to the caller of the function. The
question then becomes: how does the code know which expression to return?
@@ -320,25 +320,25 @@
value of "calltmp". If control comes from the "else" block, it gets the value
of "calltmp1".
-
At this point, you are probably starting to think "oh no! this means my
+
At this point, you are probably starting to think "Oh no! This means my
simple and elegant front-end will have to start generating SSA form in order to
use LLVM!". Fortunately, this is not the case, and we strongly advise
not implementing an SSA construction algorithm in your front-end
unless there is an amazingly good reason to do so. In practice, there are two
-sorts of values that float around in code written in your average imperative
+sorts of values that float around in code written for your average imperative
programming language that might need Phi nodes:
- Code that involves user variables: x = 1; x = x + 1;
-- Values that are implicit in the structure of your AST, such as the phi node
+
- Values that are implicit in the structure of your AST, such as the Phi node
in this case.
In Chapter 7 of this tutorial ("mutable
variables"), we'll talk about #1
in depth. For now, just believe me that you don't need SSA construction to
-handle them. For #2, you have the choice of using the techniques that we will
-describe for #1, or you can insert Phi nodes directly if convenient. In this
+handle this case. For #2, you have the choice of using the techniques that we will
+describe for #1, or you can insert Phi nodes directly, if convenient. In this
case, it is really really easy to generate the Phi node, so we choose to do it
directly.
@@ -369,7 +369,7 @@
-
This code is straight-forward and similar to what we saw before. We emit the
+
This code is straightforward and similar to what we saw before. We emit the
expression for the condition, then compare that value to zero to get a truth
value as a 1-bit (bool) value.
@@ -395,7 +395,7 @@
Once it has that, it creates three blocks. Note that it passes "TheFunction"
into the constructor for the "then" block. This causes the constructor to
-automatically insert the new block onto the end of the specified function. The
+automatically insert the new block into the end of the specified function. The
other two blocks are created, but aren't yet inserted into the function.
Once the blocks are created, we can emit the conditional branch that chooses
@@ -427,7 +427,7 @@
block. :)
Once the insertion point is set, we recursively codegen the "then" expression
-from the AST. To finish off the then block, we create an unconditional branch
+from the AST. To finish off the "then" block, we create an unconditional branch
to the merge block. One interesting (and very important) aspect of the LLVM IR
is that it requires all basic blocks
to be "terminated" with a control flow
@@ -439,7 +439,7 @@
is that when we create the Phi node in the merge block, we need to set up the
block/value pairs that indicate how the Phi will work. Importantly, the Phi
node expects to have an entry for each predecessor of the block in the CFG. Why
-then are we getting the current block when we just set it to ThenBB 5 lines
+then, are we getting the current block when we just set it to ThenBB 5 lines
above? The problem is that the "Then" expression may actually itself change the
block that the Builder is emitting into if, for example, it contains a nested
"if/then/else" expression. Because calling Codegen recursively could
@@ -492,7 +492,7 @@
feed into the code for the top-level function, which will create the return
instruction.
-
Overall, we now have the ability to execution conditional code in
+
Overall, we now have the ability to execute conditional code in
Kaleidoscope. With this extension, Kaleidoscope is a fairly complete language
that can calculate a wide variety of numeric functions. Next up we'll add
another useful expression that is familiar from non-functional languages...
@@ -571,7 +571,7 @@
-
The AST node is similarly simple. It basically boils down to capturing
+
The AST node is just as simple. It basically boils down to capturing
the variable name and the constituent expressions in the node.
@@ -704,7 +704,7 @@
-
The first part of codegen is very simple: we just output the start expression
+
The first part of Codegen is very simple: we just output the start expression
for the loop value:
@@ -804,7 +804,7 @@
Now that the body is emitted, we compute the next value of the iteration
-variable by adding the step value or 1.0 if it isn't present. 'NextVar'
+variable by adding the step value, or 1.0 if it isn't present. 'NextVar'
will be the value of the loop variable on the next iteration of the loop.
@@ -839,8 +839,7 @@
With the code for the body of the loop complete, we just need to finish up
-the control flow for it. This remembers the end block (for the phi node), then
-creates the block for the loop exit ("afterloop"). Based on the value of the
+the control flow for it. This code remembers the end block (for the phi node), then creates the block for the loop exit ("afterloop"). Based on the value of the
exit condition, it creates a conditional branch that chooses between executing
the loop again and exiting the loop. Any future code is emitted in the
"afterloop" block, so it sets the insertion position to it.
@@ -869,8 +868,7 @@
that is what we return from
ForExprAST::Codegen.
With this, we conclude the "adding control flow to Kaleidoscope" chapter of
-the tutorial. We added two control flow constructs, and used them to motivate
-a couple of aspects of the LLVM IR that are important for front-end implementors
+the tutorial. In this chapter we added two control flow constructs, and used them to motivate a couple of aspects of the LLVM IR that are important for front-end implementors
to know. In the next chapter of our saga, we will get a bit crazier and add
user-defined operators to our poor innocent
language.
From sabre at nondot.org Tue Nov 13 01:32:39 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 13 Nov 2007 07:32:39 -0000
Subject: [llvm-commits] [llvm] r44044 - in /llvm/trunk:
lib/Transforms/Scalar/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/iterative-simplify.ll
Message-ID: <200711130732.lAD7Wd7h029168@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Nov 13 01:32:38 2007
New Revision: 44044
URL: http://llvm.org/viewvc/llvm-project?rev=44044&view=rev
Log:
Implement PR1786 by iterating between dead cycle elimination
and simplifycfg in the rare cases when it is needed.
Added:
llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=44044&r1=44043&r2=44044&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Tue Nov 13 01:32:38 2007
@@ -27,6 +27,7 @@
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Pass.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
using namespace llvm;
@@ -50,9 +51,9 @@
}
static bool MarkAliveBlocks(BasicBlock *BB,
- SmallPtrSet
&Reachable) {
+ SmallPtrSet &Reachable) {
- std::vector Worklist;
+ SmallVector Worklist;
Worklist.push_back(BB);
bool Changed = false;
while (!Worklist.empty()) {
@@ -93,42 +94,46 @@
return Changed;
}
-
-// It is possible that we may require multiple passes over the code to fully
-// simplify the CFG.
-//
-bool CFGSimplifyPass::runOnFunction(Function &F) {
- SmallPtrSet Reachable;
+/// RemoveUnreachableBlocks - Remove blocks that are not reachable, even if they
+/// are in a dead cycle. Return true if a change was made, false otherwise.
+static bool RemoveUnreachableBlocks(Function &F) {
+ SmallPtrSet Reachable;
bool Changed = MarkAliveBlocks(F.begin(), Reachable);
-
+
// If there are unreachable blocks in the CFG...
- if (Reachable.size() != F.size()) {
- assert(Reachable.size() < F.size());
- NumSimpl += F.size()-Reachable.size();
-
- // Loop over all of the basic blocks that are not reachable, dropping all of
- // their internal references...
- for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB)
- if (!Reachable.count(BB)) {
- for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI!=SE; ++SI)
- if (Reachable.count(*SI))
- (*SI)->removePredecessor(BB);
- BB->dropAllReferences();
- }
-
- for (Function::iterator I = ++F.begin(); I != F.end();)
- if (!Reachable.count(I))
- I = F.getBasicBlockList().erase(I);
- else
- ++I;
-
- Changed = true;
- }
+ if (Reachable.size() == F.size())
+ return Changed;
+
+ assert(Reachable.size() < F.size());
+ NumSimpl += F.size()-Reachable.size();
+
+ // Loop over all of the basic blocks that are not reachable, dropping all of
+ // their internal references...
+ for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB)
+ if (!Reachable.count(BB)) {
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI!=SE; ++SI)
+ if (Reachable.count(*SI))
+ (*SI)->removePredecessor(BB);
+ BB->dropAllReferences();
+ }
+
+ for (Function::iterator I = ++F.begin(); I != F.end();)
+ if (!Reachable.count(I))
+ I = F.getBasicBlockList().erase(I);
+ else
+ ++I;
+
+ return true;
+}
+/// IterativeSimplifyCFG - Call SimplifyCFG on all the blocks in the function,
+/// iterating until no more changes are made.
+static bool IterativeSimplifyCFG(Function &F) {
+ bool Changed = false;
bool LocalChange = true;
while (LocalChange) {
LocalChange = false;
-
+
// Loop over all of the basic blocks (except the first one) and remove them
// if they are unneeded...
//
@@ -140,6 +145,31 @@
}
Changed |= LocalChange;
}
-
return Changed;
}
+
+// It is possible that we may require multiple passes over the code to fully
+// simplify the CFG.
+//
+bool CFGSimplifyPass::runOnFunction(Function &F) {
+ bool EverChanged = RemoveUnreachableBlocks(F);
+ EverChanged |= IterativeSimplifyCFG(F);
+
+ // If neither pass changed anything, we're done.
+ if (!EverChanged) return false;
+
+ // IterativeSimplifyCFG can (rarely) make some loops dead. If this happens,
+ // RemoveUnreachableBlocks is needed to nuke them, which means we should
+ // iterate between the two optimizations. We structure the code like this to
+ // avoid reruning IterativeSimplifyCFG if the second pass of
+ // RemoveUnreachableBlocks doesn't do anything.
+ if (!RemoveUnreachableBlocks(F))
+ return true;
+
+ do {
+ EverChanged = IterativeSimplifyCFG(F);
+ EverChanged |= RemoveUnreachableBlocks(F);
+ } while (EverChanged);
+
+ return true;
+}
Added: llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll?rev=44044&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll (added)
+++ llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll Tue Nov 13 01:32:38 2007
@@ -0,0 +1,100 @@
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep bb17
+; PR1786
+
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1]
+ %i = alloca i32, align 4 ; [#uses=7]
+ %z = alloca i32, align 4 ; [#uses=4]
+ %z16 = alloca i32, align 4 ; [#uses=4]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ store i32 0, i32* %i
+ %toBool = icmp ne i8 1, 0 ; [#uses=1]
+ br i1 %toBool, label %cond_true, label %cond_false
+
+cond_true: ; preds = %entry
+ store i32 0, i32* %z
+ br label %bb
+
+bb: ; preds = %cond_next, %cond_true
+ %tmp = load i32* %z ; [#uses=1]
+ %tmp1 = sub i32 %tmp, 16384 ; [#uses=1]
+ store i32 %tmp1, i32* %z
+ %tmp2 = load i32* %i ; [#uses=1]
+ %tmp3 = add i32 %tmp2, 1 ; [#uses=1]
+ store i32 %tmp3, i32* %i
+ %tmp4 = load i32* %i ; [#uses=1]
+ %tmp5 = icmp sgt i32 %tmp4, 262144 ; [#uses=1]
+ %tmp56 = zext i1 %tmp5 to i8 ; [#uses=1]
+ %toBool7 = icmp ne i8 %tmp56, 0 ; [#uses=1]
+ br i1 %toBool7, label %cond_true8, label %cond_next
+
+cond_true8: ; preds = %bb
+ call void @abort( )
+ unreachable
+
+cond_next: ; preds = %bb
+ %tmp9 = load i32* %z ; [#uses=1]
+ %tmp10 = icmp ne i32 %tmp9, 0 ; [#uses=1]
+ %tmp1011 = zext i1 %tmp10 to i8 ; [#uses=1]
+ %toBool12 = icmp ne i8 %tmp1011, 0 ; [#uses=1]
+ br i1 %toBool12, label %bb, label %bb13
+
+bb13: ; preds = %cond_next
+ call void @exit( i32 0 )
+ unreachable
+
+cond_false: ; preds = %entry
+ %toBool14 = icmp ne i8 1, 0 ; [#uses=1]
+ br i1 %toBool14, label %cond_true15, label %cond_false33
+
+cond_true15: ; preds = %cond_false
+ store i32 0, i32* %z16
+ br label %bb17
+
+bb17: ; preds = %cond_next27, %cond_true15
+ %tmp18 = load i32* %z16 ; [#uses=1]
+ %tmp19 = sub i32 %tmp18, 16384 ; [#uses=1]
+ store i32 %tmp19, i32* %z16
+ %tmp20 = load i32* %i ; [#uses=1]
+ %tmp21 = add i32 %tmp20, 1 ; [#uses=1]
+ store i32 %tmp21, i32* %i
+ %tmp22 = load i32* %i ; [#uses=1]
+ %tmp23 = icmp sgt i32 %tmp22, 262144 ; [#uses=1]
+ %tmp2324 = zext i1 %tmp23 to i8 ; [#uses=1]
+ %toBool25 = icmp ne i8 %tmp2324, 0 ; [#uses=1]
+ br i1 %toBool25, label %cond_true26, label %cond_next27
+
+cond_true26: ; preds = %bb17
+ call void @abort( )
+ unreachable
+
+cond_next27: ; preds = %bb17
+ %tmp28 = load i32* %z16 ; [#uses=1]
+ %tmp29 = icmp ne i32 %tmp28, 0 ; [#uses=1]
+ %tmp2930 = zext i1 %tmp29 to i8 ; [#uses=1]
+ %toBool31 = icmp ne i8 %tmp2930, 0 ; [#uses=1]
+ br i1 %toBool31, label %bb17, label %bb32
+
+bb32: ; preds = %cond_next27
+ call void @exit( i32 0 )
+ unreachable
+
+cond_false33: ; preds = %cond_false
+ call void @exit( i32 0 )
+ unreachable
+
+cond_next34: ; No predecessors!
+ br label %cond_next35
+
+cond_next35: ; preds = %cond_next34
+ br label %return
+
+return: ; preds = %cond_next35
+ %retval36 = load i32* %retval ; [#uses=1]
+ ret i32 %retval36
+}
+
+declare void @abort()
+
+declare void @exit(i32)
From clattner at apple.com Tue Nov 13 01:36:28 2007
From: clattner at apple.com (Chris Lattner)
Date: Mon, 12 Nov 2007 23:36:28 -0800
Subject: [llvm-commits] [llvm] r44037 - in /llvm/trunk:
include/llvm/CodeGen/
lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/
lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/
lib/Target/Sparc/ lib/Target/X86/
In-Reply-To: <16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
References: <200711130044.lAD0iQRw000786@zion.cs.uiuc.edu>
<8F7C0088-EF64-432C-ABB2-D09153B62744@apple.com>
<16e5fdf90711121735g36649824w6f8b47472932fe52@mail.gmail.com>
Message-ID: <12C2CAFA-5782-4FE3-B93B-0F9204A72212@apple.com>
On Nov 12, 2007, at 5:35 PM, Bill Wendling wrote:
>> Also, where are the test case(s)? :-)
>>
> I knew someone would ask that. :-)
>
> It's hard to come up with a testcase because I need to check multiple
> lines of output to make sure that the stack pointer isn't modified
> while a call is taking place. Does anyone know how to do this?
I'd suggest adding an execution test to SingleSource/UnitTests, just
write it as a simple C example.
-Chris
From isanbard at gmail.com Tue Nov 13 03:19:02 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 09:19:02 -0000
Subject: [llvm-commits] [llvm] r44045 - in /llvm/trunk/lib/Target:
ARM/ARMInstrInfo.td Alpha/AlphaInstrInfo.td Mips/MipsInstrInfo.td
PowerPC/PPCInstrInfo.td Sparc/SparcInstrInfo.td TargetSelectionDAG.td
X86/X86InstrInfo.td
Message-ID: <200711130919.lAD9J3NS009787@zion.cs.uiuc.edu>
Author: void
Date: Tue Nov 13 03:19:02 2007
New Revision: 44045
URL: http://llvm.org/viewvc/llvm-project?rev=44045&view=rev
Log:
Unifacalize the CALLSEQ{START,END} stuff.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
llvm/trunk/lib/Target/TargetSelectionDAG.td
llvm/trunk/lib/Target/X86/X86InstrInfo.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Nov 13 03:19:02 2007
@@ -17,9 +17,8 @@
//
// Type profiles.
-def SDT_ARMCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-def SDT_ARMCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
+def SDT_ARMCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
+def SDT_ARMCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>;
def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
@@ -47,9 +46,9 @@
def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
-def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq_start,
+def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeqStart,
[SDNPHasChain, SDNPOutFlag]>;
-def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq_end,
+def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeqEnd,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def ARMcall : SDNode<"ARMISD::CALL", SDT_ARMcall,
Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Tue Nov 13 03:19:02 2007
@@ -30,13 +30,13 @@
[SDNPHasChain, SDNPOptInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_AlphaCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i64> ]>;
-def SDT_AlphaCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i64>,
- SDTCisVT<1, i64> ]>;
+def SDT_AlphaCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i64> ]>;
+def SDT_AlphaCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i64>,
+ SDTCisVT<1, i64> ]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AlphaCallSeq_start,
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AlphaCallSeqStart,
[SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AlphaCallSeq_end,
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AlphaCallSeqEnd,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
//********************
Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Tue Nov 13 03:19:02 2007
@@ -34,13 +34,13 @@
SDNPOptInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_MipsCallSeq_start : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
-def SDT_MipsCallSeq_end : SDTypeProfile<0, 2, [SDTCisVT<0, i32>,
- SDTCisVT<1, i32>]>;
+def SDT_MipsCallSeqStart : SDCallSeqStart<[SDTCisVT<0, i32>]>;
+def SDT_MipsCallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i32>,
+ SDTCisVT<1, i32>]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_MipsCallSeq_start,
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_MipsCallSeqStart,
[SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeq_end,
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeqEnd,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Tue Nov 13 03:19:02 2007
@@ -23,9 +23,9 @@
def SDT_PPCShiftOp : SDTypeProfile<1, 2, [ // PPCshl, PPCsra, PPCsrl
SDTCisVT<0, i32>, SDTCisVT<1, i32>, SDTCisVT<2, i32>
]>;
-def SDT_PPCCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-def SDT_PPCCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
+def SDT_PPCCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
+def SDT_PPCCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
def SDT_PPCvperm : SDTypeProfile<1, 3, [
SDTCisVT<3, v16i8>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>
]>;
@@ -91,9 +91,9 @@
def PPCstd_32 : SDNode<"PPCISD::STD_32" , SDTStore, [SDNPHasChain]>;
// These are target-independent nodes, but have target-specific formats.
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq_start,
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeqStart,
[SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq_end,
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeqEnd,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Tue Nov 13 03:19:02 2007
@@ -114,13 +114,13 @@
def SPselectfcc : SDNode<"SPISD::SELECT_FCC", SDTSPselectcc, [SDNPInFlag]>;
// These are target-independent nodes, but have target-specific formats.
-def SDT_SPCallSeq_start : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-def SDT_SPCallSeq_end : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
+def SDT_SPCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
+def SDT_SPCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPCallSeq_start,
+def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPCallSeqStart,
[SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPCallSeq_end,
+def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPCallSeqEnd,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def SDT_SPCall : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetSelectionDAG.td (original)
+++ llvm/trunk/lib/Target/TargetSelectionDAG.td Tue Nov 13 03:19:02 2007
@@ -172,6 +172,11 @@
SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisIntVectorOfSameSize<3, 0>
]>;
+class SDCallSeqStart constraints> :
+ SDTypeProfile<0, 1, constraints>;
+class SDCallSeqEnd constraints> :
+ SDTypeProfile<0, 2, constraints>;
+
//===----------------------------------------------------------------------===//
// Selection DAG Node Properties.
//
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=44045&r1=44044&r2=44045&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Nov 13 03:19:02 2007
@@ -37,9 +37,9 @@
def SDTX86Ret : SDTypeProfile<0, 1, [SDTCisVT<0, i16>]>;
-def SDT_X86CallSeqStart : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-def SDT_X86CallSeqEnd : SDTypeProfile<0, 2, [ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
+def SDT_X86CallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
+def SDT_X86CallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
+ SDTCisVT<1, i32> ]>;
def SDT_X86Call : SDTypeProfile<0, 1, [SDTCisVT<0, iPTR>]>;
From isanbard at gmail.com Tue Nov 13 03:32:53 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 09:32:53 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44046 -
/llvm-gcc-4.0/tags/Apple/llvmgcc40-2001/
Message-ID: <200711130932.lAD9WriA010320@zion.cs.uiuc.edu>
Author: void
Date: Tue Nov 13 03:32:52 2007
New Revision: 44046
URL: http://llvm.org/viewvc/llvm-project?rev=44046&view=rev
Log:
Creating llvmgcc40-2001 Branch
Added:
llvm-gcc-4.0/tags/Apple/llvmgcc40-2001/
- copied from r44043, llvm-gcc-4.0/trunk/
From evan.cheng at apple.com Tue Nov 13 11:54:35 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 13 Nov 2007 17:54:35 -0000
Subject: [llvm-commits] [llvm] r44048 - in /llvm/trunk/lib/Target/X86:
X86CodeEmitter.cpp X86RegisterInfo.cpp
Message-ID: <200711131754.lADHsZNY003749@zion.cs.uiuc.edu>
Author: evancheng
Date: Tue Nov 13 11:54:34 2007
New Revision: 44048
URL: http://llvm.org/viewvc/llvm-project?rev=44048&view=rev
Log:
Fix x86-64 jit: remove reliance on Dwarf numbers.
Modified:
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue Nov 13 11:54:34 2007
@@ -385,13 +385,20 @@
bool Emitter::isX86_64ExtendedReg(const MachineOperand &MO) {
if (!MO.isRegister()) return false;
unsigned RegNo = MO.getReg();
- int DWNum = II->getRegisterInfo().getDwarfRegNum(RegNo);
- if (DWNum >= II->getRegisterInfo().getDwarfRegNum(X86::R8) &&
- DWNum <= II->getRegisterInfo().getDwarfRegNum(X86::R15))
- return true;
- if (DWNum >= II->getRegisterInfo().getDwarfRegNum(X86::XMM8) &&
- DWNum <= II->getRegisterInfo().getDwarfRegNum(X86::XMM15))
+ switch (MO.getReg()) {
+ default: break;
+ case X86::R8: case X86::R9: case X86::R10: case X86::R11:
+ case X86::R12: case X86::R13: case X86::R14: case X86::R15:
+ case X86::R8D: case X86::R9D: case X86::R10D: case X86::R11D:
+ case X86::R12D: case X86::R13D: case X86::R14D: case X86::R15D:
+ case X86::R8W: case X86::R9W: case X86::R10W: case X86::R11W:
+ case X86::R12W: case X86::R13W: case X86::R14W: case X86::R15W:
+ case X86::R8B: case X86::R9B: case X86::R10B: case X86::R11B:
+ case X86::R12B: case X86::R13B: case X86::R14B: case X86::R15B:
+ case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11:
+ case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15:
return true;
+ }
return false;
}
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Nov 13 11:54:34 2007
@@ -713,12 +713,22 @@
case X86::ST4: case X86::ST5: case X86::ST6: case X86::ST7:
return RegNo-X86::ST0;
- case X86::XMM0: case X86::XMM1: case X86::XMM2: case X86::XMM3:
- case X86::XMM4: case X86::XMM5: case X86::XMM6: case X86::XMM7:
- return getDwarfRegNum(RegNo) - getDwarfRegNum(X86::XMM0);
- case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11:
- case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15:
- return getDwarfRegNum(RegNo) - getDwarfRegNum(X86::XMM8);
+ case X86::XMM0: case X86::XMM8:
+ return 0;
+ case X86::XMM1: case X86::XMM9:
+ return 1;
+ case X86::XMM2: case X86::XMM10:
+ return 2;
+ case X86::XMM3: case X86::XMM11:
+ return 3;
+ case X86::XMM4: case X86::XMM12:
+ return 4;
+ case X86::XMM5: case X86::XMM13:
+ return 5;
+ case X86::XMM6: case X86::XMM14:
+ return 6;
+ case X86::XMM7: case X86::XMM15:
+ return 7;
default:
assert(isVirtualRegister(RegNo) && "Unknown physical register!");
From dalej at apple.com Tue Nov 13 12:15:08 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 13 Nov 2007 10:15:08 -0800
Subject: [llvm-commits] [llvm] r44029 -
/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
In-Reply-To: <200711122336.lACNaDoZ029865@zion.cs.uiuc.edu>
References: <200711122336.lACNaDoZ029865@zion.cs.uiuc.edu>
Message-ID: <5A6E951F-73FA-46F3-A28D-C836F23EAAF2@apple.com>
On Nov 12, 2007, at 3:36 PM, Anton Korobeynikov wrote:
> Author: asl
> Date: Mon Nov 12 17:36:13 2007
> New Revision: 44029
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44029&view=rev
> Log:
> Completely forgot, that we have some debug information emission on
> PPC. This should fix
> some regressions on ppc nightly tests.
>
> Modified:
> llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> PowerPC/PPCRegisterInfo.cpp?rev=44029&r1=44028&r2=44029&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Nov 12
> 17:36:13 2007
> @@ -1278,8 +1278,8 @@
> }
>
> int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
> - assert(0 && "What is the dwarf register number");
> - return -1;
> + // FIXME: Most probably dwarf numbers differs for Linux and Darwin
Actually, they apparently don't; however, both targets use different
numberings
for EH and debug info. Or so say the comments in gcc. I take it
these are right
for debug info?
> + return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
> }
>
> #include "PPCGenRegisterInfo.inc"
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From sabre at nondot.org Tue Nov 13 12:22:36 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 13 Nov 2007 18:22:36 -0000
Subject: [llvm-commits] [llvm] r44051 -
/llvm/trunk/tools/llvm2cpp/CppWriter.cpp
Message-ID: <200711131822.lADIMaZ6005417@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Nov 13 12:22:33 2007
New Revision: 44051
URL: http://llvm.org/viewvc/llvm-project?rev=44051&view=rev
Log:
Make llvm2cpp better, patch for PR1794, contributed by Zack Rusin.
Modified:
llvm/trunk/tools/llvm2cpp/CppWriter.cpp
Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm2cpp/CppWriter.cpp?rev=44051&r1=44050&r2=44051&view=diff
==============================================================================
--- llvm/trunk/tools/llvm2cpp/CppWriter.cpp (original)
+++ llvm/trunk/tools/llvm2cpp/CppWriter.cpp Tue Nov 13 12:22:33 2007
@@ -44,6 +44,7 @@
GenModule,
GenContents,
GenFunction,
+ GenFunctions,
GenInline,
GenVariable,
GenType
@@ -53,13 +54,14 @@
cl::desc("Choose what kind of output to generate"),
cl::init(GenProgram),
cl::values(
- clEnumValN(GenProgram, "gen-program", "Generate a complete program"),
- clEnumValN(GenModule, "gen-module", "Generate a module definition"),
- clEnumValN(GenContents,"gen-contents", "Generate contents of a module"),
- clEnumValN(GenFunction,"gen-function", "Generate a function definition"),
- clEnumValN(GenInline, "gen-inline", "Generate an inline function"),
- clEnumValN(GenVariable,"gen-variable", "Generate a variable definition"),
- clEnumValN(GenType, "gen-type", "Generate a type definition"),
+ clEnumValN(GenProgram, "gen-program", "Generate a complete program"),
+ clEnumValN(GenModule, "gen-module", "Generate a module definition"),
+ clEnumValN(GenContents, "gen-contents", "Generate contents of a module"),
+ clEnumValN(GenFunction, "gen-function", "Generate a function definition"),
+ clEnumValN(GenFunctions,"gen-functions", "Generate all function definitions"),
+ clEnumValN(GenInline, "gen-inline", "Generate an inline function"),
+ clEnumValN(GenVariable, "gen-variable", "Generate a variable definition"),
+ clEnumValN(GenType, "gen-type", "Generate a type definition"),
clEnumValEnd
)
);
@@ -103,6 +105,7 @@
void printModule(const std::string& fname, const std::string& modName );
void printContents(const std::string& fname, const std::string& modName );
void printFunction(const std::string& fname, const std::string& funcName );
+ void printFunctions();
void printInline(const std::string& fname, const std::string& funcName );
void printVariable(const std::string& fname, const std::string& varName );
void printType(const std::string& fname, const std::string& typeName );
@@ -1784,6 +1787,21 @@
Out << "}\n";
}
+void CppWriter::printFunctions() {
+ const Module::FunctionListType &funcs = TheModule->getFunctionList();
+ Module::const_iterator I = funcs.begin();
+ Module::const_iterator IE = funcs.end();
+
+ for (; I != IE; ++I) {
+ const Function &func = *I;
+ if (!func.isDeclaration()) {
+ std::string name("define_");
+ name += func.getName();
+ printFunction(name, func.getName());
+ }
+ }
+}
+
void CppWriter::printVariable(
const std::string& fname, /// Name of generated function
const std::string& varName // Name of variable to generate
@@ -1835,7 +1853,8 @@
std::string tgtname = NameToGenerate.getValue();
if (GenerationType == GenModule ||
GenerationType == GenContents ||
- GenerationType == GenProgram) {
+ GenerationType == GenProgram ||
+ GenerationType == GenFunctions) {
if (tgtname == "!bad!") {
if (mod->getModuleIdentifier() == "-")
tgtname = "";
@@ -1867,6 +1886,9 @@
fname = "makeLLVMFunction";
W.printFunction(fname,tgtname);
break;
+ case GenFunctions:
+ W.printFunctions();
+ break;
case GenInline:
if (fname.empty())
fname = "makeLLVMInline";
From dpatel at apple.com Tue Nov 13 12:23:21 2007
From: dpatel at apple.com (Devang Patel)
Date: Tue, 13 Nov 2007 18:23:21 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44052 - /llvm-gcc-4.0/trunk/build_gcc
Message-ID: <200711131823.lADINLXV005485@zion.cs.uiuc.edu>
Author: dpatel
Date: Tue Nov 13 12:23:21 2007
New Revision: 44052
URL: http://llvm.org/viewvc/llvm-project?rev=44052&view=rev
Log:
Remove dead code.
Modified:
llvm-gcc-4.0/trunk/build_gcc
Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=44052&r1=44051&r2=44052&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Tue Nov 13 12:23:21 2007
@@ -35,10 +35,8 @@
if [ "x$LLVM_DEBUG" == "x" ]; then
CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
- OPTIMIZE_OPTS="ENABLE_OPTIMIZED=1"
else
CFLAGS="-g"
- OPTIMIZE_OPTS=
fi
# This isn't a parameter; it is the architecture of the current machine.
From lattner at apple.com Tue Nov 13 12:46:46 2007
From: lattner at apple.com (Tanya Lattner)
Date: Tue, 13 Nov 2007 10:46:46 -0800
Subject: [llvm-commits] make check failures
Message-ID:
There are quite a few make check failures that the nightly testers
are reporting.
On my machine (x86 Mac OsX) I am seeing the following with TOT (svn: )
test/CFrontend/2007-11-07-CopyAggregateAlign.c
test/Transforms/GlobalOpt/deadglobal-2.llx
From the nightly testers last night:
OldGrawp (x86):
test/CFrontend/2007-10-30-Volatile.c
test/CFrontend/2007-11-07-CopyAggregateAlign.c
test/Transforms/GlobalOpt/deadglobal-2.llx
sabre-ppc32:
test/CFrontend/2007-10-15-VoidPtr.c
test/CFrontend/2007-10-30-Volatile.c
test/CFrontend/2007-11-07-CopyAggregateAlign.c
test/CFrontend/sret2.c
test/FrontendObjC/2007-10-17-SJLJExceptions.m
test/FrontendObjC/2007-10-23-GC-WriteBarrier.m
test/Transforms/GlobalOpt/deadglobal-2.llx
Can everyone please see if the changes you have made in the last 3-4
days could be causing these failures.
Thanks!
-Tanya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071113/ce4c6d6b/attachment.html
From dalej at apple.com Tue Nov 13 13:13:02 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 13 Nov 2007 19:13:02 -0000
Subject: [llvm-commits] [llvm] r44056 - in /llvm/trunk: include/llvm/Target/
lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/
lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/
utils/TableGen/
Message-ID: <200711131913.lADJD2TJ007931@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Nov 13 13:13:01 2007
New Revision: 44056
URL: http://llvm.org/viewvc/llvm-project?rev=44056&view=rev
Log:
Add parameter to getDwarfRegNum to permit targets
to use different mappings for EH and debug info;
no functional change yet.
Fix warning in X86CodeEmitter.
Modified:
llvm/trunk/include/llvm/Target/MRegisterInfo.h
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp
llvm/trunk/lib/Target/ARM/ARMRegisterInfo.h
llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.cpp
llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.h
llvm/trunk/lib/Target/IA64/IA64RegisterInfo.cpp
llvm/trunk/lib/Target/IA64/IA64RegisterInfo.h
llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp
llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h
llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.h
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Modified: llvm/trunk/include/llvm/Target/MRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/MRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/MRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/Target/MRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -677,8 +677,10 @@
/// Debug information queries.
/// getDwarfRegNum - Map a target register to an equivalent dwarf register
- /// number. Returns -1 if there is no equivalent value.
- virtual int getDwarfRegNum(unsigned RegNum) const = 0;
+ /// number. Returns -1 if there is no equivalent value. The second
+ /// parameter allows targets to use different numberings for EH info and
+ /// deubgging info.
+ virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;
/// getFrameRegister - This method should return the register used as a base
/// for values allocated in the current stack frame.
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Tue Nov 13 13:13:01 2007
@@ -968,7 +968,7 @@
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
- const std::vector &Moves) {
+ const std::vector &Moves, bool isEH) {
int stackGrowth =
Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
TargetFrameInfo::StackGrowsUp ?
@@ -1010,7 +1010,7 @@
} else {
Asm->EmitInt8(DW_CFA_def_cfa);
Asm->EOL("DW_CFA_def_cfa");
- Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister()));
+ Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister(), isEH));
Asm->EOL("Register");
}
@@ -1026,13 +1026,13 @@
if (Dst.isRegister()) {
Asm->EmitInt8(DW_CFA_def_cfa_register);
Asm->EOL("DW_CFA_def_cfa_register");
- Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister()));
+ Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister(), isEH));
Asm->EOL("Register");
} else {
assert(0 && "Machine move no supported yet.");
}
} else {
- unsigned Reg = RI->getDwarfRegNum(Src.getRegister());
+ unsigned Reg = RI->getDwarfRegNum(Src.getRegister(), isEH);
int Offset = Dst.getOffset() / stackGrowth;
if (Offset < 0) {
@@ -1340,7 +1340,7 @@
/// provided.
void AddAddress(DIE *Die, unsigned Attribute,
const MachineLocation &Location) {
- unsigned Reg = RI->getDwarfRegNum(Location.getRegister());
+ unsigned Reg = RI->getDwarfRegNum(Location.getRegister(), false);
DIEBlock *Block = new DIEBlock();
if (Location.isRegister()) {
@@ -2370,13 +2370,13 @@
Asm->EOL("CIE Code Alignment Factor");
Asm->EmitSLEB128Bytes(stackGrowth);
Asm->EOL("CIE Data Alignment Factor");
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister()));
+ Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), false));
Asm->EOL("CIE RA Column");
std::vector Moves;
RI->getInitialFrameState(Moves);
- EmitFrameMoves(NULL, 0, Moves);
+ EmitFrameMoves(NULL, 0, Moves, false);
Asm->EmitAlignment(2);
EmitLabel("debug_frame_common_end", 0);
@@ -2409,7 +2409,7 @@
"func_begin", DebugFrameInfo.Number);
Asm->EOL("FDE address range");
- EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves);
+ EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves, false);
Asm->EmitAlignment(2);
EmitLabel("debug_frame_end", DebugFrameInfo.Number);
@@ -2817,7 +2817,7 @@
Asm->EOL("CIE Code Alignment Factor");
Asm->EmitSLEB128Bytes(stackGrowth);
Asm->EOL("CIE Data Alignment Factor");
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister()));
+ Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true));
Asm->EOL("CIE RA Column");
// If there is a personality, we need to indicate the functions location.
@@ -2853,7 +2853,7 @@
// Indicate locations of general callee saved registers in frame.
std::vector Moves;
RI->getInitialFrameState(Moves);
- EmitFrameMoves(NULL, 0, Moves);
+ EmitFrameMoves(NULL, 0, Moves, true);
Asm->EmitAlignment(2);
EmitLabel("eh_frame_common_end", Index);
@@ -2915,7 +2915,7 @@
// Indicate locations of function specific callee saved registers in
// frame.
- EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves);
+ EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves, true);
Asm->EmitAlignment(2);
EmitLabel("eh_frame_end", EHFrameInfo.Number);
Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -1660,7 +1660,7 @@
return 0;
}
-int ARMRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
+int ARMRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
assert(0 && "What is the dwarf register number");
return -1;
}
Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -118,7 +118,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -480,7 +480,7 @@
return 0;
}
-int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
+int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
assert(0 && "What is the dwarf register number");
return -1;
}
Modified: llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -93,7 +93,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
static std::string getPrettyName(unsigned reg);
};
Modified: llvm/trunk/lib/Target/IA64/IA64RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64RegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64RegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -451,7 +451,7 @@
return 0;
}
-int IA64RegisterInfo::getDwarfRegNum(unsigned RegNum) const {
+int IA64RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
assert(0 && "What is the dwarf register number");
return -1;
}
Modified: llvm/trunk/lib/Target/IA64/IA64RegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64RegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64RegisterInfo.h (original)
+++ llvm/trunk/lib/Target/IA64/IA64RegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -85,7 +85,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -539,7 +539,7 @@
}
int MipsRegisterInfo::
-getDwarfRegNum(unsigned RegNum) const {
+getDwarfRegNum(unsigned RegNum, bool isEH) const {
assert(0 && "What is the dwarf register number");
return -1;
}
Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -97,7 +97,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -1277,7 +1277,7 @@
return !Subtarget.isPPC64() ? PPC::R4 : PPC::X4;
}
-int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
+int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
// FIXME: Most probably dwarf numbers differs for Linux and Darwin
return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -117,7 +117,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Nov 13 13:13:01 2007
@@ -58,7 +58,7 @@
UsedDirective = "\t.no_dead_strip\t";
WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\t";
- SupportsExceptionHandling = false;
+ SupportsExceptionHandling = true;
NeedsIndirectEncoding = true;
BSSSection = 0;
Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -333,7 +333,7 @@
return 0;
}
-int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum) const {
+int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
assert(0 && "What is the dwarf register number");
return -1;
}
Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -97,7 +97,7 @@
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue Nov 13 13:13:01 2007
@@ -384,7 +384,6 @@
/// e.g. r8, xmm8, etc.
bool Emitter::isX86_64ExtendedReg(const MachineOperand &MO) {
if (!MO.isRegister()) return false;
- unsigned RegNo = MO.getReg();
switch (MO.getReg()) {
default: break;
case X86::R8: case X86::R9: case X86::R10: case X86::R11:
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Nov 13 13:13:01 2007
@@ -657,7 +657,7 @@
// getDwarfRegNum - This function maps LLVM register identifiers to the
// Dwarf specific numbering, used in debug info and exception tables.
-int X86RegisterInfo::getDwarfRegNum(unsigned RegNo) const {
+int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
const X86Subtarget *Subtarget = &TM.getSubtarget();
unsigned Flavour = DWARFFlavour::X86_64;
if (!Subtarget->is64Bit()) {
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.h?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.h Tue Nov 13 13:13:01 2007
@@ -87,7 +87,7 @@
/// getDwarfRegNum - allows modification of X86GenRegisterInfo::getDwarfRegNum
/// (created by TableGen) for target dependencies.
- int getDwarfRegNum(unsigned RegNum) const;
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
/// Code Generation virtual methods...
///
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 13 13:13:01 2007
@@ -101,8 +101,7 @@
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
// Exceptions handling
- if (!Subtarget->is64Bit())
- SupportsExceptionHandling = true;
+ SupportsExceptionHandling = true;
AbsoluteEHSectionOffsets = false;
DwarfEHFrameSection =
".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=44056&r1=44055&r2=44056&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Tue Nov 13 13:13:01 2007
@@ -62,7 +62,7 @@
<< "(int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);\n"
<< " virtual int getDwarfRegNumFull(unsigned RegNum, "
<< "unsigned Flavour) const;\n"
- << " virtual int getDwarfRegNum(unsigned RegNum) const = 0;\n"
+ << " virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;\n"
<< " unsigned getSubReg(unsigned RegNo, unsigned Index) const;\n"
<< "};\n\n";
From dalej at apple.com Tue Nov 13 13:16:02 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 13 Nov 2007 19:16:02 -0000
Subject: [llvm-commits] [llvm] r44057 - in /llvm/trunk/lib/Target:
PowerPC/PPCTargetAsmInfo.cpp X86/X86TargetAsmInfo.cpp
Message-ID: <200711131916.lADJG2jj008052@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Nov 13 13:16:02 2007
New Revision: 44057
URL: http://llvm.org/viewvc/llvm-project?rev=44057&view=rev
Log:
Revert previous; these files aren't ready to go in yet.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=44057&r1=44056&r2=44057&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Nov 13 13:16:02 2007
@@ -58,7 +58,7 @@
UsedDirective = "\t.no_dead_strip\t";
WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\t";
- SupportsExceptionHandling = true;
+ SupportsExceptionHandling = false;
NeedsIndirectEncoding = true;
BSSSection = 0;
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=44057&r1=44056&r2=44057&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Tue Nov 13 13:16:02 2007
@@ -101,7 +101,8 @@
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
// Exceptions handling
- SupportsExceptionHandling = true;
+ if (!Subtarget->is64Bit())
+ SupportsExceptionHandling = true;
AbsoluteEHSectionOffsets = false;
DwarfEHFrameSection =
".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
From dalej at apple.com Tue Nov 13 13:35:13 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 13 Nov 2007 11:35:13 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To: <203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
References: <47367BA1.6030403@mxc.ca>
<203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
Message-ID:
On Nov 12, 2007, at 3:17 PM, Dale Johannesen wrote:
> On Nov 12, 2007, at 2:56 PM, Eric Christopher wrote:
>> On Nov 10, 2007, at 7:48 PM, Nick Lewycky wrote:
>>
>>> This patch to llvm-gcc 4.0 allows it to compile on PPC/Linux. This
>>> is a combination of patchs from myself, Dale Johannesen, and the
>>> fact that a GTY can't be declared in an #ifdef from Andrew Pinski.
>>>
>>> I'd appreciate some testing. More importantly to make sure that this
>>> doesn't break Darwin on PPC, but also anyone else who's interested
>>> in running LLVM on their PPC Linux boxes.
>>>
> I am testing Nick's patch on ppc32 Darwin and plan to check in if
> it looks like that was not broken.
Unfortunately my test run was started before 44029 went in, and there
are hundreds
of failures due to that problem. It is best to start over.
Apparently Eric is willing to change linux.h to his satisfaction, so
I'll let him.
From resistor at mac.com Tue Nov 13 13:56:28 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 13 Nov 2007 19:56:28 -0000
Subject: [llvm-commits] [llvm] r44061 -
/llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h
Message-ID: <200711131956.lADJuSRc009953@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Nov 13 13:56:28 2007
New Revision: 44061
URL: http://llvm.org/viewvc/llvm-project?rev=44061&view=rev
Log:
Wow. I definitely shouldn't write code when I'm tird.
Make my previous patch actually do what it was intended to do.
Modified:
llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h
Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h?rev=44061&r1=44060&r2=44061&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h (original)
+++ llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Tue Nov 13 13:56:28 2007
@@ -52,27 +52,16 @@
break;
}
- // Scan the operands of this branch, finding all uses of this MBB
- std::vector toRemove;
- unsigned reg = 0;
+ // Scan the operands of this branch, replacing any uses of dst with
+ // crit_mbb.
for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) {
MachineOperand & mo = mii->getOperand(i);
if (mo.isMachineBasicBlock() &&
- mo.getMachineBasicBlock() == dst)
- reg = mii->getOperand(i-1).getReg();
- toRemove.push_back(i-1);
+ mo.getMachineBasicBlock() == dst) {
+ found_branch = true;
+ mo.setMachineBasicBlock(crit_mbb);
+ }
}
-
- // Remove all uses of this MBB
- for (std::vector::reverse_iterator I = toRemove.rbegin(),
- E = toRemove.rend(); I != E; ++I) {
- mii->RemoveOperand(*I+1);
- mii->RemoveOperand(*I);
- }
-
- // Add a single use corresponding to the new MBB
- mii->addRegOperand(reg, false);
- mii->addMachineBasicBlockOperand(crit_mbb);
}
// TODO: This is tentative. It may be necessary to fix this code. Maybe
@@ -89,10 +78,26 @@
if(mii->getOpcode() != TargetInstrInfo::PHI)
break;
+ // Find the operands corresponding to the source block
+ std::vector toRemove;
+ unsigned reg = 0;
for (unsigned u = 0; u != mii->getNumOperands(); ++u)
if (mii->getOperand(u).isMachineBasicBlock() &&
- mii->getOperand(u).getMachineBasicBlock() == src)
- mii->getOperand(u).setMachineBasicBlock(crit_mbb);
+ mii->getOperand(u).getMachineBasicBlock() == src) {
+ reg = mii->getOperand(u-1).getReg();
+ toRemove.push_back(u-1);
+ }
+
+ // Remove all uses of this MBB
+ for (std::vector::reverse_iterator I = toRemove.rbegin(),
+ E = toRemove.rend(); I != E; ++I) {
+ mii->RemoveOperand(*I+1);
+ mii->RemoveOperand(*I);
+ }
+
+ // Add a single use corresponding to the new MBB
+ mii->addRegOperand(reg, false);
+ mii->addMachineBasicBlockOperand(crit_mbb);
}
return crit_mbb;
From resistor at mac.com Tue Nov 13 14:04:45 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 13 Nov 2007 20:04:45 -0000
Subject: [llvm-commits] [llvm] r44063 -
/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Message-ID: <200711132004.lADK4jgY010319@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Nov 13 14:04:45 2007
New Revision: 44063
URL: http://llvm.org/viewvc/llvm-project?rev=44063&view=rev
Log:
Preserve LiveVariables when doing critical edge splitting.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=44063&r1=44062&r2=44063&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Nov 13 14:04:45 2007
@@ -26,6 +26,7 @@
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/SSARegMap.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/Statistic.h"
@@ -296,12 +297,15 @@
}
}
+/// breakCriticalEdges - Break critical edges coming into blocks with PHI
+/// nodes, preserving dominator and livevariable info.
void StrongPHIElimination::breakCriticalEdges(MachineFunction &Fn) {
typedef std::pair MBB_pair;
MachineDominatorTree& MDT = getAnalysis();
- //LiveVariables& LV = getAnalysis();
+ LiveVariables& LV = getAnalysis();
+ // Find critical edges
std::vector criticals;
for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
if (!I->empty() &&
@@ -314,9 +318,16 @@
for (std::vector::iterator I = criticals.begin(),
E = criticals.end(); I != E; ++I) {
- SplitCriticalMachineEdge(I->first, I->second);
+ // Split the edge
+ MachineBasicBlock* new_bb = SplitCriticalMachineEdge(I->first, I->second);
+ // Update dominators
MDT.splitBlock(I->first);
+
+ // Update livevariables
+ for (unsigned var = 1024; var < Fn.getSSARegMap()->getLastVirtReg(); ++var)
+ if (isLiveOut(LV.getVarInfo(var), I->first))
+ LV.getVarInfo(var).AliveBlocks.set(new_bb->getNumber());
}
}
From resistor at mac.com Tue Nov 13 14:13:25 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 13 Nov 2007 20:13:25 -0000
Subject: [llvm-commits] [llvm] r44064 -
/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Message-ID: <200711132013.lADKDPRT010701@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Nov 13 14:13:24 2007
New Revision: 44064
URL: http://llvm.org/viewvc/llvm-project?rev=44064&view=rev
Log:
Run computeDomForest() on the set of registers that need to be tested for
interference.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=44064&r1=44063&r2=44064&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Nov 13 14:13:24 2007
@@ -285,14 +285,15 @@
} else {
PHIUnion.insert(SrcReg);
UnionedBlocks.insert(SrcInfo.DefInst->getParent());
-
- // DO STUFF HERE
-
}
-
- ProcessedNames.insert(PHIUnion.begin(), PHIUnion.end());
}
+ std::vector DF =
+ computeDomForest(PHIUnion);
+
+ // DO STUFF HERE
+
+ ProcessedNames.insert(PHIUnion.begin(), PHIUnion.end());
++P;
}
}
From sabre at nondot.org Tue Nov 13 15:42:48 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 13 Nov 2007 21:42:48 -0000
Subject: [llvm-commits] [llvm] r44067 - in
/llvm/trunk/test/Transforms/GlobalOpt: deadglobal-2.ll deadglobal-2.llx
Message-ID: <200711132142.lADLgmFG014693@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Nov 13 15:42:48 2007
New Revision: 44067
URL: http://llvm.org/viewvc/llvm-project?rev=44067&view=rev
Log:
upgrade test
Added:
llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll
Removed:
llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.llx
Added: llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll?rev=44067&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll (added)
+++ llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll Tue Nov 13 15:42:48 2007
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal
+
+; This is a harder case to delete as the GEP has a variable index.
+
+ at G = internal global [4 x i32] zeroinitializer
+
+define void @foo(i32 %X) {
+ %Ptr = getelementptr [4 x i32]* @G, i32 0, i32 %X
+ store i32 1, i32* %Ptr
+ ret void
+}
Removed: llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.llx?rev=44066&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.llx (original)
+++ llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.llx (removed)
@@ -1,11 +0,0 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep internal
-
-; This is a harder case to delete as the GEP has a variable index.
-
-%G = internal global [4 x int] zeroinitializer
-
-void %foo(int %X) {
- %Ptr = getelementptr [4 x int]* %G, int 0, int %X
- store int 1, int* %Ptr
- ret void
-}
From sabre at nondot.org Tue Nov 13 15:46:23 2007
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 13 Nov 2007 21:46:23 -0000
Subject: [llvm-commits] [llvm] r44068 -
/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Message-ID: <200711132146.lADLkN6c014844@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Nov 13 15:46:23 2007
New Revision: 44068
URL: http://llvm.org/viewvc/llvm-project?rev=44068&view=rev
Log:
Fix the regression on Transforms/GlobalOpt/deadglobal-2.ll from my
patch on friday.
Modified:
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=44068&r1=44067&r2=44068&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Nov 13 15:46:23 2007
@@ -345,14 +345,14 @@
// Do not transform "gepinst (gep constexpr (GV))" here, because forming
// "gepconstexpr (gep constexpr (GV))" will cause the two gep's to fold
// and will invalidate our notion of what Init is.
+ Constant *SubInit = 0;
if (!isa(GEP->getOperand(0))) {
ConstantExpr *CE =
dyn_cast_or_null(ConstantFoldInstruction(GEP));
if (Init && CE && CE->getOpcode() == Instruction::GetElementPtr)
- if (Constant *SubInit =
- ConstantFoldLoadThroughGEPConstantExpr(Init, CE))
- Changed |= CleanupConstantGlobalUsers(GEP, SubInit);
+ SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
}
+ Changed |= CleanupConstantGlobalUsers(GEP, SubInit);
if (GEP->use_empty()) {
GEP->eraseFromParent();
From isanbard at gmail.com Tue Nov 13 16:03:46 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 22:03:46 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44071 - /llvm-gcc-4.2/trunk/build_gcc
Message-ID: <200711132203.lADM3kmx015618@zion.cs.uiuc.edu>
Author: void
Date: Tue Nov 13 16:03:46 2007
New Revision: 44071
URL: http://llvm.org/viewvc/llvm-project?rev=44071&view=rev
Log:
Apple way build changes
Modified:
llvm-gcc-4.2/trunk/build_gcc
Modified: llvm-gcc-4.2/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=44071&r1=44070&r2=44071&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/build_gcc (original)
+++ llvm-gcc-4.2/trunk/build_gcc Tue Nov 13 16:03:46 2007
@@ -6,7 +6,9 @@
# -arch arguments are different than configure arguments. We need to
# translate them.
-TRANSLATE_ARCH="sed -e s/ppc/powerpc/ -e s/i386/i686/"
+TRANSLATE_ARCH="sed -e s/ppc/powerpc/ -e s/i386/i686/ -e s/ppc64/powerpc64/"
+TRANSLATE_TARGETS="sed -e s/ppc/powerpc/ -e s/i386/i686/ -e s/x86_64// \
+ -e s/powerpc64// -e s/ppc64//"
# Build GCC the "Apple way".
# Parameters:
@@ -20,7 +22,7 @@
# compilers will generate code for. If the current machine isn't in
# the list, a compiler for it will get built anyway, but won't be
# installed.
-TARGETS=`echo $2 | $TRANSLATE_ARCH`
+TARGETS=`echo $2 | $TRANSLATE_TARGETS`
# The GNU makefile target ('bootstrap' by default).
BOOTSTRAP=${BOOTSTRAP-bootstrap}
@@ -33,7 +35,11 @@
# $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
# We will allow this to override the default $CFLAGS and $CXXFLAGS.
-CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
+if [ "x$LLVM_DEBUG" == "x" ]; then
+ CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
+else
+ CFLAGS="-g"
+fi
# This isn't a parameter; it is the architecture of the current machine.
BUILD=`arch | $TRANSLATE_ARCH`
@@ -71,6 +77,13 @@
# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
LLVM_BIN_DIR=/Developer/usr/bin
+# LLVM_ARCHS - This tells us which architectures we'd like the libraries to be
+# build for. The default is 4-way.
+if [ "x$LLVM_ARCHS" == "x" ]; then
+ LLVM_ARCHS="ppc i386 ppc64 x86_64"
+fi
+
+# LLVM LOCAL end
# The current working directory is where the build will happen.
# It may already contain a partial result of an interrupted build,
@@ -109,18 +122,26 @@
mkdir $SRC_DIR || exit 1
ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
rm -rf $SRC_DIR/tcl $SRC_DIR/expect $SRC_DIR/dejagnu || exit 1
+
# Also remove libstdc++ since it is built from a separate project.
rm -rf $SRC_DIR/libstdc++-v3 || exit 1
# Clean out old specs files
rm -f /usr/lib/gcc/*/4.0.0/specs
# These are the configure and build flags that are used.
-CONFIGFLAGS="--disable-checking -enable-werror \
+
+if [ "x$LLVM_DEBUG" == "x" ]; then
+ CHECKING_FLAGS="--disable-checking --enable-werror"
+else
+ CHECKING_FLAGS="--enable-checking"
+fi
+
+CONFIGFLAGS="$CHECKING_FLAGS \
--prefix=$DEST_ROOT \
--mandir=\${prefix}/share/man \
--enable-languages=c,objc,c++,obj-c++ \
--program-prefix=llvm- \
- --program-suffix=-$MAJ_VERS \
+ --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
--with-gxx-include-dir=/usr/include/c++/$LIBSTDCXX_VERSION \
--with-slibdir=/usr/lib \
--build=$BUILD-apple-darwin$DARWIN_VERS"
@@ -129,6 +150,7 @@
if [ "$ENABLE_LLVM" == true ]; then
CONFIGFLAGS="$CONFIGFLAGS --enable-llvm=/usr/local"
fi
+# LLVM LOCAL end
# Figure out how many make processes to run.
SYSCTL=`sysctl -n hw.activecpu`
@@ -176,7 +198,7 @@
# Add the compiler we just built to the path, giving it appropriate names.
# LLVM LOCAL Support for non /usr $DEST_ROOT
D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
-ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1
+ln -f $D/llvm-gcc $D/gcc || exit 1
ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
# LLVM LOCAL Support for non /usr $DEST_ROOT
PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
@@ -206,8 +228,17 @@
done
PATH=$DIR/bin:$PATH
+# Determine which cross-compilers we should build. If our build architecture is
+# one of our hosts, add all of the targets to the list.
+if echo $HOSTS | grep $BUILD
+then
+ CROSS_TARGETS=`echo $TARGETS $HOSTS | tr ' ' '\n' | sort -u`
+else
+ CROSS_TARGETS="$HOSTS"
+fi
+
# Build the cross-compilers, using the compiler we just built.
-for t in $TARGETS ; do
+for t in $CROSS_TARGETS ; do
if [ $t != $BUILD ] ; then
mkdir -p $DIR/obj-$BUILD-$t $DIR/dst-$BUILD-$t || exit 1
cd $DIR/obj-$BUILD-$t || exit 1
@@ -220,16 +251,16 @@
make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$t install-gcc install-target \
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
- # Add the compiler we just built to the path.
-# LLVM LOCAL Support for non /usr $DEST_ROOT
+ # Add the compiler we just built to the path.
+ # LLVM LOCAL Support for non /usr $DEST_ROOT
PATH=$DIR/dst-$BUILD-$t/$DEST_ROOT/bin:$PATH
fi
done
# Rearrange various libraries, for no really good reason.
-for t in $TARGETS ; do
+for t in $CROSS_TARGETS ; do
DT=$DIR/dst-$BUILD-$t
-# LLVM LOCAL begin Support for non /usr $DEST_ROOT
+ # LLVM LOCAL begin Support for non /usr $DEST_ROOT
D=`echo $DT/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
mv $D/static/libgcc.a $D/libgcc_static.a || exit 1
mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1
@@ -275,13 +306,14 @@
# Clean out DEST_DIR in case -noclean was passed to buildit.
rm -rf * || exit 1
-# LLVM LOCAL Don't install HTML docs.
+# LLVM LOCAL begin - Don't install HTML docs.
if [ "$ENABLE_LLVM" == false ]; then
-# HTML documentation
-HTMLDIR="/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools"
-mkdir -p ".$HTMLDIR" || exit 1
-cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
+ # HTML documentation
+ HTMLDIR="/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools"
+ mkdir -p ".$HTMLDIR" || exit 1
+ cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
fi
+# LLVM LOCAL end - Don't install docs.
# Manual pages
mkdir -p .$DEST_ROOT/share || exit 1
@@ -328,24 +360,24 @@
$DIR/dst-*-$TARG0$DEST_ROOT/bin/*gcov* || exit 1
# The fully-named drivers, which have the same target on every host.
for t in $TARGETS ; do
+# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT
lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS -create \
- $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc || exit 1
+# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT
lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS -create \
- $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1
+ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++ || exit 1
done
# lib
mkdir -p .$DEST_ROOT/lib/gcc || exit 1
for t in $TARGETS ; do
- cp -Rp $DIR/dst-$BUILD-$t$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \
+# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT
+ cp -Rp $DIR/dst-$BUILD-$t/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \
.$DEST_ROOT/lib/gcc || exit 1
done
# And copy libgomp stuff by hand...
for t in $TARGETS ; do
- if [ ! -d .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ ]; then
- mkdir -p .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
- fi
for h in $HOSTS ; do
if [ $h = $t ] ; then
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.a \
@@ -353,17 +385,11 @@
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.spec \
.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
if [ $h = 'powerpc' ] ; then
- if [ ! -d .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ ]; then
- mkdir -p .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
- fi
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.a \
.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.spec \
.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
elif [ $h = 'i686' ] ; then
- if [ ! -d .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ ]; then
- mkdir -p .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
- fi
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.a \
.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.spec \
@@ -377,7 +403,8 @@
cp -p /usr/lib/libstdc++.6.dylib \
.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \
|| exit 1
- strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1
+# LLVM LOCAL
+# strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1
done
# include
@@ -406,19 +433,19 @@
# Add extra man page symlinks for 'c++' and for arch-specific names.
MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
-ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/llvm-c++-$MAJ_VERS.1 || exit 1
+ln -f $MDIR/llvm-g++.1 $MDIR/llvm-c++.1 || exit 1
for t in $TARGETS ; do
- ln -f $MDIR/llvm-gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS.1 \
+ ln -f $MDIR/llvm-gcc.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc.1 \
|| exit 1
- ln -f $MDIR/llvm-g++-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS.1 \
+ ln -f $MDIR/llvm-g++.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++.1 \
|| exit 1
done
# Build driver-driver using fully-named drivers
for h in $HOSTS ; do
- $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS \
+ $h-apple-darwin$DARWIN_VERS-gcc \
$ORIG_SRC_DIR/driverdriver.c \
- -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS\"" \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
-I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
@@ -426,9 +453,9 @@
-L$DIR/obj-$h-$BUILD/libiberty/ \
-o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcc-$MAJ_VERS || exit 1
- $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-gcc-$VERS \
+ $h-apple-darwin$DARWIN_VERS-gcc \
$ORIG_SRC_DIR/driverdriver.c \
- -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$VERS\"" \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS\"" \
-DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
-I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
@@ -472,7 +499,7 @@
########################################
# Remove debugging information from DEST_DIR.
-find $DEST_DIR -perm -0111 \! -name fixinc.sh \
+find $DEST_DIR -perm -0111 \! -name \*.dylib \! -name fixinc.sh \
\! -name mkheaders \! -name libstdc++.dylib -type f -print \
| xargs strip || exit 1
# APPLE LOCAL begin LLVM - Strip with -Sx instead of -SX
From clattner at apple.com Tue Nov 13 16:12:37 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 13 Nov 2007 14:12:37 -0800
Subject: [llvm-commits] make check failures
In-Reply-To:
References:
Message-ID: <3EBD5AB0-0E24-4F7D-8F2B-66069508358F@apple.com>
On Nov 13, 2007, at 10:46 AM, Tanya Lattner wrote:
> There are quite a few make check failures that the nightly testers
> are reporting.
> On my machine (x86 Mac OsX) I am seeing the following with TOT (svn: )
> test/CFrontend/2007-11-07-CopyAggregateAlign.c
> test/Transforms/GlobalOpt/deadglobal-2.llx
The second was my fault, it is fixed now. The first also fails for
me on ppc/darwin, I'm not responsible for that one. See below.
> From the nightly testers last night:
>
> OldGrawp (x86):
> test/CFrontend/2007-10-30-Volatile.c
> test/CFrontend/2007-11-07-CopyAggregateAlign.c
> test/Transforms/GlobalOpt/deadglobal-2.llx
the last one is fixed, the first one is probably due to evan's cfe
being out of date.
> sabre-ppc32:
> test/CFrontend/2007-10-15-VoidPtr.c
> test/CFrontend/2007-10-30-Volatile.c
> test/CFrontend/sret2.c
> test/FrontendObjC/2007-10-17-SJLJExceptions.m
> test/FrontendObjC/2007-10-23-GC-WriteBarrier.m
> test/Transforms/GlobalOpt/deadglobal-2.llx
All of these were because I haven't updated my cfe recently. These
should pass tonight.
> test/CFrontend/2007-11-07-CopyAggregateAlign.c
This still fails for me. Duncan, thoughts? Greping for align 2
yields just two hits:
%tmp14 = load i16* %tmp13, align 2 ;
[#uses=1]
store i16 %tmp14, i16* %tmp12, align 2
not 6.
-Chris
From asl at math.spbu.ru Tue Nov 13 16:32:44 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 01:32:44 +0300
Subject: [llvm-commits] [llvm] r44029
- /llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
In-Reply-To: <5A6E951F-73FA-46F3-A28D-C836F23EAAF2.SS1691SS@apple.com>
References: <200711122336.lACNaDoZ029865@zion.cs.uiuc.edu>
<5A6E951F-73FA-46F3-A28D-C836F23EAAF2.SS1691SS@apple.com>
Message-ID: <1194993164.10807.149.camel@asl.dorms.spbu.ru>
Hello, Dale.
> Actually, they apparently don't; however, both targets use different
> numberings for EH and debug info. Or so say the comments in gcc. I take it
> these are right for debug info?
I really don't know.
In fact, I noticed, that after my patch sabre-ppc tester had some
regressions and I remember, that debug information was supported on
ppc/darwin. That's why I added this function and a FIXME.
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From baldrick at free.fr Tue Nov 13 17:02:22 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 00:02:22 +0100
Subject: [llvm-commits] [llvm] r43988 - in /llvm/trunk:
lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td
utils/TableGen/CallingConvEmitter.cpp
In-Reply-To: <4F3C2091-7FA9-4ABE-AD4C-B848E26C9037@apple.com>
References: <200711102207.lAAM7Gtr010958@zion.cs.uiuc.edu>
<200711121948.55740.baldrick@free.fr>
<4F3C2091-7FA9-4ABE-AD4C-B848E26C9037@apple.com>
Message-ID: <200711140002.23157.baldrick@free.fr>
How about this?
Index: llvm/lib/Target/TargetCallingConv.td
===================================================================
--- llvm.orig/lib/Target/TargetCallingConv.td 2007-11-13 20:06:06.000000000 +0100
+++ llvm/lib/Target/TargetCallingConv.td 2007-11-13 20:08:24.000000000 +0100
@@ -60,19 +60,14 @@
}
/// CCAssignToStack - This action always matches: it assigns the value to a
-/// stack slot of the specified size and alignment on the stack.
+/// stack slot of the specified size and alignment on the stack. If size is
+/// zero then the ABI size is used; if align is zero then the ABI alignment
+/// is used - these may depend on the target or subtarget.
class CCAssignToStack : CCAction {
int Size = size;
int Align = align;
}
-/// CCAssignToStackABISizeAlign - This action always matches: it assigns
-/// the value to a stack slot of the ABISize and ABIAlignment for the type,
-/// which may depend on the target or subtarget.
-/// "ignored" is here because an empty arg list does not work.
-class CCAssignToStackABISizeAlign : CCAction {
-}
-
/// CCStructAssign - This action always matches: it will use the C ABI and
/// the register availability to decided whether to assign to a set of
/// registers or to a stack slot.
Index: llvm/lib/Target/X86/X86CallingConv.td
===================================================================
--- llvm.orig/lib/Target/X86/X86CallingConv.td 2007-11-13 20:08:33.000000000 +0100
+++ llvm/lib/Target/X86/X86CallingConv.td 2007-11-13 20:30:04.000000000 +0100
@@ -120,7 +120,7 @@
// Long doubles get stack slots whose size and alignment depends on the
// subtarget.
- CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+ CCIfType<[f80], CCAssignToStack<0, 0>>,
// Vectors get 16-byte stack slots that are 16-byte aligned.
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
@@ -181,7 +181,7 @@
// Long doubles get slots whose size and alignment depends on the
// subtarget.
- CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+ CCIfType<[f80], CCAssignToStack<0, 0>>,
// The first 4 vector arguments are passed in XMM registers.
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
Index: llvm/utils/TableGen/CallingConvEmitter.cpp
===================================================================
--- llvm.orig/utils/TableGen/CallingConvEmitter.cpp 2007-11-13 20:09:26.000000000 +0100
+++ llvm/utils/TableGen/CallingConvEmitter.cpp 2007-11-13 20:26:27.000000000 +0100
@@ -114,19 +114,21 @@
} else if (Action->isSubClassOf("CCAssignToStack")) {
int Size = Action->getValueAsInt("Size");
int Align = Action->getValueAsInt("Align");
-
+
O << IndentStr << "unsigned Offset" << ++Counter
- << " = State.AllocateStack(" << Size << ", " << Align << ");\n";
- O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
- << Counter << ", LocVT, LocInfo));\n";
- O << IndentStr << "return false;\n";
- } else if (Action->isSubClassOf("CCAssignToStackABISizeAlign")) {
- O << IndentStr << "unsigned Offset" << ++Counter
- << " = State.AllocateStack(State.getTarget().getTargetData()"
- "->getABITypeSize(MVT::getTypeForValueType(LocVT)),\n";
- O << IndentStr << " State.getTarget().getTargetData()"
- "->getABITypeAlignment(MVT::getTypeForValueType(LocVT)));\n";
- O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
+ << " = State.AllocateStack(";
+ if (Size)
+ O << Size << ", ";
+ else
+ O << "\n" << IndentStr << " State.getTarget().getTargetData()"
+ "->getABITypeSize(MVT::getTypeForValueType(LocVT)), ";
+ if (Align)
+ O << Align;
+ else
+ O << "\n" << IndentStr << " State.getTarget().getTargetData()"
+ "->getABITypeAlignment(MVT::getTypeForValueType(LocVT))";
+ O << ");\n" << IndentStr
+ << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
<< Counter << ", LocVT, LocInfo));\n";
O << IndentStr << "return false;\n";
} else if (Action->isSubClassOf("CCPromoteToType")) {
From hartmut.kaiser at gmail.com Tue Nov 13 17:03:34 2007
From: hartmut.kaiser at gmail.com (Hartmut Kaiser)
Date: Tue, 13 Nov 2007 23:03:34 -0000
Subject: [llvm-commits] [llvm] r44081 - in /llvm/trunk/win32:
System/System.vcproj TableGen/TableGen.vcproj Target/Target.vcproj
Transforms/Transforms.vcproj
Message-ID: <200711132303.lADN3YiH019005@zion.cs.uiuc.edu>
Author: hkaiser
Date: Tue Nov 13 17:03:32 2007
New Revision: 44081
URL: http://llvm.org/viewvc/llvm-project?rev=44081&view=rev
Log:
Updated VC++ build system
Modified:
llvm/trunk/win32/System/System.vcproj
llvm/trunk/win32/TableGen/TableGen.vcproj
llvm/trunk/win32/Target/Target.vcproj
llvm/trunk/win32/Transforms/Transforms.vcproj
Modified: llvm/trunk/win32/System/System.vcproj
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/System/System.vcproj?rev=44081&r1=44080&r2=44081&view=diff
==============================================================================
--- llvm/trunk/win32/System/System.vcproj (original)
+++ llvm/trunk/win32/System/System.vcproj Tue Nov 13 17:03:32 2007
@@ -112,7 +112,7 @@
Author: hkaiser
Date: Tue Nov 13 17:04:06 2007
New Revision: 44082
URL: http://llvm.org/viewvc/llvm-project?rev=44082&view=rev
Log:
Fixed a strange construct. Please review.
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=44082&r1=44081&r2=44082&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Tue Nov 13 17:04:06 2007
@@ -800,7 +800,7 @@
}
iterator end() const {
- return iterator(this, ~0);
+ return iterator(this, true);
}
// Get a hash value for this bitmap.
From hartmut.kaiser at gmail.com Tue Nov 13 17:04:28 2007
From: hartmut.kaiser at gmail.com (Hartmut Kaiser)
Date: Tue, 13 Nov 2007 23:04:28 -0000
Subject: [llvm-commits] [llvm] r44083 -
/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
Message-ID: <200711132304.lADN4Sd1019069@zion.cs.uiuc.edu>
Author: hkaiser
Date: Tue Nov 13 17:04:28 2007
New Revision: 44083
URL: http://llvm.org/viewvc/llvm-project?rev=44083&view=rev
Log:
Fixed a compilation error.
Modified:
llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=44083&r1=44082&r2=44083&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Nov 13 17:04:28 2007
@@ -27,6 +27,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Allocator.h"
+#include
namespace llvm {
From baldrick at free.fr Tue Nov 13 17:06:14 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 00:06:14 +0100
Subject: [llvm-commits] make check failures
In-Reply-To: <3EBD5AB0-0E24-4F7D-8F2B-66069508358F@apple.com>
References:
<3EBD5AB0-0E24-4F7D-8F2B-66069508358F@apple.com>
Message-ID: <200711140006.14564.baldrick@free.fr>
Hi Chris,
> > test/CFrontend/2007-11-07-CopyAggregateAlign.c
>
> This still fails for me. Duncan, thoughts? Greping for align 2
> yields just two hits:
>
> %tmp14 = load i16* %tmp13, align 2 ;
> [#uses=1]
> store i16 %tmp14, i16* %tmp12, align 2
>
> not 6.
well I guess Bill hasn't back-ported the DestLoc patch from 4.2 to 4.0 yet.
I can XFAIL it until he does if you like.
Ciao,
D.
From baldrick at free.fr Tue Nov 13 17:07:07 2007
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 13 Nov 2007 23:07:07 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44084 -
/llvm-gcc-4.2/trunk/gcc/Makefile.in
Message-ID: <200711132307.lADN77wK019204@zion.cs.uiuc.edu>
Author: baldrick
Date: Tue Nov 13 17:07:07 2007
New Revision: 44084
URL: http://llvm.org/viewvc/llvm-project?rev=44084&view=rev
Log:
I have a picky "make" that doesn't like ==.
Modified:
llvm-gcc-4.2/trunk/gcc/Makefile.in
Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=44084&r1=44083&r2=44084&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/Makefile.in (original)
+++ llvm-gcc-4.2/trunk/gcc/Makefile.in Tue Nov 13 17:07:07 2007
@@ -252,7 +252,7 @@
### exist, then use LLVMOBJDIR.
LLVMSRCDIR := $(shell \
P=`$(LLVMBINPATH)/llvm-config --src-root`; \
- if [ `pwd` == $$P ]; then \
+ if [ `pwd` = $$P ]; then \
echo "$(LLVMOBJDIR)"; \
else \
echo "$$P"; \
From isanbard at gmail.com Tue Nov 13 17:07:43 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 23:07:43 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44085 - /llvm-gcc-4.2/tags/Apple/
Message-ID: <200711132307.lADN7hf8019245@zion.cs.uiuc.edu>
Author: void
Date: Tue Nov 13 17:07:43 2007
New Revision: 44085
URL: http://llvm.org/viewvc/llvm-project?rev=44085&view=rev
Log:
New directory for tags
Added:
llvm-gcc-4.2/tags/Apple/
From isanbard at gmail.com Tue Nov 13 17:09:59 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 23:09:59 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44086 - in
/llvm-gcc-4.2/tags/Apple/llvmgcc42-2000: ./ gcc/ gcc/autom4te.cache/
gcc/config/ gcc/config/arm/ gcc/config/i386/ gcc/config/rs6000/ gcc/cp/
gcc/doc/ gcc/ginclude/ gcc/objc/
Message-ID: <200711132309.lADN9xBm019357@zion.cs.uiuc.edu>
Author: void
Date: Tue Nov 13 17:09:58 2007
New Revision: 44086
URL: http://llvm.org/viewvc/llvm-project?rev=44086&view=rev
Log:
Creating llvmgcc42-2000 tag
Added:
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/
- copied from r43921, llvm-gcc-4.2/trunk/
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/GNUmakefile
- copied unchanged from r44040, llvm-gcc-4.2/trunk/GNUmakefile
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/build_gcc
- copied unchanged from r44071, llvm-gcc-4.2/trunk/build_gcc
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/configure
- copied unchanged from r43990, llvm-gcc-4.2/trunk/configure
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/configure.in
- copied unchanged from r43990, llvm-gcc-4.2/trunk/configure.in
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/
- copied from r43925, llvm-gcc-4.2/trunk/gcc/
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/ChangeLog
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/ChangeLog
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/ChangeLog.apple
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/ChangeLog.lno
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/ChangeLog.lno
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/Makefile.in
- copied unchanged from r43992, llvm-gcc-4.2/trunk/gcc/Makefile.in
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/autom4te.cache/
- copied from r44085, llvm-gcc-4.2/trunk/gcc/autom4te.cache/
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/bitmap.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/bitmap.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/builtins.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/builtins.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/builtins.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/builtins.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-common.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-common.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-common.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-common.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-decl.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-decl.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-lex.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-lex.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-opts.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-opts.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-parser.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-parser.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-tree.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-tree.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c-typeck.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c-typeck.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/c.opt
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/c.opt
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/calls.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/calls.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cfghooks.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cfghooks.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/common.opt
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/common.opt
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config.gcc
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config.gcc
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/arm-protos.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/arm.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/arm.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/arm.md
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/arm.md
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/arm.opt
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/ieee754-df.S
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/ieee754-sf.S
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/lib1funcs.asm
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/arm/predicates.md
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/asm.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/asm.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/darwin-c.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/darwin-protos.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/darwin-sections.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/darwin.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/darwin.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/darwin.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/darwin.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/cygming.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/cygming.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/darwin.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/i386-protos.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/i386.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/i386.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/i386.md
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/i386.md
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/linux.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/linux.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/i386/t-mingw32
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/i386/t-mingw32
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/darwin.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/llvm-rs6000.cpp
- copied unchanged from r43926, llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/rs6000-protos.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000-protos.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/rs6000.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/rs6000.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/config/rs6000/rs6000.md
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.md
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/ChangeLog
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/ChangeLog
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/ChangeLog.apple
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/call.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/call.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/class.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/class.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/cp-gimplify.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/cp-tree.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/cp-tree.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/cp-tree.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/cvt.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/cvt.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/decl.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/decl.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/dump.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/dump.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/init.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/init.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/name-lookup.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/parser.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/parser.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/pt.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/pt.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/semantics.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/semantics.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/typeck.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/typeck.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cp/typeck2.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cp/typeck2.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/cse.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/cse.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/dbxout.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/dbxout.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/defaults.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/defaults.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/doc/extend.texi
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/doc/extend.texi
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/doc/invoke.texi
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/doc/invoke.texi
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/dwarf2out.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/dwarf2out.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/emit-rtl.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/emit-rtl.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/except.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/except.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/explow.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/explow.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/expr.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/expr.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/final.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/final.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/function.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/function.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/gcc.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/gcc.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/gcse.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/gcse.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/gimplify.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/gimplify.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/ginclude/float.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/ginclude/float.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/global.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/global.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/insn-notes.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/insn-notes.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/jump.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/jump.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/libgcc2.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/libgcc2.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/libgcc2.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/libgcc2.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/objc/ChangeLog.apple
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/objc/objc-act.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/objc/objc-act.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/objc/objc-act.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/objc/objc-tree.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/opts.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/opts.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/passes.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/passes.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/print-rtl.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/print-rtl.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/recog.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/recog.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/regclass.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/regclass.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/reload.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/reload.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/reload1.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/reload1.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/rtl.def
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/rtl.def
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/rtl.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/rtl.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/stmt.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/stmt.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/stor-layout.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/stor-layout.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/stub-objc.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/stub-objc.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/target-def.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/target-def.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/target.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/target.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/toplev.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/toplev.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/toplev.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/toplev.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-cfg.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-cfg.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-flow.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-flow.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-pass.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-pass.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-sra.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-sra.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-ssa-loop-memset.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-ssa-loop-memset.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-ssa-loop.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-ssa-loop.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-vect-analyze.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-vect-analyze.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree-vectorizer.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree-vectorizer.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/tree.h
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/tree.h
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/varasm.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/varasm.c
llvm-gcc-4.2/tags/Apple/llvmgcc42-2000/gcc/version.c
- copied unchanged from r43927, llvm-gcc-4.2/trunk/gcc/version.c
From dalej at apple.com Tue Nov 13 17:17:12 2007
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 13 Nov 2007 15:17:12 -0800
Subject: [llvm-commits] [llvm] r43988 - in /llvm/trunk:
lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td
utils/TableGen/CallingConvEmitter.cpp
In-Reply-To: <200711140002.23157.baldrick@free.fr>
References: <200711102207.lAAM7Gtr010958@zion.cs.uiuc.edu>
<200711121948.55740.baldrick@free.fr>
<4F3C2091-7FA9-4ABE-AD4C-B848E26C9037@apple.com>
<200711140002.23157.baldrick@free.fr>
Message-ID:
On Nov 13, 2007, at 3:02 PM, Duncan Sands wrote:
> How about this?
Doesn't an empty array or struct have size 0?
Personally I don't think this is an improvement, but I have no
particular objection to it,
assuming the above is not really a problem. I'm ready to move on.
> Index: llvm/lib/Target/TargetCallingConv.td
> ===================================================================
> --- llvm.orig/lib/Target/TargetCallingConv.td 2007-11-13
> 20:06:06.000000000 +0100
> +++ llvm/lib/Target/TargetCallingConv.td 2007-11-13
> 20:08:24.000000000 +0100
> @@ -60,19 +60,14 @@
> }
>
> /// CCAssignToStack - This action always matches: it assigns the
> value to a
> -/// stack slot of the specified size and alignment on the stack.
> +/// stack slot of the specified size and alignment on the stack.
> If size is
> +/// zero then the ABI size is used; if align is zero then the ABI
> alignment
> +/// is used - these may depend on the target or subtarget.
> class CCAssignToStack : CCAction {
> int Size = size;
> int Align = align;
> }
>
> -/// CCAssignToStackABISizeAlign - This action always matches: it
> assigns
> -/// the value to a stack slot of the ABISize and ABIAlignment for
> the type,
> -/// which may depend on the target or subtarget.
> -/// "ignored" is here because an empty arg list does not work.
> -class CCAssignToStackABISizeAlign : CCAction {
> -}
> -
> /// CCStructAssign - This action always matches: it will use the C
> ABI and
> /// the register availability to decided whether to assign to a
> set of
> /// registers or to a stack slot.
> Index: llvm/lib/Target/X86/X86CallingConv.td
> ===================================================================
> --- llvm.orig/lib/Target/X86/X86CallingConv.td 2007-11-13
> 20:08:33.000000000 +0100
> +++ llvm/lib/Target/X86/X86CallingConv.td 2007-11-13
> 20:30:04.000000000 +0100
> @@ -120,7 +120,7 @@
>
> // Long doubles get stack slots whose size and alignment depends
> on the
> // subtarget.
> - CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
> + CCIfType<[f80], CCAssignToStack<0, 0>>,
>
> // Vectors get 16-byte stack slots that are 16-byte aligned.
> CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
> CCAssignToStack<16, 16>>,
> @@ -181,7 +181,7 @@
>
> // Long doubles get slots whose size and alignment depends on the
> // subtarget.
> - CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
> + CCIfType<[f80], CCAssignToStack<0, 0>>,
>
> // The first 4 vector arguments are passed in XMM registers.
> CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
> Index: llvm/utils/TableGen/CallingConvEmitter.cpp
> ===================================================================
> --- llvm.orig/utils/TableGen/CallingConvEmitter.cpp 2007-11-13
> 20:09:26.000000000 +0100
> +++ llvm/utils/TableGen/CallingConvEmitter.cpp 2007-11-13
> 20:26:27.000000000 +0100
> @@ -114,19 +114,21 @@
> } else if (Action->isSubClassOf("CCAssignToStack")) {
> int Size = Action->getValueAsInt("Size");
> int Align = Action->getValueAsInt("Align");
> -
> +
> O << IndentStr << "unsigned Offset" << ++Counter
> - << " = State.AllocateStack(" << Size << ", " << Align <<
> ");\n";
> - O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo,
> ValVT, Offset"
> - << Counter << ", LocVT, LocInfo));\n";
> - O << IndentStr << "return false;\n";
> - } else if (Action->isSubClassOf("CCAssignToStackABISizeAlign")) {
> - O << IndentStr << "unsigned Offset" << ++Counter
> - << " = State.AllocateStack(State.getTarget().getTargetData()"
> - "->getABITypeSize(MVT::getTypeForValueType(LocVT)),\n";
> - O << IndentStr << " State.getTarget().getTargetData()"
> - "->getABITypeAlignment(MVT::getTypeForValueType
> (LocVT)));\n";
> - O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo,
> ValVT, Offset"
> + << " = State.AllocateStack(";
> + if (Size)
> + O << Size << ", ";
> + else
> + O << "\n" << IndentStr << " State.getTarget
> ().getTargetData()"
> + "->getABITypeSize(MVT::getTypeForValueType(LocVT)), ";
> + if (Align)
> + O << Align;
> + else
> + O << "\n" << IndentStr << " State.getTarget
> ().getTargetData()"
> + "->getABITypeAlignment(MVT::getTypeForValueType(LocVT))";
> + O << ");\n" << IndentStr
> + << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
> << Counter << ", LocVT, LocInfo));\n";
> O << IndentStr << "return false;\n";
> } else if (Action->isSubClassOf("CCPromoteToType")) {
From resistor at mac.com Tue Nov 13 17:17:31 2007
From: resistor at mac.com (Owen Anderson)
Date: Tue, 13 Nov 2007 17:17:31 -0600
Subject: [llvm-commits] [llvm] r44082 -
/llvm/trunk/include/llvm/ADT/SparseBitVector.h
In-Reply-To: <200711132304.lADN46TY019042@zion.cs.uiuc.edu>
References: <200711132304.lADN46TY019042@zion.cs.uiuc.edu>
Message-ID: <4DEEF6D7-4433-4B64-9FDB-6633B748CF4F@mac.com>
On Nov 13, 2007, at 5:04 PM, Hartmut Kaiser wrote:
> - return iterator(this, ~0);
> + return iterator(this, true);
I'm not sure this is right. Is "true" guaranteed to be all-ones when
cast to an integer, or just to contain at least one 1 bit? If the
latter, then this patch changes the meaning.
--Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2555 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071113/89c858f5/attachment.bin
From clattner at apple.com Tue Nov 13 18:42:35 2007
From: clattner at apple.com (Chris Lattner)
Date: Tue, 13 Nov 2007 16:42:35 -0800
Subject: [llvm-commits] make check failures
In-Reply-To: <200711140006.14564.baldrick@free.fr>
References:
<3EBD5AB0-0E24-4F7D-8F2B-66069508358F@apple.com>
<200711140006.14564.baldrick@free.fr>
Message-ID:
On Nov 13, 2007, at 3:06 PM, Duncan Sands wrote:
> Hi Chris,
>
>>> test/CFrontend/2007-11-07-CopyAggregateAlign.c
>>
>> This still fails for me. Duncan, thoughts? Greping for align 2
>> yields just two hits:
>>
>> %tmp14 = load i16* %tmp13, align 2 ;
>> [#uses=1]
>> store i16 %tmp14, i16* %tmp12, align 2
>>
>> not 6.
>
> well I guess Bill hasn't back-ported the DestLoc patch from 4.2 to
> 4.0 yet.
> I can XFAIL it until he does if you like.
Ahhh. Please do, thanks Duncan!
-Chris
From resistor at mac.com Tue Nov 13 20:33:58 2007
From: resistor at mac.com (Owen Anderson)
Date: Wed, 14 Nov 2007 02:33:58 -0000
Subject: [llvm-commits] [llvm] r44097 - in /llvm/trunk:
include/llvm/Analysis/LoopInfo.h include/llvm/Analysis/LoopPass.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/FunctionUtils.h lib/Analysis/LoopInfo.cpp
Message-ID: <200711140233.lAE2XxSQ028913@zion.cs.uiuc.edu>
Author: resistor
Date: Tue Nov 13 20:33:58 2007
New Revision: 44097
URL: http://llvm.org/viewvc/llvm-project?rev=44097&view=rev
Log:
Start the process of making MachineLoopInfo possible by templating Loop.
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
llvm/trunk/include/llvm/Analysis/LoopPass.h
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h
llvm/trunk/lib/Analysis/LoopInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Nov 13 20:33:58 2007
@@ -31,8 +31,22 @@
#define LLVM_ANALYSIS_LOOP_INFO_H
#include "llvm/Pass.h"
+#include "llvm/Constants.h"
+#include "llvm/Instructions.h"
#include "llvm/ADT/GraphTraits.h"
+#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/CFG.h"
+#include "llvm/Support/Streams.h"
+#include
+#include
+
+template
+static void RemoveFromVector(std::vector &V, T *N) {
+ typename std::vector::iterator I = std::find(V.begin(), V.end(), N);
+ assert(I != V.end() && "N is not in this list!");
+ V.erase(I);
+}
namespace llvm {
@@ -42,64 +56,88 @@
class Instruction;
//===----------------------------------------------------------------------===//
-/// Loop class - Instances of this class are used to represent loops that are
+/// LoopBase class - Instances of this class are used to represent loops that are
/// detected in the flow graph
///
-class Loop {
- Loop *ParentLoop;
- std::vector SubLoops; // Loops contained entirely within this one
- std::vector Blocks; // First entry is the header node
+template
+class LoopBase {
+ LoopBase *ParentLoop;
+ std::vector*> SubLoops; // Loops contained entirely within this one
+ std::vector Blocks; // First entry is the header node
- Loop(const Loop &); // DO NOT IMPLEMENT
- const Loop &operator=(const Loop &); // DO NOT IMPLEMENT
+ LoopBase(const LoopBase &); // DO NOT IMPLEMENT
+ const LoopBase &operator=(const LoopBase &); // DO NOT IMPLEMENT
public:
/// Loop ctor - This creates an empty loop.
- Loop() : ParentLoop(0) {}
- ~Loop() {
+ LoopBase() : ParentLoop(0) {}
+ ~LoopBase() {
for (unsigned i = 0, e = SubLoops.size(); i != e; ++i)
delete SubLoops[i];
}
unsigned getLoopDepth() const {
unsigned D = 0;
- for (const Loop *CurLoop = this; CurLoop; CurLoop = CurLoop->ParentLoop)
+ for (const LoopBase *CurLoop = this; CurLoop;
+ CurLoop = CurLoop->ParentLoop)
++D;
return D;
}
- BasicBlock *getHeader() const { return Blocks.front(); }
- Loop *getParentLoop() const { return ParentLoop; }
+ BlockT *getHeader() const { return Blocks.front(); }
+ LoopBase *getParentLoop() const { return ParentLoop; }
/// contains - Return true of the specified basic block is in this loop
///
- bool contains(const BasicBlock *BB) const;
+ bool contains(const BlockT *BB) const {
+ return std::find(Blocks.begin(), Blocks.end(), BB) != Blocks.end();
+ }
/// iterator/begin/end - Return the loops contained entirely within this loop.
///
- const std::vector &getSubLoops() const { return SubLoops; }
- typedef std::vector::const_iterator iterator;
+ const std::vector*> &getSubLoops() const { return SubLoops; }
+ typedef typename std::vector*>::const_iterator iterator;
iterator begin() const { return SubLoops.begin(); }
iterator end() const { return SubLoops.end(); }
bool empty() const { return SubLoops.empty(); }
/// getBlocks - Get a list of the basic blocks which make up this loop.
///
- const std::vector &getBlocks() const { return Blocks; }
- typedef std::vector::const_iterator block_iterator;
+ const std::vector &getBlocks() const { return Blocks; }
+ typedef typename std::vector::const_iterator block_iterator;
block_iterator block_begin() const { return Blocks.begin(); }
block_iterator block_end() const { return Blocks.end(); }
/// isLoopExit - True if terminator in the block can branch to another block
/// that is outside of the current loop.
///
- bool isLoopExit(const BasicBlock *BB) const;
+ bool isLoopExit(const BlockT *BB) const {
+ for (succ_const_iterator SI = succ_begin(BB), SE = succ_end(BB);
+ SI != SE; ++SI) {
+ if (!contains(*SI))
+ return true;
+ }
+ return false;
+ }
/// getNumBackEdges - Calculate the number of back edges to the loop header
///
- unsigned getNumBackEdges() const;
+ unsigned getNumBackEdges() const {
+ unsigned NumBackEdges = 0;
+ BlockT *H = getHeader();
+
+ for (pred_iterator I = pred_begin(H), E = pred_end(H); I != E; ++I)
+ if (contains(*I))
+ ++NumBackEdges;
+
+ return NumBackEdges;
+ }
/// isLoopInvariant - Return true if the specified value is loop invariant
///
- bool isLoopInvariant(Value *V) const;
+ bool isLoopInvariant(Value *V) const {
+ if (Instruction *I = dyn_cast(V))
+ return !contains(I->getParent());
+ return true; // All non-instructions are loop invariant
+ }
//===--------------------------------------------------------------------===//
// APIs for simple analysis of the loop.
@@ -113,18 +151,91 @@
/// outside of the loop. These are the blocks _inside of the current loop_
/// which branch out. The returned list is always unique.
///
- void getExitingBlocks(SmallVectorImpl &Blocks) const;
+ void getExitingBlocks(SmallVectorImpl &ExitingBlocks) const {
+ // Sort the blocks vector so that we can use binary search to do quick
+ // lookups.
+ SmallVector LoopBBs(block_begin(), block_end());
+ std::sort(LoopBBs.begin(), LoopBBs.end());
+
+ for (typename std::vector::const_iterator BI = Blocks.begin(),
+ BE = Blocks.end(); BI != BE; ++BI)
+ for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I)
+ if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I)) {
+ // Not in current loop? It must be an exit block.
+ ExitingBlocks.push_back(*BI);
+ break;
+ }
+ }
/// getExitBlocks - Return all of the successor blocks of this loop. These
/// are the blocks _outside of the current loop_ which are branched to.
///
- void getExitBlocks(SmallVectorImpl &Blocks) const;
+ void getExitBlocks(SmallVectorImpl &ExitBlocks) const {
+ // Sort the blocks vector so that we can use binary search to do quick
+ // lookups.
+ SmallVector LoopBBs(block_begin(), block_end());
+ std::sort(LoopBBs.begin(), LoopBBs.end());
+
+ for (typename std::vector::const_iterator BI = Blocks.begin(),
+ BE = Blocks.end(); BI != BE; ++BI)
+ for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I)
+ if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
+ // Not in current loop? It must be an exit block.
+ ExitBlocks.push_back(*I);
+ }
/// getUniqueExitBlocks - Return all unique successor blocks of this loop.
/// These are the blocks _outside of the current loop_ which are branched to.
/// This assumes that loop is in canonical form.
///
- void getUniqueExitBlocks(SmallVectorImpl &ExitBlocks) const;
+ void getUniqueExitBlocks(SmallVectorImpl &ExitBlocks) const {
+ // Sort the blocks vector so that we can use binary search to do quick
+ // lookups.
+ SmallVector LoopBBs(block_begin(), block_end());
+ std::sort(LoopBBs.begin(), LoopBBs.end());
+
+ std::vector switchExitBlocks;
+
+ for (typename std::vector::const_iterator BI = Blocks.begin(),
+ BE = Blocks.end(); BI != BE; ++BI) {
+
+ BlockT *current = *BI;
+ switchExitBlocks.clear();
+
+ for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I) {
+ if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
+ // If block is inside the loop then it is not a exit block.
+ continue;
+
+ pred_iterator PI = pred_begin(*I);
+ BlockT *firstPred = *PI;
+
+ // If current basic block is this exit block's first predecessor
+ // then only insert exit block in to the output ExitBlocks vector.
+ // This ensures that same exit block is not inserted twice into
+ // ExitBlocks vector.
+ if (current != firstPred)
+ continue;
+
+ // If a terminator has more then two successors, for example SwitchInst,
+ // then it is possible that there are multiple edges from current block
+ // to one exit block.
+ if (current->getTerminator()->getNumSuccessors() <= 2) {
+ ExitBlocks.push_back(*I);
+ continue;
+ }
+
+ // In case of multiple edges from current block to exit block, collect
+ // only one edge in ExitBlocks. Use switchExitBlocks to keep track of
+ // duplicate edges.
+ if (std::find(switchExitBlocks.begin(), switchExitBlocks.end(), *I)
+ == switchExitBlocks.end()) {
+ switchExitBlocks.push_back(*I);
+ ExitBlocks.push_back(*I);
+ }
+ }
+ }
+ }
/// getLoopPreheader - If there is a preheader for this loop, return it. A
/// loop has a preheader if there is only one edge to the header of the loop
@@ -133,36 +244,162 @@
///
/// This method returns null if there is no preheader for the loop.
///
- BasicBlock *getLoopPreheader() const;
+ BlockT *getLoopPreheader() const {
+ // Keep track of nodes outside the loop branching to the header...
+ BlockT *Out = 0;
+
+ // Loop over the predecessors of the header node...
+ BlockT *Header = getHeader();
+ for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
+ PI != PE; ++PI)
+ if (!contains(*PI)) { // If the block is not in the loop...
+ if (Out && Out != *PI)
+ return 0; // Multiple predecessors outside the loop
+ Out = *PI;
+ }
+
+ // Make sure there is only one exit out of the preheader.
+ assert(Out && "Header of loop has no predecessors from outside loop?");
+ succ_iterator SI = succ_begin(Out);
+ ++SI;
+ if (SI != succ_end(Out))
+ return 0; // Multiple exits from the block, must not be a preheader.
+
+ // If there is exactly one preheader, return it. If there was zero, then Out
+ // is still null.
+ return Out;
+ }
/// getLoopLatch - If there is a latch block for this loop, return it. A
/// latch block is the canonical backedge for a loop. A loop header in normal
/// form has two edges into it: one from a preheader and one from a latch
/// block.
- BasicBlock *getLoopLatch() const;
+ BlockT *getLoopLatch() const {
+ BlockT *Header = getHeader();
+ pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
+ if (PI == PE) return 0; // no preds?
+
+ BlockT *Latch = 0;
+ if (contains(*PI))
+ Latch = *PI;
+ ++PI;
+ if (PI == PE) return 0; // only one pred?
+
+ if (contains(*PI)) {
+ if (Latch) return 0; // multiple backedges
+ Latch = *PI;
+ }
+ ++PI;
+ if (PI != PE) return 0; // more than two preds
+
+ return Latch;
+ }
/// getCanonicalInductionVariable - Check to see if the loop has a canonical
/// induction variable: an integer recurrence that starts at 0 and increments
/// by one each time through the loop. If so, return the phi node that
/// corresponds to it.
///
- PHINode *getCanonicalInductionVariable() const;
+ PHINode *getCanonicalInductionVariable() const {
+ BlockT *H = getHeader();
+
+ BlockT *Incoming = 0, *Backedge = 0;
+ pred_iterator PI = pred_begin(H);
+ assert(PI != pred_end(H) && "Loop must have at least one backedge!");
+ Backedge = *PI++;
+ if (PI == pred_end(H)) return 0; // dead loop
+ Incoming = *PI++;
+ if (PI != pred_end(H)) return 0; // multiple backedges?
+
+ if (contains(Incoming)) {
+ if (contains(Backedge))
+ return 0;
+ std::swap(Incoming, Backedge);
+ } else if (!contains(Backedge))
+ return 0;
+
+ // Loop over all of the PHI nodes, looking for a canonical indvar.
+ for (typename BlockT::iterator I = H->begin(); isa(I); ++I) {
+ PHINode *PN = cast(I);
+ if (Instruction *Inc =
+ dyn_cast(PN->getIncomingValueForBlock(Backedge)))
+ if (Inc->getOpcode() == Instruction::Add && Inc->getOperand(0) == PN)
+ if (ConstantInt *CI = dyn_cast(Inc->getOperand(1)))
+ if (CI->equalsInt(1))
+ return PN;
+ }
+ return 0;
+ }
/// getCanonicalInductionVariableIncrement - Return the LLVM value that holds
/// the canonical induction variable value for the "next" iteration of the
/// loop. This always succeeds if getCanonicalInductionVariable succeeds.
///
- Instruction *getCanonicalInductionVariableIncrement() const;
+ Instruction *getCanonicalInductionVariableIncrement() const {
+ if (PHINode *PN = getCanonicalInductionVariable()) {
+ bool P1InLoop = contains(PN->getIncomingBlock(1));
+ return cast(PN->getIncomingValue(P1InLoop));
+ }
+ return 0;
+ }
/// getTripCount - Return a loop-invariant LLVM value indicating the number of
/// times the loop will be executed. Note that this means that the backedge
/// of the loop executes N-1 times. If the trip-count cannot be determined,
/// this returns null.
///
- Value *getTripCount() const;
+ Value *getTripCount() const {
+ // Canonical loops will end with a 'cmp ne I, V', where I is the incremented
+ // canonical induction variable and V is the trip count of the loop.
+ Instruction *Inc = getCanonicalInductionVariableIncrement();
+ if (Inc == 0) return 0;
+ PHINode *IV = cast(Inc->getOperand(0));
+
+ BlockT *BackedgeBlock =
+ IV->getIncomingBlock(contains(IV->getIncomingBlock(1)));
+
+ if (BranchInst *BI = dyn_cast(BackedgeBlock->getTerminator()))
+ if (BI->isConditional()) {
+ if (ICmpInst *ICI = dyn_cast(BI->getCondition())) {
+ if (ICI->getOperand(0) == Inc)
+ if (BI->getSuccessor(0) == getHeader()) {
+ if (ICI->getPredicate() == ICmpInst::ICMP_NE)
+ return ICI->getOperand(1);
+ } else if (ICI->getPredicate() == ICmpInst::ICMP_EQ) {
+ return ICI->getOperand(1);
+ }
+ }
+ }
+
+ return 0;
+ }
/// isLCSSAForm - Return true if the Loop is in LCSSA form
- bool isLCSSAForm() const;
+ bool isLCSSAForm() const {
+ // Sort the blocks vector so that we can use binary search to do quick
+ // lookups.
+ SmallPtrSet LoopBBs(block_begin(), block_end());
+
+ for (block_iterator BI = block_begin(), E = block_end(); BI != E; ++BI) {
+ BlockT *BB = *BI;
+ for (typename BlockT::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
+ for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
+ ++UI) {
+ BlockT *UserBB = cast(*UI)->getParent();
+ if (PHINode *P = dyn_cast(*UI)) {
+ unsigned OperandNo = UI.getOperandNo();
+ UserBB = P->getIncomingBlock(OperandNo/2);
+ }
+
+ // Check the current block, as a fast-path. Most values are used in the
+ // same block they are defined in.
+ if (UserBB != BB && !LoopBBs.count(UserBB))
+ return false;
+ }
+ }
+
+ return true;
+ }
//===--------------------------------------------------------------------===//
// APIs for updating loop information after changing the CFG
@@ -174,35 +411,56 @@
/// to the specified LoopInfo object as being in the current basic block. It
/// is not valid to replace the loop header with this method.
///
- void addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI);
+ void addBasicBlockToLoop(BlockT *NewBB, LoopInfo &LI);
/// replaceChildLoopWith - This is used when splitting loops up. It replaces
/// the OldChild entry in our children list with NewChild, and updates the
/// parent pointer of OldChild to be null and the NewChild to be this loop.
/// This updates the loop depth of the new child.
- void replaceChildLoopWith(Loop *OldChild, Loop *NewChild);
+ void replaceChildLoopWith(LoopBase *OldChild,
+ LoopBase *NewChild) {
+ assert(OldChild->ParentLoop == this && "This loop is already broken!");
+ assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
+ typename std::vector*>::iterator I =
+ std::find(SubLoops.begin(), SubLoops.end(), OldChild);
+ assert(I != SubLoops.end() && "OldChild not in loop!");
+ *I = NewChild;
+ OldChild->ParentLoop = 0;
+ NewChild->ParentLoop = this;
+ }
/// addChildLoop - Add the specified loop to be a child of this loop. This
/// updates the loop depth of the new child.
///
- void addChildLoop(Loop *NewChild);
+ void addChildLoop(LoopBase *NewChild) {
+ assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
+ NewChild->ParentLoop = this;
+ SubLoops.push_back(NewChild);
+ }
/// removeChildLoop - This removes the specified child from being a subloop of
/// this loop. The loop is not deleted, as it will presumably be inserted
/// into another loop.
- Loop *removeChildLoop(iterator OldChild);
+ LoopBase *removeChildLoop(iterator I) {
+ assert(I != SubLoops.end() && "Cannot remove end iterator!");
+ LoopBase *Child = *I;
+ assert(Child->ParentLoop == this && "Child is not a child of this loop!");
+ SubLoops.erase(SubLoops.begin()+(I-begin()));
+ Child->ParentLoop = 0;
+ return Child;
+ }
/// addBlockEntry - This adds a basic block directly to the basic block list.
/// This should only be used by transformations that create new loops. Other
/// transformations should use addBasicBlockToLoop.
- void addBlockEntry(BasicBlock *BB) {
+ void addBlockEntry(BlockT *BB) {
Blocks.push_back(BB);
}
/// moveToHeader - This method is used to move BB (which must be part of this
/// loop) to be the loop header of the loop (the block that dominates all
/// others).
- void moveToHeader(BasicBlock *BB) {
+ void moveToHeader(BlockT *BB) {
if (Blocks[0] == BB) return;
for (unsigned i = 0; ; ++i) {
assert(i != Blocks.size() && "Loop does not contain BB!");
@@ -217,23 +475,51 @@
/// removeBlockFromLoop - This removes the specified basic block from the
/// current loop, updating the Blocks as appropriate. This does not update
/// the mapping in the LoopInfo class.
- void removeBlockFromLoop(BasicBlock *BB);
+ void removeBlockFromLoop(BlockT *BB) {
+ RemoveFromVector(Blocks, BB);
+ }
/// verifyLoop - Verify loop structure
- void verifyLoop() const;
+ void verifyLoop() const {
+#ifndef NDEBUG
+ assert (getHeader() && "Loop header is missing");
+ assert (getLoopPreheader() && "Loop preheader is missing");
+ assert (getLoopLatch() && "Loop latch is missing");
+ for (typename std::vector*>::const_iterator I =
+ SubLoops.begin(), E = SubLoops.end(); I != E; ++I)
+ (*I)->verifyLoop();
+#endif
+ }
+
+ void print(std::ostream &OS, unsigned Depth = 0) const {
+ OS << std::string(Depth*2, ' ') << "Loop Containing: ";
+
+ for (unsigned i = 0; i < getBlocks().size(); ++i) {
+ if (i) OS << ",";
+ WriteAsOperand(OS, getBlocks()[i], false);
+ }
+ OS << "\n";
- void print(std::ostream &O, unsigned Depth = 0) const;
+ for (iterator I = begin(), E = end(); I != E; ++I)
+ (*I)->print(OS, Depth+2);
+ }
+
void print(std::ostream *O, unsigned Depth = 0) const {
if (O) print(*O, Depth);
}
- void dump() const;
+
+ void dump() const {
+ print(cerr);
+ }
+
private:
friend class LoopInfo;
- Loop(BasicBlock *BB) : ParentLoop(0) {
+ LoopBase(BlockT *BB) : ParentLoop(0) {
Blocks.push_back(BB);
}
};
+typedef LoopBase Loop;
//===----------------------------------------------------------------------===//
@@ -244,7 +530,7 @@
// BBMap - Mapping of basic blocks to the inner most loop they occur in
std::map BBMap;
std::vector TopLevelLoops;
- friend class Loop;
+ friend class LoopBase;
public:
static char ID; // Pass identification, replacement for typeid
@@ -360,6 +646,24 @@
}
};
+template
+void LoopBase::addBasicBlockToLoop(BlockT *NewBB, LoopInfo &LI) {
+ assert((Blocks.empty() || LI[getHeader()] == this) &&
+ "Incorrect LI specified for this loop!");
+ assert(NewBB && "Cannot add a null basic block to the loop!");
+ assert(LI[NewBB] == 0 && "BasicBlock already in the loop!");
+
+ // Add the loop mapping to the LoopInfo object...
+ LI.BBMap[NewBB] = this;
+
+ // Add the basic block to this loop and all parent loops...
+ LoopBase *L = this;
+ while (L) {
+ L->Blocks.push_back(NewBB);
+ L = L->getParentLoop();
+ }
+}
+
} // End llvm namespace
// Make sure that any clients of this file link in LoopInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopPass.h Tue Nov 13 20:33:58 2007
@@ -23,7 +23,6 @@
namespace llvm {
class LPPassManager;
-class Loop;
class Function;
class LoopPass : public Pass {
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Nov 13 20:33:58 2007
@@ -22,6 +22,7 @@
#define LLVM_ANALYSIS_SCALAREVOLUTION_H
#include "llvm/Pass.h"
+#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Streams.h"
#include
@@ -32,8 +33,6 @@
class Instruction;
class Type;
class ConstantRange;
- class Loop;
- class LoopInfo;
class SCEVHandle;
class ScalarEvolution;
Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h Tue Nov 13 20:33:58 2007
@@ -20,13 +20,12 @@
#include
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Analysis/LoopInfo.h"
namespace llvm {
class Module;
class Function;
-class Loop;
-class LoopInfo;
class Pass;
class LPPassManager;
class BasicBlock;
Modified: llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h Tue Nov 13 20:33:58 2007
@@ -14,13 +14,13 @@
#ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
#define LLVM_TRANSFORMS_UTILS_FUNCTION_H
-#include
+#include "llvm/Analysis/Dominators.h"
+#include "llvm/Analysis/LoopInfo.h"
#include
namespace llvm {
class BasicBlock;
class Function;
- class Loop;
/// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
///
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=44097&r1=44096&r2=44097&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Tue Nov 13 20:33:58 2007
@@ -34,69 +34,9 @@
//===----------------------------------------------------------------------===//
// Loop implementation
//
-bool Loop::contains(const BasicBlock *BB) const {
- return std::find(Blocks.begin(), Blocks.end(), BB) != Blocks.end();
-}
-
-bool Loop::isLoopExit(const BasicBlock *BB) const {
- for (succ_const_iterator SI = succ_begin(BB), SE = succ_end(BB);
- SI != SE; ++SI) {
- if (!contains(*SI))
- return true;
- }
- return false;
-}
/// getNumBackEdges - Calculate the number of back edges to the loop header.
///
-unsigned Loop::getNumBackEdges() const {
- unsigned NumBackEdges = 0;
- BasicBlock *H = getHeader();
-
- for (pred_iterator I = pred_begin(H), E = pred_end(H); I != E; ++I)
- if (contains(*I))
- ++NumBackEdges;
-
- return NumBackEdges;
-}
-
-/// isLoopInvariant - Return true if the specified value is loop invariant
-///
-bool Loop::isLoopInvariant(Value *V) const {
- if (Instruction *I = dyn_cast(V))
- return !contains(I->getParent());
- return true; // All non-instructions are loop invariant
-}
-
-void Loop::print(std::ostream &OS, unsigned Depth) const {
- OS << std::string(Depth*2, ' ') << "Loop Containing: ";
-
- for (unsigned i = 0; i < getBlocks().size(); ++i) {
- if (i) OS << ",";
- WriteAsOperand(OS, getBlocks()[i], false);
- }
- OS << "\n";
-
- for (iterator I = begin(), E = end(); I != E; ++I)
- (*I)->print(OS, Depth+2);
-}
-
-/// verifyLoop - Verify loop structure
-void Loop::verifyLoop() const {
-#ifndef NDEBUG
- assert (getHeader() && "Loop header is missing");
- assert (getLoopPreheader() && "Loop preheader is missing");
- assert (getLoopLatch() && "Loop latch is missing");
- for (std::vector::const_iterator I = SubLoops.begin(), E = SubLoops.end();
- I != E; ++I)
- (*I)->verifyLoop();
-#endif
-}
-
-void Loop::dump() const {
- print(cerr);
-}
-
//===----------------------------------------------------------------------===//
// LoopInfo implementation
@@ -341,341 +281,5 @@
}
}
-
-//===----------------------------------------------------------------------===//
-// APIs for simple analysis of the loop.
-//
-
-/// getExitingBlocks - Return all blocks inside the loop that have successors
-/// outside of the loop. These are the blocks _inside of the current loop_
-/// which branch out. The returned list is always unique.
-///
-void Loop::getExitingBlocks(SmallVectorImpl &ExitingBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- for (std::vector::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI)
- for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I)
- if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I)) {
- // Not in current loop? It must be an exit block.
- ExitingBlocks.push_back(*BI);
- break;
- }
-}
-
-/// getExitBlocks - Return all of the successor blocks of this loop. These
-/// are the blocks _outside of the current loop_ which are branched to.
-///
-void Loop::getExitBlocks(SmallVectorImpl &ExitBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- for (std::vector::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI)
- for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I)
- if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
- // Not in current loop? It must be an exit block.
- ExitBlocks.push_back(*I);
-}
-
-/// getUniqueExitBlocks - Return all unique successor blocks of this loop. These
-/// are the blocks _outside of the current loop_ which are branched to. This
-/// assumes that loop is in canonical form.
-//
-void Loop::getUniqueExitBlocks(SmallVectorImpl &ExitBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- std::vector switchExitBlocks;
-
- for (std::vector::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI) {
-
- BasicBlock *current = *BI;
- switchExitBlocks.clear();
-
- for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I) {
- if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
- // If block is inside the loop then it is not a exit block.
- continue;
-
- pred_iterator PI = pred_begin(*I);
- BasicBlock *firstPred = *PI;
-
- // If current basic block is this exit block's first predecessor
- // then only insert exit block in to the output ExitBlocks vector.
- // This ensures that same exit block is not inserted twice into
- // ExitBlocks vector.
- if (current != firstPred)
- continue;
-
- // If a terminator has more then two successors, for example SwitchInst,
- // then it is possible that there are multiple edges from current block
- // to one exit block.
- if (current->getTerminator()->getNumSuccessors() <= 2) {
- ExitBlocks.push_back(*I);
- continue;
- }
-
- // In case of multiple edges from current block to exit block, collect
- // only one edge in ExitBlocks. Use switchExitBlocks to keep track of
- // duplicate edges.
- if (std::find(switchExitBlocks.begin(), switchExitBlocks.end(), *I)
- == switchExitBlocks.end()) {
- switchExitBlocks.push_back(*I);
- ExitBlocks.push_back(*I);
- }
- }
- }
-}
-
-
-/// getLoopPreheader - If there is a preheader for this loop, return it. A
-/// loop has a preheader if there is only one edge to the header of the loop
-/// from outside of the loop. If this is the case, the block branching to the
-/// header of the loop is the preheader node.
-///
-/// This method returns null if there is no preheader for the loop.
-///
-BasicBlock *Loop::getLoopPreheader() const {
- // Keep track of nodes outside the loop branching to the header...
- BasicBlock *Out = 0;
-
- // Loop over the predecessors of the header node...
- BasicBlock *Header = getHeader();
- for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
- PI != PE; ++PI)
- if (!contains(*PI)) { // If the block is not in the loop...
- if (Out && Out != *PI)
- return 0; // Multiple predecessors outside the loop
- Out = *PI;
- }
-
- // Make sure there is only one exit out of the preheader.
- assert(Out && "Header of loop has no predecessors from outside loop?");
- succ_iterator SI = succ_begin(Out);
- ++SI;
- if (SI != succ_end(Out))
- return 0; // Multiple exits from the block, must not be a preheader.
-
- // If there is exactly one preheader, return it. If there was zero, then Out
- // is still null.
- return Out;
-}
-
-/// getLoopLatch - If there is a latch block for this loop, return it. A
-/// latch block is the canonical backedge for a loop. A loop header in normal
-/// form has two edges into it: one from a preheader and one from a latch
-/// block.
-BasicBlock *Loop::getLoopLatch() const {
- BasicBlock *Header = getHeader();
- pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
- if (PI == PE) return 0; // no preds?
-
- BasicBlock *Latch = 0;
- if (contains(*PI))
- Latch = *PI;
- ++PI;
- if (PI == PE) return 0; // only one pred?
-
- if (contains(*PI)) {
- if (Latch) return 0; // multiple backedges
- Latch = *PI;
- }
- ++PI;
- if (PI != PE) return 0; // more than two preds
-
- return Latch;
-}
-
-/// getCanonicalInductionVariable - Check to see if the loop has a canonical
-/// induction variable: an integer recurrence that starts at 0 and increments by
-/// one each time through the loop. If so, return the phi node that corresponds
-/// to it.
-///
-PHINode *Loop::getCanonicalInductionVariable() const {
- BasicBlock *H = getHeader();
-
- BasicBlock *Incoming = 0, *Backedge = 0;
- pred_iterator PI = pred_begin(H);
- assert(PI != pred_end(H) && "Loop must have at least one backedge!");
- Backedge = *PI++;
- if (PI == pred_end(H)) return 0; // dead loop
- Incoming = *PI++;
- if (PI != pred_end(H)) return 0; // multiple backedges?
-
- if (contains(Incoming)) {
- if (contains(Backedge))
- return 0;
- std::swap(Incoming, Backedge);
- } else if (!contains(Backedge))
- return 0;
-
- // Loop over all of the PHI nodes, looking for a canonical indvar.
- for (BasicBlock::iterator I = H->begin(); isa(I); ++I) {
- PHINode *PN = cast(I);
- if (Instruction *Inc =
- dyn_cast(PN->getIncomingValueForBlock(Backedge)))
- if (Inc->getOpcode() == Instruction::Add && Inc->getOperand(0) == PN)
- if (ConstantInt *CI = dyn_cast(Inc->getOperand(1)))
- if (CI->equalsInt(1))
- return PN;
- }
- return 0;
-}
-
-/// getCanonicalInductionVariableIncrement - Return the LLVM value that holds
-/// the canonical induction variable value for the "next" iteration of the loop.
-/// This always succeeds if getCanonicalInductionVariable succeeds.
-///
-Instruction *Loop::getCanonicalInductionVariableIncrement() const {
- if (PHINode *PN = getCanonicalInductionVariable()) {
- bool P1InLoop = contains(PN->getIncomingBlock(1));
- return cast(PN->getIncomingValue(P1InLoop));
- }
- return 0;
-}
-
-/// getTripCount - Return a loop-invariant LLVM value indicating the number of
-/// times the loop will be executed. Note that this means that the backedge of
-/// the loop executes N-1 times. If the trip-count cannot be determined, this
-/// returns null.
-///
-Value *Loop::getTripCount() const {
- // Canonical loops will end with a 'cmp ne I, V', where I is the incremented
- // canonical induction variable and V is the trip count of the loop.
- Instruction *Inc = getCanonicalInductionVariableIncrement();
- if (Inc == 0) return 0;
- PHINode *IV = cast(Inc->getOperand(0));
-
- BasicBlock *BackedgeBlock =
- IV->getIncomingBlock(contains(IV->getIncomingBlock(1)));
-
- if (BranchInst *BI = dyn_cast(BackedgeBlock->getTerminator()))
- if (BI->isConditional()) {
- if (ICmpInst *ICI = dyn_cast(BI->getCondition())) {
- if (ICI->getOperand(0) == Inc)
- if (BI->getSuccessor(0) == getHeader()) {
- if (ICI->getPredicate() == ICmpInst::ICMP_NE)
- return ICI->getOperand(1);
- } else if (ICI->getPredicate() == ICmpInst::ICMP_EQ) {
- return ICI->getOperand(1);
- }
- }
- }
-
- return 0;
-}
-
-/// isLCSSAForm - Return true if the Loop is in LCSSA form
-bool Loop::isLCSSAForm() const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallPtrSet LoopBBs(block_begin(), block_end());
-
- for (block_iterator BI = block_begin(), E = block_end(); BI != E; ++BI) {
- BasicBlock *BB = *BI;
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
- ++UI) {
- BasicBlock *UserBB = cast(*UI)->getParent();
- if (PHINode *P = dyn_cast(*UI)) {
- unsigned OperandNo = UI.getOperandNo();
- UserBB = P->getIncomingBlock(OperandNo/2);
- }
-
- // Check the current block, as a fast-path. Most values are used in the
- // same block they are defined in.
- if (UserBB != BB && !LoopBBs.count(UserBB))
- return false;
- }
- }
-
- return true;
-}
-
-//===-------------------------------------------------------------------===//
-// APIs for updating loop information after changing the CFG
-//
-
-/// addBasicBlockToLoop - This function is used by other analyses to update loop
-/// information. NewBB is set to be a new member of the current loop. Because
-/// of this, it is added as a member of all parent loops, and is added to the
-/// specified LoopInfo object as being in the current basic block. It is not
-/// valid to replace the loop header with this method.
-///
-void Loop::addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI) {
- assert((Blocks.empty() || LI[getHeader()] == this) &&
- "Incorrect LI specified for this loop!");
- assert(NewBB && "Cannot add a null basic block to the loop!");
- assert(LI[NewBB] == 0 && "BasicBlock already in the loop!");
-
- // Add the loop mapping to the LoopInfo object...
- LI.BBMap[NewBB] = this;
-
- // Add the basic block to this loop and all parent loops...
- Loop *L = this;
- while (L) {
- L->Blocks.push_back(NewBB);
- L = L->getParentLoop();
- }
-}
-
-/// replaceChildLoopWith - This is used when splitting loops up. It replaces
-/// the OldChild entry in our children list with NewChild, and updates the
-/// parent pointers of the two loops as appropriate.
-void Loop::replaceChildLoopWith(Loop *OldChild, Loop *NewChild) {
- assert(OldChild->ParentLoop == this && "This loop is already broken!");
- assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
- std::vector::iterator I = std::find(SubLoops.begin(), SubLoops.end(),
- OldChild);
- assert(I != SubLoops.end() && "OldChild not in loop!");
- *I = NewChild;
- OldChild->ParentLoop = 0;
- NewChild->ParentLoop = this;
-}
-
-/// addChildLoop - Add the specified loop to be a child of this loop.
-///
-void Loop::addChildLoop(Loop *NewChild) {
- assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
- NewChild->ParentLoop = this;
- SubLoops.push_back(NewChild);
-}
-
-template
-static void RemoveFromVector(std::vector &V, T *N) {
- typename std::vector::iterator I = std::find(V.begin(), V.end(), N);
- assert(I != V.end() && "N is not in this list!");
- V.erase(I);
-}
-
-/// removeChildLoop - This removes the specified child from being a subloop of
-/// this loop. The loop is not deleted, as it will presumably be inserted
-/// into another loop.
-Loop *Loop::removeChildLoop(iterator I) {
- assert(I != SubLoops.end() && "Cannot remove end iterator!");
- Loop *Child = *I;
- assert(Child->ParentLoop == this && "Child is not a child of this loop!");
- SubLoops.erase(SubLoops.begin()+(I-begin()));
- Child->ParentLoop = 0;
- return Child;
-}
-
-
-/// removeBlockFromLoop - This removes the specified basic block from the
-/// current loop, updating the Blocks and ExitBlocks lists as appropriate. This
-/// does not update the mapping in the LoopInfo class.
-void Loop::removeBlockFromLoop(BasicBlock *BB) {
- RemoveFromVector(Blocks, BB);
-}
-
// Ensure this file gets linked when LoopInfo.h is used.
DEFINING_FILE_FOR(LoopInfo)
From isanbard at gmail.com Tue Nov 13 20:50:04 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 18:50:04 -0800
Subject: [llvm-commits] make check failures
In-Reply-To:
References:
<3EBD5AB0-0E24-4F7D-8F2B-66069508358F@apple.com>
<200711140006.14564.baldrick@free.fr>
Message-ID: <16e5fdf90711131850l622d90eaw6fca452924d15d64@mail.gmail.com>
On Nov 13, 2007 4:42 PM, Chris Lattner wrote:
>
> On Nov 13, 2007, at 3:06 PM, Duncan Sands wrote:
>
> > Hi Chris,
> >
> >>> test/CFrontend/2007-11-07-CopyAggregateAlign.c
> >>
> >> This still fails for me. Duncan, thoughts? Greping for align 2
> >> yields just two hits:
> >>
> >> %tmp14 = load i16* %tmp13, align 2 ;
> >> [#uses=1]
> >> store i16 %tmp14, i16* %tmp12, align 2
> >>
> >> not 6.
> >
> > well I guess Bill hasn't back-ported the DestLoc patch from 4.2 to
> > 4.0 yet.
> > I can XFAIL it until he does if you like.
>
Doh! Thanks for reminding me! :-)
-bw
From sabre at nondot.org Wed Nov 14 00:19:26 2007
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 14 Nov 2007 06:19:26 -0000
Subject: [llvm-commits] [llvm] r44099 - in /llvm/trunk:
lib/Transforms/Scalar/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/noreturn-call.ll
Message-ID: <200711140619.lAE6JRdQ005684@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Nov 14 00:19:25 2007
New Revision: 44099
URL: http://llvm.org/viewvc/llvm-project?rev=44099&view=rev
Log:
Implement PR1796 and Transforms/SimplifyCFG/noreturn-call.ll
by inserting unreachable after no-return calls.
Added:
llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=44099&r1=44098&r2=44099&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Wed Nov 14 00:19:25 2007
@@ -24,6 +24,7 @@
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Pass.h"
@@ -50,6 +51,46 @@
return new CFGSimplifyPass();
}
+/// ChangeToUnreachable - Insert an unreachable instruction before the specified
+/// instruction, making it and the rest of the code in the block dead.
+static void ChangeToUnreachable(Instruction *I) {
+ BasicBlock *BB = I->getParent();
+ // Loop over all of the successors, removing BB's entry from any PHI
+ // nodes.
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
+ (*SI)->removePredecessor(BB);
+
+ new UnreachableInst(I);
+
+ // All instructions after this are dead.
+ BasicBlock::iterator BBI = I, BBE = BB->end();
+ while (BBI != BBE) {
+ if (!BBI->use_empty())
+ BBI->replaceAllUsesWith(UndefValue::get(BBI->getType()));
+ BB->getInstList().erase(BBI++);
+ }
+}
+
+/// IsNoReturn - Return true if the specified call is to a no-return function.
+static bool IsNoReturn(const CallInst *CI) {
+ if (const ParamAttrsList *Attrs = CI->getParamAttrs())
+ if (Attrs->paramHasAttr(0, ParamAttr::NoReturn))
+ return true;
+
+ if (const Function *Callee = CI->getCalledFunction()) {
+ if (const ParamAttrsList *Attrs = Callee->getParamAttrs())
+ if (Attrs->paramHasAttr(0, ParamAttr::NoReturn))
+ return true;
+
+ const FunctionType *FT = Callee->getFunctionType();
+ if (const ParamAttrsList *Attrs = FT->getParamAttrs())
+ if (Attrs->paramHasAttr(0, ParamAttr::NoReturn))
+ return true;
+ }
+ return false;
+}
+
+
static bool MarkAliveBlocks(BasicBlock *BB,
SmallPtrSet &Reachable) {
@@ -66,26 +107,29 @@
// Do a quick scan of the basic block, turning any obviously unreachable
// instructions into LLVM unreachable insts. The instruction combining pass
// canonnicalizes unreachable insts into stores to null or undef.
- for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ++BBI)
+ for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E;++BBI){
+ if (CallInst *CI = dyn_cast(BBI)) {
+ if (IsNoReturn(CI)) {
+ // If we found a call to a no-return function, insert an unreachable
+ // instruction after it. Make sure there isn't *already* one there
+ // though.
+ ++BBI;
+ if (!isa(BBI)) {
+ ChangeToUnreachable(BBI);
+ Changed = true;
+ }
+ break;
+ }
+ }
+
if (StoreInst *SI = dyn_cast(BBI))
if (isa(SI->getOperand(1)) ||
isa(SI->getOperand(1))) {
- // Loop over all of the successors, removing BB's entry from any PHI
- // nodes.
- for (succ_iterator I = succ_begin(BB), SE = succ_end(BB); I != SE;++I)
- (*I)->removePredecessor(BB);
-
- new UnreachableInst(SI);
-
- // All instructions after this are dead.
- while (BBI != E) {
- if (!BBI->use_empty())
- BBI->replaceAllUsesWith(UndefValue::get(BBI->getType()));
- BB->getInstList().erase(BBI++);
- }
+ ChangeToUnreachable(SI);
+ Changed = true;
break;
}
-
+ }
Changed |= ConstantFoldTerminator(BB);
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
Added: llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll?rev=44099&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll (added)
+++ llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll Wed Nov 14 00:19:25 2007
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep unreachable
+; PR1796
+
+declare void @Finisher(i32) noreturn
+
+define void @YYY(i32) {
+ tail call void @Finisher(i32 %0) noreturn
+ tail call void @Finisher(i32 %0) noreturn
+ ret void
+}
+
From nicholas at mxc.ca Wed Nov 14 00:47:06 2007
From: nicholas at mxc.ca (Nick Lewycky)
Date: Wed, 14 Nov 2007 06:47:06 -0000
Subject: [llvm-commits] [llvm] r44101 - in /llvm/trunk:
lib/Transforms/IPO/LoopExtractor.cpp tools/bugpoint/BugDriver.h
tools/bugpoint/ExtractFunction.cpp tools/bugpoint/Miscompilation.cpp
tools/bugpoint/OptimizerDriver.cpp
Message-ID: <200711140647.lAE6l6uY008493@zion.cs.uiuc.edu>
Author: nicholas
Date: Wed Nov 14 00:47:06 2007
New Revision: 44101
URL: http://llvm.org/viewvc/llvm-project?rev=44101&view=rev
Log:
Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against
anonymous or abnormally-named Funcs or BBs.
Make bugpoint use this interface to pass the BBs list to the child bugpoint.
Modified:
llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp
llvm/trunk/tools/bugpoint/BugDriver.h
llvm/trunk/tools/bugpoint/ExtractFunction.cpp
llvm/trunk/tools/bugpoint/Miscompilation.cpp
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=44101&r1=44100&r2=44101&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Wed Nov 14 00:47:06 2007
@@ -21,10 +21,13 @@
#include "llvm/Pass.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/FunctionUtils.h"
#include "llvm/ADT/Statistic.h"
+#include
+#include
using namespace llvm;
STATISTIC(NumExtracted, "Number of loops extracted");
@@ -144,15 +147,28 @@
namespace {
+ // BlockFile - A file which contains a list of blocks that should not be
+ // extracted.
+ cl::opt
+ BlockFile("extract-blocks-file", cl::value_desc("filename"),
+ cl::desc("A file containing list of basic blocks to not extract"),
+ cl::Hidden);
+
/// BlockExtractorPass - This pass is used by bugpoint to extract all blocks
/// from the module into their own functions except for those specified by the
/// BlocksToNotExtract list.
class BlockExtractorPass : public ModulePass {
+ void LoadFile(const char *Filename);
+
std::vector BlocksToNotExtract;
+ std::vector > BlocksToNotExtractByName;
public:
static char ID; // Pass identification, replacement for typeid
explicit BlockExtractorPass(const std::vector &B)
- : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {}
+ : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {
+ if (!BlockFile.empty())
+ LoadFile(BlockFile.c_str());
+ }
BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
@@ -171,6 +187,24 @@
return new BlockExtractorPass(BTNE);
}
+void BlockExtractorPass::LoadFile(const char *Filename) {
+ // Load the BlockFile...
+ std::ifstream In(Filename);
+ if (!In.good()) {
+ cerr << "WARNING: BlockExtractor couldn't load file '" << Filename
+ << "'!\n";
+ return;
+ }
+ while (In) {
+ std::string FunctionName, BlockName;
+ In >> FunctionName;
+ In >> BlockName;
+ if (!BlockName.empty())
+ BlocksToNotExtractByName.push_back(
+ std::make_pair(FunctionName, BlockName));
+ }
+}
+
bool BlockExtractorPass::runOnModule(Module &M) {
std::set TranslatedBlocksToNotExtract;
for (unsigned i = 0, e = BlocksToNotExtract.size(); i != e; ++i) {
@@ -187,6 +221,29 @@
TranslatedBlocksToNotExtract.insert(BBI);
}
+ while (!BlocksToNotExtractByName.empty()) {
+ // There's no way to find BBs by name without looking at every BB inside
+ // every Function. Fortunately, this is always empty except when used by
+ // bugpoint in which case correctness is more important than performance.
+
+ std::string &FuncName = BlocksToNotExtractByName.back().first;
+ std::string &BlockName = BlocksToNotExtractByName.back().second;
+
+ for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI) {
+ Function &F = *FI;
+ if (F.getName() != FuncName) continue;
+
+ for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {
+ BasicBlock &BB = *BI;
+ if (BB.getName() != BlockName) continue;
+
+ TranslatedBlocksToNotExtract.insert(BI);
+ }
+ }
+
+ BlocksToNotExtractByName.pop_back();
+ }
+
// Now that we know which blocks to not extract, figure out which ones we WANT
// to extract.
std::vector BlocksToExtract;
Modified: llvm/trunk/tools/bugpoint/BugDriver.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=44101&r1=44100&r2=44101&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.h (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Nov 14 00:47:06 2007
@@ -234,7 +234,8 @@
/// automatically attempt to track down a crashing pass if one exists, and
/// this method will never return null.
Module *runPassesOn(Module *M, const std::vector &Passes,
- bool AutoDebugCrashes = false);
+ bool AutoDebugCrashes = false, unsigned NumExtraArgs = 0,
+ const char * const *ExtraArgs = NULL);
/// runPasses - Run the specified passes on Program, outputting a bitcode
/// file and writting the filename into OutputFile if successful. If the
@@ -242,11 +243,13 @@
/// otherwise return false. If DeleteOutput is set to true, the bitcode is
/// deleted on success, and the filename string is undefined. This prints to
/// cout a single line message indicating whether compilation was successful
- /// or failed, unless Quiet is set.
+ /// or failed, unless Quiet is set. ExtraArgs specifies additional arguments
+ /// to pass to the child bugpoint instance.
///
bool runPasses(const std::vector &PassesToRun,
std::string &OutputFilename, bool DeleteOutput = false,
- bool Quiet = false) const;
+ bool Quiet = false, unsigned NumExtraArgs = 0,
+ const char * const *ExtraArgs = NULL) const;
/// runManyPasses - Take the specified pass list and create different
/// combinations of passes to compile the program with. Compile the program with
Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=44101&r1=44100&r2=44101&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Wed Nov 14 00:47:06 2007
@@ -27,7 +27,10 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileUtilities.h"
+#include "llvm/System/Path.h"
+#include "llvm/System/Signals.h"
#include
+#include
#include
using namespace llvm;
@@ -305,10 +308,51 @@
Module *BugDriver::ExtractMappedBlocksFromModule(const
std::vector &BBs,
Module *M) {
+ char *ExtraArg = NULL;
+
+ sys::Path uniqueFilename("bugpoint-extractblocks");
+ std::string ErrMsg;
+ if (uniqueFilename.createTemporaryFileOnDisk(true, &ErrMsg)) {
+ std::cout << "*** Basic Block extraction failed!\n";
+ std::cerr << "Error creating temporary file: " << ErrMsg << "\n";
+ M = swapProgramIn(M);
+ EmitProgressBitcode("basicblockextractfail", true);
+ swapProgramIn(M);
+ return 0;
+ }
+ sys::RemoveFileOnSignal(uniqueFilename);
+
+ std::ofstream BlocksToNotExtractFile(uniqueFilename.c_str());
+ if (!BlocksToNotExtractFile) {
+ std::cout << "*** Basic Block extraction failed!\n";
+ std::cerr << "Error writing list of blocks to not extract: " << ErrMsg
+ << "\n";
+ M = swapProgramIn(M);
+ EmitProgressBitcode("basicblockextractfail", true);
+ swapProgramIn(M);
+ return 0;
+ }
+ for (std::vector::const_iterator I = BBs.begin(), E = BBs.end();
+ I != E; ++I) {
+ BasicBlock *BB = *I;
+ BlocksToNotExtractFile << BB->getParent()->getName() << " "
+ << BB->getName() << "\n";
+ }
+ BlocksToNotExtractFile.close();
+
+ const char *uniqueFN = uniqueFilename.c_str();
+ ExtraArg = (char*)malloc(23 + strlen(uniqueFN));
+ strcat(strcpy(ExtraArg, "--extract-blocks-file="), uniqueFN);
+
std::vector PI;
- // FIXME: BBs is actually ignored. See http://llvm.org/PR1775
- PI.push_back(getPI(createBlockExtractorPass(BBs)));
- Module *Ret = runPassesOn(M, PI);
+ std::vector EmptyBBs; // This parameter is ignored.
+ PI.push_back(getPI(createBlockExtractorPass(EmptyBBs)));
+ Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
+
+ if (uniqueFilename.exists())
+ uniqueFilename.eraseFromDisk(); // Free disk space
+ free(ExtraArg);
+
if (Ret == 0) {
std::cout << "*** Basic Block extraction failed, please report a bug!\n";
M = swapProgramIn(M);
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=44101&r1=44100&r2=44101&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Wed Nov 14 00:47:06 2007
@@ -223,7 +223,7 @@
Module *ToNotOptimize = CloneModule(BD.getProgram());
Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, Funcs);
- // Run the predicate, not that the predicate will delete both input modules.
+ // Run the predicate, note that the predicate will delete both input modules.
return TestFn(BD, ToOptimize, ToNotOptimize);
}
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=44101&r1=44100&r2=44101&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Wed Nov 14 00:47:06 2007
@@ -124,7 +124,8 @@
///
bool BugDriver::runPasses(const std::vector &Passes,
std::string &OutputFilename, bool DeleteOutput,
- bool Quiet) const {
+ bool Quiet, unsigned NumExtraArgs,
+ const char * const *ExtraArgs) const {
// setup the output file name
cout << std::flush;
sys::Path uniqueFilename("bugpoint-output.bc");
@@ -156,7 +157,7 @@
// setup the child process' arguments
const char** args = (const char**)
alloca(sizeof(const char*) *
- (Passes.size()+13+2*PluginLoader::getNumPlugins()));
+ (Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs));
int n = 0;
sys::Path tool = sys::Program::FindProgramByName(ToolName);
if (UseValgrind) {
@@ -182,6 +183,8 @@
E = pass_args.end(); I != E; ++I )
args[n++] = I->c_str();
args[n++] = inputFilename.c_str();
+ for (unsigned i = 0; i < NumExtraArgs; ++i)
+ args[n++] = *ExtraArgs;
args[n++] = 0;
sys::Path prog;
@@ -225,10 +228,12 @@
/// failure.
Module *BugDriver::runPassesOn(Module *M,
const std::vector &Passes,
- bool AutoDebugCrashes) {
+ bool AutoDebugCrashes, unsigned NumExtraArgs,
+ const char * const *ExtraArgs) {
Module *OldProgram = swapProgramIn(M);
std::string BitcodeResult;
- if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/)) {
+ if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/,
+ NumExtraArgs, ExtraArgs)) {
if (AutoDebugCrashes) {
cerr << " Error running this sequence of passes"
<< " on the input program!\n";
From sabre at nondot.org Wed Nov 14 01:04:44 2007
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 14 Nov 2007 07:04:44 -0000
Subject: [llvm-commits] [llvm] r44102 -
/llvm/trunk/docs/GettingStartedVS.html
Message-ID: <200711140704.lAE74iMB009563@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Nov 14 01:04:44 2007
New Revision: 44102
URL: http://llvm.org/viewvc/llvm-project?rev=44102&view=rev
Log:
Document a limitation, patch contributed by George Russell
Modified:
llvm/trunk/docs/GettingStartedVS.html
Modified: llvm/trunk/docs/GettingStartedVS.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStartedVS.html?rev=44102&r1=44101&r2=44102&view=diff
==============================================================================
--- llvm/trunk/docs/GettingStartedVS.html (original)
+++ llvm/trunk/docs/GettingStartedVS.html Wed Nov 14 01:04:44 2007
@@ -172,6 +172,10 @@
not need them and the pre-generated files that come with the source tree
will be used.
+
+ Do not install the LLVM directory tree into a path containing spaces (e.g.
+ C:\Documents and Settings\...) as the configure step will fail.
+
From baldrick at free.fr Wed Nov 14 01:42:51 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 07:42:51 -0000
Subject: [llvm-commits] [llvm] r44103 - in /llvm/trunk/test/CFrontend:
2007-11-07-CopyAggregateAlign.c 2007-11-07-ZeroAggregateAlign.c
Message-ID: <200711140742.lAE7gpoZ011404@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 01:42:50 2007
New Revision: 44103
URL: http://llvm.org/viewvc/llvm-project?rev=44103&view=rev
Log:
XFAIL these tests until the fix gets backported
from llvm-gcc-4.2 to 4.0.
Modified:
llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
Modified: llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c?rev=44103&r1=44102&r2=44103&view=diff
==============================================================================
--- llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c (original)
+++ llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c Wed Nov 14 01:42:50 2007
@@ -1,3 +1,4 @@
// RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6
+// XFAIL: *
struct A { char s, t, u, v; short a; };
void q() { struct A a, b; a = b; }
Modified: llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c?rev=44103&r1=44102&r2=44103&view=diff
==============================================================================
--- llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c (original)
+++ llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c Wed Nov 14 01:42:50 2007
@@ -1,3 +1,4 @@
// RUN: %llvmgcc -S %s -o - | grep "align 2"
+// XFAIL: *
struct A { short s; short t; int i; };
void q() { struct A a = {0}; }
From isanbard at gmail.com Wed Nov 14 01:46:10 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 23:46:10 -0800
Subject: [llvm-commits] RFC: Back Port of Duncan's Patch
Message-ID: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
Hi,
Attached is a back port of Duncan's patch r43907
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
Mon-20071105/055332.html
I would like people to review this and test it to make sure that it
doesn't fail.
-bw
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071113/b7c3e2dc/attachment.txt
From isanbard at gmail.com Wed Nov 14 01:46:50 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 13 Nov 2007 23:46:50 -0800
Subject: [llvm-commits] [llvm] r44103 - in /llvm/trunk/test/CFrontend:
2007-11-07-CopyAggregateAlign.c 2007-11-07-ZeroAggregateAlign.c
In-Reply-To: <200711140742.lAE7gpoZ011404@zion.cs.uiuc.edu>
References: <200711140742.lAE7gpoZ011404@zion.cs.uiuc.edu>
Message-ID:
Hi Duncan,
I just sent out an RFC for this back port. Could you take a look at
it to see if it works for you?
Thanks!
-bw
On Nov 13, 2007, at 11:42 PM, Duncan Sands wrote:
> Author: baldrick
> Date: Wed Nov 14 01:42:50 2007
> New Revision: 44103
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44103&view=rev
> Log:
> XFAIL these tests until the fix gets backported
> from llvm-gcc-4.2 to 4.0.
>
> Modified:
> llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
> llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
>
> Modified: llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/
> 2007-11-07-CopyAggregateAlign.c?rev=44103&r1=44102&r2=44103&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
> (original)
> +++ llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c Wed
> Nov 14 01:42:50 2007
> @@ -1,3 +1,4 @@
> // RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6
> +// XFAIL: *
> struct A { char s, t, u, v; short a; };
> void q() { struct A a, b; a = b; }
>
> Modified: llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/
> 2007-11-07-ZeroAggregateAlign.c?rev=44103&r1=44102&r2=44103&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
> (original)
> +++ llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c Wed
> Nov 14 01:42:50 2007
> @@ -1,3 +1,4 @@
> // RUN: %llvmgcc -S %s -o - | grep "align 2"
> +// XFAIL: *
> struct A { short s; short t; int i; };
> void q() { struct A a = {0}; }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From evan.cheng at apple.com Wed Nov 14 01:59:09 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 14 Nov 2007 07:59:09 -0000
Subject: [llvm-commits] [llvm] r44104 - in /llvm/trunk:
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/MachineInstrBuilder.h include/llvm/CodeGen/SSARegMap.h
lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/MachineInstr.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/VirtRegMap.cpp
lib/Target/X86/X86ATTAsmPrinter.cpp lib/Target/X86/X86RegisterInfo.cpp
Message-ID: <200711140759.lAE7xAb1011938@zion.cs.uiuc.edu>
Author: evancheng
Date: Wed Nov 14 01:59:08 2007
New Revision: 44104
URL: http://llvm.org/viewvc/llvm-project?rev=44104&view=rev
Log:
Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/trunk/include/llvm/CodeGen/SSARegMap.h
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/MachineInstr.cpp
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Wed Nov 14 01:59:08 2007
@@ -76,6 +76,10 @@
/// offset - Offset to address of global or external, only valid for
/// MO_GlobalAddress, MO_ExternalSym and MO_ConstantPoolIndex
int offset;
+
+ /// subReg - SubRegister number, only valid for MO_Register. A value of 0
+ /// indicates the MO_Register has no subReg.
+ unsigned subReg;
} auxInfo;
MachineOperand() {}
@@ -182,6 +186,10 @@
"Wrong MachineOperand accessor");
return auxInfo.offset;
}
+ unsigned getSubReg() const {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ return auxInfo.subReg;
+ }
const char *getSymbolName() const {
assert(isExternalSymbol() && "Wrong MachineOperand accessor");
return contents.SymbolName;
@@ -267,6 +275,10 @@
"Wrong MachineOperand accessor");
auxInfo.offset = Offset;
}
+ void setSubReg(unsigned subReg) {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ auxInfo.subReg = subReg;
+ }
void setConstantPoolIndex(unsigned Idx) {
assert(isConstantPoolIndex() && "Wrong MachineOperand accessor");
contents.immedVal = Idx;
@@ -451,7 +463,8 @@
/// addRegOperand - Add a register operand.
///
void addRegOperand(unsigned Reg, bool IsDef, bool IsImp = false,
- bool IsKill = false, bool IsDead = false) {
+ bool IsKill = false, bool IsDead = false,
+ unsigned SubReg = 0) {
MachineOperand &Op = AddNewOperand(IsImp);
Op.opType = MachineOperand::MO_Register;
Op.IsDef = IsDef;
@@ -459,6 +472,7 @@
Op.IsKill = IsKill;
Op.IsDead = IsDead;
Op.contents.RegNo = Reg;
+ Op.auxInfo.subReg = SubReg;
}
/// addImmOperand - Add a zero extended constant argument to the
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Wed Nov 14 01:59:08 2007
@@ -39,8 +39,8 @@
const
MachineInstrBuilder &addReg(unsigned RegNo, bool isDef = false,
bool isImp = false, bool isKill = false,
- bool isDead = false) const {
- MI->addRegOperand(RegNo, isDef, isImp, isKill, isDead);
+ bool isDead = false, unsigned SubReg = 0) const {
+ MI->addRegOperand(RegNo, isDef, isImp, isKill, isDead, SubReg);
return *this;
}
Modified: llvm/trunk/include/llvm/CodeGen/SSARegMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SSARegMap.h?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SSARegMap.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SSARegMap.h Wed Nov 14 01:59:08 2007
@@ -26,7 +26,6 @@
class SSARegMap {
IndexedMap RegClassMap;
- IndexedMap, VirtReg2IndexFunctor> RegSubIdxMap;
unsigned NextRegNum;
public:
@@ -43,30 +42,12 @@
assert(RegClass && "Cannot create register without RegClass!");
RegClassMap.grow(NextRegNum);
RegClassMap[NextRegNum] = RegClass;
- RegSubIdxMap.grow(NextRegNum);
- RegSubIdxMap[NextRegNum] = std::make_pair(0,0);
return NextRegNum++;
}
unsigned getLastVirtReg() const {
return NextRegNum - 1;
}
-
- void setIsSubRegister(unsigned Reg, unsigned SuperReg, unsigned SubIdx) {
- RegSubIdxMap[Reg] = std::make_pair(SuperReg, SubIdx);
- }
-
- bool isSubRegister(unsigned Reg) const {
- return RegSubIdxMap[Reg].first != 0;
- }
-
- unsigned getSuperRegister(unsigned Reg) const {
- return RegSubIdxMap[Reg].first;
- }
-
- unsigned getSubRegisterIndex(unsigned Reg) const {
- return RegSubIdxMap[Reg].second;
- }
};
} // End llvm namespace
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Nov 14 01:59:08 2007
@@ -670,12 +670,8 @@
unsigned RegI = Reg;
if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg))
continue;
- bool isSubReg = RegMap->isSubRegister(Reg);
- unsigned SubIdx = 0;
- if (isSubReg) {
- SubIdx = RegMap->getSubRegisterIndex(Reg);
- Reg = RegMap->getSuperRegister(Reg);
- }
+ unsigned SubIdx = mop.getSubReg();
+ bool isSubReg = SubIdx != 0;
if (Reg != li.reg)
continue;
@@ -710,8 +706,6 @@
// Create a new virtual register for the spill interval.
unsigned NewVReg = RegMap->createVirtualRegister(rc);
vrm.grow();
- if (isSubReg)
- RegMap->setIsSubRegister(NewVReg, NewVReg, SubIdx);
// Scan all of the operands of this instruction rewriting operands
// to use NewVReg instead of li.reg as appropriate. We do this for
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Nov 14 01:59:08 2007
@@ -39,6 +39,7 @@
Op.IsKill = false;
Op.IsDead = false;
Op.contents.RegNo = *ImpDefs;
+ Op.auxInfo.subReg = 0;
Operands.push_back(Op);
}
if (TID->ImplicitUses)
@@ -50,6 +51,7 @@
Op.IsKill = false;
Op.IsDead = false;
Op.contents.RegNo = *ImpUses;
+ Op.auxInfo.subReg = 0;
Operands.push_back(Op);
}
}
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Nov 14 01:59:08 2007
@@ -1387,6 +1387,7 @@
r2rRevMap_.grow(RegMap->getLastVirtReg());
// Join (coalesce) intervals if requested.
+ IndexedMap RegSubIdxMap;
if (EnableJoining) {
joinIntervals();
DOUT << "********** INTERVALS POST JOINING **********\n";
@@ -1404,10 +1405,11 @@
// Transfer sub-registers info to SSARegMap now that coalescing information
// is complete.
+ RegSubIdxMap.grow(mf_->getSSARegMap()->getLastVirtReg()+1);
while (!SubRegIdxes.empty()) {
std::pair RI = SubRegIdxes.back();
SubRegIdxes.pop_back();
- mf_->getSSARegMap()->setIsSubRegister(RI.first, rep(RI.first), RI.second);
+ RegSubIdxMap[RI.first] = RI.second;
}
}
@@ -1448,12 +1450,13 @@
// replace register with representative register
unsigned OrigReg = mop.getReg();
unsigned reg = rep(OrigReg);
- // Don't rewrite if it is a sub-register of a virtual register.
- if (!RegMap->isSubRegister(OrigReg))
+ unsigned SubIdx = RegSubIdxMap[OrigReg];
+ if (SubIdx && MRegisterInfo::isPhysicalRegister(reg))
+ mii->getOperand(i).setReg(mri_->getSubReg(reg, SubIdx));
+ else {
mii->getOperand(i).setReg(reg);
- else if (MRegisterInfo::isPhysicalRegister(reg))
- mii->getOperand(i).setReg(mri_->getSubReg(reg,
- RegMap->getSubRegisterIndex(OrigReg)));
+ mii->getOperand(i).setSubReg(SubIdx);
+ }
// Multiple uses of reg by the same instruction. It should not
// contribute to spill weight again.
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Wed Nov 14 01:59:08 2007
@@ -788,8 +788,7 @@
if (!MO.isRegister() || MO.getReg() == 0 || !MO.isUse())
continue;
unsigned VirtReg = MO.getReg();
- if (MRegisterInfo::isPhysicalRegister(VirtReg) ||
- RegMap->isSubRegister(VirtReg))
+ if (MRegisterInfo::isPhysicalRegister(VirtReg) || MO.getSubReg())
continue;
if (VRM.isAssignedReg(VirtReg)) {
unsigned PhysReg = VRM.getPhys(VirtReg);
@@ -911,20 +910,14 @@
assert(MRegisterInfo::isVirtualRegister(VirtReg) &&
"Not a virtual or a physical register?");
- unsigned SubIdx = 0;
- bool isSubReg = RegMap->isSubRegister(VirtReg);
- if (isSubReg) {
- SubIdx = RegMap->getSubRegisterIndex(VirtReg);
- VirtReg = RegMap->getSuperRegister(VirtReg);
- }
-
+ unsigned SubIdx = MO.getSubReg();
if (VRM.isAssignedReg(VirtReg)) {
// This virtual register was assigned a physreg!
unsigned Phys = VRM.getPhys(VirtReg);
MF.setPhysRegUsed(Phys);
if (MO.isDef())
ReusedOperands.markClobbered(Phys);
- unsigned RReg = isSubReg ? MRI->getSubReg(Phys, SubIdx) : Phys;
+ unsigned RReg = SubIdx ? MRI->getSubReg(Phys, SubIdx) : Phys;
MI.getOperand(i).setReg(RReg);
continue;
}
@@ -960,7 +953,7 @@
// fi#1 is available in EDI, but it cannot be reused because it's not in
// the right register file.
if (PhysReg &&
- (isSubReg || MI.getOpcode() == TargetInstrInfo::EXTRACT_SUBREG)) {
+ (SubIdx || MI.getOpcode() == TargetInstrInfo::EXTRACT_SUBREG)) {
const TargetRegisterClass* RC = RegMap->getRegClass(VirtReg);
if (!RC->contains(PhysReg))
PhysReg = 0;
@@ -994,7 +987,7 @@
<< MRI->getName(PhysReg) << " for vreg"
<< VirtReg <<" instead of reloading into physreg "
<< MRI->getName(VRM.getPhys(VirtReg)) << "\n";
- unsigned RReg = isSubReg ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
+ unsigned RReg = SubIdx ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
// The only technical detail we have is that we don't know that
@@ -1067,7 +1060,7 @@
DOUT << " from physreg " << MRI->getName(PhysReg) << " for vreg"
<< VirtReg
<< " instead of reloading into same physreg.\n";
- unsigned RReg = isSubReg ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
+ unsigned RReg = SubIdx ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
ReusedOperands.markClobbered(RReg);
++NumReused;
@@ -1087,7 +1080,7 @@
Spills.addAvailable(ReuseSlot, &MI, DesignatedReg);
unsigned RReg =
- isSubReg ? MRI->getSubReg(DesignatedReg, SubIdx) : DesignatedReg;
+ SubIdx ? MRI->getSubReg(DesignatedReg, SubIdx) : DesignatedReg;
MI.getOperand(i).setReg(RReg);
DOUT << '\t' << *prior(MII);
++NumReused;
@@ -1127,7 +1120,7 @@
// unless it's a two-address operand.
if (TID->getOperandConstraint(i, TOI::TIED_TO) == -1)
MI.getOperand(i).setIsKill();
- unsigned RReg = isSubReg ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
+ unsigned RReg = SubIdx ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
UpdateKills(*prior(MII), RegKills, KillOps);
DOUT << '\t' << *prior(MII);
@@ -1308,13 +1301,7 @@
continue;
}
- unsigned SubIdx = 0;
- bool isSubReg = RegMap->isSubRegister(VirtReg);
- if (isSubReg) {
- SubIdx = RegMap->getSubRegisterIndex(VirtReg);
- VirtReg = RegMap->getSuperRegister(VirtReg);
- }
-
+ unsigned SubIdx = MO.getSubReg();
bool DoReMat = VRM.isReMaterialized(VirtReg);
if (DoReMat)
ReMatDefs.insert(&MI);
@@ -1329,7 +1316,7 @@
int TiedOp = MI.getInstrDescriptor()->findTiedToSrcOperand(i);
if (TiedOp != -1) {
PhysReg = MI.getOperand(TiedOp).getReg();
- if (isSubReg) {
+ if (SubIdx) {
unsigned SuperReg = findSuperReg(RC, PhysReg, SubIdx, MRI);
assert(SuperReg && MRI->getSubReg(SuperReg, SubIdx) == PhysReg &&
"Can't find corresponding super-register!");
@@ -1346,7 +1333,7 @@
}
MF.setPhysRegUsed(PhysReg);
- unsigned RReg = isSubReg ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
+ unsigned RReg = SubIdx ? MRI->getSubReg(PhysReg, SubIdx) : PhysReg;
ReusedOperands.markClobbered(RReg);
MI.getOperand(i).setReg(RReg);
Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Nov 14 01:59:08 2007
@@ -616,6 +616,15 @@
case X86::PsMOVZX64rr32:
O << TAI->getCommentString() << " ZERO-EXTEND " << "\n\t";
break;
+ case X86::MOV8mr: {
+ const MachineOperand &MO = MI->getOperand(4);
+ switch (MO.getReg()) {
+ default: abort();
+ case X86::AH: case X86::DH: case X86::CH: case X86::BH:
+ case X86::AL: case X86::DL: case X86::CL: case X86::BL:
+ break;
+ }
+ }
}
// Call the autogenerated instruction printer routines.
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=44104&r1=44103&r2=44104&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Wed Nov 14 01:59:08 2007
@@ -773,7 +773,8 @@
static const MachineInstrBuilder &X86InstrAddOperand(MachineInstrBuilder &MIB,
MachineOperand &MO) {
if (MO.isRegister())
- MIB = MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit());
+ MIB = MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit(),
+ false, false, MO.getSubReg());
else if (MO.isImmediate())
MIB = MIB.addImm(MO.getImm());
else if (MO.isFrameIndex())
@@ -1498,8 +1499,7 @@
unsigned Opc = (Amount < 128) ?
(Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) :
(Is64Bit ? X86::ADD64ri32 : X86::ADD32ri);
- New = BuildMI(TII.get(Opc), StackPtr)
- .addReg(StackPtr).addImm(Amount);
+ New = BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(Amount);
}
}
From kremenek at apple.com Wed Nov 14 02:05:03 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Wed, 14 Nov 2007 08:05:03 -0000
Subject: [llvm-commits] [llvm] r44105 - in /llvm/trunk:
include/llvm/Bitcode/Deserialize.h include/llvm/Bitcode/Serialize.h
lib/Bitcode/Reader/Deserialize.cpp
Message-ID: <200711140805.lAE854dg012171@zion.cs.uiuc.edu>
Author: kremenek
Date: Wed Nov 14 02:05:03 2007
New Revision: 44105
URL: http://llvm.org/viewvc/llvm-project?rev=44105&view=rev
Log:
Added two new overloaded versions of BatchEmitOwnedPtrs and
BatchReadOwnedPtrs.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
llvm/trunk/include/llvm/Bitcode/Serialize.h
llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44105&r1=44104&r2=44105&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Wed Nov 14 02:05:03 2007
@@ -230,6 +230,32 @@
}
}
+ template
+ void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
+ bool A1=true, bool A2=true) {
+
+ BatchIDVec.clear();
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ BatchIDVec.push_back(ReadPtrID());
+
+ SerializedPtrID ID2 = ReadPtrID();
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i) {
+ SerializedPtrID& PtrID = BatchIDVec[i];
+
+ T1* p = PtrID ? SerializeTrait::Create(*this) : NULL;
+
+ if (PtrID && A1)
+ RegisterPtr(PtrID,p);
+
+ Ptrs[i] = p;
+ }
+
+ P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
+ if (ID2 && A2) RegisterPtr(ID2,P2);
+ }
+
template
void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs,
T2*& P2, T3*& P3,
Modified: llvm/trunk/include/llvm/Bitcode/Serialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialize.h?rev=44105&r1=44104&r2=44105&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Serialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Serialize.h Wed Nov 14 02:05:03 2007
@@ -94,6 +94,20 @@
if (Ptrs[i]) SerializeTrait::Emit(*this,*Ptrs[i]);
}
+ template
+ void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs, T2* p2) {
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ EmitPtr(Ptrs[i]);
+
+ EmitPtr(p2);
+
+ for (unsigned i = 0; i < NumT1Ptrs; ++i)
+ if (Ptrs[i]) SerializeTrait::Emit(*this,*Ptrs[i]);
+
+ if (p2) SerializeTrait::Emit(*this,*p2);
+ }
+
template
void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs,
T2* p2, T3* p3) {
Modified: llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp?rev=44105&r1=44104&r2=44105&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp Wed Nov 14 02:05:03 2007
@@ -13,6 +13,8 @@
#include "llvm/Bitcode/Deserialize.h"
+#define DEBUG_BACKPATCH
+
#ifdef DEBUG_BACKPATCH
#include "llvm/Support/Streams.h"
#endif
@@ -346,18 +348,24 @@
return;
}
-#ifdef DEBUG_BACKPATCH
- llvm::cerr << "ReadUintPtr: " << PtrId << "\n";
-#endif
-
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
- if (HasFinalPtr(E))
+ if (HasFinalPtr(E)) {
PtrRef = GetFinalPtr(E);
+
+#ifdef DEBUG_BACKPATCH
+ llvm::cerr << "ReadUintPtr: " << PtrId
+ << " <-- " << (void*) GetFinalPtr(E) << '\n';
+#endif
+ }
else {
assert (AllowBackpatch &&
"Client forbids backpatching for this pointer.");
+#ifdef DEBUG_BACKPATCH
+ llvm::cerr << "ReadUintPtr: " << PtrId << " (NO PTR YET)\n";
+#endif
+
// Register backpatch. Check the freelist for a BPNode.
BPNode* N;
From baldrick at free.fr Wed Nov 14 02:29:13 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 08:29:13 -0000
Subject: [llvm-commits] [llvm] r44107 - in /llvm/trunk:
lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td
utils/TableGen/CallingConvEmitter.cpp
Message-ID: <200711140829.lAE8TDvh013261@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 02:29:13 2007
New Revision: 44107
URL: http://llvm.org/viewvc/llvm-project?rev=44107&view=rev
Log:
Eliminate the recently introduced CCAssignToStackABISizeAlign
in favour of teaching CCAssignToStack that size 0 and/or align
0 means to use the ABI values. This seems a neater solution.
It is safe since no legal value type has size 0.
Modified:
llvm/trunk/lib/Target/TargetCallingConv.td
llvm/trunk/lib/Target/X86/X86CallingConv.td
llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
Modified: llvm/trunk/lib/Target/TargetCallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetCallingConv.td?rev=44107&r1=44106&r2=44107&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetCallingConv.td (original)
+++ llvm/trunk/lib/Target/TargetCallingConv.td Wed Nov 14 02:29:13 2007
@@ -60,19 +60,14 @@
}
/// CCAssignToStack - This action always matches: it assigns the value to a
-/// stack slot of the specified size and alignment on the stack.
+/// stack slot of the specified size and alignment on the stack. If size is
+/// zero then the ABI size is used; if align is zero then the ABI alignment
+/// is used - these may depend on the target or subtarget.
class CCAssignToStack : CCAction {
int Size = size;
int Align = align;
}
-/// CCAssignToStackABISizeAlign - This action always matches: it assigns
-/// the value to a stack slot of the ABISize and ABIAlignment for the type,
-/// which may depend on the target or subtarget.
-/// "ignored" is here because an empty arg list does not work.
-class CCAssignToStackABISizeAlign : CCAction {
-}
-
/// CCStructAssign - This action always matches: it will use the C ABI and
/// the register availability to decided whether to assign to a set of
/// registers or to a stack slot.
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=44107&r1=44106&r2=44107&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Wed Nov 14 02:29:13 2007
@@ -120,7 +120,7 @@
// Long doubles get stack slots whose size and alignment depends on the
// subtarget.
- CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+ CCIfType<[f80], CCAssignToStack<0, 0>>,
// Vectors get 16-byte stack slots that are 16-byte aligned.
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
@@ -181,7 +181,7 @@
// Long doubles get slots whose size and alignment depends on the
// subtarget.
- CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+ CCIfType<[f80], CCAssignToStack<0, 0>>,
// The first 4 vector arguments are passed in XMM registers.
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=44107&r1=44106&r2=44107&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Wed Nov 14 02:29:13 2007
@@ -114,19 +114,21 @@
} else if (Action->isSubClassOf("CCAssignToStack")) {
int Size = Action->getValueAsInt("Size");
int Align = Action->getValueAsInt("Align");
-
+
O << IndentStr << "unsigned Offset" << ++Counter
- << " = State.AllocateStack(" << Size << ", " << Align << ");\n";
- O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
- << Counter << ", LocVT, LocInfo));\n";
- O << IndentStr << "return false;\n";
- } else if (Action->isSubClassOf("CCAssignToStackABISizeAlign")) {
- O << IndentStr << "unsigned Offset" << ++Counter
- << " = State.AllocateStack(State.getTarget().getTargetData()"
- "->getABITypeSize(MVT::getTypeForValueType(LocVT)),\n";
- O << IndentStr << " State.getTarget().getTargetData()"
- "->getABITypeAlignment(MVT::getTypeForValueType(LocVT)));\n";
- O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
+ << " = State.AllocateStack(";
+ if (Size)
+ O << Size << ", ";
+ else
+ O << "\n" << IndentStr << " State.getTarget().getTargetData()"
+ "->getABITypeSize(MVT::getTypeForValueType(LocVT)), ";
+ if (Align)
+ O << Align;
+ else
+ O << "\n" << IndentStr << " State.getTarget().getTargetData()"
+ "->getABITypeAlignment(MVT::getTypeForValueType(LocVT))";
+ O << ");\n" << IndentStr
+ << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
<< Counter << ", LocVT, LocInfo));\n";
O << IndentStr << "return false;\n";
} else if (Action->isSubClassOf("CCPromoteToType")) {
From baldrick at free.fr Wed Nov 14 03:03:16 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 10:03:16 +0100
Subject: [llvm-commits] RFC: Back Port of Duncan's Patch
In-Reply-To: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
References: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
Message-ID: <200711141003.17066.baldrick@free.fr>
Hi Bill,
> Attached is a back port of Duncan's patch r43907
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
> Mon-20071105/055332.html
>
> I would like people to review this and test it to make sure that it
> doesn't fail.
it is nowhere near compiling. Try it and you will see what I mean!
Also, you forgot to fix up TargetIntrinsicLower in llvm-rs6000.cpp
(a mistake in the original patch).
Ciao,
Duncan.
From asl at math.spbu.ru Wed Nov 14 03:18:42 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 09:18:42 -0000
Subject: [llvm-commits] [llvm] r44108 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
lib/Target/X86/X86ATTAsmPrinter.cpp lib/Target/X86/X86ATTAsmPrinter.h
test/CodeGen/X86/test-pic-jtbl.ll
Message-ID: <200711140918.lAE9IhRA022920@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 03:18:41 2007
New Revision: 44108
URL: http://llvm.org/viewvc/llvm-project?rev=44108&view=rev
Log:
Fix PIC jump table codegen on x86-32/linux. In fact, such thing should be applied
to all targets uses GOT-relative offsets for PIC (Alpha?)
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.h
llvm/trunk/test/CodeGen/X86/test-pic-jtbl.ll
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=44108&r1=44107&r2=44108&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Wed Nov 14 03:18:41 2007
@@ -311,7 +311,10 @@
const MachineBasicBlock *MBB) const;
virtual void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
const MachineBasicBlock *MBB) const;
-
+ virtual void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
+ const MachineBasicBlock *MBB,
+ unsigned uid) const;
+
/// printDataDirective - This method prints the asm directive for the
/// specified type.
void printDataDirective(const Type *type);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=44108&r1=44107&r2=44108&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Wed Nov 14 03:18:41 2007
@@ -245,17 +245,9 @@
MachineFunction &MF) {
const std::vector &JT = MJTI->getJumpTables();
if (JT.empty()) return;
+
bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
- // Use JumpTableDirective otherwise honor the entry size from the jump table
- // info.
- const char *JTEntryDirective = TAI->getJumpTableDirective();
- bool HadJTEntryDirective = JTEntryDirective != NULL;
- if (!HadJTEntryDirective) {
- JTEntryDirective = MJTI->getEntrySize() == 4 ?
- TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
- }
-
// Pick the directive to use to print the jump table entries, and switch to
// the appropriate section.
TargetLowering *LoweringInfo = TM.getTargetLowering();
@@ -300,30 +292,51 @@
<< '_' << i << ":\n";
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
- O << JTEntryDirective << ' ';
- // If we have emitted set directives for the jump table entries, print
- // them rather than the entries themselves. If we're emitting PIC, then
- // emit the table entries as differences between two text section labels.
- // If we're emitting non-PIC code, then emit the entries as direct
- // references to the target basic blocks.
- if (!EmittedSets.empty()) {
- O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << '_' << i << "_set_" << JTBBs[ii]->getNumber();
- } else if (IsPic) {
- printBasicBlockLabel(JTBBs[ii], false, false);
- // If the arch uses custom Jump Table directives, don't calc relative to
- // JT
- if (!HadJTEntryDirective)
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
- << getFunctionNumber() << '_' << i;
- } else {
- printBasicBlockLabel(JTBBs[ii], false, false);
- }
+ printPICJumpTableEntry(MJTI, JTBBs[ii], i);
O << '\n';
}
}
}
+void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
+ const MachineBasicBlock *MBB,
+ unsigned uid) const {
+ bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
+
+ // Use JumpTableDirective otherwise honor the entry size from the jump table
+ // info.
+ const char *JTEntryDirective = TAI->getJumpTableDirective();
+ bool HadJTEntryDirective = JTEntryDirective != NULL;
+ if (!HadJTEntryDirective) {
+ JTEntryDirective = MJTI->getEntrySize() == 4 ?
+ TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
+ }
+
+ O << JTEntryDirective << ' ';
+
+ // If we have emitted set directives for the jump table entries, print
+ // them rather than the entries themselves. If we're emitting PIC, then
+ // emit the table entries as differences between two text section labels.
+ // If we're emitting non-PIC code, then emit the entries as direct
+ // references to the target basic blocks.
+ if (IsPic) {
+ if (TAI->getSetDirective()) {
+ O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
+ << '_' << uid << "_set_" << MBB->getNumber();
+ } else {
+ printBasicBlockLabel(MBB, false, false);
+ // If the arch uses custom Jump Table directives, don't calc relative to
+ // JT
+ if (!HadJTEntryDirective)
+ O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
+ << getFunctionNumber() << '_' << uid;
+ }
+ } else {
+ printBasicBlockLabel(MBB, false, false);
+ }
+}
+
+
/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
/// special global used by LLVM. If so, emit it and return true, otherwise
/// do nothing and return false.
Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp?rev=44108&r1=44107&r2=44108&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Nov 14 03:18:41 2007
@@ -22,6 +22,7 @@
#include "X86TargetAsmInfo.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CallingConv.h"
+#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Module.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h"
@@ -502,7 +503,11 @@
const MachineBasicBlock *MBB) const {
if (!TAI->getSetDirective())
return;
-
+
+ // We don't need .set machinery if we have GOT-style relocations
+ if (Subtarget->isPICStyleGOT())
+ return;
+
O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
printBasicBlockLabel(MBB, false, false);
@@ -519,6 +524,28 @@
}
+void X86ATTAsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
+ const MachineBasicBlock *MBB,
+ unsigned uid) const
+{
+ const char *JTEntryDirective = MJTI->getEntrySize() == 4 ?
+ TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
+
+ O << JTEntryDirective << ' ';
+
+ if (TM.getRelocationModel() == Reloc::PIC_) {
+ if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStub()) {
+ O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
+ << '_' << uid << "_set_" << MBB->getNumber();
+ } else if (Subtarget->isPICStyleGOT()) {
+ printBasicBlockLabel(MBB, false, false);
+ O << "@GOTOFF";
+ } else
+ assert(0 && "Don't know how to print MBB label for this PIC mode");
+ } else
+ printBasicBlockLabel(MBB, false, false);
+}
+
bool X86ATTAsmPrinter::printAsmMRegister(const MachineOperand &MO,
const char Mode) {
const MRegisterInfo &RI = *TM.getRegisterInfo();
Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.h?rev=44108&r1=44107&r2=44108&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.h Wed Nov 14 03:18:41 2007
@@ -19,6 +19,8 @@
namespace llvm {
+struct MachineJumpTableInfo;
+
struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public X86SharedAsmPrinter {
X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T)
: X86SharedAsmPrinter(O, TM, T) { }
@@ -83,6 +85,10 @@
const MachineBasicBlock *MBB) const {
AsmPrinter::printPICJumpTableSetLabel(uid, uid2, MBB);
}
+ void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
+ const MachineBasicBlock *MBB,
+ unsigned uid) const;
+
void printPICLabel(const MachineInstr *MI, unsigned Op);
bool runOnMachineFunction(MachineFunction &F);
Modified: llvm/trunk/test/CodeGen/X86/test-pic-jtbl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/test-pic-jtbl.ll?rev=44108&r1=44107&r2=44108&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/test-pic-jtbl.ll (original)
+++ llvm/trunk/test/CodeGen/X86/test-pic-jtbl.ll Wed Nov 14 03:18:41 2007
@@ -1,9 +1,9 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 9
+; RUN: grep piclabel %t | count 3
; RUN: grep PLT %t | count 6
-; RUN: grep GOTOFF %t | count 1
+; RUN: grep GOTOFF %t | count 14
; RUN: grep JTI %t | count 2
define void @bar(i32 %n.u) {
From isanbard at gmail.com Wed Nov 14 03:25:37 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 14 Nov 2007 01:25:37 -0800
Subject: [llvm-commits] RFC: Back Port of Duncan's Patch
In-Reply-To: <200711141003.17066.baldrick@free.fr>
References: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
<200711141003.17066.baldrick@free.fr>
Message-ID: <029AD167-DFEC-49DF-B9B3-E32F86F2E61F@gmail.com>
On Nov 14, 2007, at 1:03 AM, Duncan Sands wrote:
> Hi Bill,
>
>> Attached is a back port of Duncan's patch r43907
>>
>> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
>> Mon-20071105/055332.html
>>
>> I would like people to review this and test it to make sure that it
>> doesn't fail.
>
> it is nowhere near compiling. Try it and you will see what I mean!
> Also, you forgot to fix up TargetIntrinsicLower in llvm-rs6000.cpp
> (a mistake in the original patch).
>
*hits head*
I was compiling the wrong tree. :-(
From isanbard at gmail.com Wed Nov 14 03:41:18 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 14 Nov 2007 01:41:18 -0800
Subject: [llvm-commits] RFC: Back Port of Duncan's Patch
In-Reply-To: <200711141003.17066.baldrick@free.fr>
References: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
<200711141003.17066.baldrick@free.fr>
Message-ID: <3D4A0F31-F888-4441-9754-E6A6ED857D55@gmail.com>
On Nov 14, 2007, at 1:03 AM, Duncan Sands wrote:
> Hi Bill,
>
>> Attached is a back port of Duncan's patch r43907
>>
>> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
>> Mon-20071105/055332.html
>>
>> I would like people to review this and test it to make sure that it
>> doesn't fail.
>
> it is nowhere near compiling. Try it and you will see what I mean!
> Also, you forgot to fix up TargetIntrinsicLower in llvm-rs6000.cpp
> (a mistake in the original patch).
>
Fixed. Please let me know.
-bw
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071114/bce491a9/attachment.txt
From asl at math.spbu.ru Wed Nov 14 03:52:33 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 09:52:33 -0000
Subject: [llvm-commits] [llvm] r44109 - in /llvm/trunk:
include/llvm/ParameterAttributes.h lib/AsmParser/Lexer.l
lib/AsmParser/llvmAsmParser.y lib/VMCore/Function.cpp
lib/VMCore/Verifier.cpp
Message-ID: <200711140952.lAE9qaHQ025007@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 03:52:30 2007
New Revision: 44109
URL: http://llvm.org/viewvc/llvm-project?rev=44109&view=rev
Log:
Add pure/const attributes. Documentation will follow.
Modified:
llvm/trunk/include/llvm/ParameterAttributes.h
llvm/trunk/lib/AsmParser/Lexer.l
llvm/trunk/lib/AsmParser/llvmAsmParser.y
llvm/trunk/lib/VMCore/Function.cpp
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/include/llvm/ParameterAttributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ParameterAttributes.h?rev=44109&r1=44108&r2=44109&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ParameterAttributes.h (original)
+++ llvm/trunk/include/llvm/ParameterAttributes.h Wed Nov 14 03:52:30 2007
@@ -29,16 +29,18 @@
/// results.
/// @brief Function parameter attributes.
enum Attributes {
- None = 0, ///< No attributes have been set
- ZExt = 1 << 0, ///< Zero extended before/after call
- SExt = 1 << 1, ///< Sign extended before/after call
- NoReturn = 1 << 2, ///< Mark the function as not returning
- InReg = 1 << 3, ///< Force argument to be passed in register
- StructRet = 1 << 4, ///< Hidden pointer to structure to return
- NoUnwind = 1 << 5, ///< Function doesn't unwind stack
- NoAlias = 1 << 6, ///< Considered to not alias after call
- ByVal = 1 << 7, ///< Pass structure by value
- Nest = 1 << 8 ///< Nested function static chain
+ None = 0, ///< No attributes have been set
+ ZExt = 1 << 0, ///< Zero extended before/after call
+ SExt = 1 << 1, ///< Sign extended before/after call
+ NoReturn = 1 << 2, ///< Mark the function as not returning
+ InReg = 1 << 3, ///< Force argument to be passed in register
+ StructRet = 1 << 4, ///< Hidden pointer to structure to return
+ NoUnwind = 1 << 5, ///< Function doesn't unwind stack
+ NoAlias = 1 << 6, ///< Considered to not alias after call
+ ByVal = 1 << 7, ///< Pass structure by value
+ Nest = 1 << 8, ///< Nested function static chain
+ Pure = 1 << 9, ///< Function is pure
+ Const = 1 << 10 ///< Function is const
};
}
Modified: llvm/trunk/lib/AsmParser/Lexer.l
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Lexer.l?rev=44109&r1=44108&r2=44109&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/Lexer.l (original)
+++ llvm/trunk/lib/AsmParser/Lexer.l Wed Nov 14 03:52:30 2007
@@ -275,6 +275,8 @@
noalias { return NOALIAS; }
byval { return BYVAL; }
nest { return NEST; }
+pure { return PURE; }
+const { return CONST; }
sext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
return SIGNEXT; }
zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=44109&r1=44108&r2=44109&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Wed Nov 14 03:52:30 2007
@@ -1113,6 +1113,7 @@
// Function Attributes
%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
+%token CONST PURE
// Visibility Styles
%token DEFAULT HIDDEN PROTECTED
@@ -1256,6 +1257,8 @@
| NOUNWIND { $$ = ParamAttr::NoUnwind; }
| ZEROEXT { $$ = ParamAttr::ZExt; }
| SIGNEXT { $$ = ParamAttr::SExt; }
+ | PURE { $$ = ParamAttr::Pure; }
+ | CONST { $$ = ParamAttr::Const; }
;
OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=44109&r1=44108&r2=44109&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Wed Nov 14 03:52:30 2007
@@ -108,6 +108,10 @@
Result += "byval ";
if (Attrs & ParamAttr::Nest)
Result += "nest ";
+ if (Attrs & ParamAttr::Pure)
+ Result += "pure ";
+ if (Attrs & ParamAttr::Const)
+ Result += "const ";
return Result;
}
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=44109&r1=44108&r2=44109&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Nov 14 03:52:30 2007
@@ -398,7 +398,8 @@
ParamAttr::Nest | ParamAttr::StructRet;
const uint16_t ParameterIncompatible =
- ParamAttr::NoReturn | ParamAttr::NoUnwind;
+ ParamAttr::NoReturn | ParamAttr::NoUnwind |
+ ParamAttr::Const | ParamAttr::Pure;
const uint16_t MutuallyIncompatible =
ParamAttr::ByVal | ParamAttr::InReg |
@@ -407,6 +408,9 @@
const uint16_t MutuallyIncompatible2 =
ParamAttr::ZExt | ParamAttr::SExt;
+ const uint16_t MutuallyIncompatible3 =
+ ParamAttr::Pure | ParamAttr::Const;
+
const uint16_t IntegerTypeOnly =
ParamAttr::SExt | ParamAttr::ZExt;
@@ -423,9 +427,14 @@
uint16_t RetI = Attrs->getParamAttrs(0) & ReturnIncompatible;
Assert1(!RetI, "Attribute " + Attrs->getParamAttrsText(RetI) +
"should not apply to functions!", &F);
- uint16_t MutI = Attrs->getParamAttrs(0) & MutuallyIncompatible2;
- Assert1(MutI != MutuallyIncompatible2, "Attributes" +
- Attrs->getParamAttrsText(MutI) + "are incompatible!", &F);
+
+ uint16_t MutI2 = Attrs->getParamAttrs(0) & MutuallyIncompatible2;
+ Assert1(MutI2 != MutuallyIncompatible2, "Attributes" +
+ Attrs->getParamAttrsText(MutI2) + "are incompatible!", &F);
+
+ uint16_t MutI3 = Attrs->getParamAttrs(0) & MutuallyIncompatible3;
+ Assert1(MutI3 != MutuallyIncompatible3, "Attributes" +
+ Attrs->getParamAttrsText(MutI3) + "are incompatible!", &F);
for (FunctionType::param_iterator I = FT->param_begin(),
E = FT->param_end(); I != E; ++I, ++Idx) {
From asl at math.spbu.ru Wed Nov 14 03:53:49 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 09:53:49 -0000
Subject: [llvm-commits] [llvm] r44110 - in /llvm/trunk/lib/AsmParser:
Lexer.cpp.cvs Lexer.l.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs
llvmAsmParser.y.cvs
Message-ID: <200711140953.lAE9rpvV025089@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 03:53:48 2007
New Revision: 44110
URL: http://llvm.org/viewvc/llvm-project?rev=44110&view=rev
Log:
Regenerate
Modified:
llvm/trunk/lib/AsmParser/Lexer.cpp.cvs
llvm/trunk/lib/AsmParser/Lexer.l.cvs
llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
Modified: llvm/trunk/lib/AsmParser/Lexer.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Lexer.cpp.cvs?rev=44110&r1=44109&r2=44110&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/Lexer.cpp.cvs (original)
+++ llvm/trunk/lib/AsmParser/Lexer.cpp.cvs Wed Nov 14 03:53:48 2007
@@ -1,50 +1,93 @@
-#define yy_create_buffer llvmAsm_create_buffer
-#define yy_delete_buffer llvmAsm_delete_buffer
-#define yy_scan_buffer llvmAsm_scan_buffer
-#define yy_scan_string llvmAsm_scan_string
-#define yy_scan_bytes llvmAsm_scan_bytes
-#define yy_flex_debug llvmAsm_flex_debug
-#define yy_init_buffer llvmAsm_init_buffer
-#define yy_flush_buffer llvmAsm_flush_buffer
-#define yy_load_buffer_state llvmAsm_load_buffer_state
-#define yy_switch_to_buffer llvmAsm_switch_to_buffer
-#define yyin llvmAsmin
-#define yyleng llvmAsmleng
-#define yylex llvmAsmlex
-#define yyout llvmAsmout
-#define yyrestart llvmAsmrestart
-#define yytext llvmAsmtext
-#define yylineno llvmAsmlineno
+#line 2 "Lexer.cpp"
-#line 20 "Lexer.cpp"
-/* A lexical scanner generated by flex */
+#line 4 "Lexer.cpp"
-/* Scanner skeleton version:
- * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
- */
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+/* begin standard C headers. */
#include
+#include
+#include
+#include
+/* end standard C headers. */
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have . Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
#endif
+#include
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
-#ifdef __cplusplus
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
-#include
-#include
+#endif /* ! FLEXINT_H */
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
+#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
@@ -53,34 +96,17 @@
#if __STDC__
-#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include
-#include
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
/* Returned upon end-of-file. */
#define YY_NULL 0
@@ -95,71 +121,88 @@
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE llvmAsmrestart(llvmAsmin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (16384*64)
+#endif
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int llvmAsmleng;
-extern int yyleng;
-extern FILE *yyin, *yyout;
+extern FILE *llvmAsmin, *llvmAsmout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+ * access to the local variable yy_act. Since yyless() is a macro, it would break
+ * existing scanners that call yyless() from OUTSIDE llvmAsmlex.
+ * One obvious solution it to make yy_act a global. I tried that, and saw
+ * a 5% performance hit in a non-llvmAsmlineno scanner, because yy_act is
+ * normally declared as a register variable-- so it is not worth it.
+ */
+ #define YY_LESS_LINENO(n) \
+ do { \
+ int yyl;\
+ for ( yyl = n; yyl < llvmAsmleng; ++yyl )\
+ if ( llvmAsmtext[yyl] == '\n' )\
+ --llvmAsmlineno;\
+ }while(0)
+
+/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
+ /* Undo effects of setting up llvmAsmtext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */ \
} \
while ( 0 )
-#define unput(c) yyunput( c, yytext_ptr )
+#define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
-typedef unsigned int yy_size_t;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
@@ -196,12 +239,16 @@
*/
int yy_at_bol;
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
+
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
@@ -211,207 +258,209 @@
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
+ * (via llvmAsmrestart()), so that the user can continue scanning by
+ * just pointing llvmAsmin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
+
};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
*/
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when yytext is formed. */
+/* yy_hold_char holds the character lost when llvmAsmtext is formed. */
static char yy_hold_char;
-
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+int llvmAsmleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
+static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
+/* Flag which is used to allow llvmAsmwrap()'s to do buffer switches
+ * instead of setting up a fresh llvmAsmin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
+void llvmAsmrestart (FILE *input_file );
+void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE llvmAsm_create_buffer (FILE *file,int size );
+void llvmAsm_delete_buffer (YY_BUFFER_STATE b );
+void llvmAsm_flush_buffer (YY_BUFFER_STATE b );
+void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer );
+void llvmAsmpop_buffer_state (void );
+
+static void llvmAsmensure_buffer_stack (void );
+static void llvmAsm_load_buffer_state (void );
+static void llvmAsm_init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER llvmAsm_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE llvmAsm_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE llvmAsm_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char *bytes,int len );
+
+void *llvmAsmalloc (yy_size_t );
+void *llvmAsmrealloc (void *,yy_size_t );
+void llvmAsmfree (void * );
-#define yy_new_buffer yy_create_buffer
+#define yy_new_buffer llvmAsm_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ llvmAsmensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
+ if ( ! YY_CURRENT_BUFFER ){\
+ llvmAsmensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+/* Begin user sect3 */
-#define YY_USES_REJECT
-
-#define yywrap() 1
+#define llvmAsmwrap(n) 1
#define YY_SKIP_YYWRAP
+
typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+FILE *llvmAsmin = (FILE *) 0, *llvmAsmout = (FILE *) 0;
+
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+extern int llvmAsmlineno;
+
+int llvmAsmlineno = 1;
+
+extern char *llvmAsmtext;
+#define yytext_ptr llvmAsmtext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up llvmAsmtext.
*/
#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
+ (yytext_ptr) = yy_bp; \
+ llvmAsmleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
+ (yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 152
-#define YY_END_OF_BUFFER 153
-static yyconst short int yy_acclist[233] =
- { 0,
- 153, 151, 152, 150, 151, 152, 150, 152, 151, 152,
- 151, 152, 151, 152, 151, 152, 151, 152, 151, 152,
- 140, 151, 152, 140, 151, 152, 1, 151, 152, 151,
- 152, 151, 152, 151, 152, 151, 152, 151, 152, 151,
- 152, 151, 152, 151, 152, 151, 152, 151, 152, 151,
- 152, 151, 152, 151, 152, 151, 152, 151, 152, 151,
- 152, 151, 152, 151, 152, 151, 152, 151, 152, 151,
- 152, 151, 152, 151, 152, 137, 135, 133, 143, 141,
- 145, 140, 1, 134, 144, 119, 38, 82, 64, 83,
- 78, 25, 137, 139, 133, 145, 22, 145, 146, 138,
-
- 134, 65, 77, 36, 39, 3, 67, 92, 97, 95,
- 96, 94, 93, 98, 102, 118, 87, 85, 74, 86,
- 84, 66, 100, 91, 89, 90, 88, 101, 99, 79,
- 136, 145, 145, 147, 148, 149, 76, 103, 81, 70,
- 126, 73, 80, 127, 75, 52, 24, 142, 69, 106,
- 72, 47, 26, 4, 62, 68, 71, 55, 12, 105,
- 145, 34, 32, 2, 51, 5, 56, 59, 108, 46,
- 61, 53, 128, 104, 23, 54, 125, 41, 7, 57,
- 40, 112, 111, 8, 16, 121, 124, 35, 63, 116,
- 110, 120, 27, 28, 109, 122, 117, 115, 6, 29,
-
- 107, 50, 33, 44, 45, 9, 19, 10, 113, 11,
- 49, 48, 114, 31, 58, 13, 15, 14, 60, 17,
- 30, 37, 18, 123, 20, 129, 131, 132, 42, 130,
- 43, 21
- } ;
-
-static yyconst short int yy_accept[607] =
+#define YY_NUM_RULES 154
+#define YY_END_OF_BUFFER 155
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[609] =
{ 0,
- 1, 1, 1, 2, 4, 7, 9, 11, 13, 15,
- 17, 19, 21, 24, 27, 30, 32, 34, 36, 38,
- 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
- 60, 62, 64, 66, 68, 70, 72, 74, 76, 76,
- 77, 77, 78, 78, 79, 80, 80, 81, 81, 82,
- 83, 83, 84, 84, 85, 86, 86, 86, 86, 86,
- 86, 86, 86, 87, 87, 87, 88, 88, 88, 88,
- 88, 88, 88, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 90, 90, 90, 90, 90, 90,
- 90, 90, 90, 90, 91, 91, 91, 91, 91, 91,
-
- 91, 91, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 93, 93, 93, 93, 93, 93, 93, 93, 93,
- 93, 93, 93, 93, 93, 93, 93, 94, 94, 95,
- 96, 97, 98, 99, 99, 100, 100, 100, 100, 100,
- 101, 102, 103, 103, 103, 104, 104, 104, 105, 105,
- 105, 105, 105, 106, 106, 106, 106, 106, 106, 106,
- 106, 106, 107, 107, 107, 107, 107, 107, 107, 107,
- 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
- 107, 107, 107, 107, 107, 107, 107, 108, 108, 108,
-
- 108, 108, 108, 109, 110, 111, 112, 113, 114, 114,
- 115, 116, 116, 116, 116, 117, 117, 117, 117, 117,
- 117, 118, 119, 120, 120, 120, 120, 120, 121, 122,
- 122, 122, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 124, 125, 126, 126, 127, 128, 128, 129, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 131, 131,
- 131, 132, 133, 133, 133, 133, 134, 135, 136, 137,
- 137, 137, 137, 137, 138, 138, 138, 138, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
- 139, 139, 140, 141, 141, 141, 141, 141, 141, 142,
-
- 143, 143, 143, 143, 144, 144, 144, 144, 144, 144,
- 144, 144, 145, 146, 146, 146, 147, 147, 147, 147,
- 148, 148, 148, 148, 148, 149, 150, 150, 150, 151,
- 151, 151, 151, 151, 152, 153, 153, 153, 154, 154,
- 154, 154, 155, 155, 156, 157, 157, 157, 157, 157,
- 158, 158, 159, 159, 160, 160, 160, 161, 162, 163,
- 164, 164, 164, 165, 165, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 167, 167, 168,
- 169, 170, 170, 170, 170, 170, 170, 170, 171, 171,
- 171, 171, 171, 172, 172, 172, 172, 172, 172, 172,
-
- 172, 172, 172, 172, 172, 172, 172, 173, 173, 173,
- 173, 173, 174, 174, 174, 174, 174, 175, 175, 176,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
- 178, 178, 178, 179, 179, 179, 179, 180, 180, 180,
- 180, 181, 181, 181, 182, 183, 184, 184, 184, 185,
- 186, 186, 186, 186, 187, 187, 188, 189, 189, 189,
- 189, 190, 190, 190, 190, 190, 191, 191, 191, 191,
- 192, 193, 194, 194, 195, 196, 196, 197, 198, 198,
- 198, 198, 198, 198, 198, 198, 199, 199, 199, 200,
- 201, 201, 201, 201, 201, 201, 202, 202, 202, 202,
-
- 202, 202, 203, 203, 203, 203, 203, 203, 204, 204,
- 204, 205, 205, 205, 205, 205, 205, 205, 206, 206,
- 206, 207, 207, 207, 207, 207, 208, 208, 208, 208,
- 209, 210, 211, 212, 213, 213, 213, 214, 214, 214,
- 214, 214, 215, 215, 216, 216, 216, 217, 217, 218,
- 219, 219, 219, 219, 219, 220, 221, 221, 221, 221,
- 221, 221, 221, 221, 222, 222, 222, 222, 222, 222,
- 223, 223, 223, 223, 223, 223, 224, 224, 224, 224,
- 224, 224, 225, 225, 225, 225, 225, 225, 225, 225,
- 226, 226, 226, 226, 226, 227, 228, 229, 229, 230,
+ 0, 0, 155, 153, 152, 152, 153, 153, 153, 153,
+ 153, 153, 142, 142, 1, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 0, 139,
+ 0, 137, 0, 135, 145, 0, 143, 0, 147, 142,
+ 0, 1, 0, 136, 146, 0, 0, 0, 0, 0,
+ 0, 0, 121, 0, 0, 38, 0, 0, 0, 0,
+ 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 66, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 85, 0, 0, 0, 0, 0, 0,
+
+ 0, 80, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 25, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 139, 0, 141,
+ 135, 147, 22, 147, 0, 148, 0, 0, 0, 0,
+ 140, 136, 67, 0, 0, 79, 0, 0, 36, 0,
+ 0, 0, 0, 39, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 69, 0, 0,
+
+ 0, 0, 0, 94, 99, 97, 98, 96, 95, 0,
+ 100, 104, 0, 0, 0, 0, 120, 0, 0, 0,
+ 0, 0, 89, 87, 76, 0, 0, 0, 0, 88,
+ 86, 0, 0, 68, 0, 0, 0, 0, 0, 0,
+ 0, 0, 102, 93, 91, 0, 92, 90, 0, 103,
+ 101, 0, 0, 0, 0, 0, 0, 0, 0, 81,
+ 0, 0, 138, 147, 0, 0, 0, 147, 149, 150,
+ 151, 0, 0, 0, 0, 78, 0, 0, 0, 105,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 83, 72, 0, 0, 0, 0, 0,
+
+ 128, 75, 0, 0, 0, 82, 0, 0, 0, 0,
+ 0, 0, 0, 129, 77, 0, 0, 52, 0, 0,
+ 0, 24, 0, 0, 0, 0, 53, 144, 71, 0,
+ 0, 108, 0, 0, 0, 0, 74, 47, 0, 0,
+ 26, 0, 0, 0, 4, 0, 64, 70, 0, 0,
+ 0, 0, 73, 0, 57, 0, 12, 0, 0, 107,
+ 147, 34, 32, 0, 0, 2, 0, 51, 0, 54,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 58, 61, 110, 0, 0, 0, 0, 0, 0,
+ 46, 0, 0, 0, 0, 63, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 55,
+ 0, 0, 0, 0, 130, 0, 0, 0, 0, 106,
+ 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 56, 127, 0, 0, 41, 0, 0, 0, 7,
+ 0, 0, 0, 59, 0, 0, 40, 114, 113, 0,
+ 0, 8, 16, 0, 0, 0, 123, 0, 126, 35,
+ 0, 0, 0, 65, 0, 0, 0, 0, 118, 0,
+ 0, 0, 112, 122, 27, 0, 28, 111, 0, 124,
+ 119, 0, 0, 0, 0, 0, 0, 0, 117, 0,
+ 0, 6, 29, 0, 0, 0, 0, 0, 109, 0,
+
+ 0, 0, 0, 0, 50, 0, 0, 0, 0, 0,
+ 33, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 45, 0, 0, 9, 0, 0, 0, 0, 19, 0,
+ 0, 0, 10, 115, 11, 49, 48, 0, 0, 116,
+ 0, 0, 0, 0, 31, 0, 60, 0, 0, 13,
+ 0, 15, 14, 0, 0, 0, 0, 62, 17, 0,
+ 0, 0, 0, 0, 0, 0, 30, 0, 0, 0,
+ 0, 0, 37, 0, 0, 0, 0, 0, 18, 0,
+ 0, 0, 0, 0, 125, 0, 0, 0, 0, 0,
+ 0, 0, 20, 0, 0, 0, 0, 131, 133, 134,
- 230, 231, 232, 232, 233, 233
+ 0, 42, 0, 132, 43, 0, 21, 0
} ;
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -443,7 +492,7 @@
1, 1, 1, 1, 1
} ;
-static yyconst int yy_meta[50] =
+static yyconst flex_int32_t yy_meta[50] =
{ 0,
1, 1, 2, 3, 4, 1, 5, 6, 4, 7,
7, 7, 7, 7, 7, 8, 1, 1, 4, 9,
@@ -452,294 +501,294 @@
4, 4, 4, 4, 4, 4, 4, 4, 4
} ;
-static yyconst short int yy_base[617] =
+static yyconst flex_int16_t yy_base[620] =
{ 0,
- 0, 0, 1381, 1382, 1382, 1382, 1376, 1363, 46, 52,
- 58, 66, 74, 1331, 0, 87, 76, 79, 78, 94,
+ 0, 0, 1387, 1388, 1388, 1388, 1382, 1369, 46, 52,
+ 58, 66, 74, 1337, 0, 87, 76, 79, 78, 94,
77, 106, 109, 63, 138, 130, 141, 140, 151, 155,
- 110, 189, 175, 226, 145, 114, 38, 144, 1373, 1382,
- 1360, 1382, 1371, 0, 233, 259, 265, 119, 303, 1327,
- 323, 0, 1369, 0, 271, 146, 160, 161, 39, 165,
- 188, 64, 1356, 36, 124, 187, 190, 93, 199, 193,
- 195, 221, 1355, 121, 218, 215, 225, 224, 277, 236,
- 248, 271, 273, 175, 274, 283, 240, 284, 278, 126,
- 276, 279, 292, 35, 314, 306, 289, 331, 338, 340,
-
- 315, 343, 345, 341, 346, 347, 348, 349, 350, 359,
- 356, 354, 364, 361, 371, 363, 377, 381, 386, 389,
- 1354, 392, 393, 395, 394, 397, 396, 400, 417, 402,
- 280, 419, 357, 194, 401, 406, 1353, 1364, 1382, 0,
- 395, 1351, 0, 457, 427, 464, 485, 506, 1362, 1382,
- 0, 1349, 435, 421, 1348, 428, 440, 1347, 405, 511,
- 512, 445, 1346, 513, 446, 514, 466, 469, 471, 524,
- 526, 1345, 527, 506, 507, 470, 528, 529, 286, 508,
- 531, 530, 533, 535, 542, 544, 547, 548, 549, 551,
- 555, 407, 558, 559, 563, 564, 1344, 566, 569, 565,
-
- 574, 571, 1343, 1342, 1341, 1340, 1339, 1338, 572, 1337,
- 1336, 575, 577, 579, 1335, 613, 585, 586, 581, 591,
- 1334, 1333, 1332, 587, 589, 598, 599, 1331, 1330, 615,
- 580, 1329, 603, 620, 628, 631, 629, 632, 633, 634,
- 1328, 1327, 1326, 636, 1325, 1324, 637, 1323, 1322, 638,
- 640, 641, 647, 648, 655, 649, 654, 1321, 659, 665,
- 1382, 662, 500, 674, 685, 687, 0, 0, 0, 674,
- 680, 682, 683, 1320, 684, 685, 687, 1319, 686, 688,
- 689, 690, 691, 696, 695, 698, 702, 703, 707, 709,
- 714, 1318, 1317, 710, 720, 711, 717, 723, 1316, 1315,
-
- 727, 724, 729, 1314, 732, 730, 731, 735, 734, 739,
- 740, 1313, 1312, 741, 748, 1311, 736, 744, 749, 1310,
- 750, 754, 759, 760, 0, 1309, 764, 765, 783, 761,
- 773, 774, 766, 1308, 1307, 777, 784, 1306, 785, 788,
- 789, 1305, 791, 1304, 1303, 792, 793, 794, 796, 1302,
- 799, 1301, 800, 1300, 804, 809, 825, 837, 1299, 1298,
- 801, 816, 1297, 813, 1296, 829, 805, 837, 819, 838,
- 842, 820, 841, 845, 847, 848, 1295, 849, 1294, 1293,
- 1292, 850, 853, 854, 856, 855, 857, 1291, 861, 862,
- 863, 866, 1290, 871, 865, 872, 873, 877, 880, 881,
-
- 884, 887, 889, 890, 891, 909, 1382, 900, 899, 893,
- 902, 1289, 901, 903, 904, 908, 1288, 909, 1287, 911,
- 914, 920, 910, 928, 915, 923, 929, 947, 1382, 1286,
- 931, 936, 1285, 938, 939, 940, 1284, 941, 943, 944,
- 1283, 947, 945, 1282, 1281, 1280, 946, 949, 1279, 1278,
- 960, 952, 958, 1277, 964, 1276, 1275, 962, 968, 970,
- 1274, 979, 976, 977, 978, 1273, 981, 982, 980, 1272,
- 1271, 1270, 815, 1269, 1268, 984, 1263, 1260, 983, 986,
- 990, 992, 987, 1001, 995, 1257, 997, 1005, 1245, 1242,
- 1006, 1008, 1009, 1010, 1013, 1230, 1015, 1011, 1017, 1019,
-
- 1021, 1227, 1020, 1023, 1042, 1032, 1022, 1217, 1025, 1037,
- 1214, 1040, 1043, 1047, 1046, 1057, 1053, 1211, 1048, 1055,
- 1204, 1056, 1058, 1061, 1063, 1192, 1062, 1065, 1066, 1191,
- 1190, 1189, 1188, 1187, 1068, 1071, 1186, 1069, 1078, 1072,
- 1077, 1184, 1080, 1182, 1090, 1092, 1181, 1074, 1180, 1179,
- 1093, 1095, 1096, 1097, 1177, 1174, 1100, 1098, 1103, 1105,
- 1104, 1107, 1106, 1173, 1110, 1112, 1116, 1118, 1119, 1170,
- 1120, 1121, 1122, 1130, 1133, 1169, 1127, 1135, 1136, 1137,
- 1142, 821, 1144, 1143, 1138, 1145, 1147, 1148, 1151, 600,
- 1153, 1156, 1150, 1158, 597, 487, 404, 1160, 360, 1165,
+ 110, 190, 179, 227, 145, 114, 38, 144, 1379, 1388,
+ 1366, 1388, 1377, 0, 234, 260, 266, 119, 304, 1333,
+ 324, 0, 1375, 0, 272, 146, 175, 148, 39, 161,
+ 185, 64, 1362, 36, 124, 186, 189, 93, 212, 219,
+ 165, 187, 1361, 198, 224, 196, 234, 191, 278, 236,
+ 214, 272, 274, 226, 275, 284, 277, 121, 276, 280,
+ 288, 281, 306, 35, 315, 326, 290, 339, 341, 279,
+
+ 342, 332, 346, 347, 348, 349, 350, 289, 353, 355,
+ 360, 356, 357, 365, 373, 381, 367, 378, 382, 387,
+ 390, 1360, 393, 222, 396, 395, 398, 397, 401, 405,
+ 403, 423, 420, 429, 361, 407, 409, 1359, 1370, 1388,
+ 0, 429, 1357, 0, 452, 448, 462, 483, 504, 1368,
+ 1388, 0, 1355, 510, 441, 1354, 470, 464, 1353, 445,
+ 509, 512, 469, 1352, 511, 504, 522, 505, 467, 526,
+ 527, 426, 1351, 528, 506, 529, 468, 283, 533, 406,
+ 534, 535, 538, 536, 537, 543, 539, 546, 548, 550,
+ 552, 554, 564, 566, 568, 569, 570, 1350, 572, 571,
+
+ 573, 575, 576, 1349, 1348, 1347, 1346, 1345, 1344, 579,
+ 1343, 1342, 581, 580, 583, 584, 1341, 617, 594, 591,
+ 587, 592, 1340, 1339, 1338, 408, 604, 585, 602, 1337,
+ 1336, 605, 608, 1335, 609, 622, 634, 635, 637, 638,
+ 639, 640, 1334, 1333, 1332, 642, 1331, 1330, 643, 1329,
+ 1328, 644, 645, 646, 654, 653, 658, 650, 647, 1327,
+ 661, 670, 1388, 667, 681, 680, 690, 693, 0, 0,
+ 0, 686, 687, 688, 689, 1326, 690, 691, 694, 1325,
+ 692, 693, 695, 696, 698, 701, 702, 704, 706, 707,
+ 717, 709, 716, 1324, 1323, 715, 729, 721, 723, 730,
+
+ 1322, 1321, 731, 734, 739, 1320, 738, 735, 736, 737,
+ 744, 745, 741, 1319, 1318, 746, 747, 1317, 740, 754,
+ 755, 1316, 756, 765, 767, 769, 1315, 0, 1314, 770,
+ 771, 786, 774, 776, 777, 778, 1313, 1312, 783, 793,
+ 1311, 794, 797, 795, 1310, 798, 1309, 1308, 799, 801,
+ 802, 800, 1307, 803, 1306, 805, 1305, 808, 810, 830,
+ 841, 1304, 1303, 820, 812, 1302, 818, 1301, 831, 841,
+ 843, 826, 833, 845, 825, 847, 849, 853, 854, 1300,
+ 856, 1299, 1298, 1297, 858, 859, 857, 860, 861, 863,
+ 1296, 864, 866, 869, 868, 1295, 872, 871, 877, 879,
+
+ 883, 885, 886, 889, 894, 896, 895, 897, 914, 1388,
+ 903, 904, 898, 907, 1294, 909, 906, 908, 910, 1293,
+ 914, 1292, 915, 916, 919, 921, 927, 931, 932, 935,
+ 953, 1388, 1291, 942, 941, 1290, 943, 944, 947, 1289,
+ 945, 948, 951, 1288, 946, 952, 1287, 1286, 1285, 961,
+ 949, 1284, 1283, 953, 965, 957, 1282, 967, 1281, 1280,
+ 962, 975, 977, 1279, 490, 980, 981, 982, 1278, 983,
+ 985, 986, 1273, 1270, 1267, 987, 1255, 1252, 989, 1240,
+ 1237, 990, 991, 993, 994, 997, 1001, 1004, 1227, 1008,
+ 1010, 1224, 1221, 1011, 1012, 1014, 1015, 1016, 1214, 1020,
+
+ 1019, 1021, 1022, 1026, 1202, 1027, 1030, 1045, 1043, 1023,
+ 1201, 1028, 1046, 1200, 1049, 1051, 1052, 1031, 1061, 1053,
+ 1199, 1054, 1062, 1198, 1063, 1066, 1067, 1069, 1197, 1070,
+ 1071, 1072, 1196, 1195, 1194, 1193, 1192, 1074, 1075, 1190,
+ 1083, 1079, 1076, 1078, 1189, 1084, 1187, 1097, 1086, 1185,
+ 1080, 1184, 1183, 1099, 1100, 1101, 1102, 1181, 1180, 1104,
+ 1105, 1109, 1110, 1112, 1111, 1114, 1179, 1116, 1117, 1118,
+ 1125, 1119, 1163, 1124, 1126, 1131, 1135, 1136, 1161, 1127,
+ 1142, 1143, 1144, 1148, 819, 1149, 1145, 1153, 1151, 1152,
+ 1147, 1157, 775, 1160, 1162, 1158, 1159, 601, 364, 362,
- 281, 234, 1168, 90, 1382, 1209, 1215, 1222, 1231, 1238,
- 1247, 1253, 1262, 1268, 1271, 1276
+ 1165, 282, 1175, 173, 126, 1178, 90, 1388, 1219, 1225,
+ 1232, 1241, 1248, 1257, 1263, 1272, 1278, 1281, 1286
} ;
-static yyconst short int yy_def[617] =
+static yyconst flex_int16_t yy_def[620] =
{ 0,
- 605, 1, 605, 605, 605, 605, 606, 607, 608, 605,
- 607, 607, 607, 13, 609, 610, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 606, 605,
- 607, 605, 611, 612, 605, 605, 13, 607, 607, 13,
- 49, 609, 613, 614, 605, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 25, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
-
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 605, 611, 605, 612,
- 615, 607, 49, 607, 51, 49, 49, 49, 613, 605,
- 614, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
-
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 49, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 605, 615, 616, 605, 144, 144, 146, 147, 148, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
-
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 216, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 605, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
-
- 607, 607, 607, 607, 607, 605, 605, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 605, 605, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
-
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
+ 608, 1, 608, 608, 608, 608, 609, 610, 611, 608,
+ 610, 610, 610, 13, 612, 613, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 609, 608,
+ 610, 608, 614, 615, 608, 608, 13, 610, 610, 13,
+ 49, 612, 616, 617, 608, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 25, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 608, 614, 608,
+ 615, 618, 610, 49, 610, 51, 49, 49, 49, 616,
+ 608, 617, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 49, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 608, 618, 619, 608, 145, 145, 147, 148,
+ 149, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 218, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 608, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+
+ 610, 610, 610, 610, 610, 610, 610, 610, 608, 608,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 608, 608, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
+ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610,
- 607, 607, 607, 607, 0, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605
+ 610, 610, 610, 610, 610, 610, 610, 0, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608
} ;
-static yyconst short int yy_nxt[1432] =
+static yyconst flex_int16_t yy_nxt[1438] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 14, 14, 14, 14, 4, 15, 16, 8, 8,
8, 8, 8, 8, 17, 18, 19, 20, 21, 22,
23, 24, 25, 8, 26, 27, 28, 29, 30, 8,
31, 32, 33, 34, 35, 36, 37, 8, 38, 43,
- 42, 42, 134, 42, 42, 45, 45, 45, 45, 45,
+ 42, 42, 135, 42, 42, 45, 45, 45, 45, 45,
45, 46, 46, 46, 46, 46, 46, 47, 47, 47,
- 47, 47, 47, 42, 48, 135, 198, 156, 42, 42,
- 161, 42, 49, 50, 50, 50, 50, 50, 50, 42,
+ 47, 47, 47, 42, 48, 136, 199, 157, 42, 42,
+ 162, 42, 49, 50, 50, 50, 50, 50, 50, 42,
53, 42, 42, 42, 42, 83, 55, 55, 55, 55,
- 55, 55, 65, 56, 66, 42, 160, 61, 42, 42,
+ 55, 55, 65, 56, 66, 42, 161, 61, 42, 42,
57, 62, 58, 72, 59, 67, 73, 60, 68, 63,
- 51, 42, 69, 74, 42, 42, 64, 142, 70, 42,
- 75, 71, 76, 77, 42, 166, 42, 81, 107, 42,
- 78, 42, 133, 82, 79, 42, 80, 84, 84, 84,
- 84, 84, 84, 42, 87, 42, 42, 194, 162, 42,
- 42, 42, 88, 173, 85, 91, 42, 89, 94, 131,
- 42, 90, 136, 152, 86, 42, 42, 95, 92, 97,
- 42, 98, 132, 96, 93, 99, 103, 100, 155, 101,
- 42, 102, 153, 104, 154, 105, 157, 106, 108, 119,
-
- 158, 41, 42, 42, 42, 42, 120, 257, 42, 42,
- 42, 41, 121, 163, 42, 122, 109, 110, 159, 111,
- 112, 113, 123, 114, 164, 167, 165, 170, 168, 115,
- 42, 116, 117, 42, 118, 108, 42, 169, 171, 42,
- 42, 42, 45, 45, 45, 45, 45, 45, 172, 42,
- 176, 42, 174, 124, 125, 42, 126, 177, 127, 175,
- 128, 178, 129, 42, 182, 191, 130, 141, 46, 46,
- 46, 46, 46, 46, 47, 47, 47, 47, 47, 47,
- 55, 55, 55, 55, 55, 55, 42, 179, 42, 42,
- 183, 42, 42, 42, 42, 42, 42, 295, 42, 42,
-
- 185, 42, 193, 253, 42, 180, 196, 42, 184, 186,
- 195, 41, 143, 143, 143, 143, 143, 143, 42, 181,
- 192, 42, 144, 187, 188, 189, 197, 190, 203, 42,
- 42, 144, 145, 145, 145, 145, 145, 145, 199, 209,
- 202, 145, 145, 146, 147, 148, 42, 145, 145, 145,
- 145, 145, 145, 42, 200, 42, 42, 201, 42, 204,
- 42, 42, 42, 42, 42, 42, 206, 212, 208, 42,
- 210, 42, 42, 205, 42, 42, 42, 211, 42, 42,
- 207, 256, 217, 213, 221, 218, 42, 214, 223, 228,
- 215, 225, 42, 219, 226, 216, 42, 224, 222, 230,
-
- 231, 42, 232, 229, 42, 220, 227, 42, 42, 42,
- 42, 42, 42, 233, 263, 42, 42, 42, 234, 42,
- 42, 42, 42, 263, 237, 242, 235, 240, 245, 236,
- 252, 239, 42, 241, 42, 238, 42, 275, 244, 243,
- 311, 258, 246, 42, 247, 248, 259, 41, 41, 41,
- 42, 254, 260, 255, 249, 42, 273, 250, 272, 270,
- 42, 42, 251, 264, 265, 271, 266, 266, 266, 266,
- 266, 266, 42, 267, 267, 267, 267, 267, 267, 278,
- 274, 42, 267, 267, 42, 42, 42, 280, 267, 267,
- 267, 267, 267, 267, 268, 268, 268, 268, 268, 268,
-
- 282, 283, 42, 268, 268, 284, 264, 264, 292, 268,
- 268, 268, 268, 268, 268, 269, 269, 269, 269, 269,
- 269, 42, 42, 42, 269, 269, 42, 42, 42, 42,
- 269, 269, 269, 269, 269, 269, 277, 276, 281, 42,
- 279, 42, 42, 42, 42, 42, 42, 290, 42, 291,
- 42, 287, 285, 294, 296, 288, 286, 42, 299, 42,
- 302, 301, 42, 42, 42, 300, 42, 289, 297, 303,
- 42, 298, 293, 42, 42, 305, 306, 307, 42, 42,
- 42, 42, 304, 310, 42, 312, 42, 42, 309, 42,
- 42, 308, 42, 318, 42, 42, 42, 314, 322, 313,
-
- 42, 42, 42, 317, 42, 320, 42, 315, 316, 328,
- 319, 321, 42, 42, 42, 42, 330, 331, 42, 323,
- 336, 324, 325, 325, 325, 325, 325, 325, 327, 326,
- 42, 325, 325, 329, 332, 42, 333, 325, 325, 325,
- 325, 325, 325, 42, 42, 337, 42, 42, 42, 42,
- 334, 42, 42, 42, 338, 42, 42, 335, 339, 340,
- 342, 344, 42, 42, 42, 347, 348, 341, 343, 42,
- 42, 351, 349, 346, 42, 352, 350, 355, 345, 353,
- 42, 263, 354, 358, 358, 358, 358, 358, 358, 42,
- 263, 605, 41, 605, 41, 42, 356, 42, 42, 42,
-
- 42, 42, 42, 42, 42, 42, 42, 357, 361, 364,
- 42, 42, 366, 42, 369, 359, 360, 42, 42, 362,
- 363, 365, 42, 368, 42, 42, 42, 370, 371, 42,
- 367, 376, 42, 373, 380, 42, 374, 377, 42, 42,
- 378, 372, 42, 375, 42, 42, 42, 42, 386, 42,
- 42, 42, 379, 381, 42, 42, 42, 387, 382, 42,
- 383, 385, 388, 42, 42, 42, 384, 392, 397, 42,
- 389, 390, 391, 393, 42, 42, 42, 394, 395, 42,
- 42, 42, 396, 401, 406, 407, 398, 402, 42, 42,
- 408, 405, 42, 400, 399, 411, 404, 403, 42, 42,
-
- 42, 409, 410, 42, 42, 412, 42, 42, 42, 42,
- 413, 42, 415, 414, 42, 42, 42, 417, 420, 42,
- 42, 418, 419, 416, 42, 430, 428, 429, 42, 434,
- 42, 42, 421, 424, 42, 42, 42, 426, 512, 422,
- 42, 427, 423, 431, 42, 425, 358, 358, 358, 358,
- 358, 358, 42, 42, 432, 433, 42, 42, 439, 436,
- 42, 435, 42, 42, 42, 42, 437, 438, 42, 42,
- 42, 42, 42, 441, 443, 444, 42, 42, 42, 440,
- 42, 42, 445, 442, 448, 446, 42, 42, 42, 449,
- 447, 456, 42, 450, 454, 42, 42, 458, 452, 42,
-
- 457, 453, 42, 451, 42, 42, 42, 455, 42, 461,
- 406, 407, 460, 463, 42, 42, 42, 42, 42, 42,
- 459, 464, 462, 42, 42, 42, 42, 465, 468, 42,
- 42, 473, 471, 466, 467, 42, 474, 476, 42, 469,
- 470, 477, 479, 42, 42, 472, 42, 475, 428, 429,
- 478, 42, 480, 42, 42, 42, 42, 482, 42, 42,
- 42, 42, 42, 485, 42, 484, 481, 42, 489, 483,
- 493, 494, 496, 42, 487, 42, 499, 42, 486, 42,
- 491, 492, 490, 42, 497, 42, 488, 495, 498, 505,
- 501, 42, 42, 42, 42, 42, 42, 42, 42, 42,
-
- 500, 42, 42, 502, 516, 42, 504, 42, 503, 509,
- 42, 510, 42, 507, 508, 513, 42, 514, 506, 517,
- 42, 42, 511, 42, 42, 42, 42, 515, 42, 518,
- 42, 520, 42, 519, 42, 42, 42, 42, 42, 521,
- 42, 527, 522, 528, 526, 529, 523, 42, 524, 532,
- 534, 530, 42, 535, 525, 42, 533, 42, 42, 531,
- 536, 42, 42, 42, 537, 539, 544, 541, 42, 538,
- 42, 42, 42, 42, 540, 542, 42, 42, 42, 545,
- 42, 42, 555, 42, 42, 547, 42, 42, 543, 42,
- 546, 551, 42, 42, 554, 42, 552, 557, 556, 548,
-
- 549, 553, 560, 550, 558, 42, 561, 42, 42, 559,
- 42, 42, 42, 42, 562, 42, 564, 565, 42, 42,
- 42, 42, 42, 566, 563, 42, 569, 42, 573, 571,
- 575, 42, 568, 42, 42, 42, 42, 42, 567, 572,
- 570, 574, 42, 576, 581, 42, 579, 577, 42, 582,
- 42, 42, 42, 42, 578, 586, 583, 42, 42, 42,
- 42, 580, 42, 42, 584, 42, 42, 585, 42, 592,
- 593, 42, 588, 42, 589, 42, 590, 587, 591, 598,
- 42, 594, 599, 42, 42, 42, 602, 595, 42, 42,
- 596, 597, 42, 603, 42, 42, 42, 42, 600, 42,
+ 51, 42, 69, 74, 42, 42, 64, 143, 70, 42,
+ 75, 71, 76, 77, 42, 167, 42, 81, 108, 42,
+ 78, 42, 134, 82, 79, 42, 80, 84, 84, 84,
+ 84, 84, 84, 42, 87, 42, 42, 193, 163, 42,
+ 42, 42, 88, 42, 85, 91, 42, 89, 94, 132,
+ 42, 90, 137, 153, 86, 156, 42, 95, 92, 97,
+ 42, 98, 133, 96, 93, 99, 103, 100, 42, 101,
+ 42, 102, 158, 104, 42, 105, 159, 106, 107, 109,
+
+ 42, 42, 42, 120, 42, 42, 42, 154, 172, 155,
+ 121, 42, 164, 42, 173, 160, 122, 110, 111, 123,
+ 112, 113, 114, 165, 115, 166, 124, 42, 179, 42,
+ 116, 177, 117, 118, 42, 119, 109, 42, 168, 42,
+ 174, 169, 42, 45, 45, 45, 45, 45, 45, 42,
+ 170, 42, 41, 171, 125, 126, 184, 127, 175, 128,
+ 241, 129, 41, 130, 183, 176, 178, 131, 142, 46,
+ 46, 46, 46, 46, 46, 47, 47, 47, 47, 47,
+ 47, 55, 55, 55, 55, 55, 55, 42, 180, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 601, 42, 42, 42, 42, 42, 42, 42, 604, 39,
+ 194, 186, 192, 42, 42, 42, 181, 209, 197, 185,
+ 187, 195, 41, 144, 144, 144, 144, 144, 144, 42,
+ 182, 42, 196, 145, 188, 189, 190, 295, 191, 204,
+ 42, 217, 145, 146, 146, 146, 146, 146, 146, 200,
+ 198, 42, 146, 146, 147, 148, 149, 42, 146, 146,
+ 146, 146, 146, 146, 42, 201, 42, 42, 202, 211,
+ 203, 42, 42, 42, 42, 42, 210, 205, 42, 207,
+ 42, 42, 42, 213, 259, 42, 42, 42, 212, 42,
+ 42, 206, 42, 208, 223, 214, 220, 219, 42, 215,
+ 216, 225, 227, 42, 221, 228, 42, 42, 224, 218,
+
+ 226, 230, 42, 234, 233, 42, 222, 229, 42, 232,
+ 42, 42, 42, 42, 235, 231, 42, 297, 42, 236,
+ 42, 42, 42, 42, 42, 239, 244, 237, 242, 247,
+ 238, 254, 249, 250, 243, 42, 240, 333, 42, 246,
+ 245, 42, 251, 248, 42, 252, 255, 260, 265, 261,
+ 253, 289, 256, 258, 257, 262, 42, 265, 266, 267,
+ 42, 268, 268, 268, 268, 268, 268, 42, 41, 41,
+ 41, 269, 269, 269, 269, 269, 269, 277, 274, 42,
+ 269, 269, 42, 42, 42, 42, 269, 269, 269, 269,
+ 269, 269, 270, 270, 270, 270, 270, 270, 275, 285,
+
+ 508, 270, 270, 280, 276, 42, 294, 270, 270, 270,
+ 270, 270, 270, 271, 271, 271, 271, 271, 271, 42,
+ 42, 42, 271, 271, 42, 42, 42, 42, 271, 271,
+ 271, 271, 271, 271, 272, 278, 279, 42, 281, 284,
+ 273, 42, 42, 42, 42, 282, 283, 292, 42, 42,
+ 42, 42, 42, 42, 42, 287, 290, 296, 42, 288,
+ 286, 42, 304, 42, 303, 42, 301, 42, 291, 42,
+ 305, 293, 299, 302, 307, 300, 308, 306, 309, 42,
+ 298, 42, 312, 42, 42, 42, 42, 42, 42, 311,
+ 42, 42, 310, 314, 42, 42, 42, 313, 42, 42,
+
+ 42, 320, 42, 316, 324, 319, 42, 42, 315, 42,
+ 322, 321, 327, 317, 318, 331, 42, 42, 323, 42,
+ 42, 335, 325, 42, 42, 326, 328, 328, 328, 328,
+ 328, 328, 334, 330, 332, 328, 328, 42, 329, 336,
+ 337, 328, 328, 328, 328, 328, 328, 338, 339, 42,
+ 42, 340, 42, 42, 42, 42, 341, 42, 42, 42,
+ 42, 42, 42, 343, 342, 42, 345, 347, 42, 42,
+ 358, 350, 351, 42, 346, 344, 42, 352, 354, 349,
+ 355, 353, 356, 357, 348, 42, 265, 266, 266, 361,
+ 361, 361, 361, 361, 361, 265, 608, 41, 359, 608,
+
+ 41, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 42, 360, 42, 364, 367, 42, 42, 369, 42,
+ 372, 42, 42, 363, 42, 365, 366, 362, 368, 371,
+ 42, 42, 42, 374, 373, 370, 42, 380, 42, 376,
+ 377, 379, 381, 383, 42, 42, 42, 378, 375, 42,
+ 42, 42, 42, 42, 42, 42, 42, 382, 389, 42,
+ 42, 42, 42, 384, 385, 388, 386, 390, 391, 42,
+ 42, 42, 400, 387, 394, 392, 393, 395, 397, 396,
+ 42, 399, 42, 398, 42, 42, 42, 409, 410, 42,
+ 42, 42, 42, 42, 404, 405, 401, 408, 42, 403,
+
+ 402, 42, 407, 411, 412, 413, 406, 414, 42, 42,
+ 42, 415, 42, 42, 42, 42, 42, 42, 42, 416,
+ 42, 418, 417, 42, 420, 42, 423, 42, 421, 419,
+ 422, 431, 432, 42, 42, 42, 424, 427, 429, 434,
+ 42, 42, 430, 425, 433, 42, 42, 426, 42, 428,
+ 361, 361, 361, 361, 361, 361, 42, 436, 42, 435,
+ 42, 440, 42, 442, 42, 437, 439, 438, 42, 42,
+ 441, 42, 42, 42, 42, 42, 42, 444, 42, 42,
+ 446, 42, 447, 42, 42, 443, 42, 42, 451, 445,
+ 448, 449, 42, 450, 42, 452, 457, 459, 42, 453,
+
+ 42, 42, 455, 461, 42, 460, 454, 456, 458, 42,
+ 42, 42, 42, 42, 464, 409, 410, 463, 42, 42,
+ 466, 42, 42, 42, 42, 42, 462, 465, 467, 42,
+ 42, 42, 468, 471, 42, 476, 42, 470, 477, 469,
+ 474, 479, 42, 480, 472, 473, 42, 42, 475, 481,
+ 42, 483, 478, 482, 431, 432, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 484, 42, 42, 42, 496,
+ 497, 487, 42, 485, 488, 492, 42, 42, 486, 490,
+ 42, 501, 42, 489, 500, 494, 493, 499, 495, 502,
+ 42, 491, 42, 504, 498, 42, 42, 42, 42, 503,
+
+ 42, 42, 42, 505, 42, 42, 42, 519, 42, 42,
+ 515, 512, 42, 507, 513, 506, 42, 510, 511, 42,
+ 516, 520, 509, 42, 517, 42, 42, 42, 514, 42,
+ 42, 42, 518, 522, 42, 42, 42, 42, 42, 521,
+ 523, 42, 42, 42, 530, 42, 42, 525, 531, 529,
+ 524, 526, 527, 532, 535, 533, 538, 537, 42, 528,
+ 42, 42, 534, 536, 42, 540, 42, 42, 42, 42,
+ 547, 539, 541, 546, 542, 544, 42, 42, 42, 548,
+ 545, 42, 42, 543, 42, 42, 42, 42, 558, 42,
+ 42, 42, 550, 42, 42, 42, 549, 554, 42, 42,
+
+ 557, 42, 559, 563, 555, 561, 551, 556, 552, 553,
+ 564, 560, 42, 562, 42, 42, 42, 42, 566, 42,
+ 42, 565, 567, 568, 42, 42, 42, 42, 569, 42,
+ 572, 42, 42, 42, 42, 574, 576, 571, 578, 42,
+ 42, 42, 42, 570, 575, 577, 42, 573, 584, 579,
+ 42, 42, 580, 582, 585, 589, 581, 42, 42, 42,
+ 42, 583, 42, 42, 42, 586, 42, 42, 42, 587,
+ 588, 595, 42, 42, 42, 42, 42, 42, 42, 591,
+ 42, 592, 593, 594, 590, 596, 601, 597, 602, 599,
+ 42, 605, 598, 42, 42, 42, 42, 600, 42, 42,
+
+ 42, 604, 42, 606, 42, 42, 603, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 607, 39,
39, 39, 39, 39, 39, 39, 39, 39, 41, 42,
41, 41, 41, 41, 44, 44, 42, 44, 44, 42,
44, 52, 42, 52, 52, 52, 52, 52, 52, 52,
- 54, 54, 42, 54, 54, 42, 54, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 140, 42, 140, 140,
- 42, 140, 149, 149, 149, 149, 149, 149, 149, 149,
- 149, 151, 42, 151, 151, 42, 151, 262, 42, 262,
- 358, 358, 358, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 54, 54, 42, 54, 54, 42, 54, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 141, 42, 141, 141,
+ 42, 141, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 152, 42, 152, 152, 42, 152, 264, 42, 264,
+ 361, 361, 361, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
@@ -747,18 +796,18 @@
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 150, 42, 139, 261, 42,
- 42, 42, 150, 41, 139, 42, 137, 41, 42, 40,
- 605, 3, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
-
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 151, 42, 140, 263, 42, 42, 42, 151, 41,
+ 140, 42, 138, 41, 42, 40, 608, 3, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608
} ;
-static yyconst short int yy_chk[1432] =
+static yyconst flex_int16_t yy_chk[1438] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -771,171 +820,182 @@
64, 12, 13, 13, 13, 13, 13, 13, 13, 13,
16, 17, 21, 19, 18, 24, 16, 16, 16, 16,
- 16, 16, 19, 17, 19, 604, 62, 18, 68, 20,
+ 16, 16, 19, 17, 19, 607, 62, 18, 68, 20,
17, 18, 17, 21, 17, 19, 21, 17, 20, 18,
13, 22, 20, 21, 23, 31, 18, 48, 20, 36,
- 22, 20, 22, 22, 48, 68, 74, 23, 31, 65,
- 22, 90, 36, 23, 22, 26, 22, 25, 25, 25,
- 25, 25, 25, 25, 26, 28, 27, 90, 65, 38,
- 35, 56, 26, 74, 25, 27, 29, 26, 28, 35,
- 30, 26, 38, 56, 25, 57, 58, 28, 27, 29,
- 60, 29, 35, 28, 27, 29, 30, 29, 58, 29,
- 33, 29, 57, 30, 57, 30, 60, 30, 32, 33,
-
- 60, 84, 66, 61, 32, 67, 33, 134, 70, 134,
- 71, 84, 33, 66, 69, 33, 32, 32, 61, 32,
- 32, 32, 33, 32, 67, 69, 67, 70, 69, 32,
- 76, 32, 32, 75, 32, 34, 72, 69, 71, 78,
- 77, 34, 45, 45, 45, 45, 45, 45, 72, 602,
- 76, 80, 75, 34, 34, 87, 34, 77, 34, 75,
- 34, 78, 34, 81, 80, 87, 34, 46, 46, 46,
- 46, 46, 46, 46, 47, 47, 47, 47, 47, 47,
- 55, 55, 55, 55, 55, 55, 82, 79, 83, 85,
- 81, 91, 79, 89, 92, 131, 601, 179, 86, 88,
-
- 83, 179, 89, 131, 97, 79, 92, 93, 82, 85,
- 91, 47, 49, 49, 49, 49, 49, 49, 49, 79,
- 88, 96, 49, 86, 86, 86, 93, 86, 97, 95,
- 101, 49, 51, 51, 51, 51, 51, 51, 95, 101,
- 96, 51, 51, 51, 51, 51, 98, 51, 51, 51,
- 51, 51, 51, 99, 95, 100, 104, 95, 102, 98,
- 103, 105, 106, 107, 108, 109, 99, 104, 100, 112,
- 102, 111, 133, 98, 110, 599, 114, 103, 116, 113,
- 99, 133, 109, 105, 111, 110, 115, 106, 112, 114,
- 107, 113, 117, 110, 113, 108, 118, 112, 111, 115,
-
- 116, 119, 117, 114, 120, 110, 113, 122, 123, 125,
- 124, 127, 126, 118, 141, 128, 135, 130, 119, 597,
- 159, 136, 192, 141, 122, 126, 119, 124, 128, 120,
- 130, 123, 129, 125, 132, 122, 154, 159, 127, 126,
- 192, 135, 128, 156, 129, 129, 136, 145, 145, 145,
- 153, 132, 136, 132, 129, 157, 156, 129, 154, 153,
- 162, 165, 129, 144, 144, 153, 144, 144, 144, 144,
- 144, 144, 144, 146, 146, 146, 146, 146, 146, 162,
- 157, 167, 146, 146, 168, 176, 169, 165, 146, 146,
- 146, 146, 146, 146, 147, 147, 147, 147, 147, 147,
-
- 167, 168, 596, 147, 147, 169, 263, 263, 176, 147,
- 147, 147, 147, 147, 147, 148, 148, 148, 148, 148,
- 148, 174, 175, 180, 148, 148, 160, 161, 164, 166,
- 148, 148, 148, 148, 148, 148, 161, 160, 166, 170,
- 164, 171, 173, 177, 178, 182, 181, 174, 183, 175,
- 184, 171, 170, 178, 180, 173, 170, 185, 182, 186,
- 184, 183, 187, 188, 189, 182, 190, 173, 181, 185,
- 191, 181, 177, 193, 194, 187, 188, 189, 195, 196,
- 200, 198, 186, 191, 199, 193, 202, 209, 190, 201,
- 212, 189, 213, 200, 214, 231, 219, 195, 212, 194,
-
- 217, 218, 224, 199, 225, 202, 220, 196, 198, 219,
- 201, 209, 595, 226, 227, 590, 224, 225, 233, 213,
- 231, 214, 216, 216, 216, 216, 216, 216, 218, 217,
- 230, 216, 216, 220, 226, 234, 227, 216, 216, 216,
- 216, 216, 216, 235, 237, 233, 236, 238, 239, 240,
- 230, 244, 247, 250, 234, 251, 252, 230, 235, 236,
- 238, 239, 253, 254, 256, 247, 250, 237, 238, 257,
- 255, 253, 251, 244, 259, 254, 252, 257, 240, 255,
- 260, 262, 256, 264, 264, 264, 264, 264, 264, 270,
- 262, 265, 265, 266, 266, 271, 259, 272, 273, 275,
-
- 276, 279, 277, 280, 281, 282, 283, 260, 272, 276,
- 285, 284, 279, 286, 282, 270, 271, 287, 288, 273,
- 275, 277, 289, 281, 290, 294, 296, 283, 284, 291,
- 280, 289, 297, 286, 295, 295, 287, 290, 298, 302,
- 291, 285, 301, 288, 303, 306, 307, 305, 302, 309,
- 308, 317, 294, 296, 310, 311, 314, 303, 297, 318,
- 297, 301, 305, 315, 319, 321, 298, 309, 317, 322,
- 306, 307, 308, 310, 323, 324, 330, 311, 314, 327,
- 328, 333, 315, 322, 329, 329, 318, 323, 331, 332,
- 330, 328, 336, 321, 319, 333, 327, 324, 329, 337,
-
- 339, 331, 332, 340, 341, 336, 343, 346, 347, 348,
- 337, 349, 340, 339, 351, 353, 361, 343, 348, 355,
- 367, 346, 347, 341, 356, 361, 357, 357, 364, 367,
- 473, 362, 349, 355, 369, 372, 582, 356, 473, 351,
- 357, 356, 353, 362, 366, 355, 358, 358, 358, 358,
- 358, 358, 368, 370, 364, 366, 373, 371, 372, 369,
- 374, 368, 375, 376, 378, 382, 370, 371, 383, 384,
- 386, 385, 387, 374, 376, 378, 389, 390, 391, 373,
- 395, 392, 382, 375, 385, 383, 394, 396, 397, 386,
- 384, 395, 398, 387, 392, 399, 400, 397, 390, 401,
-
- 396, 391, 402, 389, 403, 404, 405, 394, 410, 400,
- 406, 406, 399, 402, 409, 408, 413, 411, 414, 415,
- 398, 403, 401, 416, 418, 423, 420, 404, 409, 421,
- 425, 415, 413, 405, 408, 422, 416, 420, 426, 410,
- 411, 421, 423, 424, 427, 414, 431, 418, 428, 428,
- 422, 432, 424, 434, 435, 436, 438, 425, 439, 440,
- 443, 447, 442, 431, 448, 427, 424, 452, 436, 426,
- 442, 442, 447, 453, 434, 451, 452, 458, 432, 455,
- 439, 440, 438, 459, 448, 460, 435, 443, 451, 462,
- 455, 463, 464, 465, 462, 469, 467, 468, 479, 476,
-
- 453, 480, 483, 458, 481, 481, 460, 482, 459, 467,
- 485, 468, 487, 464, 465, 476, 484, 479, 463, 482,
- 488, 491, 469, 492, 493, 494, 498, 480, 495, 483,
- 497, 485, 499, 484, 500, 503, 501, 507, 504, 487,
- 509, 495, 488, 497, 494, 498, 491, 506, 492, 501,
- 504, 499, 510, 505, 493, 512, 503, 505, 513, 500,
- 506, 515, 514, 519, 507, 510, 516, 513, 517, 509,
- 520, 522, 516, 523, 512, 514, 524, 527, 525, 517,
- 528, 529, 535, 535, 538, 520, 536, 540, 515, 548,
- 519, 525, 541, 539, 529, 543, 527, 538, 536, 522,
-
- 523, 528, 541, 524, 539, 545, 543, 546, 551, 540,
- 552, 553, 554, 558, 545, 557, 548, 551, 559, 561,
- 560, 563, 562, 552, 546, 565, 557, 566, 561, 559,
- 563, 567, 554, 568, 569, 571, 572, 573, 553, 560,
- 558, 562, 577, 565, 571, 574, 568, 566, 575, 572,
- 578, 579, 580, 585, 567, 577, 573, 581, 584, 583,
- 586, 569, 587, 588, 574, 593, 589, 575, 591, 584,
- 585, 592, 579, 594, 580, 598, 581, 578, 583, 591,
- 600, 586, 592, 603, 576, 570, 598, 587, 564, 556,
- 588, 589, 555, 600, 550, 549, 547, 544, 593, 542,
-
- 594, 537, 534, 533, 532, 531, 530, 526, 603, 606,
- 606, 606, 606, 606, 606, 606, 606, 606, 607, 521,
- 607, 607, 607, 607, 608, 608, 518, 608, 608, 511,
- 608, 609, 508, 609, 609, 609, 609, 609, 609, 609,
- 610, 610, 502, 610, 610, 496, 610, 611, 611, 611,
- 611, 611, 611, 611, 611, 611, 612, 490, 612, 612,
- 489, 612, 613, 613, 613, 613, 613, 613, 613, 613,
- 613, 614, 486, 614, 614, 478, 614, 615, 477, 615,
- 616, 616, 616, 475, 474, 472, 471, 470, 466, 461,
- 457, 456, 454, 450, 449, 446, 445, 444, 441, 437,
-
- 433, 430, 419, 417, 412, 393, 388, 381, 380, 379,
- 377, 365, 363, 360, 359, 354, 352, 350, 345, 344,
- 342, 338, 335, 334, 326, 320, 316, 313, 312, 304,
- 300, 299, 293, 292, 278, 274, 258, 249, 248, 246,
- 245, 243, 242, 241, 232, 229, 228, 223, 222, 221,
- 215, 211, 210, 208, 207, 206, 205, 204, 203, 197,
- 172, 163, 158, 155, 152, 149, 142, 138, 137, 121,
- 73, 63, 53, 50, 43, 41, 39, 14, 8, 7,
- 3, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
-
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605
+ 22, 20, 22, 22, 48, 68, 88, 23, 31, 65,
+ 22, 605, 36, 23, 22, 26, 22, 25, 25, 25,
+ 25, 25, 25, 25, 26, 28, 27, 88, 65, 38,
+ 35, 56, 26, 58, 25, 27, 29, 26, 28, 35,
+ 30, 26, 38, 56, 25, 58, 60, 28, 27, 29,
+ 71, 29, 35, 28, 27, 29, 30, 29, 604, 29,
+ 57, 29, 60, 30, 33, 30, 60, 30, 30, 32,
+
+ 61, 66, 72, 33, 67, 32, 78, 57, 71, 57,
+ 33, 76, 66, 74, 72, 61, 33, 32, 32, 33,
+ 32, 32, 32, 67, 32, 67, 33, 69, 78, 81,
+ 32, 76, 32, 32, 70, 32, 34, 124, 69, 75,
+ 74, 69, 34, 45, 45, 45, 45, 45, 45, 77,
+ 69, 80, 84, 70, 34, 34, 81, 34, 75, 34,
+ 124, 34, 84, 34, 80, 75, 77, 34, 46, 46,
+ 46, 46, 46, 46, 46, 47, 47, 47, 47, 47,
+ 47, 55, 55, 55, 55, 55, 55, 82, 79, 83,
+ 85, 89, 87, 79, 100, 90, 92, 602, 178, 86,
+
+ 89, 83, 87, 91, 108, 97, 79, 100, 92, 82,
+ 85, 90, 47, 49, 49, 49, 49, 49, 49, 49,
+ 79, 93, 91, 49, 86, 86, 86, 178, 86, 97,
+ 95, 108, 49, 51, 51, 51, 51, 51, 51, 95,
+ 93, 96, 51, 51, 51, 51, 51, 102, 51, 51,
+ 51, 51, 51, 51, 98, 95, 99, 101, 95, 102,
+ 96, 103, 104, 105, 106, 107, 101, 98, 109, 99,
+ 110, 112, 113, 104, 135, 111, 135, 600, 103, 599,
+ 114, 98, 117, 99, 112, 105, 111, 110, 115, 106,
+ 107, 113, 114, 118, 111, 114, 116, 119, 112, 109,
+
+ 113, 115, 120, 118, 117, 121, 111, 114, 123, 116,
+ 126, 125, 128, 127, 119, 115, 129, 180, 131, 120,
+ 130, 180, 136, 226, 137, 123, 127, 120, 125, 129,
+ 121, 131, 130, 130, 126, 133, 123, 226, 132, 128,
+ 127, 172, 130, 129, 134, 130, 132, 136, 142, 137,
+ 130, 172, 133, 134, 133, 137, 155, 142, 145, 145,
+ 160, 145, 145, 145, 145, 145, 145, 145, 146, 146,
+ 146, 147, 147, 147, 147, 147, 147, 160, 155, 158,
+ 147, 147, 169, 177, 163, 157, 147, 147, 147, 147,
+ 147, 147, 148, 148, 148, 148, 148, 148, 157, 169,
+
+ 465, 148, 148, 163, 158, 465, 177, 148, 148, 148,
+ 148, 148, 148, 149, 149, 149, 149, 149, 149, 166,
+ 168, 175, 149, 149, 161, 154, 165, 162, 149, 149,
+ 149, 149, 149, 149, 154, 161, 162, 167, 165, 168,
+ 154, 170, 171, 174, 176, 166, 167, 175, 179, 181,
+ 182, 184, 185, 183, 187, 171, 174, 179, 186, 171,
+ 170, 188, 185, 189, 184, 190, 183, 191, 174, 192,
+ 186, 176, 182, 183, 188, 182, 189, 187, 190, 193,
+ 181, 194, 192, 195, 196, 197, 200, 199, 201, 191,
+ 202, 203, 190, 194, 210, 214, 213, 193, 215, 216,
+
+ 228, 201, 221, 196, 213, 200, 220, 222, 195, 219,
+ 203, 202, 216, 197, 199, 221, 598, 229, 210, 227,
+ 232, 228, 214, 233, 235, 215, 218, 218, 218, 218,
+ 218, 218, 227, 220, 222, 218, 218, 236, 219, 229,
+ 232, 218, 218, 218, 218, 218, 218, 232, 233, 237,
+ 238, 235, 239, 240, 241, 242, 236, 246, 249, 252,
+ 253, 254, 259, 238, 237, 258, 240, 241, 256, 255,
+ 259, 249, 252, 257, 240, 239, 261, 253, 255, 246,
+ 256, 254, 257, 258, 242, 262, 264, 265, 265, 266,
+ 266, 266, 266, 266, 266, 264, 267, 267, 261, 268,
+
+ 268, 272, 273, 274, 275, 277, 278, 281, 282, 279,
+ 283, 284, 262, 285, 274, 278, 286, 287, 281, 288,
+ 284, 289, 290, 273, 292, 275, 277, 272, 279, 283,
+ 296, 293, 291, 286, 285, 282, 298, 292, 299, 288,
+ 289, 291, 293, 297, 297, 300, 303, 290, 287, 304,
+ 308, 309, 310, 307, 305, 319, 313, 296, 304, 311,
+ 312, 316, 317, 298, 299, 303, 299, 305, 307, 320,
+ 321, 323, 319, 300, 310, 308, 309, 311, 313, 312,
+ 324, 317, 325, 316, 326, 330, 331, 332, 332, 333,
+ 593, 334, 335, 336, 324, 325, 320, 331, 339, 323,
+
+ 321, 332, 330, 333, 334, 335, 326, 336, 340, 342,
+ 344, 339, 343, 346, 349, 352, 350, 351, 354, 340,
+ 356, 343, 342, 358, 346, 359, 351, 365, 349, 344,
+ 350, 360, 360, 367, 585, 364, 352, 358, 359, 365,
+ 375, 372, 359, 354, 364, 360, 369, 356, 373, 358,
+ 361, 361, 361, 361, 361, 361, 370, 369, 371, 367,
+ 374, 373, 376, 375, 377, 370, 372, 371, 378, 379,
+ 374, 381, 387, 385, 386, 388, 389, 377, 390, 392,
+ 379, 393, 381, 395, 394, 376, 398, 397, 388, 378,
+ 385, 386, 399, 387, 400, 389, 395, 398, 401, 390,
+
+ 402, 403, 393, 400, 404, 399, 392, 394, 397, 405,
+ 407, 406, 408, 413, 403, 409, 409, 402, 411, 412,
+ 405, 417, 414, 418, 416, 419, 401, 404, 406, 421,
+ 423, 424, 407, 412, 425, 418, 426, 411, 419, 408,
+ 416, 423, 427, 424, 413, 414, 428, 429, 417, 425,
+ 430, 427, 421, 426, 431, 431, 435, 434, 437, 438,
+ 441, 445, 439, 442, 451, 427, 443, 446, 454, 445,
+ 445, 430, 456, 428, 434, 439, 450, 461, 429, 437,
+ 455, 454, 458, 435, 451, 442, 441, 450, 443, 455,
+ 462, 438, 463, 458, 446, 466, 467, 468, 470, 456,
+
+ 471, 472, 476, 461, 479, 482, 483, 484, 484, 485,
+ 476, 470, 486, 463, 471, 462, 487, 467, 468, 488,
+ 479, 485, 466, 490, 482, 491, 494, 495, 472, 496,
+ 497, 498, 483, 487, 501, 500, 502, 503, 510, 486,
+ 488, 504, 506, 512, 498, 507, 518, 491, 500, 497,
+ 490, 494, 495, 501, 504, 502, 508, 507, 509, 496,
+ 508, 513, 503, 506, 515, 510, 516, 517, 520, 522,
+ 519, 509, 512, 518, 513, 516, 519, 523, 525, 520,
+ 517, 526, 527, 515, 528, 530, 531, 532, 538, 538,
+ 539, 543, 523, 544, 542, 551, 522, 528, 541, 546,
+
+ 532, 549, 539, 544, 530, 542, 525, 531, 526, 527,
+ 546, 541, 548, 543, 554, 555, 556, 557, 549, 560,
+ 561, 548, 551, 554, 562, 563, 565, 564, 555, 566,
+ 560, 568, 569, 570, 572, 562, 564, 557, 566, 574,
+ 571, 575, 580, 556, 563, 565, 576, 561, 574, 568,
+ 577, 578, 569, 571, 575, 580, 570, 581, 582, 583,
+ 587, 572, 591, 584, 586, 576, 589, 590, 588, 577,
+ 578, 587, 592, 596, 597, 594, 579, 595, 573, 582,
+ 601, 583, 584, 586, 581, 588, 594, 589, 595, 591,
+ 603, 601, 590, 606, 567, 559, 558, 592, 553, 552,
+
+ 550, 597, 547, 603, 545, 540, 596, 537, 536, 535,
+ 534, 533, 529, 524, 521, 514, 511, 505, 606, 609,
+ 609, 609, 609, 609, 609, 609, 609, 609, 610, 499,
+ 610, 610, 610, 610, 611, 611, 493, 611, 611, 492,
+ 611, 612, 489, 612, 612, 612, 612, 612, 612, 612,
+ 613, 613, 481, 613, 613, 480, 613, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 615, 478, 615, 615,
+ 477, 615, 616, 616, 616, 616, 616, 616, 616, 616,
+ 616, 617, 475, 617, 617, 474, 617, 618, 473, 618,
+ 619, 619, 619, 469, 464, 460, 459, 457, 453, 452,
+
+ 449, 448, 447, 444, 440, 436, 433, 422, 420, 415,
+ 396, 391, 384, 383, 382, 380, 368, 366, 363, 362,
+ 357, 355, 353, 348, 347, 345, 341, 338, 337, 329,
+ 327, 322, 318, 315, 314, 306, 302, 301, 295, 294,
+ 280, 276, 260, 251, 250, 248, 247, 245, 244, 243,
+ 234, 231, 230, 225, 224, 223, 217, 212, 211, 209,
+ 208, 207, 206, 205, 204, 198, 173, 164, 159, 156,
+ 153, 150, 143, 139, 138, 122, 73, 63, 53, 50,
+ 43, 41, 39, 14, 8, 7, 3, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608
} ;
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
-static char *yy_full_match;
-static int yy_lp;
-#define REJECT \
-{ \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-++yy_lp; \
-goto find_rule; \
-}
+/* Table of booleans, true if rule could match eol. */
+static yyconst flex_int32_t yy_rule_can_match_eol[155] =
+ { 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int llvmAsm_flex_debug;
+int llvmAsm_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-#define INITIAL 0
+char *llvmAsmtext;
+#line 1 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
@@ -948,8 +1008,7 @@
// This file implements the flex scanner for LLVM assembly languages files.
//
//===----------------------------------------------------------------------===*/
-#define YY_NEVER_INTERACTIVE 1
-#line 28 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 28 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
#include "ParserInternals.h"
#include "llvm/Module.h"
#include "llvm/Support/MathExtras.h"
@@ -959,10 +1018,10 @@
#include
void set_scan_file(FILE * F){
- yy_switch_to_buffer(yy_create_buffer( F, YY_BUF_SIZE ) );
+ llvmAsm_switch_to_buffer(llvmAsm_create_buffer(F,YY_BUF_SIZE ) );
}
void set_scan_string (const char * str) {
- yy_scan_string (str);
+ llvmAsm_scan_string (str);
}
// Construct a token value for a non-obsolete token
@@ -1105,7 +1164,23 @@
* it to deal with 64 bit numbers.
*/
/* WSNL - shorthand for whitespace followed by newline */
-#line 1109 "Lexer.cpp"
+#line 1168 "Lexer.cpp"
+
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1113,65 +1188,30 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int llvmAsmwrap (void );
#else
-extern int yywrap YY_PROTO(( void ));
-#endif
+extern int llvmAsmwrap (void );
#endif
-
-#ifndef YY_NO_UNPUT
-static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
+ static inline void yyunput (int c,char *buf_ptr );
+
#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
+#ifdef __cplusplus
+static int yyinput (void );
#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
+static int input (void );
#endif
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
#endif
/* Amount of stuff to slurp up with each read. */
@@ -1180,12 +1220,11 @@
#endif
/* Copy whatever the last rule matched to the standard output. */
-
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( llvmAsmtext, llvmAsmleng, 1, llvmAsmout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1193,21 +1232,35 @@
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
- int c = '*', n; \
+ int c = '*'; \
+ size_t n; \
for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( llvmAsmin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
+ if ( c == EOF && ferror( llvmAsmin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, llvmAsmin))==0 && ferror(llvmAsmin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(llvmAsmin); \
+ } \
+ }\
+\
+
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -1228,14 +1281,20 @@
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
+/* end tables serialization structures and prototypes */
+
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
-/* Code executed at the beginning of each rule, after yytext and yyleng
+extern int llvmAsmlex (void);
+
+#define YY_DECL int llvmAsmlex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after llvmAsmtext and llvmAsmleng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -1250,433 +1309,443 @@
#define YY_RULE_SETUP \
YY_USER_ACTION
+/** The main scanner function which does all the work.
+ */
YY_DECL
- {
+{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
-#line 221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+
+#line 221 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
-#line 1263 "Lexer.cpp"
+#line 1324 "Lexer.cpp"
- if ( yy_init )
+ if ( !(yy_init) )
{
- yy_init = 0;
+ (yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
- if ( ! yy_start )
- yy_start = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! llvmAsmin )
+ llvmAsmin = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! llvmAsmout )
+ llvmAsmout = stdout;
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ if ( ! YY_CURRENT_BUFFER ) {
+ llvmAsmensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE );
+ }
- yy_load_buffer_state();
+ llvmAsm_load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_c_buf_p);
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
+ /* Support of llvmAsmtext. */
+ *yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
+ yy_current_state = (yy_start);
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 606 )
+ if ( yy_current_state >= 609 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
++yy_cp;
}
- while ( yy_current_state != 605 );
+ while ( yy_current_state != 608 );
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
yy_find_action:
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[yy_lp];
- {
- yy_full_match = yy_cp;
- break;
- }
- }
- --yy_cp;
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- }
+ yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
- if ( yy_act != YY_END_OF_BUFFER )
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
int yyl;
- for ( yyl = 0; yyl < yyleng; ++yyl )
- if ( yytext[yyl] == '\n' )
- ++yylineno;
+ for ( yyl = 0; yyl < llvmAsmleng; ++yyl )
+ if ( llvmAsmtext[yyl] == '\n' )
+
+ llvmAsmlineno++;
+;
}
do_action: /* This label is used only to access EOF actions. */
-
switch ( yy_act )
{ /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
case 1:
YY_RULE_SETUP
-#line 223 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 223 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ /* Ignore comments for now */ }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 225 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 225 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return BEGINTOK; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 226 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ENDTOK; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 227 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TRUETOK; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 228 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return FALSETOK; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 229 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DECLARE; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 230 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DEFINE; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 231 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return GLOBAL; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 232 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return CONSTANT; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 233 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return INTERNAL; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 234 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return LINKONCE; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 235 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return WEAK; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 236 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return APPENDING; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 237 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DLLIMPORT; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 238 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 238 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DLLEXPORT; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 239 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return HIDDEN; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 240 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return PROTECTED; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 241 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 241 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return EXTERN_WEAK; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 242 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return EXTERNAL; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 243 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 243 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return THREAD_LOCAL; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 244 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 244 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ZEROINITIALIZER; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 245 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DOTDOTDOT; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 246 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UNDEF; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 247 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NULL_TOK; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 248 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TO; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 249 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TAIL; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 250 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TARGET; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 251 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TRIPLE; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 252 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DEPLIBS; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 253 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return DATALAYOUT; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 254 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return VOLATILE; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 255 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ALIGN; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 256 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SECTION; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 257 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ALIAS; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 258 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 258 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return MODULE; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 259 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 259 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ASM_TOK; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 260 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 260 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SIDEEFFECT; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 262 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 262 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return CC_TOK; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 263 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 263 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return CCC_TOK; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 264 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 264 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return FASTCC_TOK; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 265 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return COLDCC_TOK; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 266 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 266 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return X86_STDCALLCC_TOK; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 267 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return X86_FASTCALLCC_TOK; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 269 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SIGNEXT; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 270 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ZEROEXT; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 271 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return INREG; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 272 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 272 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SRET; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 273 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 273 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NOUNWIND; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 274 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 274 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NORETURN; }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 275 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 275 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NOALIAS; }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 276 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 276 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return BYVAL; }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 277 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NEST; }
YY_BREAK
case 53:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 278 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 278 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ return PURE; }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 279 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ return CONST; }
+ YY_BREAK
+case 55:
+*yy_cp = (yy_hold_char); /* undo effects of setting up llvmAsmtext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */
+YY_RULE_SETUP
+#line 280 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ // For auto-upgrade only, drop in LLVM 3.0
return SIGNEXT; }
YY_BREAK
-case 54:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+case 56:
+*yy_cp = (yy_hold_char); /* undo effects of setting up llvmAsmtext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */
YY_RULE_SETUP
-#line 280 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 282 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ // For auto-upgrade only, drop in LLVM 3.0
return ZEROEXT; }
YY_BREAK
-case 55:
+case 57:
YY_RULE_SETUP
-#line 283 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 285 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::VoidTy, VOID); }
YY_BREAK
-case 56:
+case 58:
YY_RULE_SETUP
-#line 284 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 286 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::FloatTy, FLOAT); }
YY_BREAK
-case 57:
+case 59:
YY_RULE_SETUP
-#line 285 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 287 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::DoubleTy,DOUBLE);}
YY_BREAK
-case 58:
+case 60:
YY_RULE_SETUP
-#line 286 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 288 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::X86_FP80Ty, X86_FP80);}
YY_BREAK
-case 59:
+case 61:
YY_RULE_SETUP
-#line 287 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 289 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::FP128Ty, FP128);}
YY_BREAK
-case 60:
+case 62:
YY_RULE_SETUP
-#line 288 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 290 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::PPC_FP128Ty, PPC_FP128);}
YY_BREAK
-case 61:
+case 63:
YY_RULE_SETUP
-#line 289 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 291 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TY(Type::LabelTy, LABEL); }
YY_BREAK
-case 62:
+case 64:
YY_RULE_SETUP
-#line 290 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 292 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return TYPE; }
YY_BREAK
-case 63:
+case 65:
YY_RULE_SETUP
-#line 291 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 293 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OPAQUE; }
YY_BREAK
-case 64:
+case 66:
YY_RULE_SETUP
-#line 292 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ uint64_t NumBits = atoull(yytext+1);
+#line 294 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ uint64_t NumBits = atoull(llvmAsmtext+1);
if (NumBits < IntegerType::MIN_INT_BITS ||
NumBits > IntegerType::MAX_INT_BITS)
GenerateError("Bitwidth for integer type out of range!");
@@ -1684,422 +1753,426 @@
RET_TY(Ty, INTTYPE);
}
YY_BREAK
-case 65:
+case 67:
YY_RULE_SETUP
-#line 300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 302 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Add, ADD); }
YY_BREAK
-case 66:
+case 68:
YY_RULE_SETUP
-#line 301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 303 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Sub, SUB); }
YY_BREAK
-case 67:
+case 69:
YY_RULE_SETUP
-#line 302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 304 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Mul, MUL); }
YY_BREAK
-case 68:
+case 70:
YY_RULE_SETUP
-#line 303 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 305 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, UDiv, UDIV); }
YY_BREAK
-case 69:
+case 71:
YY_RULE_SETUP
-#line 304 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 306 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, SDiv, SDIV); }
YY_BREAK
-case 70:
+case 72:
YY_RULE_SETUP
-#line 305 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 307 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, FDiv, FDIV); }
YY_BREAK
-case 71:
+case 73:
YY_RULE_SETUP
-#line 306 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 308 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, URem, UREM); }
YY_BREAK
-case 72:
+case 74:
YY_RULE_SETUP
-#line 307 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 309 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, SRem, SREM); }
YY_BREAK
-case 73:
+case 75:
YY_RULE_SETUP
-#line 308 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 310 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, FRem, FREM); }
YY_BREAK
-case 74:
+case 76:
YY_RULE_SETUP
-#line 309 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 311 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Shl, SHL); }
YY_BREAK
-case 75:
+case 77:
YY_RULE_SETUP
-#line 310 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 312 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, LShr, LSHR); }
YY_BREAK
-case 76:
+case 78:
YY_RULE_SETUP
-#line 311 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 313 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, AShr, ASHR); }
YY_BREAK
-case 77:
+case 79:
YY_RULE_SETUP
-#line 312 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 314 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, And, AND); }
YY_BREAK
-case 78:
+case 80:
YY_RULE_SETUP
-#line 313 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 315 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Or , OR ); }
YY_BREAK
-case 79:
+case 81:
YY_RULE_SETUP
-#line 314 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 316 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(BinaryOpVal, Xor, XOR); }
YY_BREAK
-case 80:
+case 82:
YY_RULE_SETUP
-#line 315 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 317 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, ICmp, ICMP); }
YY_BREAK
-case 81:
+case 83:
YY_RULE_SETUP
-#line 316 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 318 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, FCmp, FCMP); }
YY_BREAK
-case 82:
+case 84:
YY_RULE_SETUP
-#line 318 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 320 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return EQ; }
YY_BREAK
-case 83:
+case 85:
YY_RULE_SETUP
-#line 319 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 321 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return NE; }
YY_BREAK
-case 84:
+case 86:
YY_RULE_SETUP
-#line 320 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 322 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SLT; }
YY_BREAK
-case 85:
+case 87:
YY_RULE_SETUP
-#line 321 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 323 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SGT; }
YY_BREAK
-case 86:
+case 88:
YY_RULE_SETUP
-#line 322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 324 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SLE; }
YY_BREAK
-case 87:
+case 89:
YY_RULE_SETUP
-#line 323 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 325 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return SGE; }
YY_BREAK
-case 88:
+case 90:
YY_RULE_SETUP
-#line 324 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 326 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ULT; }
YY_BREAK
-case 89:
+case 91:
YY_RULE_SETUP
-#line 325 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 327 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UGT; }
YY_BREAK
-case 90:
+case 92:
YY_RULE_SETUP
-#line 326 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 328 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ULE; }
YY_BREAK
-case 91:
+case 93:
YY_RULE_SETUP
-#line 327 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 329 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UGE; }
YY_BREAK
-case 92:
+case 94:
YY_RULE_SETUP
-#line 328 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 330 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OEQ; }
YY_BREAK
-case 93:
+case 95:
YY_RULE_SETUP
-#line 329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 331 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ONE; }
YY_BREAK
-case 94:
+case 96:
YY_RULE_SETUP
-#line 330 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 332 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OLT; }
YY_BREAK
-case 95:
+case 97:
YY_RULE_SETUP
-#line 331 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 333 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OGT; }
YY_BREAK
-case 96:
+case 98:
YY_RULE_SETUP
-#line 332 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 334 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OLE; }
YY_BREAK
-case 97:
+case 99:
YY_RULE_SETUP
-#line 333 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 335 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return OGE; }
YY_BREAK
-case 98:
+case 100:
YY_RULE_SETUP
-#line 334 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 336 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return ORD; }
YY_BREAK
-case 99:
+case 101:
YY_RULE_SETUP
-#line 335 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 337 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UNO; }
YY_BREAK
-case 100:
+case 102:
YY_RULE_SETUP
-#line 336 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 338 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UEQ; }
YY_BREAK
-case 101:
+case 103:
YY_RULE_SETUP
-#line 337 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 339 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ return UNE; }
YY_BREAK
-case 102:
+case 104:
YY_RULE_SETUP
-#line 339 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 341 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, PHI, PHI_TOK); }
YY_BREAK
-case 103:
+case 105:
YY_RULE_SETUP
-#line 340 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 342 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, Call, CALL); }
YY_BREAK
-case 104:
+case 106:
YY_RULE_SETUP
-#line 341 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 343 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, Trunc, TRUNC); }
YY_BREAK
-case 105:
+case 107:
YY_RULE_SETUP
-#line 342 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 344 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, ZExt, ZEXT); }
YY_BREAK
-case 106:
+case 108:
YY_RULE_SETUP
-#line 343 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 345 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, SExt, SEXT); }
YY_BREAK
-case 107:
+case 109:
YY_RULE_SETUP
-#line 344 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 346 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, FPTrunc, FPTRUNC); }
YY_BREAK
-case 108:
+case 110:
YY_RULE_SETUP
-#line 345 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 347 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, FPExt, FPEXT); }
YY_BREAK
-case 109:
+case 111:
YY_RULE_SETUP
-#line 346 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 348 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, UIToFP, UITOFP); }
YY_BREAK
-case 110:
+case 112:
YY_RULE_SETUP
-#line 347 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 349 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, SIToFP, SITOFP); }
YY_BREAK
-case 111:
+case 113:
YY_RULE_SETUP
-#line 348 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 350 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, FPToUI, FPTOUI); }
YY_BREAK
-case 112:
+case 114:
YY_RULE_SETUP
-#line 349 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 351 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, FPToSI, FPTOSI); }
YY_BREAK
-case 113:
+case 115:
YY_RULE_SETUP
-#line 350 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 352 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, IntToPtr, INTTOPTR); }
YY_BREAK
-case 114:
+case 116:
YY_RULE_SETUP
-#line 351 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 353 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, PtrToInt, PTRTOINT); }
YY_BREAK
-case 115:
+case 117:
YY_RULE_SETUP
-#line 352 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 354 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(CastOpVal, BitCast, BITCAST); }
YY_BREAK
-case 116:
+case 118:
YY_RULE_SETUP
-#line 353 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 355 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, Select, SELECT); }
YY_BREAK
-case 117:
+case 119:
YY_RULE_SETUP
-#line 354 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 356 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, VAArg , VAARG); }
YY_BREAK
-case 118:
+case 120:
YY_RULE_SETUP
-#line 355 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 357 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Ret, RET); }
YY_BREAK
-case 119:
+case 121:
YY_RULE_SETUP
-#line 356 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 358 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Br, BR); }
YY_BREAK
-case 120:
+case 122:
YY_RULE_SETUP
-#line 357 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 359 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Switch, SWITCH); }
YY_BREAK
-case 121:
+case 123:
YY_RULE_SETUP
-#line 358 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 360 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Invoke, INVOKE); }
YY_BREAK
-case 122:
+case 124:
YY_RULE_SETUP
-#line 359 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 361 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Unwind, UNWIND); }
YY_BREAK
-case 123:
+case 125:
YY_RULE_SETUP
-#line 360 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 362 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(TermOpVal, Unreachable, UNREACHABLE); }
YY_BREAK
-case 124:
+case 126:
YY_RULE_SETUP
-#line 362 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 364 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, Malloc, MALLOC); }
YY_BREAK
-case 125:
+case 127:
YY_RULE_SETUP
-#line 363 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 365 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, Alloca, ALLOCA); }
YY_BREAK
-case 126:
+case 128:
YY_RULE_SETUP
-#line 364 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 366 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, Free, FREE); }
YY_BREAK
-case 127:
+case 129:
YY_RULE_SETUP
-#line 365 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 367 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, Load, LOAD); }
YY_BREAK
-case 128:
+case 130:
YY_RULE_SETUP
-#line 366 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 368 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, Store, STORE); }
YY_BREAK
-case 129:
+case 131:
YY_RULE_SETUP
-#line 367 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 369 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); }
YY_BREAK
-case 130:
+case 132:
YY_RULE_SETUP
-#line 369 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 371 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); }
YY_BREAK
-case 131:
+case 133:
YY_RULE_SETUP
-#line 370 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 372 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); }
YY_BREAK
-case 132:
+case 134:
YY_RULE_SETUP
-#line 371 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 373 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); }
YY_BREAK
-case 133:
+case 135:
YY_RULE_SETUP
-#line 374 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 376 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- llvmAsmlval.StrVal = new std::string(yytext+1); // Skip %
+ llvmAsmlval.StrVal = new std::string(llvmAsmtext+1); // Skip %
return LOCALVAR;
}
YY_BREAK
-case 134:
+case 136:
YY_RULE_SETUP
-#line 378 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 380 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- llvmAsmlval.StrVal = new std::string(yytext+1); // Skip @
+ llvmAsmlval.StrVal = new std::string(llvmAsmtext+1); // Skip @
return GLOBALVAR;
}
YY_BREAK
-case 135:
+case 137:
YY_RULE_SETUP
-#line 382 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 384 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- yytext[yyleng-1] = 0; // nuke colon
- llvmAsmlval.StrVal = new std::string(yytext);
+ llvmAsmtext[llvmAsmleng-1] = 0; // nuke colon
+ llvmAsmlval.StrVal = new std::string(llvmAsmtext);
return LABELSTR;
}
YY_BREAK
-case 136:
+case 138:
+/* rule 138 can match eol */
YY_RULE_SETUP
-#line 387 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 389 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- yytext[yyleng-2] = 0; // nuke colon, end quote
- const char* EndChar = UnEscapeLexed(yytext+1, yytext+yyleng);
+ llvmAsmtext[llvmAsmleng-2] = 0; // nuke colon, end quote
+ const char* EndChar = UnEscapeLexed(llvmAsmtext+1, llvmAsmtext+llvmAsmleng);
llvmAsmlval.StrVal =
- new std::string(yytext+1, EndChar - yytext - 1);
+ new std::string(llvmAsmtext+1, EndChar - llvmAsmtext - 1);
return LABELSTR;
}
YY_BREAK
-case 137:
+case 139:
+/* rule 139 can match eol */
YY_RULE_SETUP
-#line 395 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ yytext[yyleng-1] = 0; // nuke end quote
- const char* EndChar = UnEscapeLexed(yytext+1, yytext+yyleng);
+#line 397 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ llvmAsmtext[llvmAsmleng-1] = 0; // nuke end quote
+ const char* EndChar = UnEscapeLexed(llvmAsmtext+1, llvmAsmtext+llvmAsmleng);
llvmAsmlval.StrVal =
- new std::string(yytext+1, EndChar - yytext - 1);
+ new std::string(llvmAsmtext+1, EndChar - llvmAsmtext - 1);
return STRINGCONSTANT;
}
YY_BREAK
-case 138:
+case 140:
+/* rule 140 can match eol */
YY_RULE_SETUP
-#line 401 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 403 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- yytext[yyleng-1] = 0; // nuke end quote
+ llvmAsmtext[llvmAsmleng-1] = 0; // nuke end quote
const char* EndChar =
- UnEscapeLexed(yytext+2, yytext+yyleng);
+ UnEscapeLexed(llvmAsmtext+2, llvmAsmtext+llvmAsmleng);
llvmAsmlval.StrVal =
- new std::string(yytext+2, EndChar - yytext - 2);
+ new std::string(llvmAsmtext+2, EndChar - llvmAsmtext - 2);
return ATSTRINGCONSTANT;
}
YY_BREAK
-case 139:
+case 141:
+/* rule 141 can match eol */
YY_RULE_SETUP
-#line 409 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 411 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- yytext[yyleng-1] = 0; // nuke end quote
+ llvmAsmtext[llvmAsmleng-1] = 0; // nuke end quote
const char* EndChar =
- UnEscapeLexed(yytext+2, yytext+yyleng);
+ UnEscapeLexed(llvmAsmtext+2, llvmAsmtext+llvmAsmleng);
llvmAsmlval.StrVal =
- new std::string(yytext+2, EndChar - yytext - 2);
+ new std::string(llvmAsmtext+2, EndChar - llvmAsmtext - 2);
return PCTSTRINGCONSTANT;
}
YY_BREAK
-case 140:
+case 142:
YY_RULE_SETUP
-#line 417 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 419 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- uint32_t numBits = ((yyleng * 64) / 19) + 1;
- APInt Tmp(numBits, yytext, yyleng, 10);
+ uint32_t numBits = ((llvmAsmleng * 64) / 19) + 1;
+ APInt Tmp(numBits, llvmAsmtext, llvmAsmleng, 10);
uint32_t activeBits = Tmp.getActiveBits();
if (activeBits > 0 && activeBits < numBits)
Tmp.trunc(activeBits);
@@ -2112,12 +2185,12 @@
}
}
YY_BREAK
-case 141:
+case 143:
YY_RULE_SETUP
-#line 431 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 433 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- uint32_t numBits = (((yyleng-1) * 64) / 19) + 2;
- APInt Tmp(numBits, yytext, yyleng, 10);
+ uint32_t numBits = (((llvmAsmleng-1) * 64) / 19) + 2;
+ APInt Tmp(numBits, llvmAsmtext, llvmAsmleng, 10);
uint32_t minBits = Tmp.getMinSignedBits();
if (minBits > 0 && minBits < numBits)
Tmp.trunc(minBits);
@@ -2130,19 +2203,19 @@
}
}
YY_BREAK
-case 142:
+case 144:
YY_RULE_SETUP
-#line 446 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ int len = yyleng - 3;
+#line 448 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ int len = llvmAsmleng - 3;
uint32_t bits = len * 4;
- APInt Tmp(bits, yytext+3, len, 16);
+ APInt Tmp(bits, llvmAsmtext+3, len, 16);
uint32_t activeBits = Tmp.getActiveBits();
if (activeBits > 0 && activeBits < bits)
Tmp.trunc(activeBits);
if (Tmp.getBitWidth() > 64) {
llvmAsmlval.APIntVal = new APInt(Tmp);
- return yytext[0] == 's' ? ESAPINTVAL : EUAPINTVAL;
- } else if (yytext[0] == 's') {
+ return llvmAsmtext[0] == 's' ? ESAPINTVAL : EUAPINTVAL;
+ } else if (llvmAsmtext[0] == 's') {
llvmAsmlval.SInt64Val = Tmp.getSExtValue();
return ESINT64VAL;
} else {
@@ -2151,117 +2224,118 @@
}
}
YY_BREAK
-case 143:
+case 145:
YY_RULE_SETUP
-#line 464 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 466 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- uint64_t Val = atoull(yytext+1);
+ uint64_t Val = atoull(llvmAsmtext+1);
if ((unsigned)Val != Val)
GenerateError("Invalid value number (too large)!");
llvmAsmlval.UIntVal = unsigned(Val);
return LOCALVAL_ID;
}
YY_BREAK
-case 144:
+case 146:
YY_RULE_SETUP
-#line 471 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 473 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
- uint64_t Val = atoull(yytext+1);
+ uint64_t Val = atoull(llvmAsmtext+1);
if ((unsigned)Val != Val)
GenerateError("Invalid value number (too large)!");
llvmAsmlval.UIntVal = unsigned(Val);
return GLOBALVAL_ID;
}
YY_BREAK
-case 145:
+case 147:
YY_RULE_SETUP
-#line 479 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ llvmAsmlval.FPVal = new APFloat(atof(yytext)); return FPVAL; }
+#line 481 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ llvmAsmlval.FPVal = new APFloat(atof(llvmAsmtext)); return FPVAL; }
YY_BREAK
-case 146:
+case 148:
YY_RULE_SETUP
-#line 480 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ llvmAsmlval.FPVal = new APFloat(HexToFP(yytext+2));
+#line 482 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ llvmAsmlval.FPVal = new APFloat(HexToFP(llvmAsmtext+2));
return FPVAL;
}
YY_BREAK
-case 147:
+case 149:
YY_RULE_SETUP
-#line 483 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 485 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ uint64_t Pair[2];
- HexToIntPair(yytext+3, Pair);
+ HexToIntPair(llvmAsmtext+3, Pair);
llvmAsmlval.FPVal = new APFloat(APInt(80, 2, Pair));
return FPVAL;
}
YY_BREAK
-case 148:
+case 150:
YY_RULE_SETUP
-#line 488 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 490 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ uint64_t Pair[2];
- HexToIntPair(yytext+3, Pair);
+ HexToIntPair(llvmAsmtext+3, Pair);
llvmAsmlval.FPVal = new APFloat(APInt(128, 2, Pair), true);
return FPVAL;
}
YY_BREAK
-case 149:
+case 151:
YY_RULE_SETUP
-#line 493 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 495 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ uint64_t Pair[2];
- HexToIntPair(yytext+3, Pair);
+ HexToIntPair(llvmAsmtext+3, Pair);
llvmAsmlval.FPVal = new APFloat(APInt(128, 2, Pair));
return FPVAL;
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 499 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 501 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{
/* Make sure to free the internal buffers for flex when we are
* done reading our input!
*/
- yy_delete_buffer(YY_CURRENT_BUFFER);
+ llvmAsm_delete_buffer(YY_CURRENT_BUFFER);
return EOF;
}
YY_BREAK
-case 150:
+case 152:
+/* rule 152 can match eol */
YY_RULE_SETUP
-#line 507 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 509 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
{ /* Ignore whitespace */ }
YY_BREAK
-case 151:
+case 153:
YY_RULE_SETUP
-#line 508 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
-{ return yytext[0]; }
+#line 510 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
+{ return llvmAsmtext[0]; }
YY_BREAK
-case 152:
+case 154:
YY_RULE_SETUP
-#line 510 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
+#line 512 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2241 "Lexer.cpp"
+#line 2315 "Lexer.cpp"
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
+ *yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
+ * just pointed llvmAsmin at a new source and called
+ * llvmAsmlex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = llvmAsmin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
@@ -2271,13 +2345,13 @@
* end-of-buffer state). Contrast this with the test
* in input().
*/
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
@@ -2290,41 +2364,42 @@
yy_next_state = yy_try_NUL_trans( yy_current_state );
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
+ yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
}
}
- else switch ( yy_get_next_buffer() )
+ else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
- yy_did_buffer_switch_on_eof = 0;
+ (yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap() )
+ if ( llvmAsmwrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * yytext, we can now set up
+ * llvmAsmtext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
@@ -2332,30 +2407,30 @@
else
{
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
@@ -2366,8 +2441,7 @@
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
- } /* end of yylex */
-
+} /* end of llvmAsmlex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -2376,21 +2450,20 @@
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
- if ( yy_current_buffer->yy_fill_buffer == 0 )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
@@ -2410,34 +2483,30 @@
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
@@ -2450,8 +2519,7 @@
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
+ llvmAsmrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
@@ -2461,35 +2529,35 @@
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = yy_current_buffer->yy_buf_size -
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
-#endif
+
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- if ( yy_n_chars == 0 )
+ if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ llvmAsmrestart(llvmAsmin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
@@ -2497,148 +2565,141 @@
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
- }
-
+}
/* yy_get_previous_state - get the state just before the EOB char was reached */
-static yy_state_type yy_get_previous_state()
- {
+ static yy_state_type yy_get_previous_state (void)
+{
register yy_state_type yy_current_state;
register char *yy_cp;
+
+ yy_current_state = (yy_start);
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 606 )
+ if ( yy_current_state >= 609 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
}
return yy_current_state;
- }
-
+}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 606 )
+ if ( yy_current_state >= 609 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 605);
- if ( ! yy_is_jam )
- *yy_state_ptr++ = yy_current_state;
+ yy_is_jam = (yy_current_state == 608);
return yy_is_jam ? 0 : yy_current_state;
- }
-
+}
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static inline void yyunput( int c, register char *yy_bp )
-#else
-static inline void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
+ static inline void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
+ /* undo effects of setting up llvmAsmtext */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > yy_current_buffer->yy_ch_buf )
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
- if ( c == '\n' )
- --yylineno;
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
+ if ( c == '\n' ){
+ --llvmAsmlineno;
+ }
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
-static int yyinput()
+ static int yyinput (void)
#else
-static int input()
+ static int input (void)
#endif
- {
- int c;
- *yy_c_buf_p = yy_hold_char;
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
- *yy_c_buf_p = '\0';
+ *(yy_c_buf_p) = '\0';
else
{ /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
- switch ( yy_get_next_buffer() )
+ switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
@@ -2652,16 +2713,16 @@
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ llvmAsmrestart(llvmAsmin );
- /* fall through */
+ /*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap() )
+ if ( llvmAsmwrap( ) )
return EOF;
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
@@ -2671,174 +2732,170 @@
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
+ (yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve llvmAsmtext */
+ (yy_hold_char) = *++(yy_c_buf_p);
if ( c == '\n' )
- ++yylineno;
+
+ llvmAsmlineno++;
+;
return c;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void llvmAsmrestart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ llvmAsmensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE );
}
+ llvmAsm_init_buffer(YY_CURRENT_BUFFER,input_file );
+ llvmAsm_load_buffer_state( );
+}
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * llvmAsmpop_buffer_state();
+ * llvmAsmpush_buffer_state(new_buffer);
+ */
+ llvmAsmensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
return;
- if ( yy_current_buffer )
+ if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ llvmAsm_load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
+ * EOF (llvmAsmwrap()) processing, but the only time this flag
+ * is looked at is after llvmAsmwrap() is called, so it's safe
* to go ahead and always set it.
*/
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+static void llvmAsm_load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ llvmAsmin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE llvmAsm_create_buffer (FILE * file, int size )
+{
YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+
+ b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) llvmAsmalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ llvmAsm_init_buffer(b,file );
return b;
- }
-
+}
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
+/** Destroy the buffer.
+ * @param b a buffer created with llvmAsm_create_buffer()
+ *
+ */
+ void llvmAsm_delete_buffer (YY_BUFFER_STATE b )
+{
+
if ( ! b )
return;
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
+ llvmAsmfree((void *) b->yy_ch_buf );
+ llvmAsmfree((void *) b );
+}
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a llvmAsmrestart() or at EOF.
+ */
+ static void llvmAsm_init_buffer (YY_BUFFER_STATE b, FILE * file )
- {
- yy_flush_buffer( b );
+{
+ int oerrno = errno;
+
+ llvmAsm_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
+ /* If b is the current buffer, then llvmAsm_init_buffer was _probably_
+ * called from llvmAsmrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
- {
- if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void llvmAsm_flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
return;
b->yy_n_chars = 0;
@@ -2855,31 +2912,123 @@
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
+ if ( b == YY_CURRENT_BUFFER )
+ llvmAsm_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ llvmAsmensure_buffer_stack();
+
+ /* This block is copied from llvmAsm_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from llvmAsm_switch_to_buffer. */
+ llvmAsm_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void llvmAsmpop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ llvmAsm_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ llvmAsm_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
+}
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void llvmAsmensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE llvmAsm_scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
@@ -2891,58 +3040,53 @@
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
+ llvmAsm_switch_to_buffer(b );
return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
+}
+/** Setup the input buffer state to scan a string. The next call to llvmAsmlex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * llvmAsm_scan_bytes() instead.
+ */
+YY_BUFFER_STATE llvmAsm_scan_string (yyconst char * yystr )
+{
+
+ return llvmAsm_scan_bytes(yystr,strlen(yystr) );
+}
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
+/** Setup the input buffer state to scan the given bytes. The next call to llvmAsmlex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
+ n = _yybytes_len + 2;
+ buf = (char *) llvmAsmalloc(n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_bytes()" );
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = llvmAsm_scan_buffer(buf,n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in llvmAsm_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2950,148 +3094,199 @@
b->yy_is_our_buffer = 1;
return b;
- }
-#endif
-
+}
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Redefine yyless() so it works in section 3 code. */
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up llvmAsmtext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ llvmAsmtext[llvmAsmleng] = (yy_hold_char); \
+ (yy_c_buf_p) = llvmAsmtext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ llvmAsmleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
+/* Accessor methods (get/set functions) to struct members. */
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the current line number.
+ *
+ */
+int llvmAsmget_lineno (void)
+{
+
+ return llvmAsmlineno;
+}
- BEGIN(new_state);
- }
-#endif
+/** Get the input stream.
+ *
+ */
+FILE *llvmAsmget_in (void)
+{
+ return llvmAsmin;
+}
+/** Get the output stream.
+ *
+ */
+FILE *llvmAsmget_out (void)
+{
+ return llvmAsmout;
+}
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+/** Get the length of the current token.
+ *
+ */
+int llvmAsmget_leng (void)
+{
+ return llvmAsmleng;
+}
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
+/** Get the current token.
+ *
+ */
+char *llvmAsmget_text (void)
+{
+ return llvmAsmtext;
+}
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void llvmAsmset_lineno (int line_number )
+{
+
+ llvmAsmlineno = line_number;
+}
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see llvmAsm_switch_to_buffer
+ */
+void llvmAsmset_in (FILE * in_str )
+{
+ llvmAsmin = in_str ;
+}
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
+void llvmAsmset_out (FILE * out_str )
+{
+ llvmAsmout = out_str ;
+}
+int llvmAsmget_debug (void)
+{
+ return llvmAsm_flex_debug;
+}
+void llvmAsmset_debug (int bdebug )
+{
+ llvmAsm_flex_debug = bdebug ;
+}
-/* Redefine yyless() so it works in section 3 code. */
+static int yy_init_globals (void)
+{
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from llvmAsmlex_destroy(), so don't allocate here.
+ */
+
+ /* We do not touch llvmAsmlineno unless the option is enabled. */
+ llvmAsmlineno = 1;
+
+ (yy_buffer_stack) = 0;
+ (yy_buffer_stack_top) = 0;
+ (yy_buffer_stack_max) = 0;
+ (yy_c_buf_p) = (char *) 0;
+ (yy_init) = 0;
+ (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ llvmAsmin = stdin;
+ llvmAsmout = stdout;
+#else
+ llvmAsmin = (FILE *) 0;
+ llvmAsmout = (FILE *) 0;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * llvmAsmlex_init()
+ */
+ return 0;
+}
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
+/* llvmAsmlex_destroy is for both reentrant and non-reentrant scanners. */
+int llvmAsmlex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ llvmAsm_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ llvmAsmpop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ llvmAsmfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * llvmAsmlex() is called, initialization will occur. */
+ yy_init_globals( );
+ return 0;
+}
-/* Internal utility routines. */
+/*
+ * Internal utility routines.
+ */
#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
- }
+}
#endif
#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
+static int yy_flex_strlen (yyconst char * s )
+{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
- }
+}
#endif
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
+void *llvmAsmalloc (yy_size_t size )
+{
return (void *) malloc( size );
- }
+}
-#ifdef YY_USE_PROTOS
-static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static inline void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
+void *llvmAsmrealloc (void * ptr, yy_size_t size )
+{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -3100,24 +3295,16 @@
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
- }
+}
+
+void llvmAsmfree (void * ptr )
+{
+ free( (char *) ptr ); /* see llvmAsmrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 512 "/home/asl/proj/llvm/src/lib/AsmParser/Lexer.l"
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 510 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/Lexer.l"
Modified: llvm/trunk/lib/AsmParser/Lexer.l.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Lexer.l.cvs?rev=44110&r1=44109&r2=44110&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/Lexer.l.cvs (original)
+++ llvm/trunk/lib/AsmParser/Lexer.l.cvs Wed Nov 14 03:53:48 2007
@@ -275,6 +275,8 @@
noalias { return NOALIAS; }
byval { return BYVAL; }
nest { return NEST; }
+pure { return PURE; }
+const { return CONST; }
sext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
return SIGNEXT; }
zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=44110&r1=44109&r2=44110&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Wed Nov 14 03:53:48 2007
@@ -1,161 +1,378 @@
+/* A Bison parser, made by GNU Bison 2.3. */
-/* A Bison parser, made from /Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y
- by GNU Bison version 1.28 */
+/* Skeleton implementation for Bison's Yacc-like parsers in C
-#define YYBISON 1 /* Identify Bison output. */
+ 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. */
+
+/* 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 llvmAsmparse
-#define yylex llvmAsmlex
+#define yylex llvmAsmlex
#define yyerror llvmAsmerror
-#define yylval llvmAsmlval
-#define yychar llvmAsmchar
+#define yylval llvmAsmlval
+#define yychar llvmAsmchar
#define yydebug llvmAsmdebug
#define yynerrs llvmAsmnerrs
-#define ESINT64VAL 257
-#define EUINT64VAL 258
-#define ESAPINTVAL 259
-#define EUAPINTVAL 260
-#define LOCALVAL_ID 261
-#define GLOBALVAL_ID 262
-#define FPVAL 263
-#define VOID 264
-#define INTTYPE 265
-#define FLOAT 266
-#define DOUBLE 267
-#define X86_FP80 268
-#define FP128 269
-#define PPC_FP128 270
-#define LABEL 271
-#define TYPE 272
-#define LOCALVAR 273
-#define GLOBALVAR 274
-#define LABELSTR 275
-#define STRINGCONSTANT 276
-#define ATSTRINGCONSTANT 277
-#define PCTSTRINGCONSTANT 278
-#define ZEROINITIALIZER 279
-#define TRUETOK 280
-#define FALSETOK 281
-#define BEGINTOK 282
-#define ENDTOK 283
-#define DECLARE 284
-#define DEFINE 285
-#define GLOBAL 286
-#define CONSTANT 287
-#define SECTION 288
-#define ALIAS 289
-#define VOLATILE 290
-#define THREAD_LOCAL 291
-#define TO 292
-#define DOTDOTDOT 293
-#define NULL_TOK 294
-#define UNDEF 295
-#define INTERNAL 296
-#define LINKONCE 297
-#define WEAK 298
-#define APPENDING 299
-#define DLLIMPORT 300
-#define DLLEXPORT 301
-#define EXTERN_WEAK 302
-#define OPAQUE 303
-#define EXTERNAL 304
-#define TARGET 305
-#define TRIPLE 306
-#define ALIGN 307
-#define DEPLIBS 308
-#define CALL 309
-#define TAIL 310
-#define ASM_TOK 311
-#define MODULE 312
-#define SIDEEFFECT 313
-#define CC_TOK 314
-#define CCC_TOK 315
-#define FASTCC_TOK 316
-#define COLDCC_TOK 317
-#define X86_STDCALLCC_TOK 318
-#define X86_FASTCALLCC_TOK 319
-#define DATALAYOUT 320
-#define RET 321
-#define BR 322
-#define SWITCH 323
-#define INVOKE 324
-#define UNWIND 325
-#define UNREACHABLE 326
-#define ADD 327
-#define SUB 328
-#define MUL 329
-#define UDIV 330
-#define SDIV 331
-#define FDIV 332
-#define UREM 333
-#define SREM 334
-#define FREM 335
-#define AND 336
-#define OR 337
-#define XOR 338
-#define SHL 339
-#define LSHR 340
-#define ASHR 341
-#define ICMP 342
-#define FCMP 343
-#define EQ 344
-#define NE 345
-#define SLT 346
-#define SGT 347
-#define SLE 348
-#define SGE 349
-#define ULT 350
-#define UGT 351
-#define ULE 352
-#define UGE 353
-#define OEQ 354
-#define ONE 355
-#define OLT 356
-#define OGT 357
-#define OLE 358
-#define OGE 359
-#define ORD 360
-#define UNO 361
-#define UEQ 362
-#define UNE 363
-#define MALLOC 364
-#define ALLOCA 365
-#define FREE 366
-#define LOAD 367
-#define STORE 368
-#define GETELEMENTPTR 369
-#define TRUNC 370
-#define ZEXT 371
-#define SEXT 372
-#define FPTRUNC 373
-#define FPEXT 374
-#define BITCAST 375
-#define UITOFP 376
-#define SITOFP 377
-#define FPTOUI 378
-#define FPTOSI 379
-#define INTTOPTR 380
-#define PTRTOINT 381
-#define PHI_TOK 382
-#define SELECT 383
-#define VAARG 384
-#define EXTRACTELEMENT 385
-#define INSERTELEMENT 386
-#define SHUFFLEVECTOR 387
-#define SIGNEXT 388
-#define ZEROEXT 389
-#define NORETURN 390
-#define INREG 391
-#define SRET 392
-#define NOUNWIND 393
-#define NOALIAS 394
-#define BYVAL 395
-#define NEST 396
-#define DEFAULT 397
-#define HIDDEN 398
-#define PROTECTED 399
-#line 14 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ ESINT64VAL = 258,
+ EUINT64VAL = 259,
+ ESAPINTVAL = 260,
+ EUAPINTVAL = 261,
+ LOCALVAL_ID = 262,
+ GLOBALVAL_ID = 263,
+ FPVAL = 264,
+ VOID = 265,
+ INTTYPE = 266,
+ FLOAT = 267,
+ DOUBLE = 268,
+ X86_FP80 = 269,
+ FP128 = 270,
+ PPC_FP128 = 271,
+ LABEL = 272,
+ TYPE = 273,
+ LOCALVAR = 274,
+ GLOBALVAR = 275,
+ LABELSTR = 276,
+ STRINGCONSTANT = 277,
+ ATSTRINGCONSTANT = 278,
+ PCTSTRINGCONSTANT = 279,
+ ZEROINITIALIZER = 280,
+ TRUETOK = 281,
+ FALSETOK = 282,
+ BEGINTOK = 283,
+ ENDTOK = 284,
+ DECLARE = 285,
+ DEFINE = 286,
+ GLOBAL = 287,
+ CONSTANT = 288,
+ SECTION = 289,
+ ALIAS = 290,
+ VOLATILE = 291,
+ THREAD_LOCAL = 292,
+ TO = 293,
+ DOTDOTDOT = 294,
+ NULL_TOK = 295,
+ UNDEF = 296,
+ INTERNAL = 297,
+ LINKONCE = 298,
+ WEAK = 299,
+ APPENDING = 300,
+ DLLIMPORT = 301,
+ DLLEXPORT = 302,
+ EXTERN_WEAK = 303,
+ OPAQUE = 304,
+ EXTERNAL = 305,
+ TARGET = 306,
+ TRIPLE = 307,
+ ALIGN = 308,
+ DEPLIBS = 309,
+ CALL = 310,
+ TAIL = 311,
+ ASM_TOK = 312,
+ MODULE = 313,
+ SIDEEFFECT = 314,
+ CC_TOK = 315,
+ CCC_TOK = 316,
+ FASTCC_TOK = 317,
+ COLDCC_TOK = 318,
+ X86_STDCALLCC_TOK = 319,
+ X86_FASTCALLCC_TOK = 320,
+ DATALAYOUT = 321,
+ RET = 322,
+ BR = 323,
+ SWITCH = 324,
+ INVOKE = 325,
+ UNWIND = 326,
+ UNREACHABLE = 327,
+ ADD = 328,
+ SUB = 329,
+ MUL = 330,
+ UDIV = 331,
+ SDIV = 332,
+ FDIV = 333,
+ UREM = 334,
+ SREM = 335,
+ FREM = 336,
+ AND = 337,
+ OR = 338,
+ XOR = 339,
+ SHL = 340,
+ LSHR = 341,
+ ASHR = 342,
+ ICMP = 343,
+ FCMP = 344,
+ EQ = 345,
+ NE = 346,
+ SLT = 347,
+ SGT = 348,
+ SLE = 349,
+ SGE = 350,
+ ULT = 351,
+ UGT = 352,
+ ULE = 353,
+ UGE = 354,
+ OEQ = 355,
+ ONE = 356,
+ OLT = 357,
+ OGT = 358,
+ OLE = 359,
+ OGE = 360,
+ ORD = 361,
+ UNO = 362,
+ UEQ = 363,
+ UNE = 364,
+ MALLOC = 365,
+ ALLOCA = 366,
+ FREE = 367,
+ LOAD = 368,
+ STORE = 369,
+ GETELEMENTPTR = 370,
+ TRUNC = 371,
+ ZEXT = 372,
+ SEXT = 373,
+ FPTRUNC = 374,
+ FPEXT = 375,
+ BITCAST = 376,
+ UITOFP = 377,
+ SITOFP = 378,
+ FPTOUI = 379,
+ FPTOSI = 380,
+ INTTOPTR = 381,
+ PTRTOINT = 382,
+ PHI_TOK = 383,
+ SELECT = 384,
+ VAARG = 385,
+ EXTRACTELEMENT = 386,
+ INSERTELEMENT = 387,
+ SHUFFLEVECTOR = 388,
+ SIGNEXT = 389,
+ ZEROEXT = 390,
+ NORETURN = 391,
+ INREG = 392,
+ SRET = 393,
+ NOUNWIND = 394,
+ NOALIAS = 395,
+ BYVAL = 396,
+ NEST = 397,
+ CONST = 398,
+ PURE = 399,
+ DEFAULT = 400,
+ HIDDEN = 401,
+ PROTECTED = 402
+ };
+#endif
+/* Tokens. */
+#define ESINT64VAL 258
+#define EUINT64VAL 259
+#define ESAPINTVAL 260
+#define EUAPINTVAL 261
+#define LOCALVAL_ID 262
+#define GLOBALVAL_ID 263
+#define FPVAL 264
+#define VOID 265
+#define INTTYPE 266
+#define FLOAT 267
+#define DOUBLE 268
+#define X86_FP80 269
+#define FP128 270
+#define PPC_FP128 271
+#define LABEL 272
+#define TYPE 273
+#define LOCALVAR 274
+#define GLOBALVAR 275
+#define LABELSTR 276
+#define STRINGCONSTANT 277
+#define ATSTRINGCONSTANT 278
+#define PCTSTRINGCONSTANT 279
+#define ZEROINITIALIZER 280
+#define TRUETOK 281
+#define FALSETOK 282
+#define BEGINTOK 283
+#define ENDTOK 284
+#define DECLARE 285
+#define DEFINE 286
+#define GLOBAL 287
+#define CONSTANT 288
+#define SECTION 289
+#define ALIAS 290
+#define VOLATILE 291
+#define THREAD_LOCAL 292
+#define TO 293
+#define DOTDOTDOT 294
+#define NULL_TOK 295
+#define UNDEF 296
+#define INTERNAL 297
+#define LINKONCE 298
+#define WEAK 299
+#define APPENDING 300
+#define DLLIMPORT 301
+#define DLLEXPORT 302
+#define EXTERN_WEAK 303
+#define OPAQUE 304
+#define EXTERNAL 305
+#define TARGET 306
+#define TRIPLE 307
+#define ALIGN 308
+#define DEPLIBS 309
+#define CALL 310
+#define TAIL 311
+#define ASM_TOK 312
+#define MODULE 313
+#define SIDEEFFECT 314
+#define CC_TOK 315
+#define CCC_TOK 316
+#define FASTCC_TOK 317
+#define COLDCC_TOK 318
+#define X86_STDCALLCC_TOK 319
+#define X86_FASTCALLCC_TOK 320
+#define DATALAYOUT 321
+#define RET 322
+#define BR 323
+#define SWITCH 324
+#define INVOKE 325
+#define UNWIND 326
+#define UNREACHABLE 327
+#define ADD 328
+#define SUB 329
+#define MUL 330
+#define UDIV 331
+#define SDIV 332
+#define FDIV 333
+#define UREM 334
+#define SREM 335
+#define FREM 336
+#define AND 337
+#define OR 338
+#define XOR 339
+#define SHL 340
+#define LSHR 341
+#define ASHR 342
+#define ICMP 343
+#define FCMP 344
+#define EQ 345
+#define NE 346
+#define SLT 347
+#define SGT 348
+#define SLE 349
+#define SGE 350
+#define ULT 351
+#define UGT 352
+#define ULE 353
+#define UGE 354
+#define OEQ 355
+#define ONE 356
+#define OLT 357
+#define OGT 358
+#define OLE 359
+#define OGE 360
+#define ORD 361
+#define UNO 362
+#define UEQ 363
+#define UNE 364
+#define MALLOC 365
+#define ALLOCA 366
+#define FREE 367
+#define LOAD 368
+#define STORE 369
+#define GETELEMENTPTR 370
+#define TRUNC 371
+#define ZEXT 372
+#define SEXT 373
+#define FPTRUNC 374
+#define FPEXT 375
+#define BITCAST 376
+#define UITOFP 377
+#define SITOFP 378
+#define FPTOUI 379
+#define FPTOSI 380
+#define INTTOPTR 381
+#define PTRTOINT 382
+#define PHI_TOK 383
+#define SELECT 384
+#define VAARG 385
+#define EXTRACTELEMENT 386
+#define INSERTELEMENT 387
+#define SHUFFLEVECTOR 388
+#define SIGNEXT 389
+#define ZEROEXT 390
+#define NORETURN 391
+#define INREG 392
+#define SRET 393
+#define NOUNWIND 394
+#define NOALIAS 395
+#define BYVAL 396
+#define NEST 397
+#define CONST 398
+#define PURE 399
+#define DEFAULT 400
+#define HIDDEN 401
+#define PROTECTED 402
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
#include "ParserInternals.h"
#include "llvm/CallingConv.h"
@@ -1109,8 +1326,29 @@
}
-#line 968 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-typedef union {
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 968 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
llvm::BasicBlock *BasicBlockVal;
@@ -1155,1161 +1393,1842 @@
llvm::Instruction::OtherOps OtherOpVal;
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
-} YYSTYPE;
-#include
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
+}
+/* Line 187 of yacc.c. */
+#line 1399 "llvmAsmParser.tab.c"
+ YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
-#define YYFINAL 600
-#define YYFLAG -32768
-#define YYNTBASE 160
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 399 ? yytranslate[x] : 241)
-
-static const short yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 150,
- 151, 148, 2, 147, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 155,
- 146, 156, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 152, 149, 154, 2, 2, 2, 2, 2, 159, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 153,
- 2, 2, 157, 2, 158, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
- 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 145
-};
+/* Copy the second part of user declarations. */
-#if YYDEBUG != 0
-static const short yyprhs[] = { 0,
- 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
- 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
- 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
- 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,
- 80, 82, 84, 86, 88, 90, 92, 94, 96, 98,
- 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
- 120, 122, 124, 126, 127, 130, 131, 133, 135, 137,
- 138, 141, 143, 145, 147, 149, 151, 153, 155, 157,
- 158, 160, 162, 164, 165, 167, 169, 170, 172, 174,
- 176, 178, 179, 181, 183, 184, 186, 188, 190, 192,
- 194, 197, 199, 201, 203, 205, 207, 209, 211, 213,
- 215, 216, 219, 221, 223, 225, 227, 228, 231, 232,
- 235, 236, 240, 243, 244, 246, 247, 251, 253, 256,
- 258, 260, 262, 264, 266, 268, 270, 272, 274, 277,
- 279, 282, 288, 294, 300, 306, 310, 313, 319, 324,
- 327, 329, 331, 333, 337, 339, 343, 345, 346, 348,
- 352, 357, 361, 365, 370, 375, 379, 386, 392, 395,
- 398, 401, 404, 407, 410, 413, 416, 419, 422, 425,
- 428, 435, 441, 450, 457, 464, 472, 480, 487, 496,
- 505, 509, 511, 513, 515, 517, 518, 521, 528, 530,
- 531, 533, 536, 537, 541, 542, 546, 550, 554, 558,
- 559, 567, 568, 577, 578, 587, 593, 596, 600, 602,
- 606, 610, 614, 618, 620, 621, 627, 631, 633, 637,
- 639, 640, 650, 652, 654, 659, 661, 663, 666, 670,
- 671, 673, 675, 677, 679, 681, 683, 685, 687, 689,
- 693, 695, 701, 703, 705, 707, 709, 711, 713, 716,
- 719, 722, 726, 729, 730, 732, 735, 738, 742, 752,
- 762, 771, 786, 788, 790, 797, 803, 806, 813, 821,
- 825, 829, 835, 841, 842, 843, 847, 850, 852, 858,
- 864, 871, 878, 883, 890, 895, 900, 907, 914, 917,
- 926, 928, 930, 931, 935, 942, 946, 953, 956, 962,
- 970
-};
-static const short yyrhs[] = { 73,
- 0, 74, 0, 75, 0, 76, 0, 77, 0, 78,
- 0, 79, 0, 80, 0, 81, 0, 85, 0, 86,
- 0, 87, 0, 82, 0, 83, 0, 84, 0, 116,
- 0, 117, 0, 118, 0, 119, 0, 120, 0, 121,
- 0, 122, 0, 123, 0, 124, 0, 125, 0, 126,
- 0, 127, 0, 90, 0, 91, 0, 92, 0, 93,
- 0, 94, 0, 95, 0, 96, 0, 97, 0, 98,
- 0, 99, 0, 100, 0, 101, 0, 102, 0, 103,
- 0, 104, 0, 105, 0, 106, 0, 107, 0, 108,
- 0, 109, 0, 96, 0, 97, 0, 98, 0, 99,
- 0, 26, 0, 27, 0, 11, 0, 12, 0, 13,
- 0, 16, 0, 15, 0, 14, 0, 19, 0, 22,
- 0, 24, 0, 167, 0, 0, 167, 146, 0, 0,
- 20, 0, 23, 0, 172, 0, 0, 170, 146, 0,
- 42, 0, 44, 0, 43, 0, 45, 0, 47, 0,
- 46, 0, 48, 0, 50, 0, 0, 143, 0, 144,
- 0, 145, 0, 0, 46, 0, 48, 0, 0, 42,
- 0, 43, 0, 44, 0, 47, 0, 0, 44, 0,
- 42, 0, 0, 61, 0, 62, 0, 63, 0, 64,
- 0, 65, 0, 60, 4, 0, 135, 0, 117, 0,
- 134, 0, 118, 0, 137, 0, 138, 0, 140, 0,
- 141, 0, 142, 0, 0, 181, 180, 0, 136, 0,
- 139, 0, 135, 0, 134, 0, 0, 183, 182, 0,
- 0, 53, 4, 0, 0, 147, 53, 4, 0, 34,
- 22, 0, 0, 186, 0, 0, 147, 189, 188, 0,
- 186, 0, 53, 4, 0, 11, 0, 12, 0, 13,
- 0, 16, 0, 15, 0, 14, 0, 17, 0, 49,
- 0, 190, 0, 191, 148, 0, 225, 0, 149, 4,
- 0, 191, 150, 195, 151, 183, 0, 10, 150, 195,
- 151, 183, 0, 152, 4, 153, 191, 154, 0, 155,
- 4, 153, 191, 156, 0, 157, 196, 158, 0, 157,
- 158, 0, 155, 157, 196, 158, 156, 0, 155, 157,
- 158, 156, 0, 191, 181, 0, 191, 0, 10, 0,
- 192, 0, 194, 147, 192, 0, 194, 0, 194, 147,
- 39, 0, 39, 0, 0, 191, 0, 196, 147, 191,
- 0, 191, 152, 199, 154, 0, 191, 152, 154, 0,
- 191, 159, 22, 0, 191, 155, 199, 156, 0, 191,
- 157, 199, 158, 0, 191, 157, 158, 0, 191, 155,
- 157, 199, 158, 156, 0, 191, 155, 157, 158, 156,
- 0, 191, 40, 0, 191, 41, 0, 191, 225, 0,
- 191, 198, 0, 191, 25, 0, 165, 3, 0, 165,
- 5, 0, 165, 4, 0, 165, 6, 0, 11, 26,
- 0, 11, 27, 0, 166, 9, 0, 162, 150, 197,
- 38, 191, 151, 0, 115, 150, 197, 236, 151, 0,
- 129, 150, 197, 147, 197, 147, 197, 151, 0, 160,
- 150, 197, 147, 197, 151, 0, 161, 150, 197, 147,
- 197, 151, 0, 88, 163, 150, 197, 147, 197, 151,
- 0, 89, 164, 150, 197, 147, 197, 151, 0, 131,
- 150, 197, 147, 197, 151, 0, 132, 150, 197, 147,
- 197, 147, 197, 151, 0, 133, 150, 197, 147, 197,
- 147, 197, 151, 0, 199, 147, 197, 0, 197, 0,
- 32, 0, 33, 0, 37, 0, 0, 193, 225, 0,
- 121, 150, 202, 38, 191, 151, 0, 204, 0, 0,
- 205, 0, 204, 205, 0, 0, 31, 206, 221, 0,
- 0, 30, 207, 222, 0, 58, 57, 211, 0, 169,
- 18, 191, 0, 169, 18, 10, 0, 0, 171, 175,
- 201, 200, 197, 208, 188, 0, 0, 171, 173, 175,
- 201, 200, 197, 209, 188, 0, 0, 171, 174, 175,
- 201, 200, 191, 210, 188, 0, 171, 175, 35, 178,
- 202, 0, 51, 212, 0, 54, 146, 213, 0, 22,
- 0, 52, 146, 22, 0, 66, 146, 22, 0, 152,
- 214, 154, 0, 214, 147, 22, 0, 22, 0, 0,
- 215, 147, 191, 181, 168, 0, 191, 181, 168, 0,
- 215, 0, 215, 147, 39, 0, 39, 0, 0, 179,
- 193, 170, 150, 216, 151, 183, 187, 184, 0, 28,
- 0, 157, 0, 177, 175, 217, 218, 0, 29, 0,
- 158, 0, 228, 220, 0, 176, 175, 217, 0, 0,
- 59, 0, 3, 0, 4, 0, 9, 0, 26, 0,
- 27, 0, 40, 0, 41, 0, 25, 0, 155, 199,
- 156, 0, 198, 0, 57, 223, 22, 147, 22, 0,
- 7, 0, 8, 0, 167, 0, 170, 0, 225, 0,
- 224, 0, 191, 226, 0, 228, 229, 0, 219, 229,
- 0, 230, 169, 231, 0, 230, 233, 0, 0, 21,
- 0, 67, 227, 0, 67, 10, 0, 68, 17, 226,
- 0, 68, 11, 226, 147, 17, 226, 147, 17, 226,
- 0, 69, 165, 226, 147, 17, 226, 152, 232, 154,
- 0, 69, 165, 226, 147, 17, 226, 152, 154, 0,
- 70, 179, 193, 226, 150, 235, 151, 183, 38, 17,
- 226, 71, 17, 226, 0, 71, 0, 72, 0, 232,
- 165, 224, 147, 17, 226, 0, 165, 224, 147, 17,
- 226, 0, 169, 238, 0, 191, 152, 226, 147, 226,
- 154, 0, 234, 147, 152, 226, 147, 226, 154, 0,
- 191, 226, 181, 0, 17, 226, 181, 0, 235, 147,
- 191, 226, 181, 0, 235, 147, 17, 226, 181, 0,
- 0, 0, 236, 147, 227, 0, 56, 55, 0, 55,
- 0, 160, 191, 226, 147, 226, 0, 161, 191, 226,
- 147, 226, 0, 88, 163, 191, 226, 147, 226, 0,
- 89, 164, 191, 226, 147, 226, 0, 162, 227, 38,
- 191, 0, 129, 227, 147, 227, 147, 227, 0, 130,
- 227, 147, 191, 0, 131, 227, 147, 227, 0, 132,
- 227, 147, 227, 147, 227, 0, 133, 227, 147, 227,
- 147, 227, 0, 128, 234, 0, 237, 179, 193, 226,
- 150, 235, 151, 183, 0, 240, 0, 36, 0, 0,
- 110, 191, 185, 0, 110, 191, 147, 11, 226, 185,
- 0, 111, 191, 185, 0, 111, 191, 147, 11, 226,
- 185, 0, 112, 227, 0, 239, 113, 191, 226, 185,
- 0, 239, 114, 227, 147, 191, 226, 185, 0, 115,
- 191, 226, 236, 0
-};
+/* Line 216 of yacc.c. */
+#line 1412 "llvmAsmParser.tab.c"
+#ifdef short
+# undef short
#endif
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
- 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1128,
- 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129, 1129, 1129,
- 1129, 1129, 1130, 1130, 1130, 1130, 1130, 1133, 1133, 1134,
- 1134, 1135, 1135, 1136, 1136, 1137, 1137, 1141, 1141, 1142,
- 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1146, 1147,
- 1147, 1148, 1149, 1154, 1155, 1155, 1155, 1155, 1155, 1157,
- 1157, 1157, 1158, 1158, 1162, 1166, 1171, 1171, 1173, 1174,
- 1179, 1185, 1186, 1187, 1188, 1189, 1193, 1194, 1195, 1199,
- 1200, 1201, 1202, 1206, 1207, 1208, 1212, 1213, 1214, 1215,
- 1216, 1220, 1221, 1222, 1225, 1225, 1226, 1227, 1228, 1229,
- 1230, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246,
- 1249, 1250, 1255, 1256, 1257, 1258, 1261, 1262, 1269, 1269,
- 1276, 1276, 1285, 1293, 1293, 1299, 1299, 1301, 1306, 1319,
- 1319, 1319, 1319, 1319, 1319, 1319, 1322, 1326, 1330, 1337,
- 1342, 1350, 1380, 1411, 1416, 1428, 1438, 1442, 1452, 1459,
- 1466, 1473, 1478, 1483, 1490, 1491, 1498, 1505, 1513, 1519,
- 1531, 1559, 1575, 1602, 1630, 1656, 1676, 1702, 1722, 1734,
- 1741, 1807, 1817, 1827, 1833, 1843, 1849, 1859, 1864, 1869,
- 1882, 1894, 1916, 1924, 1930, 1941, 1946, 1951, 1957, 1963,
- 1972, 1976, 1984, 1984, 1987, 1987, 1990, 2002, 2023, 2028,
- 2036, 2037, 2041, 2041, 2045, 2045, 2048, 2051, 2075, 2086,
- 2093, 2096, 2102, 2105, 2112, 2116, 2156, 2159, 2165, 2175,
- 2179, 2184, 2186, 2191, 2196, 2205, 2215, 2226, 2230, 2239,
- 2248, 2253, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404,
- 2408, 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445,
- 2470, 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519,
- 2523, 2532, 2541, 2550, 2554, 2561, 2565, 2569, 2574, 2584,
- 2603, 2612, 2692, 2696, 2703, 2714, 2727, 2737, 2748, 2758,
- 2767, 2773, 2782, 2788, 2791, 2792, 2799, 2803, 2808, 2829,
- 2846, 2860, 2874, 2886, 2894, 2901, 2907, 2913, 2919, 2934,
- 3019, 3024, 3028, 3035, 3042, 3050, 3057, 3065, 3073, 3087,
- 3104
-};
+#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;
+#endif
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
-static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL",
-"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL",
-"VOID","INTTYPE","FLOAT","DOUBLE","X86_FP80","FP128","PPC_FP128","LABEL","TYPE",
-"LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT","PCTSTRINGCONSTANT",
-"ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK","DECLARE","DEFINE",
-"GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE","THREAD_LOCAL","TO","DOTDOTDOT",
-"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT",
-"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL",
-"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK",
-"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE",
-"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM",
-"FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP","FCMP","EQ","NE","SLT","SGT",
-"SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD",
-"UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC",
-"ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI",
-"INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT",
-"SHUFFLEVECTOR","SIGNEXT","ZEROEXT","NORETURN","INREG","SRET","NOUNWIND","NOALIAS",
-"BYVAL","NEST","DEFAULT","HIDDEN","PROTECTED","'='","','","'*'","'\\\\'","'('",
-"')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps","LogicalOps",
-"CastOps","IPredicates","FPredicates","IntType","FPType","LocalName","OptLocalName",
-"OptLocalAssign","GlobalName","OptGlobalAssign","GlobalAssign","GVInternalLinkage",
-"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage",
-"AliasLinkage","OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs",
-"OptAlign","OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute",
-"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI",
-"ConstVal","ConstExpr","ConstVector","GlobalType","ThreadLocal","AliaseeRef",
-"Module","DefinitionList","Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition",
-"LibrariesDefinition","LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN",
-"FunctionHeader","END","Function","FunctionProto","OptSideEffect","ConstValueRef",
-"SymbolicValueRef","ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList",
-"BBTerminatorInst","JumpTable","Inst","PHIList","ParamList","IndexList","OptTailCall",
-"InstVal","OptVolatile","MemoryInst", NULL
-};
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
#endif
-static const short yyr1[] = { 0,
- 160, 160, 160, 160, 160, 160, 160, 160, 160, 161,
- 161, 161, 161, 161, 161, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 163, 163, 163,
- 163, 163, 163, 163, 163, 163, 163, 164, 164, 164,
- 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
- 164, 164, 164, 165, 166, 166, 166, 166, 166, 167,
- 167, 167, 168, 168, 169, 169, 170, 170, 171, 171,
- 172, 173, 173, 173, 173, 173, 174, 174, 174, 175,
- 175, 175, 175, 176, 176, 176, 177, 177, 177, 177,
- 177, 178, 178, 178, 179, 179, 179, 179, 179, 179,
- 179, 180, 180, 180, 180, 180, 180, 180, 180, 180,
- 181, 181, 182, 182, 182, 182, 183, 183, 184, 184,
- 185, 185, 186, 187, 187, 188, 188, 189, 189, 190,
- 190, 190, 190, 190, 190, 190, 191, 191, 191, 191,
- 191, 191, 191, 191, 191, 191, 191, 191, 191, 192,
- 193, 193, 194, 194, 195, 195, 195, 195, 196, 196,
- 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
- 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
- 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
- 199, 199, 200, 200, 201, 201, 202, 202, 203, 203,
- 204, 204, 206, 205, 207, 205, 205, 205, 205, 208,
- 205, 209, 205, 210, 205, 205, 205, 205, 211, 212,
- 212, 213, 214, 214, 214, 215, 215, 216, 216, 216,
- 216, 217, 218, 218, 219, 220, 220, 221, 222, 223,
- 223, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 225, 225, 225, 225, 226, 226, 227, 228,
- 228, 229, 230, 230, 230, 231, 231, 231, 231, 231,
- 231, 231, 231, 231, 232, 232, 233, 234, 234, 235,
- 235, 235, 235, 235, 236, 236, 237, 237, 238, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
- 238, 239, 239, 240, 240, 240, 240, 240, 240, 240,
- 240
-};
+#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
-static const short yyr2[] = { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 2, 0, 1, 1, 1, 0,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 2, 1, 1, 1, 1, 0, 2, 0, 2,
- 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
- 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
- 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
- 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 6, 5, 8, 6, 6, 7, 7, 6, 8, 8,
- 3, 1, 1, 1, 1, 0, 2, 6, 1, 0,
- 1, 2, 0, 3, 0, 3, 3, 3, 3, 0,
- 7, 0, 8, 0, 8, 5, 2, 3, 1, 3,
- 3, 3, 3, 1, 0, 5, 3, 1, 3, 1,
- 0, 9, 1, 1, 4, 1, 1, 2, 3, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
- 1, 5, 1, 1, 1, 1, 1, 1, 2, 2,
- 2, 3, 2, 0, 1, 2, 2, 3, 9, 9,
- 8, 14, 1, 1, 6, 5, 2, 6, 7, 3,
- 3, 5, 5, 0, 0, 3, 2, 1, 5, 5,
- 6, 6, 4, 6, 4, 4, 6, 6, 2, 8,
- 1, 1, 0, 3, 6, 3, 6, 2, 5, 7,
- 4
-};
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
-static const short yydefact[] = { 70,
- 60, 67, 61, 68, 62, 205, 203, 0, 0, 0,
- 0, 0, 0, 80, 69, 70, 201, 84, 87, 0,
- 0, 217, 0, 0, 65, 0, 71, 72, 74, 73,
- 75, 77, 76, 78, 79, 81, 82, 83, 80, 80,
- 196, 202, 85, 86, 80, 206, 88, 89, 90, 91,
- 80, 264, 204, 264, 0, 0, 225, 218, 219, 207,
- 253, 254, 209, 130, 131, 132, 135, 134, 133, 136,
- 137, 0, 0, 0, 0, 255, 256, 138, 208, 140,
- 196, 196, 92, 195, 0, 95, 95, 265, 261, 66,
- 236, 237, 238, 260, 220, 221, 224, 0, 158, 141,
- 0, 0, 0, 0, 147, 159, 0, 139, 158, 0,
- 0, 94, 93, 0, 193, 194, 0, 0, 96, 97,
- 98, 99, 100, 0, 239, 0, 303, 263, 0, 222,
- 157, 111, 153, 155, 0, 0, 0, 0, 0, 0,
- 146, 0, 0, 0, 152, 0, 151, 0, 216, 130,
- 131, 132, 135, 134, 133, 0, 0, 0, 210, 101,
- 0, 233, 234, 235, 302, 288, 0, 0, 0, 0,
- 95, 273, 274, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 13, 14, 15, 10, 11, 12, 0, 0,
- 0, 0, 0, 0, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 262, 95, 277, 0, 301,
- 223, 150, 0, 117, 0, 0, 149, 0, 160, 117,
- 212, 214, 0, 197, 178, 179, 174, 176, 175, 177,
- 180, 173, 169, 170, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 172, 171,
- 126, 0, 287, 267, 0, 266, 0, 0, 54, 0,
- 0, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 0, 52, 53, 48, 49, 50, 51, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 0, 121,
- 121, 308, 0, 0, 299, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 103, 105, 104, 102,
- 106, 107, 108, 109, 110, 112, 156, 154, 143, 144,
- 145, 148, 142, 126, 126, 0, 0, 0, 0, 0,
- 0, 0, 0, 162, 192, 0, 0, 0, 166, 0,
- 163, 0, 0, 0, 0, 211, 231, 242, 243, 244,
- 249, 245, 246, 247, 248, 240, 0, 251, 258, 257,
- 259, 0, 268, 0, 0, 0, 0, 0, 304, 0,
- 306, 285, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 116, 115, 113, 114, 118,
- 213, 215, 0, 0, 0, 285, 0, 0, 0, 0,
- 0, 161, 147, 159, 0, 164, 165, 0, 0, 0,
- 0, 0, 128, 126, 230, 111, 228, 0, 241, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 311,
- 0, 0, 0, 295, 296, 0, 0, 0, 0, 293,
- 0, 121, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 191, 168, 0, 0, 0, 0, 123, 129, 127,
- 64, 0, 117, 0, 250, 0, 0, 284, 0, 0,
- 121, 122, 121, 0, 0, 0, 0, 0, 0, 289,
- 290, 284, 0, 309, 0, 198, 0, 0, 182, 0,
- 0, 0, 0, 167, 0, 0, 0, 63, 227, 229,
- 111, 124, 0, 0, 0, 136, 0, 0, 291, 292,
- 305, 307, 286, 0, 0, 294, 297, 298, 0, 121,
- 0, 0, 0, 188, 0, 0, 184, 185, 181, 64,
- 125, 119, 252, 0, 0, 111, 111, 0, 117, 278,
- 0, 117, 310, 186, 187, 0, 0, 0, 226, 0,
- 232, 0, 271, 0, 0, 281, 280, 136, 0, 0,
- 279, 300, 183, 189, 190, 120, 269, 0, 270, 0,
- 111, 111, 0, 0, 0, 283, 282, 0, 0, 0,
- 0, 276, 0, 0, 275, 0, 272, 0, 0, 0
-};
+#if ! defined yyoverflow || YYERROR_VERBOSE
-static const short yydefgoto[] = { 256,
- 257, 258, 282, 299, 156, 157, 76, 509, 12, 77,
- 14, 15, 39, 40, 41, 45, 51, 114, 124, 326,
- 222, 400, 329, 561, 379, 423, 542, 356, 424, 78,
- 158, 133, 148, 134, 135, 107, 345, 368, 346, 117,
- 85, 149, 598, 16, 17, 19, 18, 261, 334, 335,
- 60, 22, 58, 98, 427, 428, 125, 164, 52, 93,
- 53, 46, 430, 369, 80, 371, 266, 54, 89, 90,
- 216, 565, 128, 305, 518, 440, 217, 218, 219, 220
+/* 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 43
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 1754
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 162
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 82
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 314
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 602
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 402
+
+#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,
+ 152, 153, 150, 2, 149, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 157, 148, 158, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 154, 151, 156, 2, 2, 2, 2, 2, 161,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 155, 2, 2, 159, 2, 160, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ 145, 146, 147
};
-static const short yypact[] = { 42,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, -8, -110, 13,
- -39, 104, 5, 167,-32768, 321,-32768, 83, 74, 12,
- 17,-32768, 41, 148,-32768, 1305,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 117, 117,
- 11,-32768,-32768,-32768, 117,-32768,-32768,-32768,-32768,-32768,
- 117, 154,-32768, -10, 181, 204, 212,-32768,-32768,-32768,
--32768,-32768, 98,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 254, 259, 3, 958,-32768,-32768,-32768, 49,-32768,
- 231, 231, 225,-32768, 65, 215, 215,-32768,-32768, 131,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, -34, 1038,-32768,
- 120, 128, 976, 98,-32768, 49, -123,-32768, 1038, 65,
- 65,-32768,-32768, 1056,-32768,-32768, 1327, 280,-32768,-32768,
--32768,-32768,-32768, 1345,-32768, -16, 1663,-32768, 263,-32768,
--32768, 49,-32768, 139, 136, 1398, 1398, 132, -95, 1398,
--32768, 143, 1327, 1398, 98, 145, 49, 213,-32768, 50,
- 287, 289, 298, 299, 300, 219, 304, 805,-32768,-32768,
- 233,-32768,-32768,-32768,-32768,-32768, 260, 1496, 70, 303,
- 215,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 396, 449,
- 1398, 1398, 1398, 1398,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 1398, 1398, 1398, 1398,
- 1398, 1398, 1398, 1398, 1398,-32768, 215,-32768, 125,-32768,
--32768, -32, 1078,-32768, 23, -105,-32768, 160, 49,-32768,
--32768, 49, 1056,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 396, 449, 168, 169, 170, 173,
- 174, 1229, 1514, 998, 295, 175, 179, 183,-32768,-32768,
- 187, 185,-32768, 98, 646,-32768, 780, 780,-32768, 780,
- 1345,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 1398,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1398, 97,
- 102,-32768, 646, 24, 195, 203, 208, 209, 210, 211,
- 646, 646, 332, 1345, 1398, 1398,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 10,-32768,
--32768,-32768, 10, 187, 187, 333, 186, 223, 1327, 1327,
- 1327, 1327, 1327,-32768,-32768, -15, 1016, -55,-32768, -79,
--32768, 1327, 1327, 1327, -4,-32768, 1247,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768, 317, 1327,-32768,-32768,-32768,
--32768, 234,-32768, 235, 780, 646, 646, 4,-32768, 22,
--32768,-32768, 780, 207, 1398, 1398, 1398, 1398, 1398, 236,
- 240, 1398, 780, 646, 241,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 1398, 1327, 1327,-32768, 244, 246, 247, 251,
- 1327,-32768, 224, 805, -78,-32768,-32768, 252, 253, 363,
- 380, 399,-32768, 187,-32768, 49, 257, 256,-32768, 386,
- -52, 392, 393, 261, 270, 275, 780, 422, 780, 282,
- 283, 780, 284, 49,-32768, 285, 288, 780, 780, 49,
- 277, 290, 1398, 30, 291, 292, -80, 1327, 1327, 1327,
- 1327,-32768,-32768, 293, 1327, 1327, 1398,-32768,-32768,-32768,
- 278, 1287,-32768, 294,-32768, 780, 780, 1554, 780, 780,
- 290,-32768, 290, 1398, 780, 296, 1398, 1398, 1398,-32768,
--32768, 1554, 383,-32768, 646,-32768, 1327, 1327,-32768, 297,
- 301, 307, 308,-32768, 305, 309, 68,-32768,-32768,-32768,
- 49, -11, 418, 314, 313, 780, 646, -9,-32768,-32768,
--32768,-32768,-32768, 312, 780,-32768,-32768,-32768, 44, 290,
- 318, 319, 1327,-32768, 1327, 1327,-32768,-32768,-32768, 278,
--32768, 395,-32768, 428, -7,-32768,-32768, 1572,-32768,-32768,
- 320,-32768,-32768,-32768,-32768, 322, 328, 329,-32768, 442,
--32768, 780,-32768, 503, -2, -32, -32, 780, 646, 1,
--32768, 10,-32768,-32768,-32768,-32768,-32768, 325,-32768, 503,
--32768,-32768, 433, 451, 334, -32, -32, 780, 780, 466,
- 413,-32768, 780, 479,-32768, 780,-32768, 500, 501,-32768
+#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, 11, 13, 15, 17,
+ 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
+ 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
+ 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
+ 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
+ 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
+ 119, 121, 123, 125, 127, 129, 130, 133, 134, 136,
+ 138, 140, 141, 144, 146, 148, 150, 152, 154, 156,
+ 158, 160, 161, 163, 165, 167, 168, 170, 172, 173,
+ 175, 177, 179, 181, 182, 184, 186, 187, 189, 191,
+ 193, 195, 197, 200, 202, 204, 206, 208, 210, 212,
+ 214, 216, 218, 219, 222, 224, 226, 228, 230, 232,
+ 234, 235, 238, 239, 242, 243, 247, 250, 251, 253,
+ 254, 258, 260, 263, 265, 267, 269, 271, 273, 275,
+ 277, 279, 281, 284, 286, 289, 295, 301, 307, 313,
+ 317, 320, 326, 331, 334, 336, 338, 340, 344, 346,
+ 350, 352, 353, 355, 359, 364, 368, 372, 377, 382,
+ 386, 393, 399, 402, 405, 408, 411, 414, 417, 420,
+ 423, 426, 429, 432, 435, 442, 448, 457, 464, 471,
+ 479, 487, 494, 503, 512, 516, 518, 520, 522, 524,
+ 525, 528, 535, 537, 538, 540, 543, 544, 548, 549,
+ 553, 557, 561, 565, 566, 574, 575, 584, 585, 594,
+ 600, 603, 607, 609, 613, 617, 621, 625, 627, 628,
+ 634, 638, 640, 644, 646, 647, 657, 659, 661, 666,
+ 668, 670, 673, 677, 678, 680, 682, 684, 686, 688,
+ 690, 692, 694, 696, 700, 702, 708, 710, 712, 714,
+ 716, 718, 720, 723, 726, 729, 733, 736, 737, 739,
+ 742, 745, 749, 759, 769, 778, 793, 795, 797, 804,
+ 810, 813, 820, 828, 832, 836, 842, 848, 849, 850,
+ 854, 857, 859, 865, 871, 878, 885, 890, 897, 902,
+ 907, 914, 921, 924, 933, 935, 937, 938, 942, 949,
+ 953, 960, 963, 969, 977
};
-static const short yypgoto[] = { 375,
- 376, 377, 264, 262, -168,-32768, 0, -30, 421, 18,
--32768,-32768,-32768,-32768, 43,-32768,-32768,-32768, -158,-32768,
- -420,-32768, -222,-32768, -287, 2,-32768, -294,-32768,-32768,
- -25, 302, -107,-32768, 404, 414, -112, -155, -233, 144,
- 189, 286,-32768,-32768, 502,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 434,-32768,-32768,-32768,
--32768,-32768,-32768, -542, -111, 122, -183,-32768, 468,-32768,
--32768,-32768,-32768,-32768, 28, 118,-32768,-32768,-32768,-32768
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int16 yyrhs[] =
+{
+ 206, 0, -1, 73, -1, 74, -1, 75, -1, 76,
+ -1, 77, -1, 78, -1, 79, -1, 80, -1, 81,
+ -1, 85, -1, 86, -1, 87, -1, 82, -1, 83,
+ -1, 84, -1, 116, -1, 117, -1, 118, -1, 119,
+ -1, 120, -1, 121, -1, 122, -1, 123, -1, 124,
+ -1, 125, -1, 126, -1, 127, -1, 90, -1, 91,
+ -1, 92, -1, 93, -1, 94, -1, 95, -1, 96,
+ -1, 97, -1, 98, -1, 99, -1, 100, -1, 101,
+ -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
+ -1, 107, -1, 108, -1, 109, -1, 96, -1, 97,
+ -1, 98, -1, 99, -1, 26, -1, 27, -1, 11,
+ -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
+ -1, 19, -1, 22, -1, 24, -1, 170, -1, -1,
+ 170, 148, -1, -1, 20, -1, 23, -1, 175, -1,
+ -1, 173, 148, -1, 42, -1, 44, -1, 43, -1,
+ 45, -1, 47, -1, 46, -1, 48, -1, 50, -1,
+ -1, 145, -1, 146, -1, 147, -1, -1, 46, -1,
+ 48, -1, -1, 42, -1, 43, -1, 44, -1, 47,
+ -1, -1, 44, -1, 42, -1, -1, 61, -1, 62,
+ -1, 63, -1, 64, -1, 65, -1, 60, 4, -1,
+ 135, -1, 117, -1, 134, -1, 118, -1, 137, -1,
+ 138, -1, 140, -1, 141, -1, 142, -1, -1, 184,
+ 183, -1, 136, -1, 139, -1, 135, -1, 134, -1,
+ 144, -1, 143, -1, -1, 186, 185, -1, -1, 53,
+ 4, -1, -1, 149, 53, 4, -1, 34, 22, -1,
+ -1, 189, -1, -1, 149, 192, 191, -1, 189, -1,
+ 53, 4, -1, 11, -1, 12, -1, 13, -1, 16,
+ -1, 15, -1, 14, -1, 17, -1, 49, -1, 193,
+ -1, 194, 150, -1, 228, -1, 151, 4, -1, 194,
+ 152, 198, 153, 186, -1, 10, 152, 198, 153, 186,
+ -1, 154, 4, 155, 194, 156, -1, 157, 4, 155,
+ 194, 158, -1, 159, 199, 160, -1, 159, 160, -1,
+ 157, 159, 199, 160, 158, -1, 157, 159, 160, 158,
+ -1, 194, 184, -1, 194, -1, 10, -1, 195, -1,
+ 197, 149, 195, -1, 197, -1, 197, 149, 39, -1,
+ 39, -1, -1, 194, -1, 199, 149, 194, -1, 194,
+ 154, 202, 156, -1, 194, 154, 156, -1, 194, 161,
+ 22, -1, 194, 157, 202, 158, -1, 194, 159, 202,
+ 160, -1, 194, 159, 160, -1, 194, 157, 159, 202,
+ 160, 158, -1, 194, 157, 159, 160, 158, -1, 194,
+ 40, -1, 194, 41, -1, 194, 228, -1, 194, 201,
+ -1, 194, 25, -1, 168, 3, -1, 168, 5, -1,
+ 168, 4, -1, 168, 6, -1, 11, 26, -1, 11,
+ 27, -1, 169, 9, -1, 165, 152, 200, 38, 194,
+ 153, -1, 115, 152, 200, 239, 153, -1, 129, 152,
+ 200, 149, 200, 149, 200, 153, -1, 163, 152, 200,
+ 149, 200, 153, -1, 164, 152, 200, 149, 200, 153,
+ -1, 88, 166, 152, 200, 149, 200, 153, -1, 89,
+ 167, 152, 200, 149, 200, 153, -1, 131, 152, 200,
+ 149, 200, 153, -1, 132, 152, 200, 149, 200, 149,
+ 200, 153, -1, 133, 152, 200, 149, 200, 149, 200,
+ 153, -1, 202, 149, 200, -1, 200, -1, 32, -1,
+ 33, -1, 37, -1, -1, 196, 228, -1, 121, 152,
+ 205, 38, 194, 153, -1, 207, -1, -1, 208, -1,
+ 207, 208, -1, -1, 31, 209, 224, -1, -1, 30,
+ 210, 225, -1, 58, 57, 214, -1, 172, 18, 194,
+ -1, 172, 18, 10, -1, -1, 174, 178, 204, 203,
+ 200, 211, 191, -1, -1, 174, 176, 178, 204, 203,
+ 200, 212, 191, -1, -1, 174, 177, 178, 204, 203,
+ 194, 213, 191, -1, 174, 178, 35, 181, 205, -1,
+ 51, 215, -1, 54, 148, 216, -1, 22, -1, 52,
+ 148, 22, -1, 66, 148, 22, -1, 154, 217, 156,
+ -1, 217, 149, 22, -1, 22, -1, -1, 218, 149,
+ 194, 184, 171, -1, 194, 184, 171, -1, 218, -1,
+ 218, 149, 39, -1, 39, -1, -1, 182, 196, 173,
+ 152, 219, 153, 186, 190, 187, -1, 28, -1, 159,
+ -1, 180, 178, 220, 221, -1, 29, -1, 160, -1,
+ 231, 223, -1, 179, 178, 220, -1, -1, 59, -1,
+ 3, -1, 4, -1, 9, -1, 26, -1, 27, -1,
+ 40, -1, 41, -1, 25, -1, 157, 202, 158, -1,
+ 201, -1, 57, 226, 22, 149, 22, -1, 7, -1,
+ 8, -1, 170, -1, 173, -1, 228, -1, 227, -1,
+ 194, 229, -1, 231, 232, -1, 222, 232, -1, 233,
+ 172, 234, -1, 233, 236, -1, -1, 21, -1, 67,
+ 230, -1, 67, 10, -1, 68, 17, 229, -1, 68,
+ 11, 229, 149, 17, 229, 149, 17, 229, -1, 69,
+ 168, 229, 149, 17, 229, 154, 235, 156, -1, 69,
+ 168, 229, 149, 17, 229, 154, 156, -1, 70, 182,
+ 196, 229, 152, 238, 153, 186, 38, 17, 229, 71,
+ 17, 229, -1, 71, -1, 72, -1, 235, 168, 227,
+ 149, 17, 229, -1, 168, 227, 149, 17, 229, -1,
+ 172, 241, -1, 194, 154, 229, 149, 229, 156, -1,
+ 237, 149, 154, 229, 149, 229, 156, -1, 194, 229,
+ 184, -1, 17, 229, 184, -1, 238, 149, 194, 229,
+ 184, -1, 238, 149, 17, 229, 184, -1, -1, -1,
+ 239, 149, 230, -1, 56, 55, -1, 55, -1, 163,
+ 194, 229, 149, 229, -1, 164, 194, 229, 149, 229,
+ -1, 88, 166, 194, 229, 149, 229, -1, 89, 167,
+ 194, 229, 149, 229, -1, 165, 230, 38, 194, -1,
+ 129, 230, 149, 230, 149, 230, -1, 130, 230, 149,
+ 194, -1, 131, 230, 149, 230, -1, 132, 230, 149,
+ 230, 149, 230, -1, 133, 230, 149, 230, 149, 230,
+ -1, 128, 237, -1, 240, 182, 196, 229, 152, 238,
+ 153, 186, -1, 243, -1, 36, -1, -1, 110, 194,
+ 188, -1, 110, 194, 149, 11, 229, 188, -1, 111,
+ 194, 188, -1, 111, 194, 149, 11, 229, 188, -1,
+ 112, 230, -1, 242, 113, 194, 229, 188, -1, 242,
+ 114, 230, 149, 194, 229, 188, -1, 115, 194, 229,
+ 239, -1
};
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const yytype_uint16 yyrline[] =
+{
+ 0, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128,
+ 1128, 1129, 1129, 1129, 1129, 1129, 1129, 1130, 1130, 1130,
+ 1130, 1130, 1130, 1131, 1131, 1131, 1131, 1131, 1131, 1134,
+ 1134, 1135, 1135, 1136, 1136, 1137, 1137, 1138, 1138, 1142,
+ 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1146, 1147,
+ 1147, 1148, 1148, 1149, 1150, 1155, 1156, 1156, 1156, 1156,
+ 1156, 1158, 1158, 1158, 1159, 1159, 1163, 1167, 1172, 1172,
+ 1174, 1175, 1180, 1186, 1187, 1188, 1189, 1190, 1194, 1195,
+ 1196, 1200, 1201, 1202, 1203, 1207, 1208, 1209, 1213, 1214,
+ 1215, 1216, 1217, 1221, 1222, 1223, 1226, 1227, 1228, 1229,
+ 1230, 1231, 1232, 1239, 1240, 1241, 1242, 1243, 1244, 1245,
+ 1246, 1247, 1250, 1251, 1256, 1257, 1258, 1259, 1260, 1261,
+ 1264, 1265, 1272, 1273, 1279, 1280, 1288, 1296, 1297, 1302,
+ 1303, 1304, 1309, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ 1325, 1329, 1333, 1340, 1345, 1353, 1383, 1414, 1419, 1431,
+ 1441, 1445, 1455, 1462, 1469, 1476, 1481, 1486, 1493, 1494,
+ 1501, 1508, 1516, 1522, 1534, 1562, 1578, 1605, 1633, 1659,
+ 1679, 1705, 1725, 1737, 1744, 1810, 1820, 1830, 1836, 1846,
+ 1852, 1862, 1867, 1872, 1885, 1897, 1919, 1927, 1933, 1944,
+ 1949, 1954, 1960, 1966, 1975, 1979, 1987, 1987, 1990, 1990,
+ 1993, 2005, 2026, 2031, 2039, 2040, 2044, 2044, 2048, 2048,
+ 2051, 2054, 2078, 2089, 2089, 2100, 2099, 2109, 2108, 2119,
+ 2159, 2162, 2168, 2178, 2182, 2187, 2189, 2194, 2199, 2208,
+ 2218, 2229, 2233, 2242, 2251, 2256, 2377, 2377, 2379, 2388,
+ 2388, 2390, 2395, 2407, 2411, 2416, 2420, 2424, 2428, 2432,
+ 2436, 2440, 2444, 2448, 2473, 2477, 2487, 2491, 2495, 2500,
+ 2507, 2507, 2513, 2522, 2526, 2535, 2544, 2553, 2557, 2564,
+ 2568, 2572, 2577, 2587, 2606, 2615, 2695, 2699, 2706, 2717,
+ 2730, 2740, 2751, 2761, 2770, 2776, 2785, 2791, 2794, 2795,
+ 2802, 2806, 2811, 2827, 2844, 2858, 2872, 2884, 2892, 2899,
+ 2905, 2911, 2917, 2932, 3017, 3022, 3026, 3033, 3040, 3048,
+ 3055, 3063, 3071, 3085, 3102
+};
+#endif
-#define YYLAST 1796
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
+ "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
+ "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
+ "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
+ "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
+ "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
+ "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
+ "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
+ "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
+ "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL",
+ "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK",
+ "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
+ "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB",
+ "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR",
+ "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT",
+ "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT",
+ "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE",
+ "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC",
+ "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR",
+ "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT",
+ "INSERTELEMENT", "SHUFFLEVECTOR", "SIGNEXT", "ZEROEXT", "NORETURN",
+ "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST", "CONST", "PURE",
+ "DEFAULT", "HIDDEN", "PROTECTED", "'='", "','", "'*'", "'\\\\'", "'('",
+ "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept",
+ "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates", "FPredicates",
+ "IntType", "FPType", "LocalName", "OptLocalName", "OptLocalAssign",
+ "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
+ "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
+ "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
+ "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptAlign", "OptCAlign",
+ "SectionString", "OptSection", "GlobalVarAttributes",
+ "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
+ "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
+ "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
+ "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
+ "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
+ "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
+ "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
+ "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
+ "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst",
+ "PHIList", "ParamList", "IndexList", "OptTailCall", "InstVal",
+ "OptVolatile", "MemoryInst", 0
+};
+#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, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
+ 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
+ 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
+ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
+ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
+ 395, 396, 397, 398, 399, 400, 401, 402, 61, 44,
+ 42, 92, 40, 41, 91, 120, 93, 60, 62, 123,
+ 125, 99
+};
+# endif
-static const short yytable[] = { 11,
- 79, 270, 259, 269, 159, 471, 102, 333, 269, 302,
- 88, 162, 271, 381, 437, 11, 161, 13, 91, 348,
- 350, 578, 421, 140, 306, 307, 308, 309, 310, 421,
- 231, 313, 439, 13, 141, 23, 234, 585, 583, 401,
- 402, -200, 108, 20, 109, 83, 260, 84, 422, 106,
- 331, 140, -54, -54, -54, -54, 438, 21, 314, -66,
- 1, 2, 228, 3, 4, 5, 484, 411, 411, 24,
- 499, 6, 7, 132, 438, 235, 236, 106, 417, 464,
- 267, 81, 82, 132, 317, 318, 268, 86, 147, 11,
- 540, 411, 8, 87, 411, 9, 115, 116, 147, 10,
- 416, 319, 320, 475, 321, 322, 25, 323, 324, 325,
- 225, 226, 129, 415, 229, 47, 48, 49, 232, 130,
- 50, 26, 396, 397, 398, 566, 567, 399, 43, 470,
- 44, 411, 395, 431, 396, 397, 398, 548, 412, 399,
- 163, 549, 265, 396, 397, 398, 563, 92, 399, 1,
- 27, 579, 3, 370, 5, 370, 370, 55, 370, 103,
- 586, 587, 56, 375, 494, 300, 301, 265, 303, 59,
- 108, 108, 109, 109, 88, 383, 330, 108, 262, 109,
- 496, 304, 265, 265, 265, 265, 265, 311, 312, 265,
- 548, 370, 57, 521, 552, 522, 108, 132, 109, 370,
- 370, 443, 95, 445, 446, 447, 393, 147, 28, 29,
- 30, 31, 32, 33, 34, 108, 35, 109, 539, 61,
- 62, 237, 238, 239, 240, 96, 406, 407, 408, 409,
- 410, 1, 2, 97, 3, 4, 5, 315, 316, 418,
- 419, 420, 553, 378, 108, 147, 109, 99, 380, 108,
- 512, 109, 2, 143, 144, 4, 376, 100, 259, 36,
- 37, 38, 101, 370, 370, 370, 112, 84, 113, 110,
- 111, 370, 136, 377, 118, 119, 120, 121, 122, 123,
- 137, 370, 370, 160, 221, 223, 224, 227, 147, 394,
- 265, 455, 456, 230, 233, -55, 1, -56, 462, 3,
- 523, 5, 260, 526, 527, 528, -59, -58, -57, 36,
- 37, 38, 241, 269, 263, 332, 351, 339, 340, 341,
- -199, 414, 342, 343, 352, 370, 570, 370, 353, 572,
- 370, 426, 354, 355, 357, 404, 370, 370, -66, 1,
- 2, 384, 3, 4, 5, 500, 501, 502, 503, 385,
- 6, 7, 505, 506, 386, 387, 388, 389, 442, 265,
- 444, 265, 265, 265, 370, 370, 450, 370, 370, 392,
- 403, 8, 405, 370, 9, 429, 564, 454, 10, 463,
- 432, 433, 448, 370, 531, 532, 449, 453, 372, 373,
- 458, 374, 459, 460, 317, 318, 580, 461, 465, 466,
- 467, 468, 469, 472, 370, 370, 473, 474, 476, 477,
- 478, 319, 320, 370, 321, 322, 479, 323, 324, 325,
- 556, 480, 557, 558, 382, 482, 492, 495, 484, 485,
- 487, 488, 390, 391, 489, 438, 493, 497, 498, 543,
- 513, 507, 525, 533, 562, 576, 511, 560, 504, 588,
- 370, 534, 517, 535, 536, 537, 370, 370, 265, 538,
- 544, 265, 265, 265, 545, 550, 517, 589, 554, 555,
- 508, 584, 573, 571, 283, 284, 370, 370, 574, 575,
- 590, 370, 593, 594, 370, 272, 273, 274, 275, 276,
- 277, 278, 279, 280, 281, 596, 434, 435, 436, 599,
- 600, 213, 214, 215, 441, 358, 359, 338, 337, 559,
- 127, 360, 142, 541, 451, 452, 139, 42, 336, 529,
- 126, 94, 569, 457, 328, 0, 0, 361, 362, 363,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 508,
- 0, 0, 364, 365, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 481, 366,
- 483, 0, 0, 486, 0, 0, 0, 0, 0, 490,
- 491, 0, 0, 0, 0, 174, 175, 176, 177, 178,
- 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
- 245, 246, 0, 0, 0, 0, 0, 514, 515, 0,
- 519, 520, 0, 0, 0, 0, 524, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 530, 247, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
- 0, 248, 0, 249, 250, 251, 0, 546, 547, 0,
- 0, 0, 0, 0, 0, 0, 551, 0, 358, 359,
- 0, 0, 61, 62, 360, 0, 0, 367, 0, 0,
- 0, 0, 0, 0, 1, 2, 0, 3, 4, 5,
- 361, 362, 363, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 577, 0, 364, 365, 0, 0, 581,
- 582, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 366, 0, 0, 0, 0, 0, 0, 591,
- 592, 0, 0, 0, 595, 0, 0, 597, 174, 175,
- 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
- 186, 187, 188, 245, 246, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 247, 195, 196, 197, 198, 199, 200, 201, 202, 203,
- 204, 205, 206, 0, 248, 0, 249, 250, 251, 0,
- 0, 0, 358, 359, 0, 0, 61, 62, 360, 0,
- 0, 0, 0, 108, 0, 109, 0, 0, 1, 2,
- 367, 3, 4, 5, 361, 362, 363, 0, 0, 0,
- 0, 61, 62, 0, 0, 0, 0, 0, 0, 364,
- 365, 0, 0, 1, 2, 0, 3, 4, 5, 242,
- 0, 0, 0, 0, 0, 0, 366, 0, 0, 0,
- 0, 0, 0, 0, 243, 244, 0, 0, 0, 0,
- 0, 0, 174, 175, 176, 177, 178, 179, 180, 181,
- 182, 183, 184, 185, 186, 187, 188, 245, 246, 0,
- 0, 0, 0, 0, 0, 0, 0, 174, 175, 176,
- 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
- 187, 188, 245, 246, 247, 195, 196, 197, 198, 199,
- 200, 201, 202, 203, 204, 205, 206, 0, 248, 0,
- 249, 250, 251, 0, 0, 0, 0, 0, 0, 247,
- 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
- 205, 206, 0, 248, 367, 249, 250, 251, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 108, 0, 109, 0, 252, 0, 0, 253,
- 0, 254, 0, 255, 61, 62, 0, 104, 64, 65,
- 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
- 4, 5, 61, 62, 0, 104, 64, 65, 66, 67,
- 68, 69, 70, 0, 1, 2, 0, 3, 4, 5,
- 0, 0, 0, 0, 61, 62, 71, 104, 150, 151,
- 152, 153, 154, 155, 70, 0, 1, 2, 0, 3,
- 4, 5, 61, 62, 71, 104, 150, 151, 152, 153,
- 154, 155, 70, 0, 1, 2, 0, 3, 4, 5,
- 0, 0, 0, 0, 61, 62, 71, 104, 64, 65,
- 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
- 4, 5, 61, 62, 71, 145, 64, 65, 66, 67,
- 68, 69, 70, 0, 1, 2, 131, 3, 4, 5,
- 0, 0, 0, 0, 61, 62, 71, 104, 64, 65,
- 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
- 4, 5, 0, 0, 71, 0, 72, 0, 0, 73,
- 0, 0, 74, 0, 75, 105, 327, 0, 0, 0,
- 0, 0, 0, 0, 72, 0, 71, 73, 0, 0,
- 74, 0, 75, 138, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
- 0, 0, 74, 0, 75, 349, 0, 0, 0, 0,
- 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
- 74, 0, 75, 413, 0, 0, 146, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
- 0, 0, 74, 0, 75, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
- 74, 0, 75, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
- 0, 0, 74, 0, 75, 61, 62, 0, 104, 150,
- 151, 152, 153, 154, 155, 70, 0, 1, 2, 0,
- 3, 4, 5, 61, 62, 0, 104, 64, 65, 66,
- 67, 68, 69, 70, 0, 1, 2, 0, 3, 4,
- 5, 0, 0, 0, 0, 0, 0, 71, 0, 0,
- 0, 0, 0, 0, 0, 425, 0, 0, 0, 0,
- 0, 0, 0, 61, 62, 71, 104, 64, 65, 66,
- 67, 68, 69, 70, 0, 1, 2, 0, 3, 4,
- 5, 61, 62, 0, 63, 64, 65, 66, 67, 68,
- 69, 70, 0, 1, 2, 510, 3, 4, 5, 0,
- 0, 0, 0, 61, 62, 71, 104, 150, 151, 152,
- 153, 154, 155, 70, 0, 1, 2, 0, 3, 4,
- 5, 61, 62, 71, 145, 64, 65, 66, 67, 68,
- 69, 70, 0, 1, 2, 0, 3, 4, 5, 0,
- 0, 0, 0, 0, 0, 71, 0, 72, 0, 0,
- 73, 0, 344, 74, 0, 75, 0, 0, 0, 0,
- 0, 0, 0, 71, 0, 72, 0, 0, 73, 0,
- 0, 74, 0, 75, 61, 62, 0, 104, 64, 65,
- 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
- 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 72, 0, 0, 73, 0,
- 0, 74, 0, 75, 0, 0, 71, 0, 0, 0,
- 0, 0, 0, 72, 0, 0, 73, 0, 0, 74,
- 0, 75, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 72, 0, 0, 73, 0,
- 0, 74, 0, 75, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 72, 0, 0, 73, 0, 0, 74,
- 0, 75, 61, 62, 0, 264, 64, 65, 66, 67,
- 68, 69, 70, 0, 1, 2, 0, 3, 4, 5,
- 61, 62, 0, 104, 150, 151, 152, 153, 154, 155,
- 70, 0, 1, 2, 0, 3, 4, 5, 0, 0,
- 0, 0, 0, 0, 71, 0, 72, 0, 0, 73,
- 0, 0, 74, 0, 75, 0, 0, 0, 0, 0,
- 61, 62, 71, 104, 64, 65, 66, 67, 68, 69,
- 516, 0, 1, 2, 0, 3, 4, 5, 61, 62,
- 0, 104, 64, 65, 66, 67, 68, 69, 568, 0,
- 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
- 0, 0, 71, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
- 74, 0, 75, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 72, 0, 0, 73, 0, 0, 74, 0,
- 347, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 165, 0,
- 0, 0, 72, 0, 0, 73, 0, 0, 74, 0,
- 75, 0, 0, 0, 0, 0, 0, 166, 167, 0,
- 72, 0, 0, 73, 0, 0, 74, 0, 75, 168,
- 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
- 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 191, 192, 193, 0, 0, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
- 207, 208, 209, 210, 211, 212
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 162, 163, 163, 163, 163, 163, 163, 163, 163,
+ 163, 164, 164, 164, 164, 164, 164, 165, 165, 165,
+ 165, 165, 165, 165, 165, 165, 165, 165, 165, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166, 166, 167,
+ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+ 167, 167, 167, 167, 167, 168, 169, 169, 169, 169,
+ 169, 170, 170, 170, 171, 171, 172, 172, 173, 173,
+ 174, 174, 175, 176, 176, 176, 176, 176, 177, 177,
+ 177, 178, 178, 178, 178, 179, 179, 179, 180, 180,
+ 180, 180, 180, 181, 181, 181, 182, 182, 182, 182,
+ 182, 182, 182, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 184, 184, 185, 185, 185, 185, 185, 185,
+ 186, 186, 187, 187, 188, 188, 189, 190, 190, 191,
+ 191, 192, 192, 193, 193, 193, 193, 193, 193, 193,
+ 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
+ 194, 194, 194, 195, 196, 196, 197, 197, 198, 198,
+ 198, 198, 199, 199, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 201, 201, 201, 201, 201, 201,
+ 201, 201, 201, 201, 202, 202, 203, 203, 204, 204,
+ 205, 205, 206, 206, 207, 207, 209, 208, 210, 208,
+ 208, 208, 208, 211, 208, 212, 208, 213, 208, 208,
+ 208, 208, 214, 215, 215, 216, 217, 217, 217, 218,
+ 218, 219, 219, 219, 219, 220, 221, 221, 222, 223,
+ 223, 224, 225, 226, 226, 227, 227, 227, 227, 227,
+ 227, 227, 227, 227, 227, 227, 228, 228, 228, 228,
+ 229, 229, 230, 231, 231, 232, 233, 233, 233, 234,
+ 234, 234, 234, 234, 234, 234, 234, 234, 235, 235,
+ 236, 237, 237, 238, 238, 238, 238, 238, 239, 239,
+ 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
+ 241, 241, 241, 241, 241, 242, 242, 243, 243, 243,
+ 243, 243, 243, 243, 243
};
-static const short yycheck[] = { 0,
- 26, 170, 158, 11, 117, 426, 4, 230, 11, 193,
- 21, 28, 171, 301, 11, 16, 124, 0, 29, 253,
- 254, 564, 34, 147, 208, 209, 210, 211, 212, 34,
- 143, 215, 11, 16, 158, 146, 148, 580, 38, 334,
- 335, 0, 148, 52, 150, 35, 158, 37, 53, 75,
- 156, 147, 3, 4, 5, 6, 53, 66, 217, 18,
- 19, 20, 158, 22, 23, 24, 147, 147, 147, 57,
- 151, 30, 31, 99, 53, 26, 27, 103, 158, 158,
- 11, 39, 40, 109, 117, 118, 17, 45, 114, 90,
- 511, 147, 51, 51, 147, 54, 32, 33, 124, 58,
- 156, 134, 135, 156, 137, 138, 146, 140, 141, 142,
- 136, 137, 147, 347, 140, 42, 43, 44, 144, 154,
- 47, 18, 134, 135, 136, 546, 547, 139, 46, 424,
- 48, 147, 316, 367, 134, 135, 136, 147, 154, 139,
- 157, 151, 168, 134, 135, 136, 154, 158, 139, 19,
- 146, 154, 22, 265, 24, 267, 268, 146, 270, 157,
- 581, 582, 146, 271, 452, 191, 192, 193, 194, 22,
- 148, 148, 150, 150, 21, 152, 154, 148, 161, 150,
- 151, 207, 208, 209, 210, 211, 212, 213, 214, 215,
- 147, 303, 152, 481, 151, 483, 148, 223, 150, 311,
- 312, 385, 22, 387, 388, 389, 314, 233, 42, 43,
- 44, 45, 46, 47, 48, 148, 50, 150, 151, 7,
- 8, 3, 4, 5, 6, 22, 339, 340, 341, 342,
- 343, 19, 20, 22, 22, 23, 24, 113, 114, 352,
- 353, 354, 530, 147, 148, 271, 150, 150, 147, 148,
- 473, 150, 20, 110, 111, 23, 282, 4, 414, 143,
- 144, 145, 4, 375, 376, 377, 42, 37, 44, 81,
- 82, 383, 153, 299, 60, 61, 62, 63, 64, 65,
- 153, 393, 394, 4, 22, 147, 151, 156, 314, 315,
- 316, 404, 405, 151, 150, 9, 19, 9, 411, 22,
- 484, 24, 414, 487, 488, 489, 9, 9, 9, 143,
- 144, 145, 9, 11, 55, 156, 22, 150, 150, 150,
- 0, 347, 150, 150, 150, 437, 549, 439, 150, 552,
- 442, 357, 150, 147, 150, 150, 448, 449, 18, 19,
- 20, 147, 22, 23, 24, 458, 459, 460, 461, 147,
- 30, 31, 465, 466, 147, 147, 147, 147, 152, 385,
- 386, 387, 388, 389, 476, 477, 392, 479, 480, 38,
- 38, 51, 150, 485, 54, 59, 545, 403, 58, 156,
- 147, 147, 147, 495, 497, 498, 147, 147, 267, 268,
- 147, 270, 147, 147, 117, 118, 565, 147, 147, 147,
- 38, 22, 4, 147, 516, 517, 151, 22, 17, 17,
- 150, 134, 135, 525, 137, 138, 147, 140, 141, 142,
- 533, 147, 535, 536, 303, 4, 150, 453, 147, 147,
- 147, 147, 311, 312, 147, 53, 147, 147, 147, 22,
- 147, 467, 147, 147, 17, 4, 472, 53, 156, 17,
- 562, 151, 478, 147, 147, 151, 568, 569, 484, 151,
- 147, 487, 488, 489, 152, 154, 492, 17, 151, 151,
- 471, 147, 151, 154, 26, 27, 588, 589, 151, 151,
- 147, 593, 17, 71, 596, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 17, 375, 376, 377, 0,
- 0, 127, 127, 127, 383, 3, 4, 246, 245, 540,
- 90, 9, 109, 512, 393, 394, 103, 16, 233, 492,
- 87, 54, 548, 406, 223, -1, -1, 25, 26, 27,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 540,
- -1, -1, 40, 41, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 437, 57,
- 439, -1, -1, 442, -1, -1, -1, -1, -1, 448,
- 449, -1, -1, -1, -1, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, -1, -1, -1, -1, -1, 476, 477, -1,
- 479, 480, -1, -1, -1, -1, 485, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 495, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
- -1, 129, -1, 131, 132, 133, -1, 516, 517, -1,
- -1, -1, -1, -1, -1, -1, 525, -1, 3, 4,
- -1, -1, 7, 8, 9, -1, -1, 155, -1, -1,
- -1, -1, -1, -1, 19, 20, -1, 22, 23, 24,
- 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 562, -1, 40, 41, -1, -1, 568,
- 569, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 57, -1, -1, -1, -1, -1, -1, 588,
- 589, -1, -1, -1, 593, -1, -1, 596, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, -1, 129, -1, 131, 132, 133, -1,
- -1, -1, 3, 4, -1, -1, 7, 8, 9, -1,
- -1, -1, -1, 148, -1, 150, -1, -1, 19, 20,
- 155, 22, 23, 24, 25, 26, 27, -1, -1, -1,
- -1, 7, 8, -1, -1, -1, -1, -1, -1, 40,
- 41, -1, -1, 19, 20, -1, 22, 23, 24, 25,
- -1, -1, -1, -1, -1, -1, 57, -1, -1, -1,
- -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
- -1, -1, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
- -1, -1, -1, -1, -1, -1, -1, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, -1, 129, -1,
- 131, 132, 133, -1, -1, -1, -1, -1, -1, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
- 126, 127, -1, 129, 155, 131, 132, 133, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 148, -1, 150, -1, 152, -1, -1, 155,
- -1, 157, -1, 159, 7, 8, -1, 10, 11, 12,
- 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
- 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
- -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
- 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
- 23, 24, 7, 8, 49, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
- -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
- 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
- 23, 24, 7, 8, 49, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, 39, 22, 23, 24,
- -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
- 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
- 23, 24, -1, -1, 49, -1, 149, -1, -1, 152,
- -1, -1, 155, -1, 157, 158, 39, -1, -1, -1,
- -1, -1, -1, -1, 149, -1, 49, 152, -1, -1,
- 155, -1, 157, 158, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
- -1, -1, 155, -1, 157, 158, -1, -1, -1, -1,
- -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
- 155, -1, 157, 158, -1, -1, 121, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
- -1, -1, 155, -1, 157, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
- 155, -1, 157, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
- -1, -1, 155, -1, 157, 7, 8, -1, 10, 11,
- 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
- 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, -1, -1, -1, -1, -1, -1, 49, -1, -1,
- -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
- -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
- 16, 17, -1, 19, 20, 39, 22, 23, 24, -1,
- -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, 7, 8, 49, 10, 11, 12, 13, 14, 15,
- 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
- -1, -1, -1, -1, -1, 49, -1, 149, -1, -1,
- 152, -1, 154, 155, -1, 157, -1, -1, -1, -1,
- -1, -1, -1, 49, -1, 149, -1, -1, 152, -1,
- -1, 155, -1, 157, 7, 8, -1, 10, 11, 12,
- 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
- 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 149, -1, -1, 152, -1,
- -1, 155, -1, 157, -1, -1, 49, -1, -1, -1,
- -1, -1, -1, 149, -1, -1, 152, -1, -1, 155,
- -1, 157, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 149, -1, -1, 152, -1,
- -1, 155, -1, 157, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 149, -1, -1, 152, -1, -1, 155,
- -1, 157, 7, 8, -1, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
- 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
- 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
- -1, -1, -1, -1, 49, -1, 149, -1, -1, 152,
- -1, -1, 155, -1, 157, -1, -1, -1, -1, -1,
- 7, 8, 49, 10, 11, 12, 13, 14, 15, 16,
- 17, -1, 19, 20, -1, 22, 23, 24, 7, 8,
- -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
- 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
- -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 49, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
- 155, -1, 157, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 149, -1, -1, 152, -1, -1, 155, -1,
- 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 36, -1,
- -1, -1, 149, -1, -1, 152, -1, -1, 155, -1,
- 157, -1, -1, -1, -1, -1, -1, 55, 56, -1,
- 149, -1, -1, 152, -1, -1, 155, -1, 157, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 110, 111, 112, -1, -1, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
- 128, 129, 130, 131, 132, 133
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 0, 2, 0, 1, 1,
+ 1, 0, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 1, 1, 0, 1, 1, 0, 1,
+ 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 2, 1, 1, 1, 1, 1, 1,
+ 0, 2, 0, 2, 0, 3, 2, 0, 1, 0,
+ 3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 1, 2, 5, 5, 5, 5, 3,
+ 2, 5, 4, 2, 1, 1, 1, 3, 1, 3,
+ 1, 0, 1, 3, 4, 3, 3, 4, 4, 3,
+ 6, 5, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 6, 5, 8, 6, 6, 7,
+ 7, 6, 8, 8, 3, 1, 1, 1, 1, 0,
+ 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
+ 3, 3, 3, 0, 7, 0, 8, 0, 8, 5,
+ 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
+ 3, 1, 3, 1, 0, 9, 1, 1, 4, 1,
+ 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 3, 1, 5, 1, 1, 1, 1,
+ 1, 1, 2, 2, 2, 3, 2, 0, 1, 2,
+ 2, 3, 9, 9, 8, 14, 1, 1, 6, 5,
+ 2, 6, 7, 3, 3, 5, 5, 0, 0, 3,
+ 2, 1, 5, 5, 6, 6, 4, 6, 4, 4,
+ 6, 6, 2, 8, 1, 1, 0, 3, 6, 3,
+ 6, 2, 5, 7, 4
};
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/bison.simple"
-/* This file comes from bison-1.28. */
-/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const yytype_uint16 yydefact[] =
+{
+ 71, 61, 68, 62, 69, 63, 208, 206, 0, 0,
+ 0, 0, 0, 0, 81, 70, 0, 71, 204, 85,
+ 88, 0, 0, 220, 0, 0, 66, 0, 72, 73,
+ 75, 74, 76, 78, 77, 79, 80, 82, 83, 84,
+ 81, 81, 199, 1, 205, 86, 87, 81, 209, 89,
+ 90, 91, 92, 81, 267, 207, 267, 0, 0, 228,
+ 221, 222, 210, 256, 257, 212, 133, 134, 135, 138,
+ 137, 136, 139, 140, 0, 0, 0, 0, 258, 259,
+ 141, 211, 143, 199, 199, 93, 198, 0, 96, 96,
+ 268, 264, 67, 239, 240, 241, 263, 223, 224, 227,
+ 0, 161, 144, 0, 0, 0, 0, 150, 162, 0,
+ 142, 161, 0, 0, 95, 94, 0, 196, 197, 0,
+ 0, 97, 98, 99, 100, 101, 0, 242, 0, 306,
+ 266, 0, 225, 160, 112, 156, 158, 0, 0, 0,
+ 0, 0, 0, 149, 0, 0, 0, 155, 0, 154,
+ 0, 219, 133, 134, 135, 138, 137, 136, 0, 0,
+ 0, 213, 102, 0, 236, 237, 238, 305, 291, 0,
+ 0, 0, 0, 96, 276, 277, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 14, 15, 16, 11, 12,
+ 13, 0, 0, 0, 0, 0, 0, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 265, 96,
+ 280, 0, 304, 226, 153, 0, 120, 0, 0, 152,
+ 0, 163, 120, 215, 217, 0, 200, 181, 182, 177,
+ 179, 178, 180, 183, 176, 172, 173, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 175, 174, 129, 0, 290, 270, 0, 269, 0,
+ 0, 55, 0, 0, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 0, 53, 54, 49, 50, 51,
+ 52, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 0, 124, 124, 311, 0, 0, 302, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 104,
+ 106, 105, 103, 107, 108, 109, 110, 111, 113, 159,
+ 157, 146, 147, 148, 151, 145, 129, 129, 0, 0,
+ 0, 0, 0, 0, 0, 0, 165, 195, 0, 0,
+ 0, 169, 0, 166, 0, 0, 0, 0, 214, 234,
+ 245, 246, 247, 252, 248, 249, 250, 251, 243, 0,
+ 254, 261, 260, 262, 0, 271, 0, 0, 0, 0,
+ 0, 307, 0, 309, 288, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 117, 116,
+ 114, 115, 119, 118, 121, 216, 218, 0, 0, 0,
+ 288, 0, 0, 0, 0, 0, 164, 150, 162, 0,
+ 167, 168, 0, 0, 0, 0, 0, 131, 129, 233,
+ 112, 231, 0, 244, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 314, 0, 0, 0, 298, 299,
+ 0, 0, 0, 0, 296, 0, 124, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 194, 171, 0, 0,
+ 0, 0, 126, 132, 130, 65, 0, 120, 0, 253,
+ 0, 0, 287, 0, 0, 124, 125, 124, 0, 0,
+ 0, 0, 0, 0, 292, 293, 287, 0, 312, 0,
+ 201, 0, 0, 185, 0, 0, 0, 0, 170, 0,
+ 0, 0, 64, 230, 232, 112, 127, 0, 0, 0,
+ 139, 0, 0, 294, 295, 308, 310, 289, 0, 0,
+ 297, 300, 301, 0, 124, 0, 0, 0, 191, 0,
+ 0, 187, 188, 184, 65, 128, 122, 255, 0, 0,
+ 112, 112, 0, 120, 281, 0, 120, 313, 189, 190,
+ 0, 0, 0, 229, 0, 235, 0, 274, 0, 0,
+ 284, 283, 139, 0, 0, 282, 303, 186, 192, 193,
+ 123, 272, 0, 273, 0, 112, 112, 0, 0, 0,
+ 286, 285, 0, 0, 0, 0, 279, 0, 0, 278,
+ 0, 275
+};
- 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.
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
+{
+ -1, 258, 259, 260, 284, 301, 158, 159, 78, 513,
+ 12, 79, 14, 15, 40, 41, 42, 47, 53, 116,
+ 126, 328, 224, 404, 331, 565, 381, 427, 546, 358,
+ 428, 80, 160, 135, 150, 136, 137, 109, 347, 370,
+ 348, 119, 87, 151, 16, 17, 18, 20, 19, 263,
+ 336, 337, 62, 23, 60, 100, 431, 432, 127, 166,
+ 54, 95, 55, 48, 434, 371, 82, 373, 268, 56,
+ 91, 92, 218, 569, 130, 307, 522, 444, 219, 220,
+ 221, 222
+};
- 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.
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -549
+static const yytype_int16 yypact[] =
+{
+ 322, -549, -549, -549, -549, -549, -549, -549, -18, -120,
+ 6, -117, 62, -60, 224, -549, 111, 464, -549, 103,
+ 184, -12, -7, -549, 21, 133, -549, 1309, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, -549, -549,
+ 140, 140, 211, -549, -549, -549, -549, 140, -549, -549,
+ -549, -549, -549, 140, 139, -549, -14, 157, 174, 182,
+ -549, -549, -549, -549, -549, 60, -549, -549, -549, -549,
+ -549, -549, -549, -549, 215, 233, 2, 526, -549, -549,
+ -549, 150, -549, 178, 178, 269, -549, 14, 274, 274,
+ -549, -549, 134, -549, -549, -549, -549, -549, -549, -549,
+ -23, 54, -549, 97, 105, 993, 60, -549, 150, -125,
+ -549, 54, 14, 14, -549, -549, 1093, -549, -549, 1340,
+ 260, -549, -549, -549, -549, -549, 1358, -549, -17, 1584,
+ -549, 251, -549, -549, 150, -549, 128, 146, 1380, 1380,
+ 145, -106, 1380, -549, 151, 1340, 1380, 60, 155, 150,
+ 231, -549, 101, 303, 305, 308, 312, 315, 229, 320,
+ 808, -549, -549, 187, -549, -549, -549, -549, -549, 275,
+ 1423, 85, 321, 274, -549, -549, -549, -549, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, -549, -549,
+ -549, 461, 481, 1380, 1380, 1380, 1380, -549, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, -549, 1380,
+ 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, -549, 274,
+ -549, 110, -549, -549, -85, 1116, -549, -2, -33, -549,
+ 173, 150, -549, -549, 150, 1093, -549, -549, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, 461, 481, 191,
+ 198, 199, 203, 204, 1156, 1534, 1033, 335, 206, 207,
+ 208, -549, -549, 217, 223, -549, 60, 649, -549, 785,
+ 785, -549, 785, 1358, -549, -549, -549, -549, -549, -549,
+ -549, -549, -549, -549, 1380, -549, -549, -549, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, -549, -549,
+ -549, 1380, 107, 113, -549, 649, 26, 218, 236, 237,
+ 238, 239, 240, 649, 649, 340, 1358, 1380, 1380, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, -549, -549,
+ -549, 162, -549, -549, -549, 162, 217, 217, 344, 242,
+ 243, 1340, 1340, 1340, 1340, 1340, -549, -549, -9, 1073,
+ -50, -549, -63, -549, 1340, 1340, 1340, -11, -549, 1187,
+ -549, -549, -549, -549, -549, -549, -549, -549, 333, 1340,
+ -549, -549, -549, -549, 247, -549, 248, 785, 649, 649,
+ 7, -549, 34, -549, -549, 785, 244, 1380, 1380, 1380,
+ 1380, 1380, 256, 257, 1380, 785, 649, 258, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, 1380, 1340, 1340,
+ -549, 261, 264, 267, 268, 1340, -549, 263, 808, -51,
+ -549, -549, 270, 273, 362, 396, 419, -549, 217, -549,
+ 150, 276, 271, -549, 405, -48, 411, 412, 280, 284,
+ 287, 785, 433, 785, 289, 290, 785, 293, 150, -549,
+ 294, 295, 785, 785, 150, 296, 297, 1380, 90, 298,
+ 300, 13, 1340, 1340, 1340, 1340, -549, -549, 299, 1340,
+ 1340, 1380, -549, -549, -549, -3, 1269, -549, 304, -549,
+ 785, 785, 1577, 785, 785, 297, -549, 297, 1380, 785,
+ 306, 1380, 1380, 1380, -549, -549, 1577, 401, -549, 649,
+ -549, 1340, 1340, -549, 309, 310, 319, 323, -549, 316,
+ 318, 126, -549, -549, -549, 150, 38, 437, 324, 307,
+ 785, 649, 44, -549, -549, -549, -549, -549, 325, 785,
+ -549, -549, -549, 53, 297, 327, 332, 1340, -549, 1340,
+ 1340, -549, -549, -549, -3, -549, 421, -549, 460, 1,
+ -549, -549, 1595, -549, -549, 334, -549, -549, -549, -549,
+ 336, 338, 339, -549, 489, -549, 785, -549, 945, 3,
+ -85, -85, 785, 649, 86, -549, 162, -549, -549, -549,
+ -549, -549, 347, -549, 945, -549, -549, 484, 485, 356,
+ -85, -85, 785, 785, 492, 439, -549, 785, 494, -549,
+ 785, -549
+};
- 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. */
+/* YYPGOTO[NTERM-NUM]. */
+static const yytype_int16 yypgoto[] =
+{
+ -549, 383, 384, 385, 272, 277, -170, -549, 0, -24,
+ 429, 8, -549, -549, -549, -549, 42, -549, -549, -549,
+ -160, -549, -421, -549, -228, -549, -293, 11, -549, -310,
+ -549, -549, -26, 341, -121, -549, 418, 425, -61, -157,
+ -226, 9, 205, 326, -549, -549, 515, -549, -549, -549,
+ -549, -549, -549, -549, -549, -549, -549, -549, 446, -549,
+ -549, -549, -549, -549, -549, -548, -69, 121, -173, -549,
+ 491, -549, -549, -549, -549, -549, 67, 158, -549, -549,
+ -549, -549
+};
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C. */
-/* This used to test MSDOS, but that is a bad idea
- since that symbol is in the user namespace. */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
- instead, just don't use alloca. */
-#include
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
- So I turned it off. rms, 2 May 1997. */
-/* #include */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up,
- and on HPUX 10. Eventually we can turn this on. */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -204
+static const yytype_int16 yytable[] =
+{
+ 11, 81, 272, 261, 335, 163, 104, 90, 13, 475,
+ 383, 164, 271, 273, 271, 93, 1, 11, 441, 3,
+ 582, 5, 304, 425, 142, 13, 405, 406, 24, 350,
+ 352, 26, 319, 320, 21, 143, 589, 308, 309, 310,
+ 311, 312, 426, 142, 315, 443, 117, 118, 22, 321,
+ 322, 108, 323, 324, 230, 325, 326, 327, 161, 316,
+ 442, 63, 64, 25, 106, 66, 67, 68, 69, 70,
+ 71, 72, 425, 1, 2, 134, 3, 4, 5, 108,
+ 27, 236, 83, 84, 233, 134, 415, 442, 28, 88,
+ 149, 262, 11, 133, 544, 89, 269, 421, 415, 415,
+ 149, 415, 270, 73, -55, -55, -55, -55, 420, 468,
+ 479, 43, 227, 228, 319, 320, 231, 110, 474, 111,
+ 234, 145, 146, 419, 587, 333, 131, 237, 238, 570,
+ 571, 321, 322, 132, 323, 324, 57, 325, 326, 327,
+ 415, 58, 165, 435, 267, 397, 94, 416, 110, 45,
+ 111, 46, 377, 1, 332, 61, 3, 567, 5, 583,
+ 90, 105, 488, 498, 590, 591, 503, 302, 303, 267,
+ 305, 264, 398, 399, 400, 59, 110, 401, 111, 97,
+ 385, 402, 403, 306, 267, 267, 267, 267, 267, 313,
+ 314, 267, 525, 552, 526, 395, 98, 553, 372, 134,
+ 372, 372, 552, 372, 99, 74, 556, 2, 75, 149,
+ 4, 76, 101, 77, 447, 86, 449, 450, 451, 102,
+ 398, 399, 400, 317, 318, 401, 49, 50, 51, 402,
+ 403, 52, 239, 240, 241, 242, 372, 103, 63, 64,
+ 110, 557, 111, 500, 372, 372, 85, 149, 86, 516,
+ 1, 2, 138, 3, 4, 5, 380, 110, 378, 111,
+ 139, 261, 382, 110, 162, 111, 29, 30, 31, 32,
+ 33, 34, 35, 223, 36, 379, 110, 225, 111, 543,
+ 410, 411, 412, 413, 414, 37, 38, 39, 112, 113,
+ 149, 396, 267, 422, 423, 424, 398, 399, 400, 226,
+ 110, 401, 111, 229, 232, 402, 403, 235, 372, 372,
+ 372, 114, -56, 115, -57, 527, 372, -60, 530, 531,
+ 532, -59, -203, 418, -58, 574, 372, 372, 576, 243,
+ 265, 334, 271, 430, 120, 121, 122, 123, 124, 125,
+ -67, 1, 2, 341, 3, 4, 5, 459, 460, 262,
+ 342, 343, 6, 7, 466, 344, 345, 353, 354, 355,
+ 356, 267, 448, 267, 267, 267, 357, 386, 454, 37,
+ 38, 39, 372, 8, 372, 359, 9, 372, 394, 568,
+ 10, 458, 407, 372, 372, 387, 388, 389, 390, 391,
+ 374, 375, 433, 376, 408, 409, 436, 437, 446, 584,
+ 471, 504, 505, 506, 507, 452, 453, 457, 509, 510,
+ 462, 372, 372, 463, 372, 372, 464, 465, 472, 469,
+ 372, 467, 470, 473, 477, 476, 384, 478, 480, 481,
+ 372, 499, 482, 483, 392, 393, 484, 486, 488, 489,
+ 535, 536, 491, 492, 493, 511, 497, 501, 496, 502,
+ 515, 372, 372, 517, 442, 529, 521, 508, 537, 547,
+ 372, 549, 267, 538, -202, 267, 267, 267, 539, 541,
+ 521, 542, 540, 548, 564, 512, 560, 566, 561, 562,
+ 558, 554, -67, 1, 2, 559, 3, 4, 5, 577,
+ 575, 578, 579, 580, 6, 7, 588, 372, 438, 439,
+ 440, 592, 593, 372, 372, 594, 445, 285, 286, 597,
+ 598, 600, 215, 216, 217, 8, 455, 456, 9, 339,
+ 563, 129, 10, 372, 372, 340, 573, 545, 372, 144,
+ 141, 372, 44, 63, 64, 128, 106, 66, 67, 68,
+ 69, 70, 71, 72, 512, 1, 2, 96, 3, 4,
+ 5, 274, 275, 276, 277, 278, 279, 280, 281, 282,
+ 283, 338, 485, 533, 487, 0, 330, 490, 461, 0,
+ 0, 0, 0, 494, 495, 73, 0, 287, 288, 289,
+ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
+ 300, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 518, 519, 0, 523, 524, 0, 0, 0, 0,
+ 528, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 534, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 550, 551, 0, 0, 0, 0, 0, 0, 0,
+ 555, 0, 360, 361, 0, 0, 63, 64, 362, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
+ 0, 3, 4, 5, 363, 364, 365, 74, 0, 0,
+ 75, 0, 0, 76, 0, 77, 107, 581, 0, 366,
+ 367, 0, 0, 585, 586, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 368, 0, 0, 0,
+ 0, 0, 0, 595, 596, 0, 0, 0, 599, 0,
+ 0, 601, 176, 177, 178, 179, 180, 181, 182, 183,
+ 184, 185, 186, 187, 188, 189, 190, 247, 248, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 249, 197, 198, 199, 200, 201,
+ 202, 203, 204, 205, 206, 207, 208, 0, 250, 0,
+ 251, 252, 253, 0, 0, 0, 0, 0, 360, 361,
+ 0, 0, 63, 64, 362, 0, 0, 0, 0, 110,
+ 0, 111, 0, 0, 1, 2, 369, 3, 4, 5,
+ 363, 364, 365, 0, 0, 63, 64, 0, 0, 0,
+ 0, 0, 0, 0, 0, 366, 367, 1, 2, 0,
+ 3, 4, 5, 244, 0, 0, 0, 0, 0, 0,
+ 0, 0, 368, 0, 0, 0, 0, 0, 245, 246,
+ 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
+ 188, 189, 190, 247, 248, 0, 0, 0, 0, 0,
+ 0, 176, 177, 178, 179, 180, 181, 182, 183, 184,
+ 185, 186, 187, 188, 189, 190, 247, 248, 0, 0,
+ 249, 197, 198, 199, 200, 201, 202, 203, 204, 205,
+ 206, 207, 208, 0, 250, 0, 251, 252, 253, 0,
+ 0, 0, 0, 249, 197, 198, 199, 200, 201, 202,
+ 203, 204, 205, 206, 207, 208, 0, 250, 0, 251,
+ 252, 253, 369, 0, 0, 0, 0, 0, 360, 361,
+ 0, 0, 0, 0, 362, 0, 0, 0, 110, 0,
+ 111, 0, 254, 0, 0, 255, 0, 256, 0, 257,
+ 363, 364, 365, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 366, 367, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 63, 64, 368, 106, 66, 67, 68, 69, 70, 71,
+ 72, 0, 1, 2, 0, 3, 4, 5, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
+ 188, 189, 190, 247, 248, 0, 0, 0, 0, 0,
+ 63, 64, 73, 106, 152, 153, 154, 155, 156, 157,
+ 72, 0, 1, 2, 0, 3, 4, 5, 0, 0,
+ 249, 197, 198, 199, 200, 201, 202, 203, 204, 205,
+ 206, 207, 208, 0, 250, 0, 251, 252, 253, 0,
+ 63, 64, 73, 106, 152, 153, 154, 155, 156, 157,
+ 72, 0, 1, 2, 0, 3, 4, 5, 0, 0,
+ 63, 64, 369, 147, 66, 67, 68, 69, 70, 71,
+ 72, 0, 1, 2, 0, 3, 4, 5, 0, 0,
+ 0, 0, 73, 63, 64, 0, 106, 66, 67, 68,
+ 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
+ 5, 0, 73, 0, 74, 0, 0, 75, 0, 0,
+ 76, 0, 77, 140, 0, 329, 0, 0, 0, 0,
+ 0, 0, 0, 63, 64, 73, 106, 152, 153, 154,
+ 155, 156, 157, 72, 0, 1, 2, 0, 3, 4,
+ 5, 0, 0, 0, 74, 0, 0, 75, 0, 0,
+ 76, 0, 77, 351, 63, 64, 0, 106, 66, 67,
+ 68, 69, 70, 71, 72, 73, 1, 2, 0, 3,
+ 4, 5, 0, 0, 148, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 74, 0, 429, 75, 0, 0,
+ 76, 0, 77, 417, 0, 0, 73, 0, 0, 0,
+ 0, 0, 0, 0, 74, 0, 0, 75, 0, 0,
+ 76, 0, 77, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
+ 75, 0, 0, 76, 0, 77, 63, 64, 0, 106,
+ 66, 67, 68, 69, 70, 71, 72, 0, 1, 2,
+ 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 74, 514, 0,
+ 75, 0, 346, 76, 0, 77, 63, 64, 73, 65,
+ 66, 67, 68, 69, 70, 71, 72, 0, 1, 2,
+ 0, 3, 4, 5, 0, 0, 0, 0, 74, 0,
+ 0, 75, 0, 0, 76, 0, 77, 63, 64, 0,
+ 106, 152, 153, 154, 155, 156, 157, 72, 73, 1,
+ 2, 0, 3, 4, 5, 63, 64, 0, 147, 66,
+ 67, 68, 69, 70, 71, 72, 0, 1, 2, 0,
+ 3, 4, 5, 0, 0, 0, 0, 63, 64, 73,
+ 106, 66, 67, 68, 69, 70, 71, 72, 0, 1,
+ 2, 0, 3, 4, 5, 0, 0, 73, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 74, 0, 0, 75, 0, 0, 76, 0, 77, 73,
+ 63, 64, 0, 266, 66, 67, 68, 69, 70, 71,
+ 72, 0, 1, 2, 0, 3, 4, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 74, 0, 0, 75, 0, 0, 76, 0, 77, 0,
+ 0, 0, 73, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 74, 0, 0, 75, 0, 0, 76, 0, 77,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 74,
+ 0, 0, 75, 0, 0, 76, 0, 77, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 74, 0, 0, 75, 0, 0, 76, 0, 77,
+ 0, 63, 64, 0, 106, 152, 153, 154, 155, 156,
+ 157, 72, 0, 1, 2, 0, 3, 4, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 74, 0, 0, 75, 0, 0,
+ 76, 0, 77, 73, 63, 64, 0, 106, 66, 67,
+ 68, 69, 70, 71, 520, 0, 1, 2, 0, 3,
+ 4, 5, 63, 64, 0, 106, 66, 67, 68, 69,
+ 70, 71, 572, 0, 1, 2, 0, 3, 4, 5,
+ 167, 0, 0, 0, 0, 0, 73, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 168,
+ 169, 0, 0, 0, 73, 0, 0, 0, 0, 0,
+ 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+ 189, 190, 191, 192, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 74, 0, 0, 75, 0,
+ 0, 76, 0, 349, 193, 194, 195, 0, 0, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
+ 207, 208, 209, 210, 211, 212, 213, 214, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
+ 0, 75, 0, 0, 76, 0, 77, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 74, 0, 0, 75,
+ 0, 0, 76, 0, 77
+};
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
+static const yytype_int16 yycheck[] =
+{
+ 0, 27, 172, 160, 232, 126, 4, 21, 0, 430,
+ 303, 28, 11, 173, 11, 29, 19, 17, 11, 22,
+ 568, 24, 195, 34, 149, 17, 336, 337, 148, 255,
+ 256, 148, 117, 118, 52, 160, 584, 210, 211, 212,
+ 213, 214, 53, 149, 217, 11, 32, 33, 66, 134,
+ 135, 77, 137, 138, 160, 140, 141, 142, 119, 219,
+ 53, 7, 8, 57, 10, 11, 12, 13, 14, 15,
+ 16, 17, 34, 19, 20, 101, 22, 23, 24, 105,
+ 18, 150, 40, 41, 145, 111, 149, 53, 148, 47,
+ 116, 160, 92, 39, 515, 53, 11, 160, 149, 149,
+ 126, 149, 17, 49, 3, 4, 5, 6, 158, 160,
+ 158, 0, 138, 139, 117, 118, 142, 150, 428, 152,
+ 146, 112, 113, 349, 38, 158, 149, 26, 27, 550,
+ 551, 134, 135, 156, 137, 138, 148, 140, 141, 142,
+ 149, 148, 159, 369, 170, 318, 160, 156, 150, 46,
+ 152, 48, 273, 19, 156, 22, 22, 156, 24, 156,
+ 21, 159, 149, 456, 585, 586, 153, 193, 194, 195,
+ 196, 163, 134, 135, 136, 154, 150, 139, 152, 22,
+ 154, 143, 144, 209, 210, 211, 212, 213, 214, 215,
+ 216, 217, 485, 149, 487, 316, 22, 153, 267, 225,
+ 269, 270, 149, 272, 22, 151, 153, 20, 154, 235,
+ 23, 157, 152, 159, 387, 37, 389, 390, 391, 4,
+ 134, 135, 136, 113, 114, 139, 42, 43, 44, 143,
+ 144, 47, 3, 4, 5, 6, 305, 4, 7, 8,
+ 150, 534, 152, 153, 313, 314, 35, 273, 37, 477,
+ 19, 20, 155, 22, 23, 24, 149, 150, 284, 152,
+ 155, 418, 149, 150, 4, 152, 42, 43, 44, 45,
+ 46, 47, 48, 22, 50, 301, 150, 149, 152, 153,
+ 341, 342, 343, 344, 345, 145, 146, 147, 83, 84,
+ 316, 317, 318, 354, 355, 356, 134, 135, 136, 153,
+ 150, 139, 152, 158, 153, 143, 144, 152, 377, 378,
+ 379, 42, 9, 44, 9, 488, 385, 9, 491, 492,
+ 493, 9, 0, 349, 9, 553, 395, 396, 556, 9,
+ 55, 158, 11, 359, 60, 61, 62, 63, 64, 65,
+ 18, 19, 20, 152, 22, 23, 24, 408, 409, 418,
+ 152, 152, 30, 31, 415, 152, 152, 22, 152, 152,
+ 152, 387, 388, 389, 390, 391, 149, 149, 394, 145,
+ 146, 147, 441, 51, 443, 152, 54, 446, 38, 549,
+ 58, 407, 38, 452, 453, 149, 149, 149, 149, 149,
+ 269, 270, 59, 272, 152, 152, 149, 149, 154, 569,
+ 38, 462, 463, 464, 465, 149, 149, 149, 469, 470,
+ 149, 480, 481, 149, 483, 484, 149, 149, 22, 149,
+ 489, 158, 149, 4, 153, 149, 305, 22, 17, 17,
+ 499, 457, 152, 149, 313, 314, 149, 4, 149, 149,
+ 501, 502, 149, 149, 149, 471, 149, 149, 152, 149,
+ 476, 520, 521, 149, 53, 149, 482, 158, 149, 22,
+ 529, 154, 488, 153, 0, 491, 492, 493, 149, 153,
+ 496, 153, 149, 149, 53, 475, 537, 17, 539, 540,
+ 153, 156, 18, 19, 20, 153, 22, 23, 24, 153,
+ 156, 153, 153, 4, 30, 31, 149, 566, 377, 378,
+ 379, 17, 17, 572, 573, 149, 385, 26, 27, 17,
+ 71, 17, 129, 129, 129, 51, 395, 396, 54, 247,
+ 544, 92, 58, 592, 593, 248, 552, 516, 597, 111,
+ 105, 600, 17, 7, 8, 89, 10, 11, 12, 13,
+ 14, 15, 16, 17, 544, 19, 20, 56, 22, 23,
+ 24, 90, 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 235, 441, 496, 443, -1, 225, 446, 410, -1,
+ -1, -1, -1, 452, 453, 49, -1, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 480, 481, -1, 483, 484, -1, -1, -1, -1,
+ 489, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 499, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 520, 521, -1, -1, -1, -1, -1, -1, -1,
+ 529, -1, 3, 4, -1, -1, 7, 8, 9, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
+ -1, 22, 23, 24, 25, 26, 27, 151, -1, -1,
+ 154, -1, -1, 157, -1, 159, 160, 566, -1, 40,
+ 41, -1, -1, 572, 573, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 57, -1, -1, -1,
+ -1, -1, -1, 592, 593, -1, -1, -1, 597, -1,
+ -1, 600, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 126, 127, -1, 129, -1,
+ 131, 132, 133, -1, -1, -1, -1, -1, 3, 4,
+ -1, -1, 7, 8, 9, -1, -1, -1, -1, 150,
+ -1, 152, -1, -1, 19, 20, 157, 22, 23, 24,
+ 25, 26, 27, -1, -1, 7, 8, -1, -1, -1,
+ -1, -1, -1, -1, -1, 40, 41, 19, 20, -1,
+ 22, 23, 24, 25, -1, -1, -1, -1, -1, -1,
+ -1, -1, 57, -1, -1, -1, -1, -1, 40, 41,
+ -1, -1, -1, -1, -1, -1, -1, -1, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, -1, -1, -1, -1, -1,
+ -1, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, -1, 129, -1, 131, 132, 133, -1,
+ -1, -1, -1, 115, 116, 117, 118, 119, 120, 121,
+ 122, 123, 124, 125, 126, 127, -1, 129, -1, 131,
+ 132, 133, 157, -1, -1, -1, -1, -1, 3, 4,
+ -1, -1, -1, -1, 9, -1, -1, -1, 150, -1,
+ 152, -1, 154, -1, -1, 157, -1, 159, -1, 161,
+ 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 7, 8, 57, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, -1, -1, -1, -1, -1,
+ 7, 8, 49, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, -1, 129, -1, 131, 132, 133, -1,
+ 7, 8, 49, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
+ 7, 8, 157, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
+ -1, -1, 49, 7, 8, -1, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
+ 24, -1, 49, -1, 151, -1, -1, 154, -1, -1,
+ 157, -1, 159, 160, -1, 39, -1, -1, -1, -1,
+ -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
+ 24, -1, -1, -1, 151, -1, -1, 154, -1, -1,
+ 157, -1, 159, 160, 7, 8, -1, 10, 11, 12,
+ 13, 14, 15, 16, 17, 49, 19, 20, -1, 22,
+ 23, 24, -1, -1, 121, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 151, -1, 39, 154, -1, -1,
+ 157, -1, 159, 160, -1, -1, 49, -1, -1, -1,
+ -1, -1, -1, -1, 151, -1, -1, 154, -1, -1,
+ 157, -1, 159, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 151, -1, -1,
+ 154, -1, -1, 157, -1, 159, 7, 8, -1, 10,
+ 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
+ -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 151, 39, -1,
+ 154, -1, 156, 157, -1, 159, 7, 8, 49, 10,
+ 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
+ -1, 22, 23, 24, -1, -1, -1, -1, 151, -1,
+ -1, 154, -1, -1, 157, -1, 159, 7, 8, -1,
+ 10, 11, 12, 13, 14, 15, 16, 17, 49, 19,
+ 20, -1, 22, 23, 24, 7, 8, -1, 10, 11,
+ 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
+ 22, 23, 24, -1, -1, -1, -1, 7, 8, 49,
+ 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
+ 20, -1, 22, 23, 24, -1, -1, 49, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 151, -1, -1, 154, -1, -1, 157, -1, 159, 49,
+ 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 151, -1, -1, 154, -1, -1, 157, -1, 159, -1,
+ -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 151, -1, -1, 154, -1, -1, 157, -1, 159,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 151,
+ -1, -1, 154, -1, -1, 157, -1, 159, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 151, -1, -1, 154, -1, -1, 157, -1, 159,
+ -1, 7, 8, -1, 10, 11, 12, 13, 14, 15,
+ 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 151, -1, -1, 154, -1, -1,
+ 157, -1, 159, 49, 7, 8, -1, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
+ 36, -1, -1, -1, -1, -1, 49, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 55,
+ 56, -1, -1, -1, 49, -1, -1, -1, -1, -1,
+ -1, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 151, -1, -1, 154, -1,
+ -1, 157, -1, 159, 110, 111, 112, -1, -1, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 126, 127, 128, 129, 130, 131, 132, 133, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 151, -1,
+ -1, 154, -1, -1, 157, -1, 159, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 151, -1, -1, 154,
+ -1, -1, 157, -1, 159
+};
-/* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const yytype_uint8 yystos[] =
+{
+ 0, 19, 20, 22, 23, 24, 30, 31, 51, 54,
+ 58, 170, 172, 173, 174, 175, 206, 207, 208, 210,
+ 209, 52, 66, 215, 148, 57, 148, 18, 148, 42,
+ 43, 44, 45, 46, 47, 48, 50, 145, 146, 147,
+ 176, 177, 178, 0, 208, 46, 48, 179, 225, 42,
+ 43, 44, 47, 180, 222, 224, 231, 148, 148, 154,
+ 216, 22, 214, 7, 8, 10, 11, 12, 13, 14,
+ 15, 16, 17, 49, 151, 154, 157, 159, 170, 173,
+ 193, 194, 228, 178, 178, 35, 37, 204, 178, 178,
+ 21, 232, 233, 29, 160, 223, 232, 22, 22, 22,
+ 217, 152, 4, 4, 4, 159, 10, 160, 194, 199,
+ 150, 152, 204, 204, 42, 44, 181, 32, 33, 203,
+ 60, 61, 62, 63, 64, 65, 182, 220, 220, 172,
+ 236, 149, 156, 39, 194, 195, 197, 198, 155, 155,
+ 160, 199, 149, 160, 198, 203, 203, 10, 121, 194,
+ 196, 205, 11, 12, 13, 14, 15, 16, 168, 169,
+ 194, 200, 4, 196, 28, 159, 221, 36, 55, 56,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 110, 111, 112, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
+ 129, 130, 131, 132, 133, 163, 164, 165, 234, 240,
+ 241, 242, 243, 22, 184, 149, 153, 194, 194, 158,
+ 160, 194, 153, 200, 194, 152, 228, 26, 27, 3,
+ 4, 5, 6, 9, 25, 40, 41, 88, 89, 115,
+ 129, 131, 132, 133, 154, 157, 159, 161, 163, 164,
+ 165, 201, 228, 211, 173, 55, 10, 194, 230, 11,
+ 17, 11, 168, 182, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 166, 26, 27, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 167, 194, 194, 230, 194, 194, 237, 230, 230,
+ 230, 230, 230, 194, 194, 230, 182, 113, 114, 117,
+ 118, 134, 135, 137, 138, 140, 141, 142, 183, 39,
+ 195, 186, 156, 158, 158, 186, 212, 213, 205, 166,
+ 167, 152, 152, 152, 152, 152, 156, 200, 202, 159,
+ 202, 160, 202, 22, 152, 152, 152, 149, 191, 152,
+ 3, 4, 9, 25, 26, 27, 40, 41, 57, 157,
+ 201, 227, 228, 229, 229, 229, 229, 196, 194, 194,
+ 149, 188, 149, 188, 229, 154, 149, 149, 149, 149,
+ 149, 149, 229, 229, 38, 196, 194, 230, 134, 135,
+ 136, 139, 143, 144, 185, 191, 191, 38, 152, 152,
+ 200, 200, 200, 200, 200, 149, 156, 160, 194, 202,
+ 158, 160, 200, 200, 200, 34, 53, 189, 192, 39,
+ 194, 218, 219, 59, 226, 202, 149, 149, 229, 229,
+ 229, 11, 53, 11, 239, 229, 154, 230, 194, 230,
+ 230, 230, 149, 149, 194, 229, 229, 149, 194, 200,
+ 200, 239, 149, 149, 149, 149, 200, 158, 160, 149,
+ 149, 38, 22, 4, 191, 184, 149, 153, 22, 158,
+ 17, 17, 152, 149, 149, 229, 4, 229, 149, 149,
+ 229, 149, 149, 149, 229, 229, 152, 149, 188, 194,
+ 153, 149, 149, 153, 200, 200, 200, 200, 158, 200,
+ 200, 194, 170, 171, 39, 194, 186, 149, 229, 229,
+ 17, 194, 238, 229, 229, 188, 188, 230, 229, 149,
+ 230, 230, 230, 238, 229, 200, 200, 149, 153, 149,
+ 149, 153, 153, 153, 184, 189, 190, 22, 149, 154,
+ 229, 229, 149, 153, 156, 229, 153, 188, 153, 153,
+ 200, 200, 200, 171, 53, 187, 17, 156, 168, 235,
+ 184, 184, 17, 194, 186, 156, 186, 153, 153, 153,
+ 4, 229, 227, 156, 168, 229, 229, 38, 149, 227,
+ 184, 184, 17, 17, 149, 229, 229, 17, 71, 229,
+ 17, 229
+};
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
+#define YYEMPTY (-2)
#define YYEOF 0
+
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
+
#define YYFAIL goto yyerrlab
+
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(token, value) \
+
+#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
-while (0)
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (YYID (0))
+
#define YYTERROR 1
#define YYERRCODE 256
-#ifndef YYPURE
-#define YYLEX yylex()
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (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
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval, &yylloc)
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
-#else /* not YYLSP_NEEDED */
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, YYLEX_PARAM)
+# define YYLEX yylex (YYLEX_PARAM)
#else
-#define YYLEX yylex(&yylval)
+# define YYLEX yylex ()
#endif
-#endif /* not YYLSP_NEEDED */
+
+/* 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
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
#endif
+{
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
-/* If nonreentrant, generate the variables here */
-#ifndef YYPURE
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
+}
-int yychar; /* the lookahead symbol */
-YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
+#if (defined __STDC__ || defined __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");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (YYID (0))
+
-int yynerrs; /* number of parse errors so far */
-#endif /* not YYPURE */
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
-#if YYDEBUG != 0
-int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
+#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;
#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");
+ }
+}
-/* YYINITDEPTH indicates the initial size of the parser's stacks */
+# 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 -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-#define YYINITDEPTH 200
+# define YYINITDEPTH 200
#endif
-/* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
+ Do not make this value too large; the results are undefined if
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
+# define YYMAXDEPTH 10000
#endif
+
-/* Define __yy_memcpy. Note that the size argument
- should be passed with type unsigned int, because that is what the non-GCC
- definitions require. With GCC, __builtin_memcpy takes an arg
- of type size_t, but it can handle unsigned int. */
-
-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
-#else /* not GNU C or C++ */
-#ifndef __cplusplus
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (to, from, count)
- char *to;
- char *from;
- unsigned int count;
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+#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
{
- register char *f = from;
- register char *t = to;
- register int i = count;
+ char *yyd = yydest;
+ const char *yys = yysrc;
- while (i-- > 0)
- *t++ = *f++;
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
}
+# endif
+# endif
-#else /* __cplusplus */
+# 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;
-/* 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)
+ 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
+
+/* 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)
{
- register char *t = to;
- register char *f = from;
- register int i = 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;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- while (i-- > 0)
- *t++ = *f++;
+ 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;
+ }
}
+#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
-#endif
-
-#line 217 "/usr/share/bison.simple"
+{
+ YYUSE (yyvaluep);
-/* 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. */
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+}
+
+
+/* Prevent warnings from -Wmissing-prototypes. */
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
#ifdef YYPARSE_PARAM
-int yyparse (void *);
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
#else
-int yyparse (void);
+int yyparse ();
#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
#endif
+#endif /* ! YYPARSE_PARAM */
+
-int
-yyparse(YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
-{
- register int yystate;
- register int yyn;
- register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
-
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
-
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+/* The look-ahead symbol. */
+int yychar;
+
+/* The semantic value of the look-ahead symbol. */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far. */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
#else
-#define YYPOPSTACK (yyvsp--, yyssp--)
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
#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
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
- int yylen;
+ 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;
+
+
+
+#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;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
-#endif
+
+ /* 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"));
yystate = 0;
yyerrstatus = 0;
@@ -2321,700 +3240,750 @@
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss - 1;
+ yyssp = yyss;
yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
- yylsp = yyls;
-#endif
-/* Push a new state, which is found in yystate . */
-/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
-yynewstate:
+ goto yysetstate;
- *++yyssp = yystate;
+/*------------------------------------------------------------.
+| 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++;
- 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
+ yysetstate:
+ *yyssp = yystate;
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
/* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
+ YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
-#ifdef YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
-#else
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
-#endif
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ 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),
- yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
- yyls = yyls1;
-#endif
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
/* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 2;
- }
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyexhaustedlab;
yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
+ if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
- yyfree_stacks = 1;
-#endif
- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1,
- size * (unsigned int) sizeof (*yyssp));
- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
- size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1,
- size * (unsigned int) sizeof (*yylsp));
-#endif
+
+ {
+ 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
#endif /* no yyoverflow */
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
-#endif
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
- if (yyssp >= yyss + yystacksize - 1)
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
- yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
- /* First try to decide what to do without reference to lookahead token. */
+ /* 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 look-ahead token. */
yyn = yypact[yystate];
- if (yyn == YYFLAG)
+ if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
+ /* Not known => get a look-ahead token if don't already have one. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
-#endif
+ YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
+ if (yychar <= YYEOF)
{
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
-#endif
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
- yychar1 = YYTRANSLATE(yychar);
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
-#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
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
-
yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
+ if (yyn <= 0)
{
- if (yyn == YYFLAG)
+ if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- else if (yyn == 0)
- goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
- /* Shift the lookahead token. */
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the token being shifted unless it is eof. */
+ /* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
+ yystate = yyn;
*++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
- yystate = yyn;
goto yynewstate;
-/* Do the default action for the current state. */
-yydefault:
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
+ goto yyreduce;
-/* Do a reduction. yyn is the number of a rule to reduce with. */
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
yyreduce:
+ /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
-#if YYDEBUG != 0
- if (yydebug)
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
{
- int i;
+ case 29:
+#line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
+ break;
- 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
-
-
- switch (yyn) {
-
-case 28:
-#line 1133 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_EQ; ;
- break;}
-case 29:
-#line 1133 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_NE; ;
- break;}
-case 30:
-#line 1134 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_SLT; ;
- break;}
-case 31:
-#line 1134 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_SGT; ;
- break;}
-case 32:
-#line 1135 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_SLE; ;
- break;}
-case 33:
-#line 1135 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_SGE; ;
- break;}
-case 34:
-#line 1136 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_ULT; ;
- break;}
-case 35:
-#line 1136 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_UGT; ;
- break;}
-case 36:
-#line 1137 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_ULE; ;
- break;}
-case 37:
-#line 1137 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.IPredicate = ICmpInst::ICMP_UGE; ;
- break;}
-case 38:
-#line 1141 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ;
- break;}
-case 39:
-#line 1141 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_ONE; ;
- break;}
-case 40:
-#line 1142 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_OLT; ;
- break;}
-case 41:
-#line 1142 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_OGT; ;
- break;}
-case 42:
-#line 1143 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_OLE; ;
- break;}
-case 43:
-#line 1143 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_OGE; ;
- break;}
-case 44:
-#line 1144 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_ORD; ;
- break;}
-case 45:
-#line 1144 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_UNO; ;
- break;}
-case 46:
-#line 1145 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ;
- break;}
-case 47:
-#line 1145 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_UNE; ;
- break;}
-case 48:
-#line 1146 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_ULT; ;
- break;}
-case 49:
-#line 1146 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_UGT; ;
- break;}
-case 50:
-#line 1147 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_ULE; ;
- break;}
-case 51:
-#line 1147 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_UGE; ;
- break;}
-case 52:
-#line 1148 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ;
- break;}
-case 53:
-#line 1149 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ;
- break;}
-case 64:
-#line 1158 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.StrVal = 0; ;
- break;}
-case 65:
-#line 1162 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = yyvsp[-1].StrVal;
+ case 30:
+#line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
+ break;
+
+ case 31:
+#line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
+ break;
+
+ case 32:
+#line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
+ break;
+
+ case 33:
+#line 1136 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
+ break;
+
+ case 34:
+#line 1136 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
+ break;
+
+ case 35:
+#line 1137 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
+ break;
+
+ case 36:
+#line 1137 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
+ break;
+
+ case 37:
+#line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
+ break;
+
+ case 38:
+#line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
+ break;
+
+ case 39:
+#line 1142 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
+ break;
+
+ case 40:
+#line 1142 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
+ break;
+
+ case 41:
+#line 1143 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
+ break;
+
+ case 42:
+#line 1143 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
+ break;
+
+ case 43:
+#line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
+ break;
+
+ case 44:
+#line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
+ break;
+
+ case 45:
+#line 1145 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
+ break;
+
+ case 46:
+#line 1145 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
+ break;
+
+ case 47:
+#line 1146 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
+ break;
+
+ case 48:
+#line 1146 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
+ break;
+
+ case 49:
+#line 1147 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
+ break;
+
+ case 50:
+#line 1147 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
+ break;
+
+ case 51:
+#line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
+ break;
+
+ case 52:
+#line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
+ break;
+
+ case 53:
+#line 1149 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
+ break;
+
+ case 54:
+#line 1150 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
+ break;
+
+ case 65:
+#line 1159 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.StrVal) = 0; ;}
+ break;
+
+ case 66:
+#line 1163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 66:
-#line 1166 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = 0;
+ ;}
+ break;
+
+ case 67:
+#line 1167 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.StrVal) = 0;
CHECK_FOR_ERROR
- ;
- break;}
-case 70:
-#line 1174 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = 0;
+ ;}
+ break;
+
+ case 71:
+#line 1175 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.StrVal) = 0;
CHECK_FOR_ERROR
- ;
- break;}
-case 71:
-#line 1179 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = yyvsp[-1].StrVal;
+ ;}
+ break;
+
+ case 72:
+#line 1180 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 72:
-#line 1185 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::InternalLinkage; ;
- break;}
-case 73:
-#line 1186 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::WeakLinkage; ;
- break;}
-case 74:
-#line 1187 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ;
- break;}
-case 75:
-#line 1188 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::AppendingLinkage; ;
- break;}
-case 76:
-#line 1189 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLExportLinkage; ;
- break;}
-case 77:
-#line 1193 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLImportLinkage; ;
- break;}
-case 78:
-#line 1194 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ;
- break;}
-case 79:
-#line 1195 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
- break;}
-case 80:
-#line 1199 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Visibility = GlobalValue::DefaultVisibility; ;
- break;}
-case 81:
-#line 1200 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Visibility = GlobalValue::DefaultVisibility; ;
- break;}
-case 82:
-#line 1201 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Visibility = GlobalValue::HiddenVisibility; ;
- break;}
-case 83:
-#line 1202 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Visibility = GlobalValue::ProtectedVisibility; ;
- break;}
-case 84:
-#line 1206 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
- break;}
-case 85:
-#line 1207 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLImportLinkage; ;
- break;}
-case 86:
-#line 1208 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ;
- break;}
-case 87:
-#line 1212 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
- break;}
-case 88:
-#line 1213 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::InternalLinkage; ;
- break;}
-case 89:
-#line 1214 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ;
- break;}
-case 90:
-#line 1215 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::WeakLinkage; ;
- break;}
-case 91:
-#line 1216 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLExportLinkage; ;
- break;}
-case 92:
-#line 1220 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
- break;}
-case 93:
-#line 1221 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::WeakLinkage; ;
- break;}
-case 94:
-#line 1222 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::InternalLinkage; ;
- break;}
-case 95:
-#line 1225 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::C; ;
- break;}
-case 96:
-#line 1226 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::C; ;
- break;}
-case 97:
-#line 1227 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::Fast; ;
- break;}
-case 98:
-#line 1228 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::Cold; ;
- break;}
-case 99:
-#line 1229 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::X86_StdCall; ;
- break;}
-case 100:
-#line 1230 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::X86_FastCall; ;
- break;}
-case 101:
-#line 1231 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val)
+ ;}
+ break;
+
+ case 73:
+#line 1186 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
+ break;
+
+ case 74:
+#line 1187 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
+ break;
+
+ case 75:
+#line 1188 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
+ break;
+
+ case 76:
+#line 1189 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
+ break;
+
+ case 77:
+#line 1190 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
+ break;
+
+ case 78:
+#line 1194 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
+ break;
+
+ case 79:
+#line 1195 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
+ break;
+
+ case 80:
+#line 1196 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
+ break;
+
+ case 81:
+#line 1200 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
+ break;
+
+ case 82:
+#line 1201 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
+ break;
+
+ case 83:
+#line 1202 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
+ break;
+
+ case 84:
+#line 1203 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
+ break;
+
+ case 85:
+#line 1207 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
+ break;
+
+ case 86:
+#line 1208 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
+ break;
+
+ case 87:
+#line 1209 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
+ break;
+
+ case 88:
+#line 1213 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
+ break;
+
+ case 89:
+#line 1214 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
+ break;
+
+ case 90:
+#line 1215 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
+ break;
+
+ case 91:
+#line 1216 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
+ break;
+
+ case 92:
+#line 1217 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
+ break;
+
+ case 93:
+#line 1221 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
+ break;
+
+ case 94:
+#line 1222 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
+ break;
+
+ case 95:
+#line 1223 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
+ break;
+
+ case 96:
+#line 1226 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::C; ;}
+ break;
+
+ case 97:
+#line 1227 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::C; ;}
+ break;
+
+ case 98:
+#line 1228 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::Fast; ;}
+ break;
+
+ case 99:
+#line 1229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::Cold; ;}
+ break;
+
+ case 100:
+#line 1230 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
+ break;
+
+ case 101:
+#line 1231 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
+ break;
+
+ case 102:
+#line 1232 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
GEN_ERROR("Calling conv too large");
- yyval.UIntVal = yyvsp[0].UInt64Val;
+ (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
CHECK_FOR_ERROR
- ;
- break;}
-case 102:
-#line 1238 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::ZExt; ;
- break;}
-case 103:
-#line 1239 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::ZExt; ;
- break;}
-case 104:
-#line 1240 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::SExt; ;
- break;}
-case 105:
-#line 1241 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::SExt; ;
- break;}
-case 106:
-#line 1242 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::InReg; ;
- break;}
-case 107:
-#line 1243 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::StructRet; ;
- break;}
-case 108:
-#line 1244 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::NoAlias; ;
- break;}
-case 109:
-#line 1245 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::ByVal; ;
- break;}
-case 110:
-#line 1246 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::Nest; ;
- break;}
-case 111:
-#line 1249 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::None; ;
- break;}
-case 112:
-#line 1250 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs;
- ;
- break;}
-case 113:
-#line 1255 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::NoReturn; ;
- break;}
-case 114:
-#line 1256 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::NoUnwind; ;
- break;}
-case 115:
-#line 1257 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::ZExt; ;
- break;}
-case 116:
-#line 1258 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::SExt; ;
- break;}
-case 117:
-#line 1261 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamAttrs = ParamAttr::None; ;
- break;}
-case 118:
-#line 1262 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs;
- ;
- break;}
-case 119:
-#line 1269 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = 0; ;
- break;}
-case 120:
-#line 1270 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.UIntVal = yyvsp[0].UInt64Val;
- if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
+ ;}
+ break;
+
+ case 103:
+#line 1239 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
+ break;
+
+ case 104:
+#line 1240 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
+ break;
+
+ case 105:
+#line 1241 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
+ break;
+
+ case 106:
+#line 1242 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
+ break;
+
+ case 107:
+#line 1243 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
+ break;
+
+ case 108:
+#line 1244 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
+ break;
+
+ case 109:
+#line 1245 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
+ break;
+
+ case 110:
+#line 1246 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
+ break;
+
+ case 111:
+#line 1247 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
+ break;
+
+ case 112:
+#line 1250 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::None; ;}
+ break;
+
+ case 113:
+#line 1251 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
+ ;}
+ break;
+
+ case 114:
+#line 1256 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
+ break;
+
+ case 115:
+#line 1257 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
+ break;
+
+ case 116:
+#line 1258 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
+ break;
+
+ case 117:
+#line 1259 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
+ break;
+
+ case 118:
+#line 1260 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::Pure; ;}
+ break;
+
+ case 119:
+#line 1261 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::Const; ;}
+ break;
+
+ case 120:
+#line 1264 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamAttrs) = ParamAttr::None; ;}
+ break;
+
+ case 121:
+#line 1265 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
+ ;}
+ break;
+
+ case 122:
+#line 1272 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = 0; ;}
+ break;
+
+ case 123:
+#line 1273 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
+ if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
GEN_ERROR("Alignment must be a power of two");
CHECK_FOR_ERROR
-;
- break;}
-case 121:
-#line 1276 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = 0; ;
- break;}
-case 122:
-#line 1277 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.UIntVal = yyvsp[0].UInt64Val;
- if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
+;}
+ break;
+
+ case 124:
+#line 1279 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.UIntVal) = 0; ;}
+ break;
+
+ case 125:
+#line 1280 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
+ if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
GEN_ERROR("Alignment must be a power of two");
CHECK_FOR_ERROR
-;
- break;}
-case 123:
-#line 1285 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- for (unsigned i = 0, e = yyvsp[0].StrVal->length(); i != e; ++i)
- if ((*yyvsp[0].StrVal)[i] == '"' || (*yyvsp[0].StrVal)[i] == '\\')
+;}
+ break;
+
+ case 126:
+#line 1288 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
+ if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
GEN_ERROR("Invalid character in section name");
- yyval.StrVal = yyvsp[0].StrVal;
+ (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
CHECK_FOR_ERROR
-;
- break;}
-case 124:
-#line 1293 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.StrVal = 0; ;
- break;}
-case 125:
-#line 1294 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.StrVal = yyvsp[0].StrVal; ;
- break;}
-case 126:
-#line 1299 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{;
- break;}
-case 127:
-#line 1300 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{;
- break;}
-case 128:
-#line 1301 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurGV->setSection(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
+;}
+ break;
+
+ case 127:
+#line 1296 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.StrVal) = 0; ;}
+ break;
+
+ case 128:
+#line 1297 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
+ break;
+
+ case 129:
+#line 1302 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {;}
+ break;
+
+ case 130:
+#line 1303 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {;}
+ break;
+
+ case 131:
+#line 1304 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
+ delete (yyvsp[(1) - (1)].StrVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 129:
-#line 1306 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val))
+ ;}
+ break;
+
+ case 132:
+#line 1309 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Alignment must be a power of two");
- CurGV->setAlignment(yyvsp[0].UInt64Val);
+ CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
CHECK_FOR_ERROR
- ;
- break;}
-case 137:
-#line 1322 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeVal = new PATypeHolder(OpaqueType::get());
+ ;}
+ break;
+
+ case 140:
+#line 1325 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
CHECK_FOR_ERROR
- ;
- break;}
-case 138:
-#line 1326 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType);
+ ;}
+ break;
+
+ case 141:
+#line 1329 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
CHECK_FOR_ERROR
- ;
- break;}
-case 139:
-#line 1330 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Pointer type?
- if (*yyvsp[-1].TypeVal == Type::LabelTy)
+ ;}
+ break;
+
+ case 142:
+#line 1333 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Pointer type?
+ if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy)
GEN_ERROR("Cannot form a pointer to a basic block");
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal)));
- delete yyvsp[-1].TypeVal;
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal))));
+ delete (yyvsp[(1) - (2)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 140:
-#line 1337 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Named types are also simple types...
- const Type* tmp = getTypeVal(yyvsp[0].ValIDVal);
- CHECK_FOR_ERROR
- yyval.TypeVal = new PATypeHolder(tmp);
- ;
- break;}
-case 141:
-#line 1342 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Type UpReference
- if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range");
+ ;}
+ break;
+
+ case 143:
+#line 1340 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Named types are also simple types...
+ const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
+ CHECK_FOR_ERROR
+ (yyval.TypeVal) = new PATypeHolder(tmp);
+ ;}
+ break;
+
+ case 144:
+#line 1345 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Type UpReference
+ if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
- UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector...
- yyval.TypeVal = new PATypeHolder(OT);
+ UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
+ (yyval.TypeVal) = new PATypeHolder(OT);
UR_OUT("New Upreference!\n");
CHECK_FOR_ERROR
- ;
- break;}
-case 142:
-#line 1350 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 145:
+#line 1353 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
std::vector Params;
ParamAttrsVector Attrs;
- if (yyvsp[0].ParamAttrs != ParamAttr::None) {
- ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs;
+ if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = 0; X.attrs = (yyvsp[(5) - (5)].ParamAttrs);
Attrs.push_back(X);
}
unsigned index = 1;
- TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end();
+ TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
for (; I != E; ++I, ++index) {
const Type *Ty = I->Ty->get();
Params.push_back(Ty);
@@ -3030,23 +3999,24 @@
ParamAttrsList *ActualAttrs = 0;
if (!Attrs.empty())
ActualAttrs = ParamAttrsList::get(Attrs);
- FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, ActualAttrs);
- delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list
- delete yyvsp[-4].TypeVal; // Delete the return type handle
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- ;
- break;}
-case 143:
-#line 1380 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, ActualAttrs);
+ delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
+ delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 146:
+#line 1383 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
std::vector Params;
ParamAttrsVector Attrs;
- if (yyvsp[0].ParamAttrs != ParamAttr::None) {
- ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs;
+ if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = 0; X.attrs = (yyvsp[(5) - (5)].ParamAttrs);
Attrs.push_back(X);
}
- TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end();
+ TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
unsigned index = 1;
for ( ; I != E; ++I, ++index) {
const Type* Ty = I->Ty->get();
@@ -3064,282 +4034,303 @@
if (!Attrs.empty())
ActualAttrs = ParamAttrsList::get(Attrs);
- FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, ActualAttrs);
- delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- ;
- break;}
-case 144:
-#line 1411 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Sized array type?
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 145:
-#line 1416 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Vector type?
- const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get();
- if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val)
+ FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, ActualAttrs);
+ delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 147:
+#line 1414 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Sized array type?
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
+ delete (yyvsp[(4) - (5)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 148:
+#line 1419 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Vector type?
+ const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
+ if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
GEN_ERROR("Unsigned result not equal to signed result");
if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
GEN_ERROR("Element type of a VectorType must be primitive");
- if (!isPowerOf2_32(yyvsp[-3].UInt64Val))
+ if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val)))
GEN_ERROR("Vector length should be a power of 2");
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
- delete yyvsp[-1].TypeVal;
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
+ delete (yyvsp[(4) - (5)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 146:
-#line 1428 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Structure type?
+ ;}
+ break;
+
+ case 149:
+#line 1431 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Structure type?
std::vector Elements;
- for (std::list::iterator I = yyvsp[-1].TypeList->begin(),
- E = yyvsp[-1].TypeList->end(); I != E; ++I)
+ for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
+ E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
Elements.push_back(*I);
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
- delete yyvsp[-1].TypeList;
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
+ delete (yyvsp[(2) - (3)].TypeList);
CHECK_FOR_ERROR
- ;
- break;}
-case 147:
-#line 1438 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Empty structure type?
- yyval.TypeVal = new PATypeHolder(StructType::get(std::vector()));
- CHECK_FOR_ERROR
- ;
- break;}
-case 148:
-#line 1442 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 150:
+#line 1441 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Empty structure type?
+ (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector()));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 151:
+#line 1445 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
std::vector Elements;
- for (std::list::iterator I = yyvsp[-2].TypeList->begin(),
- E = yyvsp[-2].TypeList->end(); I != E; ++I)
+ for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
+ E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
Elements.push_back(*I);
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
- delete yyvsp[-2].TypeList;
+ (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
+ delete (yyvsp[(3) - (5)].TypeList);
CHECK_FOR_ERROR
- ;
- break;}
-case 149:
-#line 1452 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Empty structure type?
- yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true));
- CHECK_FOR_ERROR
- ;
- break;}
-case 150:
-#line 1459 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal;
- yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs;
- ;
- break;}
-case 151:
-#line 1466 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 152:
+#line 1455 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Empty structure type?
+ (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 153:
+#line 1462 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
+ (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs);
+ ;}
+ break;
+
+ case 154:
+#line 1469 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
- if (!(*yyvsp[0].TypeVal)->isFirstClassType())
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
+ if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType())
GEN_ERROR("LLVM functions cannot return aggregate types");
- yyval.TypeVal = yyvsp[0].TypeVal;
- ;
- break;}
-case 152:
-#line 1473 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeVal = new PATypeHolder(Type::VoidTy);
- ;
- break;}
-case 153:
-#line 1478 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeWithAttrsList = new TypeWithAttrsList();
- yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs);
+ (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
+ ;}
+ break;
+
+ case 155:
+#line 1476 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
+ ;}
+ break;
+
+ case 156:
+#line 1481 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
+ (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
CHECK_FOR_ERROR
- ;
- break;}
-case 154:
-#line 1483 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs);
+ ;}
+ break;
+
+ case 157:
+#line 1486 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
CHECK_FOR_ERROR
- ;
- break;}
-case 156:
-#line 1491 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList;
+ ;}
+ break;
+
+ case 159:
+#line 1494 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
TWA.Ty = new PATypeHolder(Type::VoidTy);
- yyval.TypeWithAttrsList->push_back(TWA);
+ (yyval.TypeWithAttrsList)->push_back(TWA);
CHECK_FOR_ERROR
- ;
- break;}
-case 157:
-#line 1498 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeWithAttrsList = new TypeWithAttrsList;
+ ;}
+ break;
+
+ case 160:
+#line 1501 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
TWA.Ty = new PATypeHolder(Type::VoidTy);
- yyval.TypeWithAttrsList->push_back(TWA);
+ (yyval.TypeWithAttrsList)->push_back(TWA);
CHECK_FOR_ERROR
- ;
- break;}
-case 158:
-#line 1505 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeWithAttrsList = new TypeWithAttrsList();
+ ;}
+ break;
+
+ case 161:
+#line 1508 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
CHECK_FOR_ERROR
- ;
- break;}
-case 159:
-#line 1513 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeList = new std::list();
- yyval.TypeList->push_back(*yyvsp[0].TypeVal);
- delete yyvsp[0].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 160:
-#line 1519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal);
- delete yyvsp[0].TypeVal;
+ ;}
+ break;
+
+ case 162:
+#line 1516 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TypeList) = new std::list();
+ (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
+ delete (yyvsp[(1) - (1)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 161:
-#line 1531 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Nonempty unsized arr
+ ;}
+ break;
+
+ case 163:
+#line 1522 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
+ delete (yyvsp[(3) - (3)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 164:
+#line 1534 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Nonempty unsized arr
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
+ const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
const Type *ETy = ATy->getElementType();
int NumElements = ATy->getNumElements();
// Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size())
+ if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
GEN_ERROR("Type mismatch: constant sized array initialized with " +
- utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " +
+ utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
itostr(NumElements) + "");
// Verify all elements are correct type!
- for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) {
- if (ETy != (*yyvsp[-1].ConstVector)[i]->getType())
+ for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
+ if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
ETy->getDescription() +"' as required!\nIt is of type '"+
- (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'.");
+ (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
}
- yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector);
- delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector;
+ (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
+ delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
CHECK_FOR_ERROR
- ;
- break;}
-case 162:
-#line 1559 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 165:
+#line 1562 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
+ const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
int NumElements = ATy->getNumElements();
if (NumElements != -1 && NumElements != 0)
GEN_ERROR("Type mismatch: constant sized array initialized with 0"
" arguments, but has size of " + itostr(NumElements) +"");
- yyval.ConstVal = ConstantArray::get(ATy, std::vector());
- delete yyvsp[-2].TypeVal;
+ (yyval.ConstVal) = ConstantArray::get(ATy, std::vector());
+ delete (yyvsp[(1) - (3)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 163:
-#line 1575 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 166:
+#line 1578 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
+ const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
int NumElements = ATy->getNumElements();
const Type *ETy = ATy->getElementType();
- if (NumElements != -1 && NumElements != int(yyvsp[0].StrVal->length()))
+ if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
GEN_ERROR("Can't build string constant of size " +
- itostr((int)(yyvsp[0].StrVal->length())) +
+ itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
" when array has size " + itostr(NumElements) + "");
std::vector Vals;
if (ETy == Type::Int8Ty) {
- for (unsigned i = 0; i < yyvsp[0].StrVal->length(); ++i)
- Vals.push_back(ConstantInt::get(ETy, (*yyvsp[0].StrVal)[i]));
+ for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
+ Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
} else {
- delete yyvsp[0].StrVal;
+ delete (yyvsp[(3) - (3)].StrVal);
GEN_ERROR("Cannot build string arrays of non byte sized elements");
}
- delete yyvsp[0].StrVal;
- yyval.ConstVal = ConstantArray::get(ATy, Vals);
- delete yyvsp[-2].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 164:
-#line 1602 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Nonempty unsized arr
+ delete (yyvsp[(3) - (3)].StrVal);
+ (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
+ delete (yyvsp[(1) - (3)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 167:
+#line 1605 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Nonempty unsized arr
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
+ const VectorType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
if (PTy == 0)
GEN_ERROR("Cannot make packed constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
const Type *ETy = PTy->getElementType();
int NumElements = PTy->getNumElements();
// Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size())
+ if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
GEN_ERROR("Type mismatch: constant sized packed initialized with " +
- utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " +
+ utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
itostr(NumElements) + "");
// Verify all elements are correct type!
- for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) {
- if (ETy != (*yyvsp[-1].ConstVector)[i]->getType())
+ for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
+ if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
ETy->getDescription() +"' as required!\nIt is of type '"+
- (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'.");
+ (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
}
- yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector);
- delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector;
+ (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
+ delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
CHECK_FOR_ERROR
- ;
- break;}
-case 165:
-#line 1630 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get());
+ ;}
+ break;
+
+ case 168:
+#line 1633 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
- if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes())
+ if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
GEN_ERROR("Illegal number of initializers for structure type");
// Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i)
- if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i))
+ for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
+ if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
GEN_ERROR("Expected type '" +
STy->getElementType(i)->getDescription() +
"' for element #" + utostr(i) +
@@ -3350,20 +4341,21 @@
GEN_ERROR("Unpacked Initializer to vector type '" +
STy->getDescription() + "'");
- yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector);
- delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector;
+ (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
+ delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
CHECK_FOR_ERROR
- ;
- break;}
-case 166:
-#line 1656 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 169:
+#line 1659 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
+ const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
if (STy->getNumContainedTypes() != 0)
GEN_ERROR("Illegal number of initializers for structure type");
@@ -3373,25 +4365,26 @@
GEN_ERROR("Unpacked Initializer to vector type '" +
STy->getDescription() + "'");
- yyval.ConstVal = ConstantStruct::get(STy, std::vector());
- delete yyvsp[-2].TypeVal;
+ (yyval.ConstVal) = ConstantStruct::get(STy, std::vector());
+ delete (yyvsp[(1) - (3)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 167:
-#line 1676 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get());
+ ;}
+ break;
+
+ case 170:
+#line 1679 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-5].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
- if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes())
+ if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
GEN_ERROR("Illegal number of initializers for structure type");
// Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i)
- if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i))
+ for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
+ if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
GEN_ERROR("Expected type '" +
STy->getElementType(i)->getDescription() +
"' for element #" + utostr(i) +
@@ -3402,20 +4395,21 @@
GEN_ERROR("Vector initializer to non-vector type '" +
STy->getDescription() + "'");
- yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector);
- delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector;
+ (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
+ delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
CHECK_FOR_ERROR
- ;
- break;}
-case 168:
-#line 1702 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 171:
+#line 1705 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
- const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
+ const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-4].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
if (STy->getNumContainedTypes() != 0)
GEN_ERROR("Illegal number of initializers for structure type");
@@ -3425,42 +4419,45 @@
GEN_ERROR("Vector initializer to non-vector type '" +
STy->getDescription() + "'");
- yyval.ConstVal = ConstantStruct::get(STy, std::vector());
- delete yyvsp[-4].TypeVal;
+ (yyval.ConstVal) = ConstantStruct::get(STy, std::vector());
+ delete (yyvsp[(1) - (5)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 169:
-#line 1722 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 172:
+#line 1725 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get());
if (PTy == 0)
GEN_ERROR("Cannot make null pointer constant with type: '" +
- (*yyvsp[-1].TypeVal)->getDescription() + "'");
+ (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
- yyval.ConstVal = ConstantPointerNull::get(PTy);
- delete yyvsp[-1].TypeVal;
+ (yyval.ConstVal) = ConstantPointerNull::get(PTy);
+ delete (yyvsp[(1) - (2)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 170:
-#line 1734 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 173:
+#line 1737 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get());
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 171:
-#line 1741 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
+ delete (yyvsp[(1) - (2)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 174:
+#line 1744 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get());
if (Ty == 0)
GEN_ERROR("Global const reference must be a pointer type");
@@ -3474,7 +4471,7 @@
Function *SavedCurFn = CurFun.CurrentFunction;
CurFun.CurrentFunction = 0;
- Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal);
+ Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
CHECK_FOR_ERROR
CurFun.CurrentFunction = SavedCurFn;
@@ -3489,16 +4486,16 @@
// First check to see if the forward references value is already created!
PerModuleInfo::GlobalRefsType::iterator I =
- CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal));
+ CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
if (I != CurModule.GlobalRefs.end()) {
V = I->second; // Placeholder already exists, use it...
- yyvsp[0].ValIDVal.destroy();
+ (yyvsp[(2) - (2)].ValIDVal).destroy();
} else {
std::string Name;
- if (yyvsp[0].ValIDVal.Type == ValID::GlobalName)
- Name = yyvsp[0].ValIDVal.getName();
- else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID)
+ if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
+ Name = (yyvsp[(2) - (2)].ValIDVal).getName();
+ else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
GEN_ERROR("Invalid reference to global");
// Create the forward referenced global.
@@ -3514,342 +4511,377 @@
}
// Keep track of the fact that we have a forward ref to recycle it
- CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV));
+ CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
V = GV;
}
}
- yyval.ConstVal = cast(V);
- delete yyvsp[-1].TypeVal; // Free the type handle
+ (yyval.ConstVal) = cast(V);
+ delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
CHECK_FOR_ERROR
- ;
- break;}
-case 172:
-#line 1807 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 175:
+#line 1810 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType())
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
GEN_ERROR("Mismatched types for constant expression: " +
- (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription());
- yyval.ConstVal = yyvsp[0].ConstVal;
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 173:
-#line 1817 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
+ (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
+ delete (yyvsp[(1) - (2)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 176:
+#line 1820 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- const Type *Ty = yyvsp[-1].TypeVal->get();
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
if (isa(Ty) || Ty == Type::LabelTy || isa(Ty))
GEN_ERROR("Cannot create a null initialized value of this type");
- yyval.ConstVal = Constant::getNullValue(Ty);
- delete yyvsp[-1].TypeVal;
+ (yyval.ConstVal) = Constant::getNullValue(Ty);
+ delete (yyvsp[(1) - (2)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 174:
-#line 1827 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // integral constants
- if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val))
+ ;}
+ break;
+
+ case 177:
+#line 1830 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // integral constants
+ if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
- yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true);
+ (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
CHECK_FOR_ERROR
- ;
- break;}
-case 175:
-#line 1833 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // arbitrary precision integer constants
- uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth();
- if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) {
+ ;}
+ break;
+
+ case 178:
+#line 1836 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // arbitrary precision integer constants
+ uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
+ if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
GEN_ERROR("Constant value does not fit in type");
}
- yyvsp[0].APIntVal->sextOrTrunc(BitWidth);
- yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal);
- delete yyvsp[0].APIntVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 176:
-#line 1843 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // integral constants
- if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val))
+ (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
+ (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
+ delete (yyvsp[(2) - (2)].APIntVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 179:
+#line 1846 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // integral constants
+ if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
- yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false);
+ (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
CHECK_FOR_ERROR
- ;
- break;}
-case 177:
-#line 1849 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // arbitrary precision integer constants
- uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth();
- if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) {
+ ;}
+ break;
+
+ case 180:
+#line 1852 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // arbitrary precision integer constants
+ uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
+ if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
GEN_ERROR("Constant value does not fit in type");
}
- yyvsp[0].APIntVal->zextOrTrunc(BitWidth);
- yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal);
- delete yyvsp[0].APIntVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 178:
-#line 1859 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Boolean constants
- assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?");
- yyval.ConstVal = ConstantInt::getTrue();
- CHECK_FOR_ERROR
- ;
- break;}
-case 179:
-#line 1864 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Boolean constants
- assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?");
- yyval.ConstVal = ConstantInt::getFalse();
- CHECK_FOR_ERROR
- ;
- break;}
-case 180:
-#line 1869 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Floating point constants
- if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal))
+ (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
+ (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
+ delete (yyvsp[(2) - (2)].APIntVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 181:
+#line 1862 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Boolean constants
+ assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
+ (yyval.ConstVal) = ConstantInt::getTrue();
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 182:
+#line 1867 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Boolean constants
+ assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
+ (yyval.ConstVal) = ConstantInt::getFalse();
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 183:
+#line 1872 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Floating point constants
+ if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
GEN_ERROR("Floating point constant invalid for type");
// Lexer has no type info, so builds all float and double FP constants
// as double. Fix this here. Long double is done right.
- if (&yyvsp[0].FPVal->getSemantics()==&APFloat::IEEEdouble && yyvsp[-1].PrimType==Type::FloatTy)
- yyvsp[0].FPVal->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, *yyvsp[0].FPVal);
- delete yyvsp[0].FPVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 181:
-#line 1882 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
+ (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
+ (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal));
+ delete (yyvsp[(2) - (2)].FPVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 184:
+#line 1885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- Constant *Val = yyvsp[-3].ConstVal;
- const Type *DestTy = yyvsp[-1].TypeVal->get();
- if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
+ Constant *Val = (yyvsp[(3) - (6)].ConstVal);
+ const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
+ if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
GEN_ERROR("invalid cast opcode for cast from '" +
Val->getType()->getDescription() + "' to '" +
DestTy->getDescription() + "'");
- yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy);
- delete yyvsp[-1].TypeVal;
- ;
- break;}
-case 182:
-#line 1894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!isa(yyvsp[-2].ConstVal->getType()))
+ (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
+ delete (yyvsp[(5) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 185:
+#line 1897 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()))
GEN_ERROR("GetElementPtr requires a pointer operand");
const Type *IdxTy =
- GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end(),
+ GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
true);
if (!IdxTy)
GEN_ERROR("Index list invalid for constant getelementptr");
SmallVector IdxVec;
- for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i)
- if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i]))
+ for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
+ if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i]))
IdxVec.push_back(C);
else
GEN_ERROR("Indices to constant getelementptr must be constants");
- delete yyvsp[-1].ValueList;
+ delete (yyvsp[(4) - (5)].ValueList);
- yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size());
+ (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
CHECK_FOR_ERROR
- ;
- break;}
-case 183:
-#line 1916 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty)
+ ;}
+ break;
+
+ case 186:
+#line 1919 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
GEN_ERROR("Select condition must be of boolean type");
- if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
GEN_ERROR("Select operand types must match");
- yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
+ (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 184:
-#line 1924 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ ;}
+ break;
+
+ case 187:
+#line 1927 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Binary operator types must match");
CHECK_FOR_ERROR;
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- ;
- break;}
-case 185:
-#line 1930 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
+ ;}
+ break;
+
+ case 188:
+#line 1933 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Logical operator types must match");
- if (!yyvsp[-3].ConstVal->getType()->isInteger()) {
- if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) ||
- !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger())
+ if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
+ if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) ||
+ !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
GEN_ERROR("Logical operator requires integral operands");
}
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
+ (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 186:
-#line 1941 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ ;}
+ break;
+
+ case 189:
+#line 1944 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("icmp operand types must match");
- yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- ;
- break;}
-case 187:
-#line 1946 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
+ ;}
+ break;
+
+ case 190:
+#line 1949 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("fcmp operand types must match");
- yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- ;
- break;}
-case 188:
-#line 1951 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
+ (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
+ ;}
+ break;
+
+ case 191:
+#line 1954 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
GEN_ERROR("Invalid extractelement operands");
- yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
+ (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 189:
-#line 1957 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
+ ;}
+ break;
+
+ case 192:
+#line 1960 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid insertelement operands");
- yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
+ (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 190:
-#line 1963 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
+ ;}
+ break;
+
+ case 193:
+#line 1966 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid shufflevector operands");
- yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
+ (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 191:
-#line 1972 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal);
+ ;}
+ break;
+
+ case 194:
+#line 1975 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 192:
-#line 1976 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ConstVector = new std::vector();
- yyval.ConstVector->push_back(yyvsp[0].ConstVal);
+ ;}
+ break;
+
+ case 195:
+#line 1979 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ConstVector) = new std::vector();
+ (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 193:
-#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.BoolVal = false; ;
- break;}
-case 194:
-#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.BoolVal = true; ;
- break;}
-case 195:
-#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.BoolVal = true; ;
- break;}
-case 196:
-#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.BoolVal = false; ;
- break;}
-case 197:
-#line 1990 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- const Type* VTy = yyvsp[-1].TypeVal->get();
- Value *V = getVal(VTy, yyvsp[0].ValIDVal);
+ ;}
+ break;
+
+ case 196:
+#line 1987 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.BoolVal) = false; ;}
+ break;
+
+ case 197:
+#line 1987 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.BoolVal) = true; ;}
+ break;
+
+ case 198:
+#line 1990 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.BoolVal) = true; ;}
+ break;
+
+ case 199:
+#line 1990 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.BoolVal) = false; ;}
+ break;
+
+ case 200:
+#line 1993 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
+ Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
CHECK_FOR_ERROR
GlobalValue* Aliasee = dyn_cast(V);
if (!Aliasee)
GEN_ERROR("Aliases can be created only to global values");
- yyval.ConstVal = Aliasee;
+ (yyval.ConstVal) = Aliasee;
CHECK_FOR_ERROR
- delete yyvsp[-1].TypeVal;
- ;
- break;}
-case 198:
-#line 2002 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- Constant *Val = yyvsp[-3].ConstVal;
- const Type *DestTy = yyvsp[-1].TypeVal->get();
- if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy))
+ delete (yyvsp[(1) - (2)].TypeVal);
+ ;}
+ break;
+
+ case 201:
+#line 2005 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ Constant *Val = (yyvsp[(3) - (6)].ConstVal);
+ const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
+ if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
GEN_ERROR("invalid cast opcode for cast from '" +
Val->getType()->getDescription() + "' to '" +
DestTy->getDescription() + "'");
- yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy);
+ (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
CHECK_FOR_ERROR
- delete yyvsp[-1].TypeVal;
- ;
- break;}
-case 199:
-#line 2023 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ModuleVal = ParserResult = CurModule.CurrentModule;
+ delete (yyvsp[(5) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 202:
+#line 2026 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
CHECK_FOR_ERROR;
- ;
- break;}
-case 200:
-#line 2028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ModuleVal = ParserResult = CurModule.CurrentModule;
+ ;}
+ break;
+
+ case 203:
+#line 2031 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
CHECK_FOR_ERROR;
- ;
- break;}
-case 203:
-#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ CurFun.isDeclare = false; ;
- break;}
-case 204:
-#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 206:
+#line 2044 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { CurFun.isDeclare = false; ;}
+ break;
+
+ case 207:
+#line 2044 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CurFun.FunctionDone();
CHECK_FOR_ERROR
- ;
- break;}
-case 205:
-#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ CurFun.isDeclare = true; ;
- break;}
-case 206:
-#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 208:
+#line 2048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { CurFun.isDeclare = true; ;}
+ break;
+
+ case 209:
+#line 2048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CHECK_FOR_ERROR
- ;
- break;}
-case 207:
-#line 2048 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 210:
+#line 2051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CHECK_FOR_ERROR
- ;
- break;}
-case 208:
-#line 2051 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 211:
+#line 2054 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
// Eagerly resolve types. This is not an optimization, this is a
// requirement that is due to the fact that we could have this:
//
@@ -3859,100 +4891,108 @@
// If types are not resolved eagerly, then the two types will not be
// determined to be the same type!
//
- ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal);
+ ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
- if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) {
+ if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
CHECK_FOR_ERROR
// If this is a named type that is not a redefinition, add it to the slot
// table.
- CurModule.Types.push_back(*yyvsp[0].TypeVal);
+ CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
}
- delete yyvsp[0].TypeVal;
+ delete (yyvsp[(3) - (3)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 209:
-#line 2075 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType);
+ ;}
+ break;
+
+ case 212:
+#line 2078 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
- if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) {
+ if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
CHECK_FOR_ERROR
// If this is a named type that is not a redefinition, add it to the slot
// table.
- CurModule.Types.push_back(yyvsp[0].PrimType);
+ CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
}
CHECK_FOR_ERROR
- ;
- break;}
-case 210:
-#line 2086 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 213:
+#line 2089 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
/* "Externally Visible" Linkage */
- if (yyvsp[0].ConstVal == 0)
+ if ((yyvsp[(5) - (5)].ConstVal) == 0)
GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, GlobalValue::ExternalLinkage,
- yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal);
+ CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), GlobalValue::ExternalLinkage,
+ (yyvsp[(2) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal), (yyvsp[(3) - (5)].BoolVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 211:
-#line 2093 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 214:
+#line 2096 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CurGV = 0;
- ;
- break;}
-case 212:
-#line 2097 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].ConstVal == 0)
+ ;}
+ break;
+
+ case 215:
+#line 2100 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(6) - (6)].ConstVal) == 0)
GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal);
+ CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), (yyvsp[(6) - (6)].ConstVal)->getType(), (yyvsp[(6) - (6)].ConstVal), (yyvsp[(4) - (6)].BoolVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 213:
-#line 2102 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 216:
+#line 2105 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CurGV = 0;
- ;
- break;}
-case 214:
-#line 2106 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 217:
+#line 2109 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
- CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0, yyvsp[-2].BoolVal);
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (6)].TypeVal))->getDescription());
+ CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), *(yyvsp[(6) - (6)].TypeVal), 0, (yyvsp[(4) - (6)].BoolVal));
CHECK_FOR_ERROR
- delete yyvsp[0].TypeVal;
- ;
- break;}
-case 215:
-#line 2112 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ delete (yyvsp[(6) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 218:
+#line 2115 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CurGV = 0;
CHECK_FOR_ERROR
- ;
- break;}
-case 216:
-#line 2116 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 219:
+#line 2119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
std::string Name;
- if (yyvsp[-4].StrVal) {
- Name = *yyvsp[-4].StrVal;
- delete yyvsp[-4].StrVal;
+ if ((yyvsp[(1) - (5)].StrVal)) {
+ Name = *(yyvsp[(1) - (5)].StrVal);
+ delete (yyvsp[(1) - (5)].StrVal);
}
if (Name.empty())
GEN_ERROR("Alias name cannot be empty");
- Constant* Aliasee = yyvsp[0].ConstVal;
+ Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
if (Aliasee == 0)
GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
- GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee,
+ GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
CurModule.CurrentModule);
- GA->setVisibility(yyvsp[-3].Visibility);
+ GA->setVisibility((yyvsp[(2) - (5)].Visibility));
InsertValue(GA, CurModule.Values);
@@ -3976,152 +5016,167 @@
ID.destroy();
CHECK_FOR_ERROR
- ;
- break;}
-case 217:
-#line 2156 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CHECK_FOR_ERROR
- ;
- break;}
-case 218:
-#line 2159 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 220:
+#line 2159 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CHECK_FOR_ERROR
- ;
- break;}
-case 219:
-#line 2165 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 221:
+#line 2162 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 222:
+#line 2168 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
if (AsmSoFar.empty())
- CurModule.CurrentModule->setModuleInlineAsm(*yyvsp[0].StrVal);
+ CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
else
- CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
+ CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
+ delete (yyvsp[(1) - (1)].StrVal);
CHECK_FOR_ERROR
-;
- break;}
-case 220:
-#line 2175 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
- ;
- break;}
-case 221:
-#line 2179 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
- ;
- break;}
-case 223:
-#line 2186 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
+;}
+ break;
+
+ case 223:
+#line 2178 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
+ delete (yyvsp[(3) - (3)].StrVal);
+ ;}
+ break;
+
+ case 224:
+#line 2182 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
+ delete (yyvsp[(3) - (3)].StrVal);
+ ;}
+ break;
+
+ case 226:
+#line 2189 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
+ delete (yyvsp[(3) - (3)].StrVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 224:
-#line 2191 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
+ ;}
+ break;
+
+ case 227:
+#line 2194 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
+ delete (yyvsp[(1) - (1)].StrVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 225:
-#line 2196 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 228:
+#line 2199 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
CHECK_FOR_ERROR
- ;
- break;}
-case 226:
-#line 2205 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 229:
+#line 2208 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- if (*yyvsp[-2].TypeVal == Type::VoidTy)
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
+ if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal;
- yyval.ArgList = yyvsp[-4].ArgList;
- yyvsp[-4].ArgList->push_back(E);
- CHECK_FOR_ERROR
- ;
- break;}
-case 227:
-#line 2215 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
+ (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
+ (yyvsp[(1) - (5)].ArgList)->push_back(E);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 230:
+#line 2218 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- if (*yyvsp[-2].TypeVal == Type::VoidTy)
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
+ if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal;
- yyval.ArgList = new ArgListType;
- yyval.ArgList->push_back(E);
- CHECK_FOR_ERROR
- ;
- break;}
-case 228:
-#line 2226 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ArgList = yyvsp[0].ArgList;
+ ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
+ (yyval.ArgList) = new ArgListType;
+ (yyval.ArgList)->push_back(E);
CHECK_FOR_ERROR
- ;
- break;}
-case 229:
-#line 2230 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ArgList = yyvsp[-2].ArgList;
+ ;}
+ break;
+
+ case 231:
+#line 2229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 232:
+#line 2233 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
struct ArgListEntry E;
E.Ty = new PATypeHolder(Type::VoidTy);
E.Name = 0;
E.Attrs = ParamAttr::None;
- yyval.ArgList->push_back(E);
+ (yyval.ArgList)->push_back(E);
CHECK_FOR_ERROR
- ;
- break;}
-case 230:
-#line 2239 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ArgList = new ArgListType;
+ ;}
+ break;
+
+ case 233:
+#line 2242 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ArgList) = new ArgListType;
struct ArgListEntry E;
E.Ty = new PATypeHolder(Type::VoidTy);
E.Name = 0;
E.Attrs = ParamAttr::None;
- yyval.ArgList->push_back(E);
+ (yyval.ArgList)->push_back(E);
CHECK_FOR_ERROR
- ;
- break;}
-case 231:
-#line 2248 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ArgList = 0;
+ ;}
+ break;
+
+ case 234:
+#line 2251 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ArgList) = 0;
CHECK_FOR_ERROR
- ;
- break;}
-case 232:
-#line 2254 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- std::string FunctionName(*yyvsp[-6].StrVal);
- delete yyvsp[-6].StrVal; // Free strdup'd memory!
+ ;}
+ break;
+
+ case 235:
+#line 2257 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ std::string FunctionName(*(yyvsp[(3) - (9)].StrVal));
+ delete (yyvsp[(3) - (9)].StrVal); // Free strdup'd memory!
// Check the function result for abstractness if this is a define. We should
// have no abstract types at this point
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal))
- GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription());
+ if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal)))
+ GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription());
std::vector ParamTypeList;
ParamAttrsVector Attrs;
- if (yyvsp[-2].ParamAttrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-2].ParamAttrs;
+ if ((yyvsp[(7) - (9)].ParamAttrs) != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(7) - (9)].ParamAttrs);
Attrs.push_back(PAWI);
}
- if (yyvsp[-4].ArgList) { // If there are arguments...
+ if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments...
unsigned index = 1;
- for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I, ++index) {
+ for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I, ++index) {
const Type* Ty = I->Ty->get();
if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
@@ -4141,9 +5196,9 @@
if (!Attrs.empty())
PAL = ParamAttrsList::get(Attrs);
- FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, PAL);
+ FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, PAL);
const PointerType *PFT = PointerType::get(FT);
- delete yyvsp[-7].TypeVal;
+ delete (yyvsp[(2) - (9)].TypeVal);
ValID ID;
if (!FunctionName.empty()) {
@@ -4192,26 +5247,26 @@
Fn->setLinkage(CurFun.Linkage);
Fn->setVisibility(CurFun.Visibility);
}
- Fn->setCallingConv(yyvsp[-8].UIntVal);
- Fn->setAlignment(yyvsp[0].UIntVal);
- if (yyvsp[-1].StrVal) {
- Fn->setSection(*yyvsp[-1].StrVal);
- delete yyvsp[-1].StrVal;
+ Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal));
+ Fn->setAlignment((yyvsp[(9) - (9)].UIntVal));
+ if ((yyvsp[(8) - (9)].StrVal)) {
+ Fn->setSection(*(yyvsp[(8) - (9)].StrVal));
+ delete (yyvsp[(8) - (9)].StrVal);
}
// Add all of the arguments we parsed to the function...
- if (yyvsp[-4].ArgList) { // Is null if empty...
+ if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty...
if (isVarArg) { // Nuke the last entry
- assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 &&
+ assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 &&
"Not a varargs marker!");
- delete yyvsp[-4].ArgList->back().Ty;
- yyvsp[-4].ArgList->pop_back(); // Delete the last entry
+ delete (yyvsp[(5) - (9)].ArgList)->back().Ty;
+ (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry
}
Function::arg_iterator ArgIt = Fn->arg_begin();
Function::arg_iterator ArgEnd = Fn->arg_end();
unsigned Idx = 1;
- for (ArgListType::iterator I = yyvsp[-4].ArgList->begin();
- I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
+ for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin();
+ I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
delete I->Ty; // Delete the typeholder...
setValueName(ArgIt, I->Name); // Insert arg into symtab...
CHECK_FOR_ERROR
@@ -4219,114 +5274,128 @@
Idx++;
}
- delete yyvsp[-4].ArgList; // We're now done with the argument list
+ delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list
}
CHECK_FOR_ERROR
-;
- break;}
-case 235:
-#line 2376 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.FunctionVal = CurFun.CurrentFunction;
+;}
+ break;
+
+ case 238:
+#line 2379 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.FunctionVal) = CurFun.CurrentFunction;
// Make sure that we keep track of the linkage type even if there was a
// previous "declare".
- yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage);
- yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility);
-;
- break;}
-case 238:
-#line 2387 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.FunctionVal = yyvsp[-1].FunctionVal;
+ (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
+ (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
+;}
+ break;
+
+ case 241:
+#line 2390 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
-;
- break;}
-case 239:
-#line 2392 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage);
- CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility);
- yyval.FunctionVal = CurFun.CurrentFunction;
+;}
+ break;
+
+ case 242:
+#line 2395 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
+ CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
+ (yyval.FunctionVal) = CurFun.CurrentFunction;
CurFun.FunctionDone();
CHECK_FOR_ERROR
- ;
- break;}
-case 240:
-#line 2404 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = false;
+ ;}
+ break;
+
+ case 243:
+#line 2407 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = false;
CHECK_FOR_ERROR
- ;
- break;}
-case 241:
-#line 2408 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = true;
+ ;}
+ break;
+
+ case 244:
+#line 2411 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = true;
CHECK_FOR_ERROR
- ;
- break;}
-case 242:
-#line 2413 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // A reference to a direct constant
- yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val);
- CHECK_FOR_ERROR
- ;
- break;}
-case 243:
-#line 2417 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val);
+ ;}
+ break;
+
+ case 245:
+#line 2416 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // A reference to a direct constant
+ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
CHECK_FOR_ERROR
- ;
- break;}
-case 244:
-#line 2421 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Perhaps it's an FP constant?
- yyval.ValIDVal = ValID::create(yyvsp[0].FPVal);
- CHECK_FOR_ERROR
- ;
- break;}
-case 245:
-#line 2425 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::create(ConstantInt::getTrue());
+ ;}
+ break;
+
+ case 246:
+#line 2420 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
CHECK_FOR_ERROR
- ;
- break;}
-case 246:
-#line 2429 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::create(ConstantInt::getFalse());
+ ;}
+ break;
+
+ case 247:
+#line 2424 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Perhaps it's an FP constant?
+ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 247:
-#line 2433 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::createNull();
+ ;}
+ break;
+
+ case 248:
+#line 2428 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
CHECK_FOR_ERROR
- ;
- break;}
-case 248:
-#line 2437 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::createUndef();
+ ;}
+ break;
+
+ case 249:
+#line 2432 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 250:
+#line 2436 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::createNull();
CHECK_FOR_ERROR
- ;
- break;}
-case 249:
-#line 2441 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // A vector zero constant.
- yyval.ValIDVal = ValID::createZeroInit();
- CHECK_FOR_ERROR
- ;
- break;}
-case 250:
-#line 2445 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Nonempty unsized packed vector
- const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType();
- int NumElements = yyvsp[-1].ConstVector->size();
+ ;}
+ break;
+
+ case 251:
+#line 2440 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::createUndef();
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 252:
+#line 2444 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // A vector zero constant.
+ (yyval.ValIDVal) = ValID::createZeroInit();
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 253:
+#line 2448 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Nonempty unsized packed vector
+ const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
+ int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
VectorType* pt = VectorType::get(ETy, NumElements);
PATypeHolder* PTy = new PATypeHolder(
@@ -4338,213 +5407,233 @@
);
// Verify all elements are correct type!
- for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) {
- if (ETy != (*yyvsp[-1].ConstVector)[i]->getType())
+ for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
+ if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
ETy->getDescription() +"' as required!\nIt is of type '" +
- (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'.");
+ (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
}
- yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector));
- delete PTy; delete yyvsp[-1].ConstVector;
+ (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
+ delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 254:
+#line 2473 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 255:
+#line 2477 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
+ delete (yyvsp[(3) - (5)].StrVal);
+ delete (yyvsp[(5) - (5)].StrVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 256:
+#line 2487 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Is it an integer reference...?
+ (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 257:
+#line 2491 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 258:
+#line 2495 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Is it a named reference...?
+ (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
+ delete (yyvsp[(1) - (1)].StrVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 259:
+#line 2500 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Is it a named reference...?
+ (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
+ delete (yyvsp[(1) - (1)].StrVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 262:
+#line 2513 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
+ (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
+ delete (yyvsp[(1) - (2)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 263:
+#line 2522 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 264:
+#line 2526 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Do not allow functions with 0 basic blocks
+ (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 265:
+#line 2535 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
+ CHECK_FOR_ERROR
+ InsertValue((yyvsp[(3) - (3)].TermInstVal));
+ (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
+ (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 266:
+#line 2544 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal)))
+ if (CastInst *CI2 = dyn_cast(CI1->getOperand(0)))
+ if (CI2->getParent() == 0)
+ (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
+ (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
+ (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 267:
+#line 2553 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Empty space between instruction lists
+ (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 268:
+#line 2557 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Labelled (named) basic block
+ (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
+ delete (yyvsp[(1) - (1)].StrVal);
+ CHECK_FOR_ERROR
+
+ ;}
+ break;
+
+ case 269:
+#line 2564 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Return with a result...
+ (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal));
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 270:
+#line 2568 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Return with no result...
+ (yyval.TermInstVal) = new ReturnInst();
CHECK_FOR_ERROR
- ;
- break;}
-case 251:
-#line 2470 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal);
+ ;}
+ break;
+
+ case 271:
+#line 2572 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Unconditional Branch...
+ BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 252:
-#line 2474 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal);
- delete yyvsp[-2].StrVal;
- delete yyvsp[0].StrVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 253:
-#line 2484 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Is it an integer reference...?
- yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal);
- CHECK_FOR_ERROR
- ;
- break;}
-case 254:
-#line 2488 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal);
+ (yyval.TermInstVal) = new BranchInst(tmpBB);
+ ;}
+ break;
+
+ case 272:
+#line 2577 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
+ BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 255:
-#line 2492 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Is it a named reference...?
- yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 256:
-#line 2497 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Is it a named reference...?
- yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal);
- delete yyvsp[0].StrVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 259:
-#line 2510 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal);
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 260:
-#line 2519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.FunctionVal = yyvsp[-1].FunctionVal;
+ BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 261:
-#line 2523 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Do not allow functions with 0 basic blocks
- yyval.FunctionVal = yyvsp[-1].FunctionVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 262:
-#line 2532 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal);
+ Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
CHECK_FOR_ERROR
- InsertValue(yyvsp[0].TermInstVal);
- yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal);
- yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 263:
-#line 2541 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal))
- if (CastInst *CI2 = dyn_cast(CI1->getOperand(0)))
- if (CI2->getParent() == 0)
- yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2);
- yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal);
- yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 264:
-#line 2550 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Empty space between instruction lists
- yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
- CHECK_FOR_ERROR
- ;
- break;}
-case 265:
-#line 2554 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Labelled (named) basic block
- yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal));
- delete yyvsp[0].StrVal;
- CHECK_FOR_ERROR
-
- ;
- break;}
-case 266:
-#line 2561 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Return with a result...
- yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal);
- CHECK_FOR_ERROR
- ;
- break;}
-case 267:
-#line 2565 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Return with no result...
- yyval.TermInstVal = new ReturnInst();
- CHECK_FOR_ERROR
- ;
- break;}
-case 268:
-#line 2569 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Unconditional Branch...
- BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
- CHECK_FOR_ERROR
- yyval.TermInstVal = new BranchInst(tmpBB);
- ;
- break;}
-case 269:
-#line 2574 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?");
- BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal);
- CHECK_FOR_ERROR
- BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal);
- CHECK_FOR_ERROR
- Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal);
- CHECK_FOR_ERROR
- yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal);
- ;
- break;}
-case 270:
-#line 2584 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal);
+ (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal);
+ ;}
+ break;
+
+ case 273:
+#line 2587 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal);
+ BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
CHECK_FOR_ERROR
- SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size());
- yyval.TermInstVal = S;
+ SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
+ (yyval.TermInstVal) = S;
- std::vector >::iterator I = yyvsp[-1].JumpTable->begin(),
- E = yyvsp[-1].JumpTable->end();
+ std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
+ E = (yyvsp[(8) - (9)].JumpTable)->end();
for (; I != E; ++I) {
if (ConstantInt *CI = dyn_cast(I->first))
S->addCase(CI, I->second);
else
GEN_ERROR("Switch case is constant, but not a simple integer");
}
- delete yyvsp[-1].JumpTable;
+ delete (yyvsp[(8) - (9)].JumpTable);
CHECK_FOR_ERROR
- ;
- break;}
-case 271:
-#line 2603 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal);
+ ;}
+ break;
+
+ case 274:
+#line 2606 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal);
+ BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
CHECK_FOR_ERROR
SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0);
- yyval.TermInstVal = S;
+ (yyval.TermInstVal) = S;
CHECK_FOR_ERROR
- ;
- break;}
-case 272:
-#line 2613 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 275:
+#line 2616 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
// Handle the short syntax
const PointerType *PFTy = 0;
const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) ||
+ if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) ||
!(Ty = dyn_cast(PFTy->getElementType()))) {
// Pull out the types of all of the arguments...
std::vector ParamTypes;
ParamAttrsVector Attrs;
- if (yyvsp[-6].ParamAttrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs;
+ if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
Attrs.push_back(PAWI);
}
- ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end();
+ ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
unsigned index = 1;
for (; I != E; ++I, ++index) {
const Type *Ty = I->Val->getType();
@@ -4560,22 +5649,22 @@
ParamAttrsList *PAL = 0;
if (!Attrs.empty())
PAL = ParamAttrsList::get(Attrs);
- Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, PAL);
+ Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, PAL);
PFTy = PointerType::get(Ty);
}
- delete yyvsp[-11].TypeVal;
+ delete (yyvsp[(3) - (14)].TypeVal);
- Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling...
+ Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
CHECK_FOR_ERROR
- BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal);
+ BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
CHECK_FOR_ERROR
- BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal);
+ BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
CHECK_FOR_ERROR
// Check the arguments
ValueList Args;
- if (yyvsp[-8].ParamList->empty()) { // Has no arguments?
+ if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
// Make sure no arguments is a good thing!
if (Ty->getNumParams() != 0)
GEN_ERROR("No arguments passed to a function that "
@@ -4585,7 +5674,7 @@
// correctly!
FunctionType::param_iterator I = Ty->param_begin();
FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end();
+ ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
for (; ArgI != ArgE && I != E; ++ArgI, ++I) {
if (ArgI->Val->getType() != *I)
@@ -4604,340 +5693,363 @@
// Create the InvokeInst
InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
- II->setCallingConv(yyvsp[-12].UIntVal);
- yyval.TermInstVal = II;
- delete yyvsp[-8].ParamList;
- CHECK_FOR_ERROR
- ;
- break;}
-case 273:
-#line 2692 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TermInstVal = new UnwindInst();
+ II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
+ (yyval.TermInstVal) = II;
+ delete (yyvsp[(6) - (14)].ParamList);
CHECK_FOR_ERROR
- ;
- break;}
-case 274:
-#line 2696 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TermInstVal = new UnreachableInst();
+ ;}
+ break;
+
+ case 276:
+#line 2695 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TermInstVal) = new UnwindInst();
CHECK_FOR_ERROR
- ;
- break;}
-case 275:
-#line 2703 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.JumpTable = yyvsp[-5].JumpTable;
- Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
+ ;}
+ break;
+
+ case 277:
+#line 2699 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.TermInstVal) = new UnreachableInst();
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 278:
+#line 2706 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
+ Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
CHECK_FOR_ERROR
if (V == 0)
GEN_ERROR("May only switch on a constant pool value");
- BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
+ BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
CHECK_FOR_ERROR
- yyval.JumpTable->push_back(std::make_pair(V, tmpBB));
- ;
- break;}
-case 276:
-#line 2714 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.JumpTable = new std::vector >();
- Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
+ (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
+ ;}
+ break;
+
+ case 279:
+#line 2717 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.JumpTable) = new std::vector >();
+ Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
CHECK_FOR_ERROR
if (V == 0)
GEN_ERROR("May only switch on a constant pool value");
- BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
+ BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
CHECK_FOR_ERROR
- yyval.JumpTable->push_back(std::make_pair(V, tmpBB));
- ;
- break;}
-case 277:
-#line 2727 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
+ ;}
+ break;
+
+ case 280:
+#line 2730 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
// Is this definition named?? if so, assign the name...
- setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal);
+ setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
CHECK_FOR_ERROR
- InsertValue(yyvsp[0].InstVal);
- yyval.InstVal = yyvsp[0].InstVal;
+ InsertValue((yyvsp[(2) - (2)].InstVal));
+ (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 278:
-#line 2737 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Used for PHI nodes
+ ;}
+ break;
+
+ case 281:
+#line 2740 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { // Used for PHI nodes
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription());
- yyval.PHIList = new std::list >();
- Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal);
- CHECK_FOR_ERROR
- yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB));
- delete yyvsp[-5].TypeVal;
- ;
- break;}
-case 279:
-#line 2748 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.PHIList = yyvsp[-6].PHIList;
- Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal);
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
+ (yyval.PHIList) = new std::list >();
+ Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
+ CHECK_FOR_ERROR
+ BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
+ CHECK_FOR_ERROR
+ (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
+ delete (yyvsp[(1) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 282:
+#line 2751 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
+ Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal);
+ BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
CHECK_FOR_ERROR
- yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB));
- ;
- break;}
-case 280:
-#line 2758 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
+ ;}
+ break;
+
+ case 283:
+#line 2761 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
// Used for call and invoke instructions
- yyval.ParamList = new ParamList();
- ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal);
- yyval.ParamList->push_back(E);
- delete yyvsp[-2].TypeVal;
- ;
- break;}
-case 281:
-#line 2767 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.ParamList) = new ParamList();
+ ParamListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal));
+ (yyval.ParamList)->push_back(E);
+ delete (yyvsp[(1) - (3)].TypeVal);
+ ;}
+ break;
+
+ case 284:
+#line 2770 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
// Labels are only valid in ASMs
- yyval.ParamList = new ParamList();
- ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal);
- yyval.ParamList->push_back(E);
- ;
- break;}
-case 282:
-#line 2773 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.ParamList) = new ParamList();
+ ParamListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getBBVal((yyvsp[(2) - (3)].ValIDVal));
+ (yyval.ParamList)->push_back(E);
+ ;}
+ break;
+
+ case 285:
+#line 2776 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- yyval.ParamList = yyvsp[-4].ParamList;
- ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal);
- yyval.ParamList->push_back(E);
- delete yyvsp[-2].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 283:
-#line 2782 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ParamList = yyvsp[-4].ParamList;
- ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal);
- yyval.ParamList->push_back(E);
- CHECK_FOR_ERROR
- ;
- break;}
-case 284:
-#line 2788 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ParamList = new ParamList(); ;
- break;}
-case 285:
-#line 2791 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ValueList = new std::vector(); ;
- break;}
-case 286:
-#line 2792 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValueList = yyvsp[-2].ValueList;
- yyval.ValueList->push_back(yyvsp[0].ValueVal);
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
+ (yyval.ParamList) = (yyvsp[(1) - (5)].ParamList);
+ ParamListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal));
+ (yyval.ParamList)->push_back(E);
+ delete (yyvsp[(3) - (5)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 287:
-#line 2799 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = true;
+ ;}
+ break;
+
+ case 286:
+#line 2785 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ParamList) = (yyvsp[(1) - (5)].ParamList);
+ ParamListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getBBVal((yyvsp[(4) - (5)].ValIDVal));
+ (yyval.ParamList)->push_back(E);
CHECK_FOR_ERROR
- ;
- break;}
-case 288:
-#line 2803 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = false;
+ ;}
+ break;
+
+ case 287:
+#line 2791 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ParamList) = new ParamList(); ;}
+ break;
+
+ case 288:
+#line 2794 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ { (yyval.ValueList) = new std::vector(); ;}
+ break;
+
+ case 289:
+#line 2795 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
+ (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 289:
-#line 2808 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 290:
+#line 2802 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = true;
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 291:
+#line 2806 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = false;
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 292:
+#line 2811 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() &&
- !isa((*yyvsp[-3].TypeVal).get()))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
+ if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
+ !isa((*(yyvsp[(2) - (5)].TypeVal)).get()))
GEN_ERROR(
"Arithmetic operator requires integer, FP, or packed operands");
- if (isa((*yyvsp[-3].TypeVal).get()) &&
- (yyvsp[-4].BinaryOpVal == Instruction::URem ||
- yyvsp[-4].BinaryOpVal == Instruction::SRem ||
- yyvsp[-4].BinaryOpVal == Instruction::FRem))
- GEN_ERROR("Remainder not supported on vector types");
- Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
+ Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
CHECK_FOR_ERROR
- Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
+ Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2);
- if (yyval.InstVal == 0)
+ (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
+ if ((yyval.InstVal) == 0)
GEN_ERROR("binary operator returned null");
- delete yyvsp[-3].TypeVal;
- ;
- break;}
-case 290:
-#line 2829 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ delete (yyvsp[(2) - (5)].TypeVal);
+ ;}
+ break;
+
+ case 293:
+#line 2827 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- if (!(*yyvsp[-3].TypeVal)->isInteger()) {
- if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) ||
- !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger())
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
+ if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
+ if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) ||
+ !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
GEN_ERROR("Logical operator requires integral operands");
}
- Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
+ Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
+ Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2);
- if (yyval.InstVal == 0)
+ (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
+ if ((yyval.InstVal) == 0)
GEN_ERROR("binary operator returned null");
- delete yyvsp[-3].TypeVal;
- ;
- break;}
-case 291:
-#line 2846 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ delete (yyvsp[(2) - (5)].TypeVal);
+ ;}
+ break;
+
+ case 294:
+#line 2844 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- if (isa((*yyvsp[-3].TypeVal).get()))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
+ if (isa((*(yyvsp[(3) - (6)].TypeVal)).get()))
GEN_ERROR("Vector types not supported by icmp instruction");
- Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
+ Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
+ Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2);
- if (yyval.InstVal == 0)
+ (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
+ if ((yyval.InstVal) == 0)
GEN_ERROR("icmp operator returned null");
- delete yyvsp[-3].TypeVal;
- ;
- break;}
-case 292:
-#line 2860 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ delete (yyvsp[(3) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 295:
+#line 2858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
- if (isa((*yyvsp[-3].TypeVal).get()))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
+ if (isa((*(yyvsp[(3) - (6)].TypeVal)).get()))
GEN_ERROR("Vector types not supported by fcmp instruction");
- Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
+ Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
+ Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2);
- if (yyval.InstVal == 0)
+ (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
+ if ((yyval.InstVal) == 0)
GEN_ERROR("fcmp operator returned null");
- delete yyvsp[-3].TypeVal;
- ;
- break;}
-case 293:
-#line 2874 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ delete (yyvsp[(3) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 296:
+#line 2872 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
- Value* Val = yyvsp[-2].ValueVal;
- const Type* DestTy = yyvsp[0].TypeVal->get();
- if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
+ Value* Val = (yyvsp[(2) - (4)].ValueVal);
+ const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
+ if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
GEN_ERROR("invalid cast opcode for cast from '" +
Val->getType()->getDescription() + "' to '" +
DestTy->getDescription() + "'");
- yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy);
- delete yyvsp[0].TypeVal;
- ;
- break;}
-case 294:
-#line 2886 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty)
+ (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
+ delete (yyvsp[(4) - (4)].TypeVal);
+ ;}
+ break;
+
+ case 297:
+#line 2884 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
GEN_ERROR("select condition must be boolean");
- if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType())
+ if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
GEN_ERROR("select value types should match");
- yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
+ (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 295:
-#line 2894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 298:
+#line 2892 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
- yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal);
- delete yyvsp[0].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 296:
-#line 2901 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
+ (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
+ delete (yyvsp[(4) - (4)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 299:
+#line 2899 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
GEN_ERROR("Invalid extractelement operands");
- yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
+ (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 297:
-#line 2907 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
+ ;}
+ break;
+
+ case 300:
+#line 2905 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid insertelement operands");
- yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
+ (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 298:
-#line 2913 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
+ ;}
+ break;
+
+ case 301:
+#line 2911 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid shufflevector operands");
- yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
+ (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 299:
-#line 2919 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- const Type *Ty = yyvsp[0].PHIList->front().first->getType();
+ ;}
+ break;
+
+ case 302:
+#line 2917 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
if (!Ty->isFirstClassType())
GEN_ERROR("PHI node operands must be of first class type");
- yyval.InstVal = new PHINode(Ty);
- ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size());
- while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) {
- if (yyvsp[0].PHIList->front().first->getType() != Ty)
+ (yyval.InstVal) = new PHINode(Ty);
+ ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
+ while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
+ if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
GEN_ERROR("All elements of a PHI node must be of the same type");
- cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second);
- yyvsp[0].PHIList->pop_front();
+ cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
+ (yyvsp[(2) - (2)].PHIList)->pop_front();
}
- delete yyvsp[0].PHIList; // Free the list...
+ delete (yyvsp[(2) - (2)].PHIList); // Free the list...
CHECK_FOR_ERROR
- ;
- break;}
-case 300:
-#line 2935 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 303:
+#line 2933 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
// Handle the short syntax
const PointerType *PFTy = 0;
const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) ||
+ if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) ||
!(Ty = dyn_cast(PFTy->getElementType()))) {
// Pull out the types of all of the arguments...
std::vector ParamTypes;
ParamAttrsVector Attrs;
- if (yyvsp[0].ParamAttrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[0].ParamAttrs;
+ if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
Attrs.push_back(PAWI);
}
unsigned index = 1;
- ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end();
+ ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
for (; I != E; ++I, ++index) {
const Type *Ty = I->Val->getType();
if (Ty == Type::VoidTy)
@@ -4953,11 +6065,11 @@
if (!Attrs.empty())
PAL = ParamAttrsList::get(Attrs);
- Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, PAL);
+ Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, PAL);
PFTy = PointerType::get(Ty);
}
- Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling...
+ Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
CHECK_FOR_ERROR
// Check for call to invalid intrinsic to avoid crashing later.
@@ -4971,7 +6083,7 @@
// Check the arguments
ValueList Args;
- if (yyvsp[-2].ParamList->empty()) { // Has no arguments?
+ if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
// Make sure no arguments is a good thing!
if (Ty->getNumParams() != 0)
GEN_ERROR("No arguments passed to a function that "
@@ -4982,7 +6094,7 @@
//
FunctionType::param_iterator I = Ty->param_begin();
FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end();
+ ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
for (; ArgI != ArgE && I != E; ++ArgI, ++I) {
if (ArgI->Val->getType() != *I)
@@ -4999,365 +6111,371 @@
}
// Create the call node
CallInst *CI = new CallInst(V, Args.begin(), Args.end());
- CI->setTailCall(yyvsp[-7].BoolVal);
- CI->setCallingConv(yyvsp[-6].UIntVal);
- yyval.InstVal = CI;
- delete yyvsp[-2].ParamList;
- delete yyvsp[-5].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 301:
-#line 3019 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.InstVal = yyvsp[0].InstVal;
+ CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
+ CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
+ (yyval.InstVal) = CI;
+ delete (yyvsp[(6) - (8)].ParamList);
+ delete (yyvsp[(3) - (8)].TypeVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 302:
-#line 3024 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = true;
+ ;}
+ break;
+
+ case 304:
+#line 3017 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 303:
-#line 3028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BoolVal = false;
+ ;}
+ break;
+
+ case 305:
+#line 3022 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = true;
CHECK_FOR_ERROR
- ;
- break;}
-case 304:
-#line 3035 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 306:
+#line 3026 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ (yyval.BoolVal) = false;
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 307:
+#line 3033 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal);
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 305:
-#line 3042 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
+ (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
+ delete (yyvsp[(2) - (3)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 308:
+#line 3040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
- Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal);
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
+ Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal);
- delete yyvsp[-4].TypeVal;
- ;
- break;}
-case 306:
-#line 3050 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
+ delete (yyvsp[(2) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 309:
+#line 3048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
- yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal);
- delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 307:
-#line 3057 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
+ (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
+ delete (yyvsp[(2) - (3)].TypeVal);
+ CHECK_FOR_ERROR
+ ;}
+ break;
+
+ case 310:
+#line 3055 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
- Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal);
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
+ Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal);
- delete yyvsp[-4].TypeVal;
- ;
- break;}
-case 308:
-#line 3065 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!isa(yyvsp[0].ValueVal->getType()))
+ (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
+ delete (yyvsp[(2) - (6)].TypeVal);
+ ;}
+ break;
+
+ case 311:
+#line 3063 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
+ if (!isa((yyvsp[(2) - (2)].ValueVal)->getType()))
GEN_ERROR("Trying to free nonpointer type " +
- yyvsp[0].ValueVal->getType()->getDescription() + "");
- yyval.InstVal = new FreeInst(yyvsp[0].ValueVal);
+ (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
+ (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
CHECK_FOR_ERROR
- ;
- break;}
-case 309:
-#line 3073 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ ;}
+ break;
+
+ case 312:
+#line 3071 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- if (!isa(yyvsp[-2].TypeVal->get()))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
+ if (!isa((yyvsp[(3) - (5)].TypeVal)->get()))
GEN_ERROR("Can't load from nonpointer type: " +
- (*yyvsp[-2].TypeVal)->getDescription());
- if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType())
+ (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
+ if (!cast((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
GEN_ERROR("Can't load from pointer of non-first-class type: " +
- (*yyvsp[-2].TypeVal)->getDescription());
- Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
+ (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
+ Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal);
- delete yyvsp[-2].TypeVal;
- ;
- break;}
-case 310:
-#line 3087 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
+ delete (yyvsp[(3) - (5)].TypeVal);
+ ;}
+ break;
+
+ case 313:
+#line 3085 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get());
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
+ const PointerType *PT = dyn_cast((yyvsp[(5) - (7)].TypeVal)->get());
if (!PT)
GEN_ERROR("Can't store to a nonpointer type: " +
- (*yyvsp[-2].TypeVal)->getDescription());
+ (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
const Type *ElTy = PT->getElementType();
- if (ElTy != yyvsp[-4].ValueVal->getType())
- GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() +
+ if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
+ GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
"' into space of type '" + ElTy->getDescription() + "'");
- Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
+ Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal);
- delete yyvsp[-2].TypeVal;
- ;
- break;}
-case 311:
-#line 3104 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+ (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
+ delete (yyvsp[(5) - (7)].TypeVal);
+ ;}
+ break;
+
+ case 314:
+#line 3102 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+ {
if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
- if (!isa(yyvsp[-2].TypeVal->get()))
+ GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
+ if (!isa((yyvsp[(2) - (4)].TypeVal)->get()))
GEN_ERROR("getelementptr insn requires pointer operand");
- if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end(), true))
+ if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true))
GEN_ERROR("Invalid getelementptr indices for type '" +
- (*yyvsp[-2].TypeVal)->getDescription()+ "'");
- Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
+ (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
+ Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
CHECK_FOR_ERROR
- yyval.InstVal = new GetElementPtrInst(tmpVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end());
- delete yyvsp[-2].TypeVal;
- delete yyvsp[0].ValueList;
- ;
- break;}
-}
- /* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/share/bison.simple"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-#ifdef YYLSP_NEEDED
- yylsp -= yylen;
-#endif
+ (yyval.InstVal) = new GetElementPtrInst(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
+ delete (yyvsp[(2) - (4)].TypeVal);
+ delete (yyvsp[(4) - (4)].ValueList);
+ ;}
+ 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");
- }
-#endif
+
+/* Line 1267 of yacc.c. */
+#line 6265 "llvmAsmParser.tab.c"
+ default: break;
+ }
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
*++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 - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTBASE];
+ yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
-yyerrlab: /* here on detecting error */
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
{
++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- 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
-#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
+#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
}
- 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. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
+ /* If just tried and failed to reuse look-ahead token after an
+ error, discard it. */
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
- yychar = YYEMPTY;
+ if (yychar <= YYEOF)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
- /* Else will try to reuse lookahead token
- after shifting the error token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
+ /* Else will try to reuse look-ahead token after shifting the error
+ token. */
+ goto yyerrlab1;
-yyerrdefault: /* current state does not do anything special for the error token. */
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
-#endif
+/*---------------------------------------------------.
+| 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;
-yyerrpop: /* pop the current state because it cannot handle the error token */
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
- yylsp--;
-#endif
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
-#if YYDEBUG != 0
- if (yydebug)
+ for (;;)
{
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
-yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp);
+ YYPOPSTACK (1);
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
}
- else if (yyn == 0)
- goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
-#endif
-
*++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
+
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 0;
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
+/*-------------------------------------.
+| 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)
{
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
+ 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);
#endif
- }
- return 1;
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 3121 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+
+
+#line 3119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
// common code from the two 'RunVMAsmParser' functions
@@ -5438,3 +6556,4 @@
GenerateError(errMsg);
return 0;
}
+
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=44110&r1=44109&r2=44110&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Wed Nov 14 03:53:48 2007
@@ -1,4 +1,345 @@
-typedef union {
+/* 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 {
+ ESINT64VAL = 258,
+ EUINT64VAL = 259,
+ ESAPINTVAL = 260,
+ EUAPINTVAL = 261,
+ LOCALVAL_ID = 262,
+ GLOBALVAL_ID = 263,
+ FPVAL = 264,
+ VOID = 265,
+ INTTYPE = 266,
+ FLOAT = 267,
+ DOUBLE = 268,
+ X86_FP80 = 269,
+ FP128 = 270,
+ PPC_FP128 = 271,
+ LABEL = 272,
+ TYPE = 273,
+ LOCALVAR = 274,
+ GLOBALVAR = 275,
+ LABELSTR = 276,
+ STRINGCONSTANT = 277,
+ ATSTRINGCONSTANT = 278,
+ PCTSTRINGCONSTANT = 279,
+ ZEROINITIALIZER = 280,
+ TRUETOK = 281,
+ FALSETOK = 282,
+ BEGINTOK = 283,
+ ENDTOK = 284,
+ DECLARE = 285,
+ DEFINE = 286,
+ GLOBAL = 287,
+ CONSTANT = 288,
+ SECTION = 289,
+ ALIAS = 290,
+ VOLATILE = 291,
+ THREAD_LOCAL = 292,
+ TO = 293,
+ DOTDOTDOT = 294,
+ NULL_TOK = 295,
+ UNDEF = 296,
+ INTERNAL = 297,
+ LINKONCE = 298,
+ WEAK = 299,
+ APPENDING = 300,
+ DLLIMPORT = 301,
+ DLLEXPORT = 302,
+ EXTERN_WEAK = 303,
+ OPAQUE = 304,
+ EXTERNAL = 305,
+ TARGET = 306,
+ TRIPLE = 307,
+ ALIGN = 308,
+ DEPLIBS = 309,
+ CALL = 310,
+ TAIL = 311,
+ ASM_TOK = 312,
+ MODULE = 313,
+ SIDEEFFECT = 314,
+ CC_TOK = 315,
+ CCC_TOK = 316,
+ FASTCC_TOK = 317,
+ COLDCC_TOK = 318,
+ X86_STDCALLCC_TOK = 319,
+ X86_FASTCALLCC_TOK = 320,
+ DATALAYOUT = 321,
+ RET = 322,
+ BR = 323,
+ SWITCH = 324,
+ INVOKE = 325,
+ UNWIND = 326,
+ UNREACHABLE = 327,
+ ADD = 328,
+ SUB = 329,
+ MUL = 330,
+ UDIV = 331,
+ SDIV = 332,
+ FDIV = 333,
+ UREM = 334,
+ SREM = 335,
+ FREM = 336,
+ AND = 337,
+ OR = 338,
+ XOR = 339,
+ SHL = 340,
+ LSHR = 341,
+ ASHR = 342,
+ ICMP = 343,
+ FCMP = 344,
+ EQ = 345,
+ NE = 346,
+ SLT = 347,
+ SGT = 348,
+ SLE = 349,
+ SGE = 350,
+ ULT = 351,
+ UGT = 352,
+ ULE = 353,
+ UGE = 354,
+ OEQ = 355,
+ ONE = 356,
+ OLT = 357,
+ OGT = 358,
+ OLE = 359,
+ OGE = 360,
+ ORD = 361,
+ UNO = 362,
+ UEQ = 363,
+ UNE = 364,
+ MALLOC = 365,
+ ALLOCA = 366,
+ FREE = 367,
+ LOAD = 368,
+ STORE = 369,
+ GETELEMENTPTR = 370,
+ TRUNC = 371,
+ ZEXT = 372,
+ SEXT = 373,
+ FPTRUNC = 374,
+ FPEXT = 375,
+ BITCAST = 376,
+ UITOFP = 377,
+ SITOFP = 378,
+ FPTOUI = 379,
+ FPTOSI = 380,
+ INTTOPTR = 381,
+ PTRTOINT = 382,
+ PHI_TOK = 383,
+ SELECT = 384,
+ VAARG = 385,
+ EXTRACTELEMENT = 386,
+ INSERTELEMENT = 387,
+ SHUFFLEVECTOR = 388,
+ SIGNEXT = 389,
+ ZEROEXT = 390,
+ NORETURN = 391,
+ INREG = 392,
+ SRET = 393,
+ NOUNWIND = 394,
+ NOALIAS = 395,
+ BYVAL = 396,
+ NEST = 397,
+ CONST = 398,
+ PURE = 399,
+ DEFAULT = 400,
+ HIDDEN = 401,
+ PROTECTED = 402
+ };
+#endif
+/* Tokens. */
+#define ESINT64VAL 258
+#define EUINT64VAL 259
+#define ESAPINTVAL 260
+#define EUAPINTVAL 261
+#define LOCALVAL_ID 262
+#define GLOBALVAL_ID 263
+#define FPVAL 264
+#define VOID 265
+#define INTTYPE 266
+#define FLOAT 267
+#define DOUBLE 268
+#define X86_FP80 269
+#define FP128 270
+#define PPC_FP128 271
+#define LABEL 272
+#define TYPE 273
+#define LOCALVAR 274
+#define GLOBALVAR 275
+#define LABELSTR 276
+#define STRINGCONSTANT 277
+#define ATSTRINGCONSTANT 278
+#define PCTSTRINGCONSTANT 279
+#define ZEROINITIALIZER 280
+#define TRUETOK 281
+#define FALSETOK 282
+#define BEGINTOK 283
+#define ENDTOK 284
+#define DECLARE 285
+#define DEFINE 286
+#define GLOBAL 287
+#define CONSTANT 288
+#define SECTION 289
+#define ALIAS 290
+#define VOLATILE 291
+#define THREAD_LOCAL 292
+#define TO 293
+#define DOTDOTDOT 294
+#define NULL_TOK 295
+#define UNDEF 296
+#define INTERNAL 297
+#define LINKONCE 298
+#define WEAK 299
+#define APPENDING 300
+#define DLLIMPORT 301
+#define DLLEXPORT 302
+#define EXTERN_WEAK 303
+#define OPAQUE 304
+#define EXTERNAL 305
+#define TARGET 306
+#define TRIPLE 307
+#define ALIGN 308
+#define DEPLIBS 309
+#define CALL 310
+#define TAIL 311
+#define ASM_TOK 312
+#define MODULE 313
+#define SIDEEFFECT 314
+#define CC_TOK 315
+#define CCC_TOK 316
+#define FASTCC_TOK 317
+#define COLDCC_TOK 318
+#define X86_STDCALLCC_TOK 319
+#define X86_FASTCALLCC_TOK 320
+#define DATALAYOUT 321
+#define RET 322
+#define BR 323
+#define SWITCH 324
+#define INVOKE 325
+#define UNWIND 326
+#define UNREACHABLE 327
+#define ADD 328
+#define SUB 329
+#define MUL 330
+#define UDIV 331
+#define SDIV 332
+#define FDIV 333
+#define UREM 334
+#define SREM 335
+#define FREM 336
+#define AND 337
+#define OR 338
+#define XOR 339
+#define SHL 340
+#define LSHR 341
+#define ASHR 342
+#define ICMP 343
+#define FCMP 344
+#define EQ 345
+#define NE 346
+#define SLT 347
+#define SGT 348
+#define SLE 349
+#define SGE 350
+#define ULT 351
+#define UGT 352
+#define ULE 353
+#define UGE 354
+#define OEQ 355
+#define ONE 356
+#define OLT 357
+#define OGT 358
+#define OLE 359
+#define OGE 360
+#define ORD 361
+#define UNO 362
+#define UEQ 363
+#define UNE 364
+#define MALLOC 365
+#define ALLOCA 366
+#define FREE 367
+#define LOAD 368
+#define STORE 369
+#define GETELEMENTPTR 370
+#define TRUNC 371
+#define ZEXT 372
+#define SEXT 373
+#define FPTRUNC 374
+#define FPEXT 375
+#define BITCAST 376
+#define UITOFP 377
+#define SITOFP 378
+#define FPTOUI 379
+#define FPTOSI 380
+#define INTTOPTR 381
+#define PTRTOINT 382
+#define PHI_TOK 383
+#define SELECT 384
+#define VAARG 385
+#define EXTRACTELEMENT 386
+#define INSERTELEMENT 387
+#define SHUFFLEVECTOR 388
+#define SIGNEXT 389
+#define ZEROEXT 390
+#define NORETURN 391
+#define INREG 392
+#define SRET 393
+#define NOUNWIND 394
+#define NOALIAS 395
+#define BYVAL 396
+#define NEST 397
+#define CONST 398
+#define PURE 399
+#define DEFAULT 400
+#define HIDDEN 401
+#define PROTECTED 402
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 968 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
llvm::BasicBlock *BasicBlockVal;
@@ -43,150 +384,14 @@
llvm::Instruction::OtherOps OtherOpVal;
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
-} YYSTYPE;
-#define ESINT64VAL 257
-#define EUINT64VAL 258
-#define ESAPINTVAL 259
-#define EUAPINTVAL 260
-#define LOCALVAL_ID 261
-#define GLOBALVAL_ID 262
-#define FPVAL 263
-#define VOID 264
-#define INTTYPE 265
-#define FLOAT 266
-#define DOUBLE 267
-#define X86_FP80 268
-#define FP128 269
-#define PPC_FP128 270
-#define LABEL 271
-#define TYPE 272
-#define LOCALVAR 273
-#define GLOBALVAR 274
-#define LABELSTR 275
-#define STRINGCONSTANT 276
-#define ATSTRINGCONSTANT 277
-#define PCTSTRINGCONSTANT 278
-#define ZEROINITIALIZER 279
-#define TRUETOK 280
-#define FALSETOK 281
-#define BEGINTOK 282
-#define ENDTOK 283
-#define DECLARE 284
-#define DEFINE 285
-#define GLOBAL 286
-#define CONSTANT 287
-#define SECTION 288
-#define ALIAS 289
-#define VOLATILE 290
-#define THREAD_LOCAL 291
-#define TO 292
-#define DOTDOTDOT 293
-#define NULL_TOK 294
-#define UNDEF 295
-#define INTERNAL 296
-#define LINKONCE 297
-#define WEAK 298
-#define APPENDING 299
-#define DLLIMPORT 300
-#define DLLEXPORT 301
-#define EXTERN_WEAK 302
-#define OPAQUE 303
-#define EXTERNAL 304
-#define TARGET 305
-#define TRIPLE 306
-#define ALIGN 307
-#define DEPLIBS 308
-#define CALL 309
-#define TAIL 310
-#define ASM_TOK 311
-#define MODULE 312
-#define SIDEEFFECT 313
-#define CC_TOK 314
-#define CCC_TOK 315
-#define FASTCC_TOK 316
-#define COLDCC_TOK 317
-#define X86_STDCALLCC_TOK 318
-#define X86_FASTCALLCC_TOK 319
-#define DATALAYOUT 320
-#define RET 321
-#define BR 322
-#define SWITCH 323
-#define INVOKE 324
-#define UNWIND 325
-#define UNREACHABLE 326
-#define ADD 327
-#define SUB 328
-#define MUL 329
-#define UDIV 330
-#define SDIV 331
-#define FDIV 332
-#define UREM 333
-#define SREM 334
-#define FREM 335
-#define AND 336
-#define OR 337
-#define XOR 338
-#define SHL 339
-#define LSHR 340
-#define ASHR 341
-#define ICMP 342
-#define FCMP 343
-#define EQ 344
-#define NE 345
-#define SLT 346
-#define SGT 347
-#define SLE 348
-#define SGE 349
-#define ULT 350
-#define UGT 351
-#define ULE 352
-#define UGE 353
-#define OEQ 354
-#define ONE 355
-#define OLT 356
-#define OGT 357
-#define OLE 358
-#define OGE 359
-#define ORD 360
-#define UNO 361
-#define UEQ 362
-#define UNE 363
-#define MALLOC 364
-#define ALLOCA 365
-#define FREE 366
-#define LOAD 367
-#define STORE 368
-#define GETELEMENTPTR 369
-#define TRUNC 370
-#define ZEXT 371
-#define SEXT 372
-#define FPTRUNC 373
-#define FPEXT 374
-#define BITCAST 375
-#define UITOFP 376
-#define SITOFP 377
-#define FPTOUI 378
-#define FPTOSI 379
-#define INTTOPTR 380
-#define PTRTOINT 381
-#define PHI_TOK 382
-#define SELECT 383
-#define VAARG 384
-#define EXTRACTELEMENT 385
-#define INSERTELEMENT 386
-#define SHUFFLEVECTOR 387
-#define SIGNEXT 388
-#define ZEROEXT 389
-#define NORETURN 390
-#define INREG 391
-#define SRET 392
-#define NOUNWIND 393
-#define NOALIAS 394
-#define BYVAL 395
-#define NEST 396
-#define DEFAULT 397
-#define HIDDEN 398
-#define PROTECTED 399
-
+}
+/* Line 1489 of yacc.c. */
+#line 390 "llvmAsmParser.tab.h"
+ YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
extern YYSTYPE llvmAsmlval;
+
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=44110&r1=44109&r2=44110&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Wed Nov 14 03:53:48 2007
@@ -1113,6 +1113,7 @@
// Function Attributes
%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
+%token CONST PURE
// Visibility Styles
%token DEFAULT HIDDEN PROTECTED
@@ -1256,6 +1257,8 @@
| NOUNWIND { $$ = ParamAttr::NoUnwind; }
| ZEROEXT { $$ = ParamAttr::ZExt; }
| SIGNEXT { $$ = ParamAttr::SExt; }
+ | PURE { $$ = ParamAttr::Pure; }
+ | CONST { $$ = ParamAttr::Const; }
;
OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
@@ -2812,11 +2815,6 @@
!isa((*$2).get()))
GEN_ERROR(
"Arithmetic operator requires integer, FP, or packed operands");
- if (isa((*$2).get()) &&
- ($1 == Instruction::URem ||
- $1 == Instruction::SRem ||
- $1 == Instruction::FRem))
- GEN_ERROR("Remainder not supported on vector types");
Value* val1 = getVal(*$2, $3);
CHECK_FOR_ERROR
Value* val2 = getVal(*$2, $5);
From asl at math.spbu.ru Wed Nov 14 04:30:19 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 10:30:19 -0000
Subject: [llvm-commits] [llvm] r44111 - /llvm/trunk/docs/LangRef.html
Message-ID: <200711141030.lAEAUL2c027306@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 04:30:13 2007
New Revision: 44111
URL: http://llvm.org/viewvc/llvm-project?rev=44111&view=rev
Log:
Document pure/const parameter attributes
Modified:
llvm/trunk/docs/LangRef.html
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Wed Nov 14 04:30:13 2007
@@ -813,6 +813,15 @@
nest
This indicates that the parameter can be excised using the
trampoline intrinsics.
+ pure
+ This function attribute indicates, that the function have no effects
+ except the return value and its return value depends only on the
+ arguments and/or global variables.
+ const
+ This function attribute is slightly more stricter version
+ of pure function attribute. const functions are not
+ allowed to read global memory, so such function only examines its arguments
+ and has no effects except return value.
From baldrick at free.fr Wed Nov 14 06:54:48 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 12:54:48 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44112 -
/llvm-gcc-4.0/trunk/gcc/Makefile.in
Message-ID: <200711141254.lAECsmPQ001366@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 06:54:47 2007
New Revision: 44112
URL: http://llvm.org/viewvc/llvm-project?rev=44112&view=rev
Log:
Use = not == in makefiles.
Modified:
llvm-gcc-4.0/trunk/gcc/Makefile.in
Modified: llvm-gcc-4.0/trunk/gcc/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/Makefile.in?rev=44112&r1=44111&r2=44112&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/Makefile.in (original)
+++ llvm-gcc-4.0/trunk/gcc/Makefile.in Wed Nov 14 06:54:47 2007
@@ -240,7 +240,7 @@
#LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root)
LLVMSRCDIR := $(shell \
P=`$(LLVMBINPATH)/llvm-config --src-root`; \
- if [ `pwd` == $$P ]; then \
+ if [ `pwd` = $$P ]; then \
echo "$(LLVMOBJDIR)"; \
else \
echo "$$P"; \
From baldrick at free.fr Wed Nov 14 07:09:09 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 14:09:09 +0100
Subject: [llvm-commits] RFC: Back Port of Duncan's Patch
In-Reply-To: <3D4A0F31-F888-4441-9754-E6A6ED857D55@gmail.com>
References: <7D3FCD0E-2AAB-400F-8489-E388796CDE74@gmail.com>
<200711141003.17066.baldrick@free.fr>
<3D4A0F31-F888-4441-9754-E6A6ED857D55@gmail.com>
Message-ID: <200711141409.10712.baldrick@free.fr>
Hi Bill, the patch looks fine (except that it modifies build_gcc
for some reason!) - thanks for doing this.
Best wishes,
Duncan.
From baldrick at free.fr Wed Nov 14 07:19:54 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 13:19:54 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44113 - in /llvm-gcc-4.2/trunk/gcc:
llvm-convert.cpp llvm-internal.h
Message-ID: <200711141319.lAEDJtwN002858@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 07:19:54 2007
New Revision: 44113
URL: http://llvm.org/viewvc/llvm-project?rev=44113&view=rev
Log:
Fix some comments.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44113&r1=44112&r2=44113&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Nov 14 07:19:54 2007
@@ -1314,7 +1314,7 @@
}
}
-/// EmitAggregateZero - Zero the elements of DestPtr.
+/// EmitAggregateZero - Zero the elements of DestLoc.
///
void TreeToLLVM::EmitAggregateZero(MemRef DestLoc, tree type) {
// If the type is small, copy the elements instead of using a block copy.
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=44113&r1=44112&r2=44113&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Wed Nov 14 07:19:54 2007
@@ -399,7 +399,7 @@
/// GCC type specified by GCCType to know which elements to copy.
void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType);
- /// EmitAggregateZero - Zero the elements of DestPtr.
+ /// EmitAggregateZero - Zero the elements of DestLoc.
///
void EmitAggregateZero(MemRef DestLoc, tree_node *GCCType);
From baldrick at free.fr Wed Nov 14 07:26:03 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 13:26:03 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44114 - in /llvm-gcc-4.0/trunk/gcc:
config/i386/llvm-i386.cpp config/rs6000/llvm-rs6000.cpp llvm-convert.cpp
llvm-internal.h
Message-ID: <200711141326.lAEDQ4t3003237@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 07:26:03 2007
New Revision: 44114
URL: http://llvm.org/viewvc/llvm-project?rev=44114&view=rev
Log:
Backport from 4.2 by Bill Wendling of
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071105/055332.html
Modified:
llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.0/trunk/gcc/config/rs6000/llvm-rs6000.cpp
llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.0/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp Wed Nov 14 07:26:03 2007
@@ -40,7 +40,7 @@
*/
bool TreeToLLVM::TargetIntrinsicLower(tree exp,
unsigned FnCode,
- Value *DestLoc,
+ const MemRef *DestLoc,
Value *&Result,
const Type *ResultType,
std::vector
&Ops) {
Modified: llvm-gcc-4.0/trunk/gcc/config/rs6000/llvm-rs6000.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/rs6000/llvm-rs6000.cpp?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/rs6000/llvm-rs6000.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/config/rs6000/llvm-rs6000.cpp Wed Nov 14 07:26:03 2007
@@ -80,7 +80,7 @@
//
bool TreeToLLVM::TargetIntrinsicLower(tree exp,
unsigned FnCode,
- Value *DestLoc,
+ const MemRef *DestLoc,
Value *&Result,
const Type *ResultType,
std::vector &Ops) {
Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Wed Nov 14 07:26:03 2007
@@ -35,6 +35,7 @@
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Analysis/ConstantFolding.h"
+#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
@@ -758,7 +759,7 @@
}
-Value *TreeToLLVM::Emit(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::Emit(tree exp, const MemRef *DestLoc) {
assert((isAggregateTreeType(TREE_TYPE(exp)) == (DestLoc != 0) ||
TREE_CODE(exp) == MODIFY_EXPR) &&
"Didn't pass DestLoc to an aggregate expr, or passed it to scalar!");
@@ -1108,6 +1109,15 @@
return new AllocaInst(Ty, 0, "memtmp", AllocaInsertionPoint);
}
+/// CreateTempLoc - Like CreateTemporary, but returns a MemRef.
+MemRef TreeToLLVM::CreateTempLoc(const Type *Ty) {
+ AllocaInst *AI = CreateTemporary(Ty);
+ // MemRefs do not allow alignment 0.
+ if (!AI->getAlignment())
+ AI->setAlignment(TD.getPrefTypeAlignment(Ty));
+ return MemRef(AI, AI->getAlignment(), false);
+}
+
/// EmitBlock - Add the specified basic block to the end of the function. If
/// the previous block falls through into it, add an explicit branch. Also,
/// manage fixups for EH info.
@@ -1147,42 +1157,46 @@
/// CopyAggregate - Recursively traverse the potientially aggregate src/dest
/// ptrs, copying all of the elements.
-static void CopyAggregate(Value *DestPtr, Value *SrcPtr,
- bool isDstVolatile, bool isSrcVolatile,
- unsigned Alignment, LLVMBuilder &Builder) {
- assert(DestPtr->getType() == SrcPtr->getType() &&
+static void CopyAggregate(MemRef DestLoc, MemRef SrcLoc, LLVMBuilder &Builder) {
+ assert(DestLoc.Ptr->getType() == SrcLoc.Ptr->getType() &&
"Cannot copy between two pointers of different type!");
- const Type *ElTy = cast(DestPtr->getType())->getElementType();
+ const Type *ElTy =
+ cast(DestLoc.Ptr->getType())->getElementType();
- unsigned TypeAlign = getTargetData().getABITypeAlignment(ElTy);
- Alignment = MIN(Alignment, TypeAlign);
+ unsigned Alignment = std::min(DestLoc.Alignment, SrcLoc.Alignment);
if (ElTy->isFirstClassType()) {
- LoadInst *V = Builder.CreateLoad(SrcPtr, isSrcVolatile, "tmp");
- StoreInst *S = Builder.CreateStore(V, DestPtr, isDstVolatile);
+ LoadInst *V = Builder.CreateLoad(SrcLoc.Ptr, SrcLoc.Volatile, "tmp");
+ StoreInst *S = Builder.CreateStore(V, DestLoc.Ptr, DestLoc.Volatile);
V->setAlignment(Alignment);
S->setAlignment(Alignment);
} else if (const StructType *STy = dyn_cast(ElTy)) {
+ const StructLayout *SL = getTargetData().getStructLayout(STy);
Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
if (isPaddingElement(STy, i))
continue;
Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
Value *Idxs[2] = { Zero, Idx };
- Value *DElPtr = Builder.CreateGEP(DestPtr, Idxs, Idxs + 2, "tmp");
- Value *SElPtr = Builder.CreateGEP(SrcPtr, Idxs, Idxs + 2, "tmp");
- CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile, Alignment,
+ Value *DElPtr = Builder.CreateGEP(DestLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ Value *SElPtr = Builder.CreateGEP(SrcLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ unsigned Align = MinAlign(Alignment, SL->getElementOffset(i));
+ CopyAggregate(MemRef(DElPtr, Align, DestLoc.Volatile),
+ MemRef(SElPtr, Align, SrcLoc.Volatile),
Builder);
}
} else {
const ArrayType *ATy = cast(ElTy);
Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
+ unsigned EltSize = getTargetData().getABITypeSize(ATy->getElementType());
for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) {
Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
Value *Idxs[2] = { Zero, Idx };
- Value *DElPtr = Builder.CreateGEP(DestPtr, Idxs, Idxs + 2, "tmp");
- Value *SElPtr = Builder.CreateGEP(SrcPtr, Idxs, Idxs + 2, "tmp");
- CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile, Alignment,
+ Value *DElPtr = Builder.CreateGEP(DestLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ Value *SElPtr = Builder.CreateGEP(SrcLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ unsigned Align = MinAlign(Alignment, i * EltSize);
+ CopyAggregate(MemRef(DElPtr, Align, DestLoc.Volatile),
+ MemRef(SElPtr, Align, SrcLoc.Volatile),
Builder);
}
}
@@ -1208,12 +1222,10 @@
#define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 64
#endif
-/// EmitAggregateCopy - Copy the elements from SrcPtr to DestPtr, using the
+/// EmitAggregateCopy - Copy the elements from SrcLoc to DestLoc, using the
/// GCC type specified by GCCType to know which elements to copy.
-void TreeToLLVM::EmitAggregateCopy(Value *DestPtr, Value *SrcPtr, tree type,
- bool isDstVolatile, bool isSrcVolatile,
- unsigned Alignment) {
- if (DestPtr == SrcPtr && !isDstVolatile && !isSrcVolatile)
+void TreeToLLVM::EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree type) {
+ if (DestLoc.Ptr == SrcLoc.Ptr && !DestLoc.Volatile && !SrcLoc.Volatile)
return; // noop copy.
// If the type is small, copy the elements instead of using a block copy.
@@ -1227,66 +1239,76 @@
if (!TheTypeConverter->GCCTypeOverlapsWithLLVMTypePadding(type, LLVMTy) &&
// Don't copy tons of tiny elements.
CountAggregateElements(LLVMTy) <= 8) {
- DestPtr = CastToType(Instruction::BitCast, DestPtr,
- PointerType::get(LLVMTy));
- SrcPtr = CastToType(Instruction::BitCast, SrcPtr,
- PointerType::get(LLVMTy));
- CopyAggregate(DestPtr, SrcPtr, isDstVolatile, isSrcVolatile, Alignment,
- Builder);
+ DestLoc.Ptr = CastToType(Instruction::BitCast, DestLoc.Ptr,
+ PointerType::get(LLVMTy));
+ SrcLoc.Ptr = CastToType(Instruction::BitCast, SrcLoc.Ptr,
+ PointerType::get(LLVMTy));
+ CopyAggregate(DestLoc, SrcLoc, Builder);
return;
}
}
Value *TypeSize = Emit(TYPE_SIZE_UNIT(type), 0);
- EmitMemCpy(DestPtr, SrcPtr, TypeSize, Alignment);
+ EmitMemCpy(DestLoc.Ptr, SrcLoc.Ptr, TypeSize,
+ std::min(DestLoc.Alignment, SrcLoc.Alignment));
}
-/// ZeroAggregate - Recursively traverse the potientially aggregate dest
-/// ptr, zero'ing all of the elements.
-static void ZeroAggregate(Value *DestPtr, LLVMBuilder &Builder) {
- const Type *ElTy = cast(DestPtr->getType())->getElementType();
+/// ZeroAggregate - Recursively traverse the potentially aggregate DestLoc,
+/// zero'ing all of the elements.
+static void ZeroAggregate(MemRef DestLoc, LLVMBuilder &Builder) {
+ const Type *ElTy =
+ cast(DestLoc.Ptr->getType())->getElementType();
if (ElTy->isFirstClassType()) {
- Builder.CreateStore(Constant::getNullValue(ElTy), DestPtr);
+ StoreInst *St = Builder.CreateStore(Constant::getNullValue(ElTy),
+ DestLoc.Ptr, DestLoc.Volatile);
+ St->setAlignment(DestLoc.Alignment);
} else if (const StructType *STy = dyn_cast(ElTy)) {
+ const StructLayout *SL = getTargetData().getStructLayout(STy);
Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
Value *Idxs[2] = { Zero, Idx };
- ZeroAggregate(Builder.CreateGEP(DestPtr, Idxs, Idxs + 2, "tmp"),
- Builder);
+ Value *Ptr = Builder.CreateGEP(DestLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ unsigned Alignment = MinAlign(DestLoc.Alignment, SL->getElementOffset(i));
+ ZeroAggregate(MemRef(Ptr, Alignment, DestLoc.Volatile), Builder);
}
} else {
const ArrayType *ATy = cast(ElTy);
Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
+ unsigned EltSize = getTargetData().getABITypeSize(ATy->getElementType());
for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) {
Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
Value *Idxs[2] = { Zero, Idx };
- ZeroAggregate(Builder.CreateGEP(DestPtr, Idxs, Idxs + 2, "tmp"),
- Builder);
+ Value *Ptr = Builder.CreateGEP(DestLoc.Ptr, Idxs, Idxs + 2, "tmp");
+ unsigned Alignment = MinAlign(DestLoc.Alignment, i * EltSize);
+ ZeroAggregate(MemRef(Ptr, Alignment, DestLoc.Volatile), Builder);
}
}
}
/// EmitAggregateZero - Zero the elements of DestPtr.
///
-void TreeToLLVM::EmitAggregateZero(Value *DestPtr, tree type) {
+void TreeToLLVM::EmitAggregateZero(MemRef DestLoc, tree type) {
// If the type is small, copy the elements instead of using a block copy.
if (TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST &&
TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) < 128) {
const Type *LLVMTy = ConvertType(type);
- DestPtr = CastToType(Instruction::BitCast, DestPtr,
- PointerType::get(LLVMTy));
-
- // FIXME: Is this always safe? The LLVM type might theoretically have holes
- // or might be suboptimal to copy this way. It may be better to copy the
- // structure by the GCCType's fields.
- ZeroAggregate(DestPtr, Builder);
- return;
+
+ // If the GCC type is not fully covered by the LLVM type, use memset. This
+ // can occur with unions etc.
+ if (!TheTypeConverter->GCCTypeOverlapsWithLLVMTypePadding(type, LLVMTy) &&
+ // Don't zero tons of tiny elements.
+ CountAggregateElements(LLVMTy) <= 8) {
+ DestLoc.Ptr = CastToType(Instruction::BitCast, DestLoc.Ptr,
+ PointerType::get(LLVMTy));
+
+ ZeroAggregate(DestLoc, Builder);
+ return;
+ }
}
- unsigned Alignment = TYPE_ALIGN_OK(type) ? (TYPE_ALIGN_UNIT(type) & ~0U) : 0;
- EmitMemSet(DestPtr, ConstantInt::get(Type::Int8Ty, 0),
- Emit(TYPE_SIZE_UNIT(type), 0), Alignment);
+ EmitMemSet(DestLoc.Ptr, ConstantInt::get(Type::Int8Ty, 0),
+ Emit(TYPE_SIZE_UNIT(type), 0), DestLoc.Alignment);
}
void TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size,
@@ -1297,10 +1319,7 @@
CastToType(Instruction::BitCast, DestPtr, SBP),
CastToType(Instruction::BitCast, SrcPtr, SBP),
CastToSIntType(Size, IntPtr),
- // FIXME: (PR1781) The alignment of DestPtr and SrcPtr may be different. We
- // want the alignment of memcpy to be the minimal of the two. This isn't
- // currently possible. Setting to 1 for the meantime.
- ConstantInt::get(Type::Int32Ty, 1)
+ ConstantInt::get(Type::Int32Ty, Align)
};
Intrinsic::ID IID =
@@ -1316,10 +1335,7 @@
CastToType(Instruction::BitCast, DestPtr, SBP),
CastToType(Instruction::BitCast, SrcPtr, SBP),
CastToSIntType(Size, IntPtr),
- // FIXME: (PR1781) The alignment of DestPtr and SrcPtr may be different. We
- // want the alignment of memmove to be the minimal of the two. This isn't
- // currently possible. Setting to 1 for the meantime.
- ConstantInt::get(Type::Int32Ty, 1)
+ ConstantInt::get(Type::Int32Ty, Align)
};
Intrinsic::ID IID =
@@ -1335,10 +1351,7 @@
CastToType(Instruction::BitCast, DestPtr, SBP),
CastToSIntType(SrcVal, Type::Int8Ty),
CastToSIntType(Size, IntPtr),
- // FIXME: (PR1781) The alignment of DestPtr and SrcPtr may be different. We
- // want the alignment of memset to be the minimal of the two. This isn't
- // currently possible. Setting to 1 for the meantime.
- ConstantInt::get(Type::Int32Ty, 1)
+ ConstantInt::get(Type::Int32Ty, Align)
};
Intrinsic::ID IID =
@@ -1641,7 +1654,7 @@
}
}
-Value *TreeToLLVM::EmitBIND_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitBIND_EXPR(tree exp, const MemRef *DestLoc) {
// Start region only if not top level.
if (TheDebugInfo && DECL_SAVED_TREE(FnDecl) != exp)
TheDebugInfo->EmitRegionStart(Fn, Builder.GetInsertBlock());
@@ -1684,21 +1697,21 @@
return Result;
}
-Value *TreeToLLVM::EmitSTATEMENT_LIST(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitSTATEMENT_LIST(tree exp, const MemRef *DestLoc) {
assert(DestLoc == 0 && "Does not return a value!");
// Convert each statement.
for (tree_stmt_iterator I = tsi_start(exp); !tsi_end_p(I); tsi_next(&I)) {
tree stmt = tsi_stmt(I);
- Value *DestLoc = 0;
+ MemRef DestLoc;
// If this stmt returns an aggregate value (e.g. a call whose result is
// ignored), create a temporary to receive the value. Note that we don't
// do this for MODIFY_EXPRs as an efficiency hack.
if (isAggregateTreeType(TREE_TYPE(stmt)) && TREE_CODE(stmt) != MODIFY_EXPR)
- DestLoc = CreateTemporary(ConvertType(TREE_TYPE(stmt)));
+ DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt)));
- Emit(stmt, DestLoc);
+ Emit(stmt, DestLoc.Ptr ? &DestLoc : NULL);
}
return 0;
}
@@ -1793,16 +1806,16 @@
}
-Value *TreeToLLVM::EmitRETURN_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitRETURN_EXPR(tree exp, const MemRef *DestLoc) {
assert(DestLoc == 0 && "Does not return a value!");
if (TREE_OPERAND(exp, 0)) {
// Emit the expression, including the assignment to RESULT_DECL. If the
// operand is an aggregate value, create a temporary to evaluate it into.
- Value *DestLoc = 0;
+ MemRef DestLoc;
const Type *DestTy = ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0)));
if (!DestTy->isFirstClassType() && TREE_CODE(exp) != MODIFY_EXPR)
- DestLoc = CreateTemporary(DestTy);
- Emit(TREE_OPERAND(exp, 0), DestLoc);
+ DestLoc = CreateTempLoc(DestTy);
+ Emit(TREE_OPERAND(exp, 0), DestLoc.Ptr ? &DestLoc : NULL);
}
// Emit a branch to the exit label.
@@ -2520,20 +2533,20 @@
/// FIXME: When merged with mainline, remove this code. The C++ front-end has
/// been fixed.
///
-void TreeToLLVM::EmitINTEGER_CST_Aggregate(tree exp, Value *DestLoc) {
+void TreeToLLVM::EmitINTEGER_CST_Aggregate(tree exp, const MemRef *DestLoc) {
tree type = TREE_TYPE(exp);
#ifndef NDEBUG
assert(TREE_CODE(type) == RECORD_TYPE && "Not an empty class!");
for (tree F = TYPE_FIELDS(type); F; F = TREE_CHAIN(F))
assert(TREE_CODE(F) != FIELD_DECL && "Not an empty struct/class!");
#endif
- EmitAggregateZero(DestLoc, type);
+ EmitAggregateZero(*DestLoc, type);
}
/// EmitLoadOfLValue - When an l-value expression is used in a context that
/// requires an r-value, this method emits the lvalue computation, then loads
/// the result.
-Value *TreeToLLVM::EmitLoadOfLValue(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitLoadOfLValue(tree exp, const MemRef *DestLoc) {
// If this is an SSA value, don't emit a load, just use the result.
if (isGCC_SSA_Temporary(exp)) {
assert(DECL_LLVM_SET_P(exp) && "Definition not found before use!");
@@ -2560,8 +2573,8 @@
LI->setAlignment(Alignment);
return LI;
} else {
- EmitAggregateCopy(DestLoc, LV.Ptr, TREE_TYPE(exp), false, isVolatile,
- Alignment);
+ EmitAggregateCopy(*DestLoc, MemRef(LV.Ptr, Alignment, isVolatile),
+ TREE_TYPE(exp));
return 0;
}
} else {
@@ -2622,7 +2635,7 @@
ConvertType(TREE_TYPE(exp)));
}
-Value *TreeToLLVM::EmitCALL_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitCALL_EXPR(tree exp, const MemRef *DestLoc) {
// Check for a built-in function call. If we can lower it directly, do so
// now.
tree fndecl = get_callee_fndecl(exp);
@@ -2674,12 +2687,12 @@
CallingConv::ID &CallingConvention;
bool isStructRet;
LLVMBuilder &Builder;
- Value *DestLoc;
+ const MemRef *DestLoc;
std::vector LocStack;
FunctionCallArgumentConversion(tree exp, SmallVector &ops,
CallingConv::ID &cc,
- LLVMBuilder &b, Value *destloc)
+ LLVMBuilder &b, const MemRef *destloc)
: CallExpression(exp), CallOperands(ops), CallingConvention(cc),
Builder(b), DestLoc(destloc) {
CallingConvention = CallingConv::C;
@@ -2740,12 +2753,16 @@
// Otherwise, we need to pass a buffer to return into. If the caller uses
// the result, DestLoc will be set. If it ignores it, it could be unset,
// in which case we need to create a dummy buffer.
- if (DestLoc == 0)
- DestLoc = TheTreeToLLVM->CreateTemporary(PtrArgTy->getElementType());
- else
- assert(PtrArgTy == DestLoc->getType());
- CallOperands.push_back(DestLoc);
- }
+ // FIXME: The alignment and volatility of the buffer are being ignored!
+ Value *DestPtr;
+ if (DestLoc == 0) {
+ DestPtr = TheTreeToLLVM->CreateTemporary(PtrArgTy->getElementType());
+ } else {
+ DestPtr = DestLoc->Ptr;
+ assert(PtrArgTy == DestPtr->getType());
+ }
+ CallOperands.push_back(DestPtr);
+ }
void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) {
assert(!LocStack.empty());
@@ -2778,7 +2795,7 @@
/// EmitCallOf - Emit a call to the specified callee with the operands specified
/// in the CALL_EXP 'exp'. If the result of the call is a scalar, return the
/// result, otherwise store it in DestLoc.
-Value *TreeToLLVM::EmitCallOf(Value *Callee, tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitCallOf(Value *Callee, tree exp, const MemRef *DestLoc) {
// Determine if we need to generate an invoke instruction (instead of a simple
// call) and if so, what the exception destination will be.
BasicBlock *UnwindBlock = 0;
@@ -2906,8 +2923,9 @@
if (!DestLoc)
return Call; // Normal scalar return.
- DestLoc = BitCastToType(DestLoc, PointerType::get(Call->getType()));
- Builder.CreateStore(Call, DestLoc);
+ Value *Ptr = BitCastToType(DestLoc->Ptr, PointerType::get(Call->getType()));
+ StoreInst *St = Builder.CreateStore(Call, Ptr, DestLoc->Volatile);
+ St->setAlignment(DestLoc->Alignment);
return 0;
}
@@ -2972,7 +2990,7 @@
/// EmitMODIFY_EXPR - Note that MODIFY_EXPRs are rvalues only!
///
-Value *TreeToLLVM::EmitMODIFY_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitMODIFY_EXPR(tree exp, const MemRef *DestLoc) {
// If this is the definition of an SSA variable, set its DECL_LLVM to the
// RHS.
bool Op0Signed = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
@@ -3025,27 +3043,21 @@
}
// Non-bitfield aggregate value.
+ MemRef NewLoc(LV.Ptr, Alignment, isVolatile);
+
if (DestLoc) {
- Emit(TREE_OPERAND(exp, 1), LV.Ptr);
- EmitAggregateCopy(DestLoc, LV.Ptr, TREE_TYPE(exp), isVolatile, false,
- Alignment);
- } else if (!isVolatile && TREE_CODE(TREE_OPERAND(exp, 0)) != RESULT_DECL) {
- Emit(TREE_OPERAND(exp, 1), LV.Ptr);
+ Emit(TREE_OPERAND(exp, 1), &NewLoc);
+ EmitAggregateCopy(*DestLoc, NewLoc, TREE_TYPE(exp));
+ } else if (TREE_CODE(TREE_OPERAND(exp, 0)) != RESULT_DECL) {
+ Emit(TREE_OPERAND(exp, 1), &NewLoc);
} else {
- // Need to do a volatile store into TREE_OPERAND(exp, 1). To do this, we
- // emit it into a temporary memory location, then do a volatile copy into
- // the real destination. This is probably suboptimal in some cases, but
- // it gets the volatile memory access right. It would be better if the
- // destloc pointer of 'Emit' had a flag that indicated it should be
- // volatile.
// We do this for stores into RESULT_DECL because it is possible for that
// memory area to overlap with the object being stored into it; see
// gcc.c-torture/execute/20010124-1.c.
- Value *Tmp = CreateTemporary(ConvertType(TREE_TYPE(TREE_OPERAND(exp,1))));
- Emit(TREE_OPERAND(exp, 1), Tmp);
- EmitAggregateCopy(LV.Ptr, Tmp, TREE_TYPE(TREE_OPERAND(exp,1)),
- isVolatile, false, Alignment);
+ MemRef Tmp = CreateTempLoc(ConvertType(TREE_TYPE(TREE_OPERAND(exp,1))));
+ Emit(TREE_OPERAND(exp, 1), &Tmp);
+ EmitAggregateCopy(NewLoc, Tmp, TREE_TYPE(TREE_OPERAND(exp,1)));
}
return 0;
}
@@ -3088,7 +3100,7 @@
return RetVal;
}
-Value *TreeToLLVM::EmitNOP_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitNOP_EXPR(tree exp, const MemRef *DestLoc) {
if (TREE_CODE(TREE_TYPE(exp)) == VOID_TYPE && // deleted statement.
TREE_CODE(TREE_OPERAND(exp, 0)) == INTEGER_CST)
return 0;
@@ -3105,21 +3117,24 @@
return CastToAnyType(OpVal, OpIsSigned, Ty, ExpIsSigned);
} else if (isAggregateTreeType(TREE_TYPE(Op))) {
// Aggregate to aggregate copy.
- DestLoc = CastToType(Instruction::BitCast, DestLoc, PointerType::get(Ty));
- Value *OpVal = Emit(Op, DestLoc);
+ MemRef NewLoc = *DestLoc;
+ NewLoc.Ptr =
+ CastToType(Instruction::BitCast, DestLoc->Ptr, PointerType::get(Ty));
+ Value *OpVal = Emit(Op, &NewLoc);
assert(OpVal == 0 && "Shouldn't cast scalar to aggregate!");
return 0;
}
// Scalar to aggregate copy.
Value *OpVal = Emit(Op, 0);
- DestLoc = CastToType(Instruction::BitCast, DestLoc,
- PointerType::get(OpVal->getType()));
- Builder.CreateStore(OpVal, DestLoc);
+ Value *Ptr = CastToType(Instruction::BitCast, DestLoc->Ptr,
+ PointerType::get(OpVal->getType()));
+ StoreInst *St = Builder.CreateStore(OpVal, Ptr, DestLoc->Volatile);
+ St->setAlignment(DestLoc->Alignment);
return 0;
}
-Value *TreeToLLVM::EmitCONVERT_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitCONVERT_EXPR(tree exp, const MemRef *DestLoc) {
assert(!DestLoc && "Cannot handle aggregate casts!");
Value *Op = Emit(TREE_OPERAND(exp, 0), 0);
bool OpIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
@@ -3127,20 +3142,25 @@
return CastToAnyType(Op, OpIsSigned, ConvertType(TREE_TYPE(exp)),ExpIsSigned);
}
-Value *TreeToLLVM::EmitVIEW_CONVERT_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitVIEW_CONVERT_EXPR(tree exp, const MemRef *DestLoc) {
tree Op = TREE_OPERAND(exp, 0);
if (isAggregateTreeType(TREE_TYPE(Op))) {
const Type *OpTy = ConvertType(TREE_TYPE(Op));
- Value *Target = DestLoc ?
+ MemRef Target;
+ if (DestLoc) {
// This is an aggregate-to-agg VIEW_CONVERT_EXPR, just evaluate in place.
- CastToType(Instruction::BitCast, DestLoc, PointerType::get(OpTy)) :
+ Target = *DestLoc;
+ Target.Ptr =
+ CastToType(Instruction::BitCast, DestLoc->Ptr, PointerType::get(OpTy));
+ } else {
// This is an aggregate-to-scalar VIEW_CONVERT_EXPR, evaluate, then load.
- CreateTemporary(OpTy);
+ Target = CreateTempLoc(OpTy);
+ }
switch (TREE_CODE(Op)) {
default: {
- Value *OpVal = Emit(Op, Target);
+ Value *OpVal = Emit(Op, &Target);
assert(OpVal == 0 && "Expected an aggregate operand!");
break;
}
@@ -3164,16 +3184,17 @@
bool isVolatile = TREE_THIS_VOLATILE(Op);
unsigned Alignment = expr_align(Op) / 8;
- EmitAggregateCopy(Target, LV.Ptr, TREE_TYPE(exp), false, isVolatile,
- Alignment);
+ EmitAggregateCopy(Target, MemRef(LV.Ptr, Alignment, isVolatile),
+ TREE_TYPE(exp));
break;
}
if (DestLoc)
return 0;
+ // Target holds the temporary created above.
const Type *ExpTy = ConvertType(TREE_TYPE(exp));
- return Builder.CreateLoad(CastToType(Instruction::BitCast, Target,
+ return Builder.CreateLoad(CastToType(Instruction::BitCast, Target.Ptr,
PointerType::get(ExpTy)), "tmp");
}
@@ -3182,9 +3203,10 @@
// then store into DestLoc.
Value *OpVal = Emit(Op, 0);
assert(OpVal && "Expected a scalar result!");
- DestLoc = CastToType(Instruction::BitCast, DestLoc,
- PointerType::get(OpVal->getType()));
- Builder.CreateStore(OpVal, DestLoc);
+ Value *Ptr = CastToType(Instruction::BitCast, DestLoc->Ptr,
+ PointerType::get(OpVal->getType()));
+ StoreInst *St = Builder.CreateStore(OpVal, Ptr, DestLoc->Volatile);
+ St->setAlignment(DestLoc->Alignment);
return 0;
}
@@ -3210,7 +3232,7 @@
return Builder.CreateBitCast(OpVal, DestTy, "tmp");
}
-Value *TreeToLLVM::EmitNEGATE_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitNEGATE_EXPR(tree exp, const MemRef *DestLoc) {
if (!DestLoc) {
Value *V = Emit(TREE_OPERAND(exp, 0), 0);
if (!isa(V->getType()))
@@ -3224,31 +3246,33 @@
}
// Emit the operand to a temporary.
- const Type *ComplexTy=cast(DestLoc->getType())->getElementType();
- Value *Tmp = CreateTemporary(ComplexTy);
- Emit(TREE_OPERAND(exp, 0), Tmp);
+ const Type *ComplexTy =
+ cast(DestLoc->Ptr->getType())->getElementType();
+ MemRef Tmp = CreateTempLoc(ComplexTy);
+ Emit(TREE_OPERAND(exp, 0), &Tmp);
// Handle complex numbers: -(a+ib) = -a + i*-b
Value *R, *I;
- EmitLoadFromComplex(R, I, Tmp, TREE_THIS_VOLATILE(TREE_OPERAND(exp, 0)));
+ EmitLoadFromComplex(R, I, Tmp);
R = Builder.CreateNeg(R, "tmp");
I = Builder.CreateNeg(I, "tmp");
- EmitStoreToComplex(DestLoc, R, I, false);
+ EmitStoreToComplex(*DestLoc, R, I);
return 0;
}
-Value *TreeToLLVM::EmitCONJ_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitCONJ_EXPR(tree exp, const MemRef *DestLoc) {
assert(DestLoc && "CONJ_EXPR only applies to complex numbers.");
// Emit the operand to a temporary.
- const Type *ComplexTy=cast(DestLoc->getType())->getElementType();
- Value *Tmp = CreateTemporary(ComplexTy);
- Emit(TREE_OPERAND(exp, 0), Tmp);
+ const Type *ComplexTy =
+ cast(DestLoc->Ptr->getType())->getElementType();
+ MemRef Tmp = CreateTempLoc(ComplexTy);
+ Emit(TREE_OPERAND(exp, 0), &Tmp);
// Handle complex numbers: ~(a+ib) = a + i*-b
Value *R, *I;
- EmitLoadFromComplex(R, I, Tmp, TREE_THIS_VOLATILE(TREE_OPERAND(exp, 0)));
+ EmitLoadFromComplex(R, I, Tmp);
I = Builder.CreateNeg(I, "tmp");
- EmitStoreToComplex(DestLoc, R, I, false);
+ EmitStoreToComplex(*DestLoc, R, I);
return 0;
}
@@ -3329,7 +3353,7 @@
/// EmitBinOp - 'exp' is a binary operator.
///
-Value *TreeToLLVM::EmitBinOp(tree exp, Value *DestLoc, unsigned Opc) {
+Value *TreeToLLVM::EmitBinOp(tree exp, const MemRef *DestLoc, unsigned Opc) {
const Type *Ty = ConvertType(TREE_TYPE(exp));
if (isa(Ty))
return EmitPtrBinOp(exp, Opc); // Pointer arithmetic!
@@ -3364,7 +3388,7 @@
TREE_CODE(TREE_OPERAND(exp, 1)) == INTEGER_CST) {
int64_t Offset = getINTEGER_CSTVal(TREE_OPERAND(exp, 1));
- // If POINTER_SIZE is 32-bits and the offset is signed, sign extend the offset.
+ // If POINTER_SIZE is 32-bits and the offset is signed, sign extend it.
if (POINTER_SIZE == 32 && !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1))))
Offset = (Offset << 32) >> 32;
@@ -3420,7 +3444,7 @@
}
-Value *TreeToLLVM::EmitShiftOp(tree exp, Value *DestLoc, unsigned Opc) {
+Value *TreeToLLVM::EmitShiftOp(tree exp, const MemRef *DestLoc, unsigned Opc) {
assert(DestLoc == 0 && "aggregate shift?");
const Type *Ty = ConvertType(TREE_TYPE(exp));
assert(!isa(Ty) && "Pointer arithmetic!?");
@@ -3486,7 +3510,7 @@
TREE_CODE(exp) == MAX_EXPR ? "max" : "min");
}
-Value *TreeToLLVM::EmitEXACT_DIV_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitEXACT_DIV_EXPR(tree exp, const MemRef *DestLoc) {
// Unsigned EXACT_DIV_EXPR -> normal udiv.
if (TYPE_UNSIGNED(TREE_TYPE(exp)))
return EmitBinOp(exp, DestLoc, Instruction::UDiv);
@@ -3510,7 +3534,7 @@
return EmitBinOp(exp, DestLoc, Instruction::SDiv);
}
-Value *TreeToLLVM::EmitFLOOR_MOD_EXPR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitFLOOR_MOD_EXPR(tree exp, const MemRef *DestLoc) {
// Notation: FLOOR_MOD_EXPR <-> Mod, TRUNC_MOD_EXPR <-> Rem.
// We express Mod in terms of Rem as follows: if RHS exactly divides LHS,
@@ -3700,7 +3724,7 @@
/// Reads from register variables are handled by emitting an inline asm node
/// that copies the value out of the specified register.
-Value *TreeToLLVM::EmitReadOfRegisterVariable(tree decl, Value *DestLoc) {
+Value *TreeToLLVM::EmitReadOfRegisterVariable(tree decl, const MemRef *DestLoc){
const Type *Ty = ConvertType(TREE_TYPE(decl));
// If there was an error, return something bogus.
@@ -4253,7 +4277,8 @@
/// This method returns true if the builtin is handled, otherwise false.
///
bool TreeToLLVM::EmitFrontendExpandedBuiltinCall(tree exp, tree fndecl,
- Value *DestLoc,Value *&Result){
+ const MemRef *DestLoc,
+ Value *&Result){
#ifdef LLVM_TARGET_INTRINSIC_LOWER
// Get the result type and oeprand line in an easy to consume format.
const Type *ResultType = ConvertType(TREE_TYPE(TREE_TYPE(fndecl)));
@@ -4280,7 +4305,7 @@
/// the call in a special way, setting Result to the scalar result if necessary.
/// If we can't handle the builtin, return false, otherwise return true.
bool TreeToLLVM::EmitBuiltinCall(tree exp, tree fndecl,
- Value *DestLoc, Value *&Result) {
+ const MemRef *DestLoc, Value *&Result) {
if (DECL_BUILT_IN_CLASS(fndecl) == BUILT_IN_MD) {
unsigned FnCode = DECL_FUNCTION_CODE(fndecl);
if (TargetBuiltinCache.size() <= FnCode)
@@ -4943,7 +4968,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinExpect(tree exp, Value *DestLoc, Value *&Result) {
+bool TreeToLLVM::EmitBuiltinExpect(tree exp, const MemRef *DestLoc,
+ Value *&Result) {
// Ignore the hint for now, just expand the expr. This is safe, but not
// optimal.
tree arglist = TREE_OPERAND(exp, 1);
@@ -5009,16 +5035,18 @@
// If the target has aggregate valists, emit the srcval directly into a
// temporary.
const Type *VAListTy = cast(Arg1->getType())->getElementType();
- Arg2 = CreateTemporary(VAListTy);
- Emit(Arg2T, Arg2);
+ MemRef DestLoc = CreateTempLoc(VAListTy);
+ Emit(Arg2T, &DestLoc);
+ Arg2 = DestLoc.Ptr;
}
static const Type *VPTy = PointerType::get(Type::Int8Ty);
+ // FIXME: This ignores alignment and volatility of the arguments.
SmallVector Args;
Args.push_back(CastToType(Instruction::BitCast, Arg1, VPTy));
Args.push_back(CastToType(Instruction::BitCast, Arg2, VPTy));
-
+
Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::vacopy),
Args.begin(), Args.end());
return true;
@@ -5054,62 +5082,69 @@
//===----------------------------------------------------------------------===//
void TreeToLLVM::EmitLoadFromComplex(Value *&Real, Value *&Imag,
- Value *SrcComplex, bool isVolatile) {
+ MemRef SrcComplex) {
Value *I0 = ConstantInt::get(Type::Int32Ty, 0);
Value *I1 = ConstantInt::get(Type::Int32Ty, 1);
Value *Idxs[2] = { I0, I0 };
- Value *RealPtr = Builder.CreateGEP(SrcComplex, Idxs, Idxs + 2, "real");
- Real = Builder.CreateLoad(RealPtr, isVolatile, "real");
+ Value *RealPtr = Builder.CreateGEP(SrcComplex.Ptr, Idxs, Idxs + 2, "real");
+ Real = Builder.CreateLoad(RealPtr, SrcComplex.Volatile, "real");
+ cast(Real)->setAlignment(SrcComplex.Alignment);
Idxs[1] = I1;
- Value *ImagPtr = Builder.CreateGEP(SrcComplex, Idxs, Idxs + 2, "real");
- Imag = Builder.CreateLoad(ImagPtr, isVolatile, "imag");
+ Value *ImagPtr = Builder.CreateGEP(SrcComplex.Ptr, Idxs, Idxs + 2, "real");
+ Imag = Builder.CreateLoad(ImagPtr, SrcComplex.Volatile, "imag");
+ cast(Imag)->setAlignment(
+ MinAlign(SrcComplex.Alignment, TD.getABITypeSize(Real->getType()))
+ );
}
-void TreeToLLVM::EmitStoreToComplex(Value *DestComplex, Value *Real,
- Value *Imag, bool isVolatile) {
+void TreeToLLVM::EmitStoreToComplex(MemRef DestComplex, Value *Real,
+ Value *Imag) {
Value *I0 = ConstantInt::get(Type::Int32Ty, 0);
Value *I1 = ConstantInt::get(Type::Int32Ty, 1);
Value *Idxs[2] = { I0, I0 };
+ StoreInst *St;
- Value *RealPtr = Builder.CreateGEP(DestComplex, Idxs, Idxs + 2, "real");
- Builder.CreateStore(Real, RealPtr, isVolatile);
+ Value *RealPtr = Builder.CreateGEP(DestComplex.Ptr, Idxs, Idxs + 2, "real");
+ St = Builder.CreateStore(Real, RealPtr, DestComplex.Volatile);
+ St->setAlignment(DestComplex.Alignment);
Idxs[1] = I1;
- Value *ImagPtr = Builder.CreateGEP(DestComplex, Idxs, Idxs + 2, "real");
- Builder.CreateStore(Imag, ImagPtr, isVolatile);
+ Value *ImagPtr = Builder.CreateGEP(DestComplex.Ptr, Idxs, Idxs + 2, "real");
+ St = Builder.CreateStore(Imag, ImagPtr, DestComplex.Volatile);
+ St->setAlignment(
+ MinAlign(DestComplex.Alignment, TD.getABITypeSize(Real->getType()))
+ );
}
-void TreeToLLVM::EmitCOMPLEX_EXPR(tree exp, Value *DestLoc) {
+void TreeToLLVM::EmitCOMPLEX_EXPR(tree exp, const MemRef *DestLoc) {
Value *Real = Emit(TREE_OPERAND(exp, 0), 0);
Value *Imag = Emit(TREE_OPERAND(exp, 1), 0);
- EmitStoreToComplex(DestLoc, Real, Imag, false);
+ EmitStoreToComplex(*DestLoc, Real, Imag);
}
-void TreeToLLVM::EmitCOMPLEX_CST(tree exp, Value *DestLoc) {
+void TreeToLLVM::EmitCOMPLEX_CST(tree exp, const MemRef *DestLoc) {
Value *Real = Emit(TREE_REALPART(exp), 0);
Value *Imag = Emit(TREE_IMAGPART(exp), 0);
- EmitStoreToComplex(DestLoc, Real, Imag, false);
+ EmitStoreToComplex(*DestLoc, Real, Imag);
}
// EmitComplexBinOp - Note that this operands on binops like ==/!=, which return
// a bool, not a complex value.
-Value *TreeToLLVM::EmitComplexBinOp(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitComplexBinOp(tree exp, const MemRef *DestLoc) {
const Type *ComplexTy = ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0)));
-
- Value *LHSTmp = CreateTemporary(ComplexTy);
- Value *RHSTmp = CreateTemporary(ComplexTy);
- Emit(TREE_OPERAND(exp, 0), LHSTmp);
- Emit(TREE_OPERAND(exp, 1), RHSTmp);
-
+
+ MemRef LHSTmp = CreateTempLoc(ComplexTy);
+ MemRef RHSTmp = CreateTempLoc(ComplexTy);
+ Emit(TREE_OPERAND(exp, 0), &LHSTmp);
+ Emit(TREE_OPERAND(exp, 1), &RHSTmp);
+
Value *LHSr, *LHSi;
- EmitLoadFromComplex(LHSr, LHSi, LHSTmp,
- TREE_THIS_VOLATILE(TREE_OPERAND(exp, 0)));
+ EmitLoadFromComplex(LHSr, LHSi, LHSTmp);
Value *RHSr, *RHSi;
- EmitLoadFromComplex(RHSr, RHSi, RHSTmp,
- TREE_THIS_VOLATILE(TREE_OPERAND(exp, 1)));
+ EmitLoadFromComplex(RHSr, RHSi, RHSTmp);
Value *DSTr, *DSTi;
switch (TREE_CODE(exp)) {
@@ -5169,7 +5204,7 @@
return Builder.CreateOr(DSTr, DSTi, "tmp");
}
- EmitStoreToComplex(DestLoc, DSTr, DSTi, false);
+ EmitStoreToComplex(*DestLoc, DSTr, DSTi);
return 0;
}
@@ -5563,7 +5598,7 @@
/// EmitCONSTRUCTOR - emit the constructor into the location specified by
/// DestLoc.
-Value *TreeToLLVM::EmitCONSTRUCTOR(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::EmitCONSTRUCTOR(tree exp, const MemRef *DestLoc) {
tree type = TREE_TYPE(exp);
const Type *Ty = ConvertType(type);
if (const VectorType *PTy = dyn_cast(Ty)) {
@@ -5592,7 +5627,7 @@
assert(!Ty->isFirstClassType() && "Constructor for scalar type??");
// Start out with the value zero'd out.
- EmitAggregateZero(DestLoc, type);
+ EmitAggregateZero(*DestLoc, type);
tree elt = CONSTRUCTOR_ELTS(exp);
switch (TREE_CODE(TREE_TYPE(exp))) {
@@ -5617,9 +5652,10 @@
} else {
// Scalar value. Evaluate to a register, then do the store.
Value *V = Emit(TREE_VALUE(elt), 0);
- DestLoc = CastToType(Instruction::BitCast, DestLoc,
- PointerType::get(V->getType()));
- Builder.CreateStore(V, DestLoc);
+ Value *Ptr = CastToType(Instruction::BitCast, DestLoc->Ptr,
+ PointerType::get(V->getType()));
+ StoreInst *St = Builder.CreateStore(V, Ptr, DestLoc->Volatile);
+ St->setAlignment(DestLoc->Alignment);
}
break;
}
Modified: llvm-gcc-4.0/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-internal.h?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-internal.h Wed Nov 14 07:26:03 2007
@@ -202,6 +202,21 @@
/// false.
bool ValidateRegisterVariable(tree_node *decl);
+/// MemRef - This struct holds the information needed for a memory access: a
+/// pointer to the memory, its alignment and whether the access is volatile.
+struct MemRef {
+ Value *Ptr;
+ unsigned Alignment;
+ bool Volatile;
+
+ MemRef() : Ptr(0), Alignment(0), Volatile(false) {}
+ MemRef(Value *P, unsigned A, bool V)
+ : Ptr(P), Alignment(A), Volatile(V) {
+ // Allowing alignment 0 would complicate calculations, so forbid it.
+ assert(A && !(A & (A - 1)) && "Alignment not a power of 2!");
+ }
+};
+
/// LValue - This struct represents an lvalue in the program. In particular,
/// the Ptr member indicates the memory that the lvalue lives in. If this is
/// a bitfield reference, BitStart indicates the first bit in the memory that
@@ -375,7 +390,7 @@
/// expression that fits into an LLVM scalar value, the result is returned. If
/// the result is an aggregate, it is stored into the location specified by
/// DestLoc.
- Value *Emit(tree_node *exp, Value *DestLoc);
+ Value *Emit(tree_node *exp, const MemRef *DestLoc);
/// EmitLV - Convert the specified l-value tree node to LLVM code, returning
/// the address of the result.
@@ -437,14 +452,13 @@
/// manage fixups for EH info.
void EmitBlock(BasicBlock *BB);
- /// EmitAggregateCopy - Copy the elements from SrcPtr to DestPtr, using the
+ /// EmitAggregateCopy - Copy the elements from SrcPtr to DestLoc, using the
/// GCC type specified by GCCType to know which elements to copy.
- void EmitAggregateCopy(Value *DestPtr, Value *SrcPtr, tree_node *GCCType,
- bool isDstVolatile, bool isSrcVolatile,
- unsigned Alignment);
- /// EmitAggregateZero - Zero the elements of DestPtr.
+ void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType);
+
+ /// EmitAggregateZero - Zero the elements of DestLoc.
///
- void EmitAggregateZero(Value *DestPtr, tree_node *GCCType);
+ void EmitAggregateZero(MemRef DestLoc, tree_node *GCCType);
/// EmitMemCpy/EmitMemMove/EmitMemSet - Emit an llvm.memcpy/llvm.memmove or
/// llvm.memset call with the specified operands.
@@ -462,6 +476,9 @@
/// that works.
void AddBranchFixup(BranchInst *BI, bool isExceptionEdge);
private:
+ /// CreateTempLoc - Like CreateTemporary, but returns a MemRef.
+ MemRef CreateTempLoc(const Type *Ty);
+
void EmitAutomaticVariableDecl(tree_node *decl);
/// isNoopCast - Return true if a cast from V to Ty does not change any bits.
@@ -492,8 +509,8 @@
// characteristics.
// Basic lists and binding scopes.
- Value *EmitBIND_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitSTATEMENT_LIST(tree_node *exp, Value *DestLoc);
+ Value *EmitBIND_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitSTATEMENT_LIST(tree_node *exp, const MemRef *DestLoc);
// Helpers for exception handling.
void EmitProtectedCleanups(tree_node *cleanups);
@@ -502,7 +519,7 @@
// Control flow.
Value *EmitLABEL_EXPR(tree_node *exp);
Value *EmitGOTO_EXPR(tree_node *exp);
- Value *EmitRETURN_EXPR(tree_node *exp, Value *DestLoc);
+ Value *EmitRETURN_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitCOND_EXPR(tree_node *exp);
Value *EmitSWITCH_EXPR(tree_node *exp);
Value *EmitTRY_EXPR(tree_node *exp);
@@ -511,39 +528,39 @@
Value *EmitEH_FILTER_EXPR(tree_node *exp);
// Expressions.
- void EmitINTEGER_CST_Aggregate(tree_node *exp, Value *DestLoc);
- Value *EmitLoadOfLValue(tree_node *exp, Value *DestLoc);
- Value *EmitOBJ_TYPE_REF(tree_node *exp, Value *DestLoc);
+ void EmitINTEGER_CST_Aggregate(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitLoadOfLValue(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitOBJ_TYPE_REF(tree_node *exp, const MemRef *DestLoc);
Value *EmitADDR_EXPR(tree_node *exp);
Value *EmitOBJ_TYPE_REF(tree_node *exp);
- Value *EmitCALL_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitCallOf(Value *Callee, tree_node *exp, Value *DestLoc);
- Value *EmitMODIFY_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitNOP_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitCONVERT_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitVIEW_CONVERT_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitNEGATE_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitCONJ_EXPR(tree_node *exp, Value *DestLoc);
+ Value *EmitCALL_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitCallOf(Value *Callee, tree_node *exp, const MemRef *DestLoc);
+ Value *EmitMODIFY_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitNOP_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitCONVERT_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitVIEW_CONVERT_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitNEGATE_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitCONJ_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitABS_EXPR(tree_node *exp);
Value *EmitBIT_NOT_EXPR(tree_node *exp);
Value *EmitTRUTH_NOT_EXPR(tree_node *exp);
- Value *EmitEXACT_DIV_EXPR(tree_node *exp, Value *DestLoc);
+ Value *EmitEXACT_DIV_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitCompare(tree_node *exp, unsigned UIPred, unsigned SIPred,
unsigned FPOpc);
- Value *EmitBinOp(tree_node *exp, Value *DestLoc, unsigned Opc);
+ Value *EmitBinOp(tree_node *exp, const MemRef *DestLoc, unsigned Opc);
Value *EmitPtrBinOp(tree_node *exp, unsigned Opc);
Value *EmitTruthOp(tree_node *exp, unsigned Opc);
- Value *EmitShiftOp(tree_node *exp, Value *DestLoc, unsigned Opc);
+ Value *EmitShiftOp(tree_node *exp, const MemRef *DestLoc, unsigned Opc);
Value *EmitRotateOp(tree_node *exp, unsigned Opc1, unsigned Opc2);
Value *EmitMinMaxExpr(tree_node *exp, unsigned UIPred, unsigned SIPred,
unsigned Opc);
- Value *EmitFLOOR_MOD_EXPR(tree_node *exp, Value *DestLoc);
+ Value *EmitFLOOR_MOD_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitCEIL_DIV_EXPR(tree_node *exp);
Value *EmitROUND_DIV_EXPR(tree_node *exp);
// Inline Assembly and Register Variables.
Value *EmitASM_EXPR(tree_node *exp);
- Value *EmitReadOfRegisterVariable(tree_node *vardecl, Value *DestLoc);
+ Value *EmitReadOfRegisterVariable(tree_node *vardecl, const MemRef *DestLoc);
void EmitModifyOfRegisterVariable(tree_node *vardecl, Value *RHS);
// Helpers for Builtin Function Expansion.
@@ -553,9 +570,9 @@
// Builtin Function Expansion.
bool EmitBuiltinCall(tree_node *exp, tree_node *fndecl,
- Value *DestLoc, Value *&Result);
+ const MemRef *DestLoc, Value *&Result);
bool EmitFrontendExpandedBuiltinCall(tree_node *exp, tree_node *fndecl,
- Value *DestLoc, Value *&Result);
+ const MemRef *DestLoc, Value *&Result);
bool EmitBuiltinUnaryIntOp(Value *InVal, Value *&Result, Intrinsic::ID Id);
Value *EmitBuiltinUnaryFPOp(Value *InVal, const char *F32Name,
const char *F64Name, const char *LongDoubleName);
@@ -564,7 +581,7 @@
bool EmitBuiltinConstantP(tree_node *exp, Value *&Result);
bool EmitBuiltinAlloca(tree_node *exp, Value *&Result);
- bool EmitBuiltinExpect(tree_node *exp, Value *DestLoc, Value *&Result);
+ bool EmitBuiltinExpect(tree_node *exp, const MemRef *DestLoc, Value *&Result);
bool EmitBuiltinExtendPointer(tree_node *exp, Value *&Result);
bool EmitBuiltinVAStart(tree_node *exp);
bool EmitBuiltinVAEnd(tree_node *exp);
@@ -587,13 +604,11 @@
bool EmitBuiltinInitTrampoline(tree_node *exp, Value *&Result);
// Complex Math Expressions.
- void EmitLoadFromComplex(Value *&Real, Value *&Imag, Value *SrcComplex,
- bool isVolatile);
- void EmitStoreToComplex(Value *DestComplex, Value *Real, Value *Imag,
- bool isVolatile);
- void EmitCOMPLEX_CST(tree_node *exp, Value *DestLoc);
- void EmitCOMPLEX_EXPR(tree_node *exp, Value *DestLoc);
- Value *EmitComplexBinOp(tree_node *exp, Value *DestLoc);
+ void EmitLoadFromComplex(Value *&Real, Value *&Imag, MemRef SrcComplex);
+ void EmitStoreToComplex(MemRef DestComplex, Value *Real, Value *Imag);
+ void EmitCOMPLEX_CST(tree_node *exp, const MemRef *DestLoc);
+ void EmitCOMPLEX_EXPR(tree_node *exp, const MemRef *DestLoc);
+ Value *EmitComplexBinOp(tree_node *exp, const MemRef *DestLoc);
// L-Value Expressions.
LValue EmitLV_DECL(tree_node *exp);
@@ -606,12 +621,12 @@
// Constant Expressions.
Value *EmitINTEGER_CST(tree_node *exp);
Value *EmitREAL_CST(tree_node *exp);
- Value *EmitCONSTRUCTOR(tree_node *exp, Value *DestLoc);
+ Value *EmitCONSTRUCTOR(tree_node *exp, const MemRef *DestLoc);
// Optional target defined builtin intrinsic expanding function.
bool TargetIntrinsicLower(tree_node *exp,
unsigned FnCode,
- Value *DestLoc,
+ const MemRef *DestLoc,
Value *&Result,
const Type *ResultType,
std::vector &Ops);
From baldrick at free.fr Wed Nov 14 07:40:53 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 13:40:53 -0000
Subject: [llvm-commits] [llvm] r44115 - in /llvm/trunk/test/CFrontend:
2007-11-07-CopyAggregateAlign.c 2007-11-07-ZeroAggregateAlign.c
Message-ID: <200711141340.lAEDerfD003821@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 07:40:53 2007
New Revision: 44115
URL: http://llvm.org/viewvc/llvm-project?rev=44115&view=rev
Log:
Un XFAIL these tests, now that Bill has backported
the fix from 4.2.
Modified:
llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
Modified: llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c?rev=44115&r1=44114&r2=44115&view=diff
==============================================================================
--- llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c (original)
+++ llvm/trunk/test/CFrontend/2007-11-07-CopyAggregateAlign.c Wed Nov 14 07:40:53 2007
@@ -1,4 +1,3 @@
// RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6
-// XFAIL: *
struct A { char s, t, u, v; short a; };
void q() { struct A a, b; a = b; }
Modified: llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c?rev=44115&r1=44114&r2=44115&view=diff
==============================================================================
--- llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c (original)
+++ llvm/trunk/test/CFrontend/2007-11-07-ZeroAggregateAlign.c Wed Nov 14 07:40:53 2007
@@ -1,4 +1,3 @@
// RUN: %llvmgcc -S %s -o - | grep "align 2"
-// XFAIL: *
struct A { short s; short t; int i; };
void q() { struct A a = {0}; }
From baldrick at free.fr Wed Nov 14 08:02:13 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 14:02:13 -0000
Subject: [llvm-commits] [llvm] r44116 - /llvm/trunk/lib/VMCore/Verifier.cpp
Message-ID: <200711141402.lAEE2DIG005807@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 08:02:11 2007
New Revision: 44116
URL: http://llvm.org/viewvc/llvm-project?rev=44116&view=rev
Log:
Simplify the attribute verification code.
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=44116&r1=44115&r2=44116&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Nov 14 08:02:11 2007
@@ -401,15 +401,14 @@
ParamAttr::NoReturn | ParamAttr::NoUnwind |
ParamAttr::Const | ParamAttr::Pure;
- const uint16_t MutuallyIncompatible =
+ const uint16_t MutuallyIncompatible[3] = {
ParamAttr::ByVal | ParamAttr::InReg |
- ParamAttr::Nest | ParamAttr::StructRet;
+ ParamAttr::Nest | ParamAttr::StructRet,
- const uint16_t MutuallyIncompatible2 =
- ParamAttr::ZExt | ParamAttr::SExt;
+ ParamAttr::ZExt | ParamAttr::SExt,
- const uint16_t MutuallyIncompatible3 =
- ParamAttr::Pure | ParamAttr::Const;
+ ParamAttr::Pure | ParamAttr::Const
+ };
const uint16_t IntegerTypeOnly =
ParamAttr::SExt | ParamAttr::ZExt;
@@ -421,37 +420,28 @@
bool SawSRet = false;
if (const ParamAttrsList *Attrs = FT->getParamAttrs()) {
- unsigned Idx = 1;
bool SawNest = false;
- uint16_t RetI = Attrs->getParamAttrs(0) & ReturnIncompatible;
- Assert1(!RetI, "Attribute " + Attrs->getParamAttrsText(RetI) +
- "should not apply to functions!", &F);
-
- uint16_t MutI2 = Attrs->getParamAttrs(0) & MutuallyIncompatible2;
- Assert1(MutI2 != MutuallyIncompatible2, "Attributes" +
- Attrs->getParamAttrsText(MutI2) + "are incompatible!", &F);
-
- uint16_t MutI3 = Attrs->getParamAttrs(0) & MutuallyIncompatible3;
- Assert1(MutI3 != MutuallyIncompatible3, "Attributes" +
- Attrs->getParamAttrsText(MutI3) + "are incompatible!", &F);
+ for (unsigned Idx = 0; Idx <= FT->getNumParams(); ++Idx) {
+ uint16_t Attr = Attrs->getParamAttrs(Idx);
- for (FunctionType::param_iterator I = FT->param_begin(),
- E = FT->param_end(); I != E; ++I, ++Idx) {
+ if (!Idx) {
+ uint16_t RetI = Attr & ReturnIncompatible;
+ Assert1(!RetI, "Attribute " + Attrs->getParamAttrsText(RetI) +
+ "should not apply to functions!", &F);
+ } else {
+ uint16_t ParmI = Attr & ParameterIncompatible;
+ Assert1(!ParmI, "Attribute " + Attrs->getParamAttrsText(ParmI) +
+ "should only be applied to function!", &F);
- uint16_t Attr = Attrs->getParamAttrs(Idx);
+ }
- uint16_t ParmI = Attr & ParameterIncompatible;
- Assert1(!ParmI, "Attribute " + Attrs->getParamAttrsText(ParmI) +
- "should only be applied to function!", &F);
-
- uint16_t MutI = Attr & MutuallyIncompatible;
- Assert1(!(MutI & (MutI - 1)), "Attributes " +
- Attrs->getParamAttrsText(MutI) + "are incompatible!", &F);
-
- uint16_t MutI2 = Attr & MutuallyIncompatible2;
- Assert1(MutI2 != MutuallyIncompatible2, "Attributes" +
- Attrs->getParamAttrsText(MutI2) + "are incompatible!", &F);
+ for (unsigned i = 0; i * sizeof MutuallyIncompatible[0] <
+ sizeof MutuallyIncompatible; ++i) {
+ uint16_t MutI = Attr & MutuallyIncompatible[i];
+ Assert1(!(MutI & (MutI - 1)), "Attributes " +
+ Attrs->getParamAttrsText(MutI) + "are incompatible!", &F);
+ }
uint16_t IType = Attr & IntegerTypeOnly;
Assert1(!IType || FT->getParamType(Idx-1)->isInteger(),
@@ -463,19 +453,19 @@
"Attribute " + Attrs->getParamAttrsText(PType) +
"should only apply to Pointer type!", &F);
- if (Attrs->paramHasAttr(Idx, ParamAttr::ByVal)) {
+ if (Attr & ParamAttr::ByVal) {
const PointerType *Ty =
dyn_cast(FT->getParamType(Idx-1));
Assert1(!Ty || isa(Ty->getElementType()),
"Attribute byval should only apply to pointer to structs!", &F);
}
- if (Attrs->paramHasAttr(Idx, ParamAttr::Nest)) {
+ if (Attr & ParamAttr::Nest) {
Assert1(!SawNest, "More than one parameter has attribute nest!", &F);
SawNest = true;
}
- if (Attrs->paramHasAttr(Idx, ParamAttr::StructRet)) {
+ if (Attr & ParamAttr::StructRet) {
SawSRet = true;
Assert1(Idx == 1, "Attribute sret not on first parameter!", &F);
}
From asl at math.spbu.ru Wed Nov 14 11:00:03 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 17:00:03 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44121 -
/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Message-ID: <200711141700.lAEH03RW014913@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 11:00:03 2007
New Revision: 44121
URL: http://llvm.org/viewvc/llvm-project?rev=44121&view=rev
Log:
Propagate information about pure/const functions into IR
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=44121&r1=44120&r2=44121&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Wed Nov 14 11:00:03 2007
@@ -1007,21 +1007,32 @@
#ifdef TARGET_ADJUST_LLVM_CC
TARGET_ADJUST_LLVM_CC(CallingConv, type);
#endif
-
- // Compute whether the result needs to be zext or sext'd, adding an attribute
- // if so.
+
+ // Compute attributes for return type (and function attributes)
ParamAttrsVector Attrs;
+ uint16_t RAttributes = ParamAttr::None;
+
+ // Check for 'const' function attribute
+ if (decl && TREE_READONLY(decl))
+ RAttributes |= ParamAttr::Const;
+
+ // Check for 'pure' function attribute
+ if (decl && DECL_IS_PURE(decl))
+ RAttributes |= ParamAttr::Pure;
+
+ // Compute whether the result needs to be zext or sext'd
if (isa(RetTy.get())) {
- uint16_t RAttributes = ParamAttr::None;
tree ResultTy = TREE_TYPE(type);
if (TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) {
if (TYPE_UNSIGNED(ResultTy) || TREE_CODE(ResultTy) == BOOLEAN_TYPE)
- Attrs.push_back(ParamAttrsWithIndex::get(0, ParamAttr::ZExt));
- else
- Attrs.push_back(ParamAttrsWithIndex::get(0, ParamAttr::SExt));
+ RAttributes |= ParamAttr::ZExt;
+ else
+ RAttributes |= ParamAttr::SExt;
}
}
+ Attrs.push_back(ParamAttrsWithIndex::get(0, RAttributes));
+
// If this is a struct-return function, the dest loc is passed in as a
// pointer. Mark that pointer as structret.
if (ABIConverter.isStructReturn())
From asl at math.spbu.ru Wed Nov 14 11:05:41 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 14 Nov 2007 17:05:41 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44122 -
/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Message-ID: <200711141705.lAEH5fqt015178@zion.cs.uiuc.edu>
Author: asl
Date: Wed Nov 14 11:05:41 2007
New Revision: 44122
URL: http://llvm.org/viewvc/llvm-project?rev=44122&view=rev
Log:
Backport of r44121
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=44122&r1=44121&r2=44122&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Wed Nov 14 11:05:41 2007
@@ -983,21 +983,32 @@
#ifdef TARGET_ADJUST_LLVM_CC
TARGET_ADJUST_LLVM_CC(CallingConv, type);
#endif
-
- // Compute whether the result needs to be zext or sext'd, adding an attribute
- // if so.
+
+ // Compute attributes for return type (and function attributes)
ParamAttrsVector Attrs;
+ uint16_t RAttributes = ParamAttr::None;
+
+ // Check for 'const' function attribute
+ if (decl && TREE_READONLY(decl))
+ RAttributes |= ParamAttr::Const;
+
+ // Check for 'pure' function attribute
+ if (decl && DECL_IS_PURE(decl))
+ RAttributes |= ParamAttr::Pure;
+
+ // Compute whether the result needs to be zext or sext'd
if (isa(RetTy.get())) {
- uint16_t RAttributes = ParamAttr::None;
tree ResultTy = TREE_TYPE(type);
if (TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) {
if (TYPE_UNSIGNED(ResultTy) || TREE_CODE(ResultTy) == BOOLEAN_TYPE)
- Attrs.push_back(ParamAttrsWithIndex::get(0, ParamAttr::ZExt));
- else
- Attrs.push_back(ParamAttrsWithIndex::get(0, ParamAttr::SExt));
+ RAttributes |= ParamAttr::ZExt;
+ else
+ RAttributes |= ParamAttr::SExt;
}
}
+ Attrs.push_back(ParamAttrsWithIndex::get(0, RAttributes));
+
// If this is a struct-return function, the dest loc is passed in as a
// pointer. Mark that pointer as structret.
if (ABIConverter.isStructReturn())
From dalej at apple.com Wed Nov 14 11:41:15 2007
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 14 Nov 2007 09:41:15 -0800
Subject: [llvm-commits] llvm on ppc/linux
In-Reply-To:
References: <47367BA1.6030403@mxc.ca>
<203DF1E6-2916-4AFC-A219-C06E430D68FC@apple.com>
Message-ID: <42FB7AF2-8885-4B57-8043-D8D10B9D8EE7@apple.com>
On Nov 13, 2007, at 11:35 AM, Dale Johannesen wrote:
>
> On Nov 12, 2007, at 3:17 PM, Dale Johannesen wrote:
>> On Nov 12, 2007, at 2:56 PM, Eric Christopher wrote:
>>> On Nov 10, 2007, at 7:48 PM, Nick Lewycky wrote:
>>>
>>>> This patch to llvm-gcc 4.0 allows it to compile on PPC/Linux. This
>>>> is a combination of patchs from myself, Dale Johannesen, and the
>>>> fact that a GTY can't be declared in an #ifdef from Andrew Pinski.
>>>>
>>>> I'd appreciate some testing. More importantly to make sure that
>>>> this
>>>> doesn't break Darwin on PPC, but also anyone else who's interested
>>>> in running LLVM on their PPC Linux boxes.
>>>>
>> I am testing Nick's patch on ppc32 Darwin and plan to check in if
>> it looks like that was not broken.
>
> Unfortunately my test run was started before 44029 went in, and
> there are hundreds
> of failures due to that problem. It is best to start over.
A new test run looks good; you aren't breaking ppc darwin.
> Apparently Eric is willing to change linux.h to his satisfaction,
> so I'll let him.
From kremenek at apple.com Wed Nov 14 11:42:10 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Wed, 14 Nov 2007 17:42:10 -0000
Subject: [llvm-commits] [llvm] r44124 -
/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
Message-ID: <200711141742.lAEHgAiB017908@zion.cs.uiuc.edu>
Author: kremenek
Date: Wed Nov 14 11:42:09 2007
New Revision: 44124
URL: http://llvm.org/viewvc/llvm-project?rev=44124&view=rev
Log:
Removed debug #define that was accidentally checked in while debugging
the deserializer.
Fixed assertion when "stream jumping" in the deserializer to properly function
when we have reached the end of the stream.
Modified:
llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp?rev=44124&r1=44123&r2=44124&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp Wed Nov 14 11:42:09 2007
@@ -13,8 +13,6 @@
#include "llvm/Bitcode/Deserialize.h"
-#define DEBUG_BACKPATCH
-
#ifdef DEBUG_BACKPATCH
#include "llvm/Support/Streams.h"
#endif
@@ -170,7 +168,7 @@
// AdvanceStream();
// assert (AbbrevNo == bitc::ENTER_SUBBLOCK);
- assert (!BlockStack.empty());
+ assert (!BlockStack.empty() || AtEnd());
uint64_t LastBPos = StreamStart.BitNo;
From evan.cheng at apple.com Wed Nov 14 13:08:33 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 14 Nov 2007 19:08:33 -0000
Subject: [llvm-commits] [llvm] r44128 -
/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
Message-ID: <200711141908.lAEJ8Xkv022731@zion.cs.uiuc.edu>
Author: evancheng
Date: Wed Nov 14 13:08:32 2007
New Revision: 44128
URL: http://llvm.org/viewvc/llvm-project?rev=44128&view=rev
Log:
Oops. Debugging code shouldn't have been checked in.
Modified:
llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp?rev=44128&r1=44127&r2=44128&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Nov 14 13:08:32 2007
@@ -643,15 +643,6 @@
case X86::PsMOVZX64rr32:
O << TAI->getCommentString() << " ZERO-EXTEND " << "\n\t";
break;
- case X86::MOV8mr: {
- const MachineOperand &MO = MI->getOperand(4);
- switch (MO.getReg()) {
- default: abort();
- case X86::AH: case X86::DH: case X86::CH: case X86::BH:
- case X86::AL: case X86::DL: case X86::CL: case X86::BL:
- break;
- }
- }
}
// Call the autogenerated instruction printer routines.
From baldrick at free.fr Wed Nov 14 15:14:04 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 21:14:04 -0000
Subject: [llvm-commits] [llvm] r44132 - /llvm/trunk/docs/LangRef.html
Message-ID: <200711142114.lAELE4HC029160@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 15:14:02 2007
New Revision: 44132
URL: http://llvm.org/viewvc/llvm-project?rev=44132&view=rev
Log:
Tweak the descriptions of the new 'const' and 'pure' attributes.
Modified:
llvm/trunk/docs/LangRef.html
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=44132&r1=44131&r2=44132&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Wed Nov 14 15:14:02 2007
@@ -814,14 +814,14 @@
This indicates that the parameter can be excised using the
trampoline intrinsics.
pure
- This function attribute indicates, that the function have no effects
- except the return value and its return value depends only on the
- arguments and/or global variables.
+ This function attribute indicates that the function has no side-effects
+ except for producing a return value. The value returned must only depend on
+ the function arguments and/or global variables. It may use values obtained
+ by dereferencing pointers.
const
- This function attribute is slightly more stricter version
- of pure function attribute. const functions are not
- allowed to read global memory, so such function only examines its arguments
- and has no effects except return value.
+ A const function has the same restrictions as a pure
+ function, but in addition it is not allowed to dereference any pointer arguments
+ or global variables.
From dpatel at apple.com Wed Nov 14 15:29:37 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 14 Nov 2007 21:29:37 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44135 - in /llvm-gcc-4.0/trunk:
GNUmakefile build_gcc
Message-ID: <200711142129.lAELTbLu029883@zion.cs.uiuc.edu>
Author: dpatel
Date: Wed Nov 14 15:29:37 2007
New Revision: 44135
URL: http://llvm.org/viewvc/llvm-project?rev=44135&view=rev
Log:
Find llvm using LLVMCORE_PATH
Modified:
llvm-gcc-4.0/trunk/GNUmakefile
llvm-gcc-4.0/trunk/build_gcc
Modified: llvm-gcc-4.0/trunk/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/GNUmakefile?rev=44135&r1=44134&r2=44135&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/GNUmakefile (original)
+++ llvm-gcc-4.0/trunk/GNUmakefile Wed Nov 14 15:29:37 2007
@@ -51,6 +51,10 @@
LLVM_ASSERTIONS := no
endif
+ifndef LLVMCORE_PATH
+LLVMCORE_PATH = /usr/local
+endif
+
ifndef RC_ProjectSourceVersion
RC_ProjectSourceVersion = 9999
endif
@@ -63,8 +67,9 @@
cd $(OBJROOT) && \
$(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
$(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(ENABLE_LLVM) \
- $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \
- $(LLVM_ASSERTIONS)
+ $(LLVM_ASSERTIONS) $(LLVMCORE_PATH) \
+ $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
+
# APPLE LOCAL end LLVM
# installhdrs does nothing, because the headers aren't useful until
Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=44135&r1=44134&r2=44135&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Wed Nov 14 15:29:37 2007
@@ -66,15 +66,18 @@
# or not.
ENABLE_LLVM="$7"
+# The tenth parameter is a yes/no that indicates whether assertions should be
+# enabled in the LLVM libs/tools.
+LLVM_ASSERTIONS="$8"
+
+# The eleventh parameter indicates llvmCore location.
+LLVMCORE_PATH="$9"
+
# The eighth parameter is the version number of the submission, e.g. 1007.
-LLVM_SUBMIT_VERSION="$8"
+LLVM_SUBMIT_VERSION="${10}"
# The nineth parameter is the subversion number of the submission, e.g. 03.
-LLVM_SUBMIT_SUBVERSION="$9"
-
-# The tenth parameter is a yes/no that indicates whether assertions should be
-# enabled in the LLVM libs/tools.
-LLVM_ASSERTIONS="${10}"
+LLVM_SUBMIT_SUBVERSION="${11}"
# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
LLVM_BIN_DIR=/Developer/usr/bin
@@ -158,7 +161,7 @@
--program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
$LIBSTDCXX_CONFIG_OPTION \
--with-slibdir=/usr/lib \
- --enable-llvm=/usr/local/ \
+ --enable-llvm=$LLVMCORE_PATH \
--build=$BUILD-apple-darwin$DARWIN_VERS"
# Figure out how many make processes to run.
From dpatel at apple.com Wed Nov 14 15:30:16 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 14 Nov 2007 21:30:16 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44136 - /llvm-gcc-4.0/trunk/build_gcc
Message-ID: <200711142130.lAELUGJ2029921@zion.cs.uiuc.edu>
Author: dpatel
Date: Wed Nov 14 15:30:16 2007
New Revision: 44136
URL: http://llvm.org/viewvc/llvm-project?rev=44136&view=rev
Log:
Add band-aid that allows me to do non-bootstrap build.
Modified:
llvm-gcc-4.0/trunk/build_gcc
Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=44136&r1=44135&r2=44136&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Wed Nov 14 15:30:16 2007
@@ -217,6 +217,9 @@
D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
ln -f $D/llvm-gcc $D/gcc || exit 1
ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
+# FIXME Why do we need this. Stop this madness somehow.
+ln -f $D/llvm-g++ $D/g++ || exit 1
+ln -f $D/g++ $D/$BUILD-apple-darwin$DARWIN_VERS-g++ || exit 1
# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT
PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
From dalej at apple.com Wed Nov 14 15:39:53 2007
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 14 Nov 2007 21:39:53 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44138 -
/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
Message-ID: <200711142139.lAELdsUp030543@zion.cs.uiuc.edu>
Author: johannes
Date: Wed Nov 14 15:39:53 2007
New Revision: 44138
URL: http://llvm.org/viewvc/llvm-project?rev=44138&view=rev
Log:
Small improvement in asm handling; not enough
to get 5599110 working, but a step.
Modified:
llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=44138&r1=44137&r2=44138&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Wed Nov 14 15:39:53 2007
@@ -4010,6 +4010,8 @@
NewConstraint[RegNameLen+2] = '}';
NewConstraint[RegNameLen+3] = 0;
SimplifiedConstraint = NewConstraint;
+ // We should no longer consider mem constraints.
+ AllowsMem = false;
} else {
// If we can simplify the constraint into something else, do so now. This
// avoids LLVM having to know about all the (redundant) GCC constraints.
From baldrick at free.fr Wed Nov 14 15:58:03 2007
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 14 Nov 2007 21:58:03 -0000
Subject: [llvm-commits] [llvm] r44139 - /llvm/trunk/lib/VMCore/Verifier.cpp
Message-ID: <200711142158.lAELw30I031813@zion.cs.uiuc.edu>
Author: baldrick
Date: Wed Nov 14 15:58:02 2007
New Revision: 44139
URL: http://llvm.org/viewvc/llvm-project?rev=44139&view=rev
Log:
I discover array_lengthof, thanks to gabor on #llvm.
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=44139&r1=44138&r2=44139&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Nov 14 15:58:02 2007
@@ -436,8 +436,7 @@
}
- for (unsigned i = 0; i * sizeof MutuallyIncompatible[0] <
- sizeof MutuallyIncompatible; ++i) {
+ for (unsigned i = 0; i < array_lengthof(MutuallyIncompatible); ++i) {
uint16_t MutI = Attr & MutuallyIncompatible[i];
Assert1(!(MutI & (MutI - 1)), "Attributes " +
Attrs->getParamAttrsText(MutI) + "are incompatible!", &F);
From dpatel at apple.com Wed Nov 14 16:11:08 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 14 Nov 2007 22:11:08 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44140 - in /llvm-gcc-4.2/trunk:
GNUmakefile build_gcc
Message-ID: <200711142211.lAEMB8HE000460@zion.cs.uiuc.edu>
Author: dpatel
Date: Wed Nov 14 16:11:08 2007
New Revision: 44140
URL: http://llvm.org/viewvc/llvm-project?rev=44140&view=rev
Log:
Find llvm using LLVMCORE_PATH
Modified:
llvm-gcc-4.2/trunk/GNUmakefile
llvm-gcc-4.2/trunk/build_gcc
Modified: llvm-gcc-4.2/trunk/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/GNUmakefile?rev=44140&r1=44139&r2=44140&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/GNUmakefile (original)
+++ llvm-gcc-4.2/trunk/GNUmakefile Wed Nov 14 16:11:08 2007
@@ -51,6 +51,10 @@
LLVM_ASSERTIONS := no
endif
+ifndef LLVMCORE_PATH
+LLVMCORE_PATH = /usr/local
+endif
+
ifndef RC_ProjectSourceVersion
RC_ProjectSourceVersion = 9999
endif
@@ -63,8 +67,9 @@
cd $(OBJROOT) && \
$(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
$(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(ENABLE_LLVM) \
- $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \
- $(LLVM_ASSERTIONS)
+ $(LLVM_ASSERTIONS) $(LLVMCORE_PATH) \
+ $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
+
# LLVM LOCAL end
# installhdrs does nothing, because the headers aren't useful until
Modified: llvm-gcc-4.2/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=44140&r1=44139&r2=44140&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/build_gcc (original)
+++ llvm-gcc-4.2/trunk/build_gcc Wed Nov 14 16:11:08 2007
@@ -68,11 +68,18 @@
# or not.
ENABLE_LLVM="$7"
-# The eighth parameter is the version number of the submission, e.g. 1007.
-LLVM_GCC_SUBMIT_VERSION="$8"
+# The eighth parameter is a yes/no that indicates whether assertions should be
+# enabled in the LLVM libs/tools.
+LLVM_ASSERTIONS="$8"
-# The nineth parameter is the subversion number of the submission, e.g. 03.
-LLVM_GCC_SUBMIT_SUBVERSION="$9"
+# The nineth parameter indicates llvmCore location.
+LLVMCORE_PATH="$9"
+
+# The tenth parameter is the version number of the submission, e.g. 1007.
+LLVM_SUBMIT_VERSION="${10}"
+
+# The eleventh parameter is the subversion number of the submission, e.g. 03.
+LLVM_SUBMIT_SUBVERSION="${11}"
# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
LLVM_BIN_DIR=/Developer/usr/bin
From dpatel at apple.com Wed Nov 14 16:12:25 2007
From: dpatel at apple.com (Devang Patel)
Date: Wed, 14 Nov 2007 22:12:25 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44141 - /llvm-gcc-4.0/trunk/build_gcc
Message-ID: <200711142212.lAEMCPXm000675@zion.cs.uiuc.edu>
Author: dpatel
Date: Wed Nov 14 16:12:25 2007
New Revision: 44141
URL: http://llvm.org/viewvc/llvm-project?rev=44141&view=rev
Log:
Count properly.
Modified:
llvm-gcc-4.0/trunk/build_gcc
Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=44141&r1=44140&r2=44141&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Wed Nov 14 16:12:25 2007
@@ -66,17 +66,17 @@
# or not.
ENABLE_LLVM="$7"
-# The tenth parameter is a yes/no that indicates whether assertions should be
+# The eighth parameter is a yes/no that indicates whether assertions should be
# enabled in the LLVM libs/tools.
LLVM_ASSERTIONS="$8"
-# The eleventh parameter indicates llvmCore location.
+# The nineth parameter indicates llvmCore location.
LLVMCORE_PATH="$9"
-# The eighth parameter is the version number of the submission, e.g. 1007.
+# The tenth parameter is the version number of the submission, e.g. 1007.
LLVM_SUBMIT_VERSION="${10}"
-# The nineth parameter is the subversion number of the submission, e.g. 03.
+# The eleventh parameter is the subversion number of the submission, e.g. 03.
LLVM_SUBMIT_SUBVERSION="${11}"
# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
From isanbard at gmail.com Wed Nov 14 18:00:54 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 15 Nov 2007 00:00:54 -0000
Subject: [llvm-commits] [llvm] r44150 - /llvm/tags/Apple/llvmCore-2001/
Message-ID: <200711150000.lAF00sg3007122@zion.cs.uiuc.edu>
Author: void
Date: Wed Nov 14 18:00:53 2007
New Revision: 44150
URL: http://llvm.org/viewvc/llvm-project?rev=44150&view=rev
Log:
Creating llvmCore-2001 tag
Added:
llvm/tags/Apple/llvmCore-2001/
- copied from r44148, llvm/trunk/
From isanbard at gmail.com Wed Nov 14 18:02:19 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 15 Nov 2007 00:02:19 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44151 -
/llvm-gcc-4.0/tags/Apple/llvmgcc40-2002/
Message-ID: <200711150002.lAF02JfZ007179@zion.cs.uiuc.edu>
Author: void
Date: Wed Nov 14 18:02:19 2007
New Revision: 44151
URL: http://llvm.org/viewvc/llvm-project?rev=44151&view=rev
Log:
Creating llvmgcc40-20002
Added:
llvm-gcc-4.0/tags/Apple/llvmgcc40-2002/
- copied from r44150, llvm-gcc-4.0/trunk/
From kremenek at apple.com Wed Nov 14 18:05:03 2007
From: kremenek at apple.com (Ted Kremenek)
Date: Thu, 15 Nov 2007 00:05:03 -0000
Subject: [llvm-commits] [llvm] r44152 -
/llvm/trunk/include/llvm/Bitcode/Deserialize.h
Message-ID: <200711150005.lAF053QW007281@zion.cs.uiuc.edu>
Author: kremenek
Date: Wed Nov 14 18:05:03 2007
New Revision: 44152
URL: http://llvm.org/viewvc/llvm-project?rev=44152&view=rev
Log:
Fixed serious bug in BatchReadOwnedPtrs where in a chain of calls to
deserialize objects if BatchReadOwnedPtrs was called more than once in the
same call chain then the second call would overwrite the SerializedPtrIDs
being used by the first call. Solved this problem by making the vector that
holds the pointer IDs local to a function call. Now BatchReadOwnedPtrs is
reentrant.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44152&r1=44151&r2=44152&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Wed Nov 14 18:05:03 2007
@@ -126,7 +126,6 @@
unsigned AbbrevNo;
unsigned RecordCode;
Location StreamStart;
- std::vector
BatchIDVec;
//===----------------------------------------------------------===//
// Public Interface.
@@ -213,7 +212,7 @@
template
void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) {
- BatchIDVec.clear();
+ llvm::SmallVector BatchIDVec;
for (unsigned i = 0; i < NumPtrs; ++i)
BatchIDVec.push_back(ReadPtrID());
@@ -234,8 +233,8 @@
void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
bool A1=true, bool A2=true) {
- BatchIDVec.clear();
-
+ llvm::SmallVector BatchIDVec;
+
for (unsigned i = 0; i < NumT1Ptrs; ++i)
BatchIDVec.push_back(ReadPtrID());
@@ -261,7 +260,7 @@
T2*& P2, T3*& P3,
bool A1=true, bool A2=true, bool A3=true) {
- BatchIDVec.clear();
+ llvm::SmallVector BatchIDVec;
for (unsigned i = 0; i < NumT1Ptrs; ++i)
BatchIDVec.push_back(ReadPtrID());
From isanbard at gmail.com Wed Nov 14 18:40:48 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 15 Nov 2007 00:40:48 -0000
Subject: [llvm-commits] [llvm] r44153 -
/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Message-ID: <200711150040.lAF0emv9009574@zion.cs.uiuc.edu>
Author: void
Date: Wed Nov 14 18:40:48 2007
New Revision: 44153
URL: http://llvm.org/viewvc/llvm-project?rev=44153&view=rev
Log:
Need to increment the iterator.
Modified:
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=44153&r1=44152&r2=44153&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Wed Nov 14 18:40:48 2007
@@ -342,7 +342,7 @@
// expire any remaining inactive intervals
DEBUG(for (IntervalPtrs::reverse_iterator
- i = inactive_.rbegin(); i != inactive_.rend(); )
+ i = inactive_.rbegin(); i != inactive_.rend(); ++i)
DOUT << "\tinterval " << *i->first << " expired\n");
inactive_.clear();
From isanbard at gmail.com Wed Nov 14 20:06:31 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 15 Nov 2007 02:06:31 -0000
Subject: [llvm-commits] [llvm] r44154 -
/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Message-ID: <200711150206.lAF26VP3013640@zion.cs.uiuc.edu>
Author: void
Date: Wed Nov 14 20:06:30 2007
New Revision: 44154
URL: http://llvm.org/viewvc/llvm-project?rev=44154&view=rev
Log:
Adding debug output during coalescing.
Modified:
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=44154&r1=44153&r2=44154&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Wed Nov 14 20:06:30 2007
@@ -233,6 +233,7 @@
// Try to coalesce.
if (!li_->conflictsWithPhysRegDef(cur, *vrm_, SrcReg)) {
+ DOUT << "Coalescing: " << cur << " -> " << mri_->getName(SrcReg) << '\n';
vrm_->clearVirt(cur.reg);
vrm_->assignVirt2Phys(cur.reg, SrcReg);
++NumCoalesce;
From nicholas at mxc.ca Wed Nov 14 20:41:27 2007
From: nicholas at mxc.ca (Nick Lewycky)
Date: Thu, 15 Nov 2007 02:41:27 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44155 - in
/llvm-gcc-4.0/trunk/gcc/config/rs6000: linux.h rs6000.c
Message-ID: <200711150241.lAF2fRaM015159@zion.cs.uiuc.edu>
Author: nicholas
Date: Wed Nov 14 20:41:26 2007
New Revision: 44155
URL: http://llvm.org/viewvc/llvm-project?rev=44155&view=rev
Log:
Fix build errors on PowerPC Linux.
Modified:
llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h
llvm-gcc-4.0/trunk/gcc/config/rs6000/rs6000.c
Modified: llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h?rev=44155&r1=44154&r2=44155&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h (original)
+++ llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h Wed Nov 14 20:41:26 2007
@@ -110,3 +110,13 @@
#define TARGET_HAS_F_SETLKW
#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
+
+#undef ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
+ (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
+ (((COMPUTED) == RS6000_VECTOR_ALIGNMENT) \
+ ? RS6000_VECTOR_ALIGNMENT \
+ : (MIN ((COMPUTED), \
+ (TARGET_ALIGN_MAC68K ? 16 \
+ : ((FIRST_FIELD_P) ? (COMPUTED) \
+ : 32))))))
Modified: llvm-gcc-4.0/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/rs6000/rs6000.c?rev=44155&r1=44154&r2=44155&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.0/trunk/gcc/config/rs6000/rs6000.c Wed Nov 14 20:41:26 2007
@@ -16202,8 +16202,6 @@
/* If we're saving vector or FP regs via a function call,
then don't bother with this ObjC R12 optimization.
This test also eliminates world_save. */
- && (info->first_altivec_reg_save > LAST_ALTIVEC_REGNO
- || VECTOR_SAVE_INLINE (info->first_altivec_reg_save))
&& (info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save)))
{
@@ -16531,10 +16529,7 @@
while scheduling insns after global_alloc! */
&& (optimize == 0 || !flag_schedule_insns_after_reload)
#endif
- /* If this is the last CALL in the prolog, then we've got our PC.
- If we're saving AltiVec regs via a function, we're not last. */
- && (info->first_altivec_reg_save > LAST_ALTIVEC_REGNO
- || VECTOR_SAVE_INLINE (info->first_altivec_reg_save)))
+ )
gen_following_label =
#if TARGET_MACHO
lr_already_set_up_for_pic =
@@ -17879,7 +17874,6 @@
#if TARGET_MACHO
if (MACHOPIC_INDIRECT)
funexp = machopic_indirect_call_target (funexp);
-#endif
/* APPLE LOCAL begin 4299630 */
if (DEFAULT_ABI == ABI_DARWIN
@@ -17894,6 +17888,7 @@
is_longcall_p = (TARGET_LONG_BRANCH);
}
if (!is_longcall_p)
+#endif
{
/* gen_sibcall expects reload to convert scratch pseudo to LR so we must
generate sibcall RTL explicitly to avoid constraint abort. */
@@ -17909,6 +17904,7 @@
gen_rtx_RETURN (VOIDmode))));
SIBLING_CALL_P (insn) = 1;
}
+#if TARGET_MACHO
else
{
/* APPLE LOCAL begin 4380289 */
@@ -17936,6 +17932,7 @@
XEXP (DECL_RTL (function), 0)));
/* APPLE LOCAL end 4380289 */
}
+#endif
/* APPLE LOCAL end 4299630 */
emit_barrier ();
@@ -20088,11 +20085,11 @@
fatal_insn ("bad address", op);
}
-#if TARGET_MACHO
-
/* APPLE LOCAL mlongcall long names 4271187 */
static GTY (()) tree branch_island_list = 0;
+#if TARGET_MACHO
+
/* APPLE LOCAL begin 4380289 */
/* Remember to generate a branch island for far calls to the given
function. Force the creation of a Mach-O stub. */
From sabre at nondot.org Wed Nov 14 22:51:32 2007
From: sabre at nondot.org (Chris Lattner)
Date: Thu, 15 Nov 2007 04:51:32 -0000
Subject: [llvm-commits] [llvm] r44157 - in /llvm/trunk/docs/tutorial:
LangImpl6.html LangImpl7.html LangImpl8.html
Message-ID: <200711150451.lAF4pXWx020807@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Nov 14 22:51:31 2007
New Revision: 44157
URL: http://llvm.org/viewvc/llvm-project?rev=44157&view=rev
Log:
many edits, patch by Kelly Wilson!
Modified:
llvm/trunk/docs/tutorial/LangImpl6.html
llvm/trunk/docs/tutorial/LangImpl7.html
llvm/trunk/docs/tutorial/LangImpl8.html
Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=44157&r1=44156&r2=44157&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Wed Nov 14 22:51:31 2007
@@ -41,15 +41,16 @@
Welcome to Chapter 6 of the "Implementing a language
with LLVM" tutorial. At this point in our tutorial, we now have a fully
-functional language that is fairly minimal, but also useful. One big problem
-with it though is that it doesn't have many useful operators (like division,
-logical negation, or even any comparisons other than less-than.
+functional language that is fairly minimal, but also useful. There
+is still one big problem with it, however. Our language doesn't have many
+useful operators (like division, logical negation, or even any comparisons
+besides less-than).
This chapter of the tutorial takes a wild digression into adding user-defined
-operators to the simple and beautiful Kaleidoscope language, giving us a
-simple and ugly language in some ways, but also a powerful one at the same time.
+operators to the simple and beautiful Kaleidoscope language. This digression now gives
+us a simple and ugly language in some ways, but also a powerful one at the same time.
One of the great things about creating your own language is that you get to
-decide what is good or bad. In this tutorial we'll assume that it is okay and
+decide what is good or bad. In this tutorial we'll assume that it is okay to
use this as a way to show some interesting parsing techniques.
At the end of this tutorial, we'll run through an example Kaleidoscope
@@ -73,8 +74,8 @@
operators that are supported.
The point of going into user-defined operators in a tutorial like this is to
-show the power and flexibility of using a hand-written parser. The parser we
-are using so far is using recursive descent for most parts of the grammar, and
+show the power and flexibility of using a hand-written parser. Thus far, the parser
+we have been implementing uses recursive descent for most parts of the grammar and
operator precedence parsing for the expressions. See Chapter 2 for details. Without using operator
precedence parsing, it would be very difficult to allow the programmer to
@@ -152,12 +153,12 @@
This just adds lexer support for the unary and binary keywords, like we
did in previous chapters. One nice thing
-about our current AST is that we represent binary operators fully generally
-with their ASCII code as the opcode. For our extended operators, we'll use the
+about our current AST, is that we represent binary operators with full generalisation
+by using their ASCII code as the opcode. For our extended operators, we'll use this
same representation, so we don't need any new AST or parser support.
On the other hand, we have to be able to represent the definitions of these
-new operators, in the "def binary| 5" part of the function definition. In the
+new operators, in the "def binary| 5" part of the function definition. In our
grammar so far, the "name" for the function definition is parsed as the
"prototype" production and into the PrototypeAST AST node. To
represent our new user-defined operators as prototypes, we have to extend
@@ -257,14 +258,14 @@
-
This is all fairly straight-forward parsing code, and we have already seen
-a lot of similar code in the past. One interesting piece of this is the part
-that sets up FnName for binary operators. This builds names like
-"binary@" for a newly defined "@" operator. This takes advantage of the fact
-that symbol names in the LLVM symbol table are allowed to have any character in
-them, even including embedded nul characters.
+
This is all fairly straightforward parsing code, and we have already seen
+a lot of similar code in the past. One interesting part about the code above is
+the couple lines that set up FnName for binary operators. This builds names
+like "binary@" for a newly defined "@" operator. This then takes advantage of the
+fact that symbol names in the LLVM symbol table are allowed to have any character in
+them, including embedded nul characters.
-
The next interesting piece is codegen support for these binary operators.
+
The next interesting thing to add, is codegen support for these binary operators.
Given our current structure, this is a simple addition of a default case for our
existing binary operator node:
@@ -301,10 +302,10 @@
As you can see above, the new code is actually really simple. It just does
a lookup for the appropriate operator in the symbol table and generates a
function call to it. Since user-defined operators are just built as normal
-functions (because the "prototype" boils down into a function with the right
+functions (because the "prototype" boils down to a function with the right
name) everything falls into place.
-
The final missing piece is a bit of top level magic, here:
+
The final piece of code we are missing, is a bit of top level magic:
@@ -330,10 +331,9 @@
Basically, before codegening a function, if it is a user-defined operator, we
register it in the precedence table. This allows the binary operator parsing
-logic we already have to handle it. Since it is a fully-general operator
-precedence parser, this is all we need to do to "extend the grammar".
+logic we already have in place to handle it. Since we are working on a fully-general operator precedence parser, this is all we need to do to "extend the grammar".
-With that, we have useful user-defined binary operators. This builds a lot
+
Now we have useful user-defined binary operators. This builds a lot
on the previous framework we built for other operators. Adding unary operators
is a bit more challenging, because we don't have any framework for it yet - lets
see what it takes.
@@ -347,7 +347,7 @@
Since we don't currently support unary operators in the Kaleidoscope
-language, we'll need to add everything for them. Above, we added simple
+language, we'll need to add everything to support them. Above, we added simple
support for the 'unary' keyword to the lexer. In addition to that, we need an
AST node:
@@ -390,14 +390,14 @@
-The grammar we add is pretty straight-forward here. If we see a unary
+
The grammar we add is pretty straightforward here. If we see a unary
operator when parsing a primary operator, we eat the operator as a prefix and
parse the remaining piece as another unary operator. This allows us to handle
multiple unary operators (e.g. "!!x"). Note that unary operators can't have
ambiguous parses like binary operators can, so there is no need for precedence
information.
-The problem with the above is that we need to call ParseUnary from somewhere.
+
The problem with this function, is that we need to call ParseUnary from somewhere.
To do this, we change previous callers of ParsePrimary to call ParseUnary
instead:
@@ -424,7 +424,7 @@
-
With these two simple changes, we now parse unary operators and build the
+
With these two simple changes, we are now able to parse unary operators and build the
AST for them. Next up, we need to add parser support for prototypes, to parse
the unary operator prototype. We extend the binary operator code above
with:
@@ -587,7 +587,7 @@
Based on these simple primitive operations, we can start to define more
interesting things. For example, here's a little function that solves for the
-number of iterations it takes for a function in the complex plane to
+number of iterations it takes a function in the complex plane to
converge:
@@ -779,8 +779,8 @@
plot things that are!
With this, we conclude the "adding user-defined operators" chapter of the
-tutorial. We successfully extended our language with the ability to extend the
-language in the library, and showed how this can be used to build a simple but
+tutorial. We have successfully augmented our language, adding the ability to extend the
+language in the library, and we have shown how this can be used to build a simple but
interesting end-user application in Kaleidoscope. At this point, Kaleidoscope
can build a variety of applications that are functional and can call functions
with side-effects, but it can't actually define and mutate a variable itself.
@@ -790,7 +790,7 @@
languages, and it is not at all obvious how to add
support for mutable variables without having to add an "SSA construction"
phase to your front-end. In the next chapter, we will describe how you can
-add this without building SSA in your front-end.
+add variable mutation without building SSA in your front-end.
Modified: llvm/trunk/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=44157&r1=44156&r2=44157&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl7.html Wed Nov 14 22:51:31 2007
@@ -49,11 +49,11 @@
href="http://en.wikipedia.org/wiki/Functional_programming">functional
programming language. In our journey, we learned some parsing techniques,
how to build and represent an AST, how to build LLVM IR, and how to optimize
-the resultant code and JIT compile it.
+the resultant code as well as JIT compile it.
-
While Kaleidoscope is interesting as a functional language, this makes it
-"too easy" to generate LLVM IR for it. In particular, a functional language
-makes it very easy to build LLVM IR directly in While Kaleidoscope is interesting as a functional language, the fact that it
+is functional makes it "too easy" to generate LLVM IR for it. In particular, a
+functional language makes it very easy to build LLVM IR directly in SSA form.
Since LLVM requires that the input code be in SSA form, this is a very nice
property and it is often unclear to newcomers how to generate code for an
@@ -124,13 +124,13 @@
(cond_true/cond_false). In order to merge the incoming values, the X.2 phi node
in the cond_next block selects the right value to use based on where control
flow is coming from: if control flow comes from the cond_false block, X.2 gets
-the value of X.1. Alternatively, if control flow comes from cond_tree, it gets
+the value of X.1. Alternatively, if control flow comes from cond_true, it gets
the value of X.0. The intent of this chapter is not to explain the details of
SSA form. For more information, see one of the many online
references.
-
The question for this article is "who places phi nodes when lowering
+
The question for this article is "who places the phi nodes when lowering
assignments to mutable variables?". The issue here is that LLVM
requires that its IR be in SSA form: there is no "non-ssa" mode for it.
However, SSA construction requires non-trivial algorithms and data structures,
@@ -162,12 +162,12 @@
In LLVM, all memory accesses are explicit with load/store instructions, and
-it is carefully designed to not have (or need) an "address-of" operator. Notice
+it is carefully designed not to have (or need) an "address-of" operator. Notice
how the type of the @G/@H global variables is actually "i32*" even though the
variable is defined as "i32". What this means is that @G defines space
for an i32 in the global data area, but its name actually refers to the
-address for that space. Stack variables work the same way, but instead of being
-declared with global variable definitions, they are declared with the
+address for that space. Stack variables work the same way, except that instead of
+being declared with global variable definitions, they are declared with the
LLVM alloca instruction:
@@ -259,10 +259,10 @@
-
The mem2reg pass implements the standard "iterated dominator frontier"
+
The mem2reg pass implements the standard "iterated dominance frontier"
algorithm for constructing SSA form and has a number of optimizations that speed
-up (very common) degenerate cases. mem2reg is the answer for dealing with
-mutable variables, and we highly recommend that you depend on it. Note that
+up (very common) degenerate cases. The mem2reg optimization pass is the answer to dealing
+with mutable variables, and we highly recommend that you depend on it. Note that
mem2reg only works on variables in certain circumstances:
@@ -288,10 +288,10 @@
All of these properties are easy to satisfy for most imperative languages, and
-we'll illustrate this below with Kaleidoscope. The final question you may be
+we'll illustrate it below with Kaleidoscope. The final question you may be
asking is: should I bother with this nonsense for my front-end? Wouldn't it be
better if I just did SSA construction directly, avoiding use of the mem2reg
-optimization pass? In short, we strongly recommend that use you this technique
+optimization pass? In short, we strongly recommend that you use this technique
for building SSA form, unless there is an extremely good reason not to. Using
this technique is:
@@ -309,8 +309,8 @@
- Needed for debug info generation:
Debug information in LLVM relies on having the address of the variable
-exposed to attach debug info to it. This technique dovetails very naturally
-with this style of debug info.
+exposed so that debug info can be attached to it. This technique dovetails
+very naturally with this style of debug info.
If nothing else, this makes it much easier to get your front-end up and
@@ -337,7 +337,7 @@
While the first item is really what this is about, we only have variables
-for incoming arguments and for induction variables, and redefining those only
+for incoming arguments as well as for induction variables, and redefining those only
goes so far :). Also, the ability to define new variables is a
useful thing regardless of whether you will be mutating them. Here's a
motivating example that shows how we could use these:
@@ -403,8 +403,8 @@
To start our transformation of Kaleidoscope, we'll change the NamedValues
-map to map to AllocaInst* instead of Value*. Once we do this, the C++ compiler
-will tell use what parts of the code we need to update:
+map so that it maps to AllocaInst* instead of Value*. Once we do this, the C++
+compiler will tell us what parts of the code we need to update:
-
As you can see, this is pretty straight-forward. Next we need to update the
+
As you can see, this is pretty straightforward. Now we need to update the
things that define the variables to set up the alloca. We'll start with
ForExprAST::Codegen (see the full code listing for
the unabridged code):
@@ -518,7 +518,7 @@
argument. This method gets invoked by
FunctionAST::Codegen right after
it sets up the entry block for the function.
-
The final missing piece is adding the 'mem2reg' pass, which allows us to get
+
The final missing piece is adding the mem2reg pass, which allows us to get
good codegen once again:
@@ -537,7 +537,7 @@
It is interesting to see what the code looks like before and after the
mem2reg optimization runs. For example, this is the before/after code for our
-recursive fib. Before the optimization:
+recursive fib function. Before the optimization:
-
Once it has the variable, codegen'ing the assignment is straight-forward:
+
Once we have the variable, codegen'ing the assignment is straightforward:
we emit the RHS of the assignment, create a store, and return the computed
value. Returning a value allows for chained assignments like "X = (Y = Z)".
@@ -799,7 +799,7 @@
the VarNames vector. Also, var/in has a body, this body is allowed to access
the variables defined by the var/in.
-
With this ready, we can define the parser pieces. First thing we do is add
+
With this in place, we can define the parser pieces. The first thing we do is add
it as a primary expression:
@@ -972,7 +972,7 @@
With this, we completed what we set out to do. Our nice iterative fib
example from the intro compiles and runs just fine. The mem2reg pass optimizes
all of our stack variables into SSA registers, inserting PHI nodes where needed,
-and our front-end remains simple: no iterated dominator frontier computation
+and our front-end remains simple: no "iterated dominance frontier" computation
anywhere in sight.
Modified: llvm/trunk/docs/tutorial/LangImpl8.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl8.html?rev=44157&r1=44156&r2=44157&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl8.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl8.html Wed Nov 14 22:51:31 2007
@@ -98,7 +98,7 @@
standard runtime - Our current language allows the user to access
arbitrary external functions, and we use it for things like "printd" and
"putchard". As you extend the language to add higher-level constructs, often
-these constructs make the most amount of sense to be lowered into calls into a
+these constructs make the most sense if they are lowered to calls into a
language-supplied runtime. For example, if you add hash tables to the language,
it would probably make sense to add the routines to a runtime, instead of
inlining them all the way.
@@ -106,14 +106,14 @@
memory management - Currently we can only access the stack in
Kaleidoscope. It would also be useful to be able to allocate heap memory,
either with calls to the standard libc malloc/free interface or with a garbage
-collector. If you choose to use garbage collection, note that LLVM fully
+collector. If you would like to use garbage collection, note that LLVM fully
supports Accurate Garbage Collection
including algorithms that move objects and need to scan/update the stack.
debugger support - LLVM supports generation of DWARF Debug info which is understood by
common debuggers like GDB. Adding support for debug info is fairly
-straight-forward. The best way to understand it is to compile some C/C++ code
+straightforward. The best way to understand it is to compile some C/C++ code
with "llvm-gcc -g -O0" and taking a look at what it produces.
exception handling support - LLVM supports generation of
Have fun - try doing something crazy and unusual. Building a language like
-everyone else always has is much less fun than trying something a little crazy
-and off the wall and seeing how it turns out. If you get stuck or want to talk
+everyone else always has, is much less fun than trying something a little crazy
+or off the wall and seeing how it turns out. If you get stuck or want to talk
about it, feel free to email the llvmdev mailing
list: it has lots of people who are interested in languages and are often
willing to help out.
-Before we end, I want to talk about some "tips and tricks" for generating
+
Before we end this tutorial, I want to talk about some "tips and tricks" for generating
LLVM IR. These are some of the more subtle things that may not be obvious, but
are very useful if you want to take advantage of LLVM's capabilities.
-
While it is possible to engineer more and more complex solutions to problems
-like this, it cannot be solved in full generality in a way better than shipping
+like this, it cannot be solved in full generality in a way that is better than shipping
the actual source code.
That said, there are interesting subsets of C that can be made portable. If
@@ -263,7 +263,7 @@
writing, there is no way to distinguish in the LLVM IR whether an SSA-value came
from a C "int" or a C "long" on an ILP32 machine (other than debug info). Both
get compiled down to an 'i32' value and the information about what it came from
-is lost. The more general issue here is that the LLVM type system uses
+is lost. The more general issue here, is that the LLVM type system uses
"structural equivalence" instead of "name equivalence". Another place this
surprises people is if you have two types in a high-level language that have the
same structure (e.g. two different structs that have a single int field): these
@@ -275,10 +275,10 @@
adding new features (LLVM did not always support exceptions or debug info), we
also extend the IR to capture important information for optimization (e.g.
whether an argument is sign or zero extended, information about pointers
-aliasing, etc. Many of the enhancements are user-driven: people want LLVM to
-do some specific feature, so they go ahead and extend it to do so.
+aliasing, etc). Many of the enhancements are user-driven: people want LLVM to
+include some specific feature, so they go ahead and extend it.
-
Third, it is possible and easy to add language-specific
+
Third, it is possible and easy to add language-specific
optimizations, and you have a number of choices in how to do it. As one trivial
example, it is easy to add language-specific optimization passes that
"know" things about code compiled for a language. In the case of the C family,
@@ -291,7 +291,7 @@
other language-specific information into the LLVM IR. If you have a specific
need and run into a wall, please bring the topic up on the llvmdev list. At the
very worst, you can always treat LLVM as if it were a "dumb code generator" and
-implement the high-level optimizations you desire in your front-end on the
+implement the high-level optimizations you desire in your front-end, on the
language-specific AST.
@@ -316,8 +316,8 @@
-
One interesting thing that comes up if you are trying to keep the code
-generated by your compiler "target independent" is that you often need to know
+
One interesting thing that comes up, if you are trying to keep the code
+generated by your compiler "target independent", is that you often need to know
the size of some LLVM type or the offset of some field in an llvm structure.
For example, you might need to pass the size of a type into a function that
allocates memory.
@@ -342,10 +342,10 @@
are often better ways to implement these features than explicit stack frames,
but
LLVM
-does support them if you want. It requires your front-end to convert the
+does support them, if you want. It requires your front-end to convert the
code into
Continuation
-Passing Style and use of tail calls (which LLVM also supports).
+Passing Style and the use of tail calls (which LLVM also supports).
From resistor at mac.com Wed Nov 14 23:00:16 2007
From: resistor at mac.com (Owen Anderson)
Date: Thu, 15 Nov 2007 05:00:16 -0000
Subject: [llvm-commits] [llvm] r44158 - in /llvm/trunk:
include/llvm/Analysis/LoopInfo.h lib/Analysis/LoopInfo.cpp
Message-ID: <200711150500.lAF50GAA021264@zion.cs.uiuc.edu>
Author: resistor
Date: Wed Nov 14 23:00:15 2007
New Revision: 44158
URL: http://llvm.org/viewvc/llvm-project?rev=44158&view=rev
Log:
More templatization.
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
llvm/trunk/lib/Analysis/LoopInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=44158&r1=44157&r2=44158&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Wed Nov 14 23:00:15 2007
@@ -33,9 +33,11 @@
#include "llvm/Pass.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
+#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Streams.h"
#include
@@ -54,6 +56,7 @@
class LoopInfo;
class PHINode;
class Instruction;
+template class LoopInfoBase;
//===----------------------------------------------------------------------===//
/// LoopBase class - Instances of this class are used to represent loops that are
@@ -513,7 +516,7 @@
}
private:
- friend class LoopInfo;
+ friend class LoopInfoBase;
LoopBase(BlockT *BB) : ParentLoop(0) {
Blocks.push_back(BB);
}
@@ -526,61 +529,352 @@
/// LoopInfo - This class builds and contains all of the top level loop
/// structures in the specified function.
///
-class LoopInfo : public FunctionPass {
+
+template
+class LoopInfoBase {
// BBMap - Mapping of basic blocks to the inner most loop they occur in
- std::map BBMap;
- std::vector TopLevelLoops;
- friend class LoopBase;
+ std::map BBMap;
+ std::vector*> TopLevelLoops;
+ friend class LoopBase;
+
public:
- static char ID; // Pass identification, replacement for typeid
-
- LoopInfo() : FunctionPass(intptr_t(&ID)) {}
- ~LoopInfo() { releaseMemory(); }
+ LoopInfoBase() { }
+ ~LoopInfoBase() { releaseMemory(); }
+
+ void releaseMemory() {
+ for (typename std::vector* >::iterator I =
+ TopLevelLoops.begin(), E = TopLevelLoops.end(); I != E; ++I)
+ delete *I; // Delete all of the loops...
+ BBMap.clear(); // Reset internal state of analysis
+ TopLevelLoops.clear();
+ }
+
/// iterator/begin/end - The interface to the top-level loops in the current
/// function.
///
- typedef std::vector::const_iterator iterator;
+ typedef typename std::vector*>::const_iterator iterator;
iterator begin() const { return TopLevelLoops.begin(); }
iterator end() const { return TopLevelLoops.end(); }
-
+
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
/// block is in no loop (for example the entry node), null is returned.
///
- Loop *getLoopFor(const BasicBlock *BB) const {
- std::map::const_iterator I=
+ LoopBase *getLoopFor(const BlockT *BB) const {
+ typename std::map*>::const_iterator I=
BBMap.find(const_cast(BB));
return I != BBMap.end() ? I->second : 0;
}
-
+
/// operator[] - same as getLoopFor...
///
- const Loop *operator[](const BasicBlock *BB) const {
+ const LoopBase *operator[](const BlockT *BB) const {
return getLoopFor(BB);
}
-
+
/// getLoopDepth - Return the loop nesting level of the specified block...
///
- unsigned getLoopDepth(const BasicBlock *BB) const {
+ unsigned getLoopDepth(const BlockT *BB) const {
const Loop *L = getLoopFor(BB);
return L ? L->getLoopDepth() : 0;
}
// isLoopHeader - True if the block is a loop header node
- bool isLoopHeader(BasicBlock *BB) const {
+ bool isLoopHeader(BlockT *BB) const {
const Loop *L = getLoopFor(BB);
return L && L->getHeader() == BB;
}
+
+ /// removeLoop - This removes the specified top-level loop from this loop info
+ /// object. The loop is not deleted, as it will presumably be inserted into
+ /// another loop.
+ LoopBase *removeLoop(iterator I) {
+ assert(I != end() && "Cannot remove end iterator!");
+ LoopBase *L = *I;
+ assert(L->getParentLoop() == 0 && "Not a top-level loop!");
+ TopLevelLoops.erase(TopLevelLoops.begin() + (I-begin()));
+ return L;
+ }
+
+ /// changeLoopFor - Change the top-level loop that contains BB to the
+ /// specified loop. This should be used by transformations that restructure
+ /// the loop hierarchy tree.
+ void changeLoopFor(BlockT *BB, LoopBase *L) {
+ LoopBase *&OldLoop = BBMap[BB];
+ assert(OldLoop && "Block not in a loop yet!");
+ OldLoop = L;
+ }
+
+ /// changeTopLevelLoop - Replace the specified loop in the top-level loops
+ /// list with the indicated loop.
+ void changeTopLevelLoop(LoopBase *OldLoop,
+ LoopBase *NewLoop) {
+ typename std::vector*>::iterator I =
+ std::find(TopLevelLoops.begin(), TopLevelLoops.end(), OldLoop);
+ assert(I != TopLevelLoops.end() && "Old loop not at top level!");
+ *I = NewLoop;
+ assert(NewLoop->ParentLoop == 0 && OldLoop->ParentLoop == 0 &&
+ "Loops already embedded into a subloop!");
+ }
+
+ /// addTopLevelLoop - This adds the specified loop to the collection of
+ /// top-level loops.
+ void addTopLevelLoop(LoopBase *New) {
+ assert(New->getParentLoop() == 0 && "Loop already in subloop!");
+ TopLevelLoops.push_back(New);
+ }
+
+ /// removeBlock - This method completely removes BB from all data structures,
+ /// including all of the Loop objects it is nested in and our mapping from
+ /// BasicBlocks to loops.
+ void removeBlock(BlockT *BB) {
+ typename std::map*>::iterator I = BBMap.find(BB);
+ if (I != BBMap.end()) {
+ for (Loop *L = I->second; L; L = L->getParentLoop())
+ L->removeBlockFromLoop(BB);
+
+ BBMap.erase(I);
+ }
+ }
+
+ // Internals
+
+ static bool isNotAlreadyContainedIn(Loop *SubLoop, Loop *ParentLoop) {
+ if (SubLoop == 0) return true;
+ if (SubLoop == ParentLoop) return false;
+ return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop);
+ }
+
+ void Calculate(DominatorTree &DT) {
+ BlockT *RootNode = DT.getRootNode()->getBlock();
+
+ for (df_iterator NI = df_begin(RootNode),
+ NE = df_end(RootNode); NI != NE; ++NI)
+ if (LoopBase *L = ConsiderForLoop(*NI, DT))
+ TopLevelLoops.push_back(L);
+ }
+
+ LoopBase *ConsiderForLoop(BlockT *BB, DominatorTree &DT) {
+ if (BBMap.find(BB) != BBMap.end()) return 0;// Haven't processed this node?
+
+ std::vector TodoStack;
+
+ // Scan the predecessors of BB, checking to see if BB dominates any of
+ // them. This identifies backedges which target this node...
+ for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I)
+ if (DT.dominates(BB, *I)) // If BB dominates it's predecessor...
+ TodoStack.push_back(*I);
+
+ if (TodoStack.empty()) return 0; // No backedges to this block...
+
+ // Create a new loop to represent this basic block...
+ LoopBase *L = new LoopBase(BB);
+ BBMap[BB] = L;
+
+ BlockT *EntryBlock = &BB->getParent()->getEntryBlock();
+
+ while (!TodoStack.empty()) { // Process all the nodes in the loop
+ BlockT *X = TodoStack.back();
+ TodoStack.pop_back();
+
+ if (!L->contains(X) && // As of yet unprocessed??
+ DT.dominates(EntryBlock, X)) { // X is reachable from entry block?
+ // Check to see if this block already belongs to a loop. If this occurs
+ // then we have a case where a loop that is supposed to be a child of the
+ // current loop was processed before the current loop. When this occurs,
+ // this child loop gets added to a part of the current loop, making it a
+ // sibling to the current loop. We have to reparent this loop.
+ if (LoopBase *SubLoop =
+ const_cast*>(getLoopFor(X)))
+ if (SubLoop->getHeader() == X && isNotAlreadyContainedIn(SubLoop, L)) {
+ // Remove the subloop from it's current parent...
+ assert(SubLoop->ParentLoop && SubLoop->ParentLoop != L);
+ LoopBase *SLP = SubLoop->ParentLoop; // SubLoopParent
+ typename std::vector*>::iterator I =
+ std::find(SLP->SubLoops.begin(), SLP->SubLoops.end(), SubLoop);
+ assert(I != SLP->SubLoops.end() && "SubLoop not a child of parent?");
+ SLP->SubLoops.erase(I); // Remove from parent...
+
+ // Add the subloop to THIS loop...
+ SubLoop->ParentLoop = L;
+ L->SubLoops.push_back(SubLoop);
+ }
+
+ // Normal case, add the block to our loop...
+ L->Blocks.push_back(X);
+
+ // Add all of the predecessors of X to the end of the work stack...
+ TodoStack.insert(TodoStack.end(), pred_begin(X), pred_end(X));
+ }
+ }
+
+ // If there are any loops nested within this loop, create them now!
+ for (typename std::vector::iterator I = L->Blocks.begin(),
+ E = L->Blocks.end(); I != E; ++I)
+ if (LoopBase *NewLoop = ConsiderForLoop(*I, DT)) {
+ L->SubLoops.push_back(NewLoop);
+ NewLoop->ParentLoop = L;
+ }
+
+ // Add the basic blocks that comprise this loop to the BBMap so that this
+ // loop can be found for them.
+ //
+ for (typename std::vector::iterator I = L->Blocks.begin(),
+ E = L->Blocks.end(); I != E; ++I) {
+ typename std::map*>::iterator BBMI =
+ BBMap.lower_bound(*I);
+ if (BBMI == BBMap.end() || BBMI->first != *I) // Not in map yet...
+ BBMap.insert(BBMI, std::make_pair(*I, L)); // Must be at this level
+ }
+
+ // Now that we have a list of all of the child loops of this loop, check to
+ // see if any of them should actually be nested inside of each other. We can
+ // accidentally pull loops our of their parents, so we must make sure to
+ // organize the loop nests correctly now.
+ {
+ std::map*> ContainingLoops;
+ for (unsigned i = 0; i != L->SubLoops.size(); ++i) {
+ LoopBase *Child = L->SubLoops[i];
+ assert(Child->getParentLoop() == L && "Not proper child loop?");
+
+ if (LoopBase *ContainingLoop =
+ ContainingLoops[Child->getHeader()]) {
+ // If there is already a loop which contains this loop, move this loop
+ // into the containing loop.
+ MoveSiblingLoopInto(Child, ContainingLoop);
+ --i; // The loop got removed from the SubLoops list.
+ } else {
+ // This is currently considered to be a top-level loop. Check to see if
+ // any of the contained blocks are loop headers for subloops we have
+ // already processed.
+ for (unsigned b = 0, e = Child->Blocks.size(); b != e; ++b) {
+ LoopBase *&BlockLoop = ContainingLoops[Child->Blocks[b]];
+ if (BlockLoop == 0) { // Child block not processed yet...
+ BlockLoop = Child;
+ } else if (BlockLoop != Child) {
+ LoopBase *SubLoop = BlockLoop;
+ // Reparent all of the blocks which used to belong to BlockLoops
+ for (unsigned j = 0, e = SubLoop->Blocks.size(); j != e; ++j)
+ ContainingLoops[SubLoop->Blocks[j]] = Child;
+
+ // There is already a loop which contains this block, that means
+ // that we should reparent the loop which the block is currently
+ // considered to belong to to be a child of this loop.
+ MoveSiblingLoopInto(SubLoop, Child);
+ --i; // We just shrunk the SubLoops list.
+ }
+ }
+ }
+ }
+ }
+
+ return L;
+ }
+
+ /// MoveSiblingLoopInto - This method moves the NewChild loop to live inside of
+ /// the NewParent Loop, instead of being a sibling of it.
+ void MoveSiblingLoopInto(LoopBase *NewChild,
+ LoopBase *NewParent) {
+ LoopBase *OldParent = NewChild->getParentLoop();
+ assert(OldParent && OldParent == NewParent->getParentLoop() &&
+ NewChild != NewParent && "Not sibling loops!");
+
+ // Remove NewChild from being a child of OldParent
+ typename std::vector*>::iterator I =
+ std::find(OldParent->SubLoops.begin(), OldParent->SubLoops.end(), NewChild);
+ assert(I != OldParent->SubLoops.end() && "Parent fields incorrect??");
+ OldParent->SubLoops.erase(I); // Remove from parent's subloops list
+ NewChild->ParentLoop = 0;
+
+ InsertLoopInto(NewChild, NewParent);
+ }
+
+ /// InsertLoopInto - This inserts loop L into the specified parent loop. If the
+ /// parent loop contains a loop which should contain L, the loop gets inserted
+ /// into L instead.
+ void InsertLoopInto(LoopBase *L, LoopBase *Parent) {
+ BlockT *LHeader = L->getHeader();
+ assert(Parent->contains(LHeader) && "This loop should not be inserted here!");
+
+ // Check to see if it belongs in a child loop...
+ for (unsigned i = 0, e = Parent->SubLoops.size(); i != e; ++i)
+ if (Parent->SubLoops[i]->contains(LHeader)) {
+ InsertLoopInto(L, Parent->SubLoops[i]);
+ return;
+ }
+
+ // If not, insert it here!
+ Parent->SubLoops.push_back(L);
+ L->ParentLoop = Parent;
+ }
+
+ // Debugging
+
+ void print(std::ostream &OS, const Module* ) const {
+ for (unsigned i = 0; i < TopLevelLoops.size(); ++i)
+ TopLevelLoops[i]->print(OS);
+ #if 0
+ for (std::map::const_iterator I = BBMap.begin(),
+ E = BBMap.end(); I != E; ++I)
+ OS << "BB '" << I->first->getName() << "' level = "
+ << I->second->getLoopDepth() << "\n";
+ #endif
+ }
+};
+
+class LoopInfo : public FunctionPass {
+ LoopInfoBase* LI;
+ friend class LoopBase;
+
+ LoopInfoBase& getBase() { return *LI; }
+public:
+ static char ID; // Pass identification, replacement for typeid
+
+ LoopInfo() : FunctionPass(intptr_t(&ID)) {
+ LI = new LoopInfoBase();
+ }
+
+ ~LoopInfo() { LI->releaseMemory(); }
+
+ /// iterator/begin/end - The interface to the top-level loops in the current
+ /// function.
+ ///
+ typedef std::vector::const_iterator iterator;
+ inline iterator begin() const { return LI->begin(); }
+ inline iterator end() const { return LI->end(); }
+
+ /// getLoopFor - Return the inner most loop that BB lives in. If a basic
+ /// block is in no loop (for example the entry node), null is returned.
+ ///
+ inline Loop *getLoopFor(const BasicBlock *BB) const {
+ return LI->getLoopFor(BB);
+ }
+
+ /// operator[] - same as getLoopFor...
+ ///
+ inline const Loop *operator[](const BasicBlock *BB) const {
+ return LI->getLoopFor(BB);
+ }
+
+ /// getLoopDepth - Return the loop nesting level of the specified block...
+ ///
+ inline unsigned getLoopDepth(const BasicBlock *BB) const {
+ return LI->getLoopDepth(BB);
+ }
+
+ // isLoopHeader - True if the block is a loop header node
+ inline bool isLoopHeader(BasicBlock *BB) const {
+ return LI->isLoopHeader(BB);
+ }
/// runOnFunction - Calculate the natural loop information.
///
virtual bool runOnFunction(Function &F);
- virtual void releaseMemory();
+ virtual void releaseMemory() { LI->releaseMemory(); }
- void print(std::ostream &O, const Module* = 0) const;
- void print(std::ostream *O, const Module* M = 0) const {
- if (O) print(*O, M);
+ virtual void print(std::ostream &O, const Module* M = 0) const {
+ if (O) LI->print(O, M);
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
@@ -588,34 +882,33 @@
/// removeLoop - This removes the specified top-level loop from this loop info
/// object. The loop is not deleted, as it will presumably be inserted into
/// another loop.
- Loop *removeLoop(iterator I);
+ inline Loop *removeLoop(iterator I) { return LI->removeLoop(I); }
/// changeLoopFor - Change the top-level loop that contains BB to the
/// specified loop. This should be used by transformations that restructure
/// the loop hierarchy tree.
- void changeLoopFor(BasicBlock *BB, Loop *L);
+ inline void changeLoopFor(BasicBlock *BB, Loop *L) {
+ LI->changeLoopFor(BB, L);
+ }
/// changeTopLevelLoop - Replace the specified loop in the top-level loops
/// list with the indicated loop.
- void changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop);
+ inline void changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop) {
+ LI->changeTopLevelLoop(OldLoop, NewLoop);
+ }
/// addTopLevelLoop - This adds the specified loop to the collection of
/// top-level loops.
- void addTopLevelLoop(Loop *New) {
- assert(New->getParentLoop() == 0 && "Loop already in subloop!");
- TopLevelLoops.push_back(New);
+ inline void addTopLevelLoop(Loop *New) {
+ LI->addTopLevelLoop(New);
}
/// removeBlock - This method completely removes BB from all data structures,
/// including all of the Loop objects it is nested in and our mapping from
/// BasicBlocks to loops.
- void removeBlock(BasicBlock *BB);
-
-private:
- void Calculate(DominatorTree &DT);
- Loop *ConsiderForLoop(BasicBlock *BB, DominatorTree &DT);
- void MoveSiblingLoopInto(Loop *NewChild, Loop *NewParent);
- void InsertLoopInto(Loop *L, Loop *Parent);
+ void removeBlock(BasicBlock *BB) {
+ LI->removeBlock(BB);
+ }
};
@@ -647,14 +940,17 @@
};
template
-void LoopBase::addBasicBlockToLoop(BlockT *NewBB, LoopInfo &LI) {
+void LoopBase::addBasicBlockToLoop(BlockT *NewBB,
+ LoopInfo &LI) {
assert((Blocks.empty() || LI[getHeader()] == this) &&
"Incorrect LI specified for this loop!");
assert(NewBB && "Cannot add a null basic block to the loop!");
assert(LI[NewBB] == 0 && "BasicBlock already in the loop!");
+ LoopInfoBase& LIB = LI.getBase();
+
// Add the loop mapping to the LoopInfo object...
- LI.BBMap[NewBB] = this;
+ LIB.BBMap[NewBB] = this;
// Add the basic block to this loop and all parent loops...
LoopBase *L = this;
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=44158&r1=44157&r2=44158&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Wed Nov 14 23:00:15 2007
@@ -43,243 +43,14 @@
//
bool LoopInfo::runOnFunction(Function &) {
releaseMemory();
- Calculate(getAnalysis()); // Update
+ LI->Calculate(getAnalysis()); // Update
return false;
}
-void LoopInfo::releaseMemory() {
- for (std::vector::iterator I = TopLevelLoops.begin(),
- E = TopLevelLoops.end(); I != E; ++I)
- delete *I; // Delete all of the loops...
-
- BBMap.clear(); // Reset internal state of analysis
- TopLevelLoops.clear();
-}
-
-void LoopInfo::Calculate(DominatorTree &DT) {
- BasicBlock *RootNode = DT.getRootNode()->getBlock();
-
- for (df_iterator NI = df_begin(RootNode),
- NE = df_end(RootNode); NI != NE; ++NI)
- if (Loop *L = ConsiderForLoop(*NI, DT))
- TopLevelLoops.push_back(L);
-}
-
void LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired();
}
-void LoopInfo::print(std::ostream &OS, const Module* ) const {
- for (unsigned i = 0; i < TopLevelLoops.size(); ++i)
- TopLevelLoops[i]->print(OS);
-#if 0
- for (std::map::const_iterator I = BBMap.begin(),
- E = BBMap.end(); I != E; ++I)
- OS << "BB '" << I->first->getName() << "' level = "
- << I->second->getLoopDepth() << "\n";
-#endif
-}
-
-static bool isNotAlreadyContainedIn(Loop *SubLoop, Loop *ParentLoop) {
- if (SubLoop == 0) return true;
- if (SubLoop == ParentLoop) return false;
- return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop);
-}
-
-Loop *LoopInfo::ConsiderForLoop(BasicBlock *BB, DominatorTree &DT) {
- if (BBMap.find(BB) != BBMap.end()) return 0; // Haven't processed this node?
-
- std::vector TodoStack;
-
- // Scan the predecessors of BB, checking to see if BB dominates any of
- // them. This identifies backedges which target this node...
- for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I)
- if (DT.dominates(BB, *I)) // If BB dominates it's predecessor...
- TodoStack.push_back(*I);
-
- if (TodoStack.empty()) return 0; // No backedges to this block...
-
- // Create a new loop to represent this basic block...
- Loop *L = new Loop(BB);
- BBMap[BB] = L;
-
- BasicBlock *EntryBlock = &BB->getParent()->getEntryBlock();
-
- while (!TodoStack.empty()) { // Process all the nodes in the loop
- BasicBlock *X = TodoStack.back();
- TodoStack.pop_back();
-
- if (!L->contains(X) && // As of yet unprocessed??
- DT.dominates(EntryBlock, X)) { // X is reachable from entry block?
- // Check to see if this block already belongs to a loop. If this occurs
- // then we have a case where a loop that is supposed to be a child of the
- // current loop was processed before the current loop. When this occurs,
- // this child loop gets added to a part of the current loop, making it a
- // sibling to the current loop. We have to reparent this loop.
- if (Loop *SubLoop = const_cast(getLoopFor(X)))
- if (SubLoop->getHeader() == X && isNotAlreadyContainedIn(SubLoop, L)) {
- // Remove the subloop from it's current parent...
- assert(SubLoop->ParentLoop && SubLoop->ParentLoop != L);
- Loop *SLP = SubLoop->ParentLoop; // SubLoopParent
- std::vector::iterator I =
- std::find(SLP->SubLoops.begin(), SLP->SubLoops.end(), SubLoop);
- assert(I != SLP->SubLoops.end() && "SubLoop not a child of parent?");
- SLP->SubLoops.erase(I); // Remove from parent...
-
- // Add the subloop to THIS loop...
- SubLoop->ParentLoop = L;
- L->SubLoops.push_back(SubLoop);
- }
-
- // Normal case, add the block to our loop...
- L->Blocks.push_back(X);
-
- // Add all of the predecessors of X to the end of the work stack...
- TodoStack.insert(TodoStack.end(), pred_begin(X), pred_end(X));
- }
- }
-
- // If there are any loops nested within this loop, create them now!
- for (std::vector::iterator I = L->Blocks.begin(),
- E = L->Blocks.end(); I != E; ++I)
- if (Loop *NewLoop = ConsiderForLoop(*I, DT)) {
- L->SubLoops.push_back(NewLoop);
- NewLoop->ParentLoop = L;
- }
-
- // Add the basic blocks that comprise this loop to the BBMap so that this
- // loop can be found for them.
- //
- for (std::vector::iterator I = L->Blocks.begin(),
- E = L->Blocks.end(); I != E; ++I) {
- std::map::iterator BBMI = BBMap.lower_bound(*I);
- if (BBMI == BBMap.end() || BBMI->first != *I) // Not in map yet...
- BBMap.insert(BBMI, std::make_pair(*I, L)); // Must be at this level
- }
-
- // Now that we have a list of all of the child loops of this loop, check to
- // see if any of them should actually be nested inside of each other. We can
- // accidentally pull loops our of their parents, so we must make sure to
- // organize the loop nests correctly now.
- {
- std::map ContainingLoops;
- for (unsigned i = 0; i != L->SubLoops.size(); ++i) {
- Loop *Child = L->SubLoops[i];
- assert(Child->getParentLoop() == L && "Not proper child loop?");
-
- if (Loop *ContainingLoop = ContainingLoops[Child->getHeader()]) {
- // If there is already a loop which contains this loop, move this loop
- // into the containing loop.
- MoveSiblingLoopInto(Child, ContainingLoop);
- --i; // The loop got removed from the SubLoops list.
- } else {
- // This is currently considered to be a top-level loop. Check to see if
- // any of the contained blocks are loop headers for subloops we have
- // already processed.
- for (unsigned b = 0, e = Child->Blocks.size(); b != e; ++b) {
- Loop *&BlockLoop = ContainingLoops[Child->Blocks[b]];
- if (BlockLoop == 0) { // Child block not processed yet...
- BlockLoop = Child;
- } else if (BlockLoop != Child) {
- Loop *SubLoop = BlockLoop;
- // Reparent all of the blocks which used to belong to BlockLoops
- for (unsigned j = 0, e = SubLoop->Blocks.size(); j != e; ++j)
- ContainingLoops[SubLoop->Blocks[j]] = Child;
-
- // There is already a loop which contains this block, that means
- // that we should reparent the loop which the block is currently
- // considered to belong to to be a child of this loop.
- MoveSiblingLoopInto(SubLoop, Child);
- --i; // We just shrunk the SubLoops list.
- }
- }
- }
- }
- }
-
- return L;
-}
-
-/// MoveSiblingLoopInto - This method moves the NewChild loop to live inside of
-/// the NewParent Loop, instead of being a sibling of it.
-void LoopInfo::MoveSiblingLoopInto(Loop *NewChild, Loop *NewParent) {
- Loop *OldParent = NewChild->getParentLoop();
- assert(OldParent && OldParent == NewParent->getParentLoop() &&
- NewChild != NewParent && "Not sibling loops!");
-
- // Remove NewChild from being a child of OldParent
- std::vector::iterator I =
- std::find(OldParent->SubLoops.begin(), OldParent->SubLoops.end(), NewChild);
- assert(I != OldParent->SubLoops.end() && "Parent fields incorrect??");
- OldParent->SubLoops.erase(I); // Remove from parent's subloops list
- NewChild->ParentLoop = 0;
-
- InsertLoopInto(NewChild, NewParent);
-}
-
-/// InsertLoopInto - This inserts loop L into the specified parent loop. If the
-/// parent loop contains a loop which should contain L, the loop gets inserted
-/// into L instead.
-void LoopInfo::InsertLoopInto(Loop *L, Loop *Parent) {
- BasicBlock *LHeader = L->getHeader();
- assert(Parent->contains(LHeader) && "This loop should not be inserted here!");
-
- // Check to see if it belongs in a child loop...
- for (unsigned i = 0, e = Parent->SubLoops.size(); i != e; ++i)
- if (Parent->SubLoops[i]->contains(LHeader)) {
- InsertLoopInto(L, Parent->SubLoops[i]);
- return;
- }
-
- // If not, insert it here!
- Parent->SubLoops.push_back(L);
- L->ParentLoop = Parent;
-}
-
-/// changeLoopFor - Change the top-level loop that contains BB to the
-/// specified loop. This should be used by transformations that restructure
-/// the loop hierarchy tree.
-void LoopInfo::changeLoopFor(BasicBlock *BB, Loop *L) {
- Loop *&OldLoop = BBMap[BB];
- assert(OldLoop && "Block not in a loop yet!");
- OldLoop = L;
-}
-
-/// changeTopLevelLoop - Replace the specified loop in the top-level loops
-/// list with the indicated loop.
-void LoopInfo::changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop) {
- std::vector::iterator I = std::find(TopLevelLoops.begin(),
- TopLevelLoops.end(), OldLoop);
- assert(I != TopLevelLoops.end() && "Old loop not at top level!");
- *I = NewLoop;
- assert(NewLoop->ParentLoop == 0 && OldLoop->ParentLoop == 0 &&
- "Loops already embedded into a subloop!");
-}
-
-/// removeLoop - This removes the specified top-level loop from this loop info
-/// object. The loop is not deleted, as it will presumably be inserted into
-/// another loop.
-Loop *LoopInfo::removeLoop(iterator I) {
- assert(I != end() && "Cannot remove end iterator!");
- Loop *L = *I;
- assert(L->getParentLoop() == 0 && "Not a top-level loop!");
- TopLevelLoops.erase(TopLevelLoops.begin() + (I-begin()));
- return L;
-}
-
-/// removeBlock - This method completely removes BB from all data structures,
-/// including all of the Loop objects it is nested in and our mapping from
-/// BasicBlocks to loops.
-void LoopInfo::removeBlock(BasicBlock *BB) {
- std::map::iterator I = BBMap.find(BB);
- if (I != BBMap.end()) {
- for (Loop *L = I->second; L; L = L->getParentLoop())
- L->removeBlockFromLoop(BB);
-
- BBMap.erase(I);
- }
-}
-
// Ensure this file gets linked when LoopInfo.h is used.
DEFINING_FILE_FOR(LoopInfo)
From sabre at nondot.org Wed Nov 14 23:57:07 2007
From: sabre at nondot.org (Chris Lattner)
Date: Thu, 15 Nov 2007 05:57:07 -0000
Subject: [llvm-commits] [llvm] r44161 - in /llvm/trunk: LICENSE.TXT
docs/BOOST_LICENSE_1_0.txt include/llvm/ADT/scoped_ptr.h
Message-ID: <200711150557.lAF5v76a024032@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Nov 14 23:57:06 2007
New Revision: 44161
URL: http://llvm.org/viewvc/llvm-project?rev=44161&view=rev
Log:
Import the boost scoped_ptr class to LLVM. This patch was prepared by
C?dric Venet.
Added:
llvm/trunk/docs/BOOST_LICENSE_1_0.txt
llvm/trunk/include/llvm/ADT/scoped_ptr.h
Modified:
llvm/trunk/LICENSE.TXT
Modified: llvm/trunk/LICENSE.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/LICENSE.TXT?rev=44161&r1=44160&r2=44161&view=diff
==============================================================================
--- llvm/trunk/LICENSE.TXT (original)
+++ llvm/trunk/LICENSE.TXT Wed Nov 14 23:57:06 2007
@@ -66,3 +66,6 @@
Autoconf llvm/autoconf
llvm/projects/ModuleMaker/autoconf
llvm/projects/sample/autoconf
+Boost C++ Libraries llvm/include : docs/BOOST_LICENSE_1_0.txt
+
+
Added: llvm/trunk/docs/BOOST_LICENSE_1_0.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/BOOST_LICENSE_1_0.txt?rev=44161&view=auto
==============================================================================
--- llvm/trunk/docs/BOOST_LICENSE_1_0.txt (added)
+++ llvm/trunk/docs/BOOST_LICENSE_1_0.txt Wed Nov 14 23:57:06 2007
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
Added: llvm/trunk/include/llvm/ADT/scoped_ptr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/scoped_ptr.h?rev=44161&view=auto
==============================================================================
--- llvm/trunk/include/llvm/ADT/scoped_ptr.h (added)
+++ llvm/trunk/include/llvm/ADT/scoped_ptr.h Wed Nov 14 23:57:06 2007
@@ -0,0 +1,129 @@
+//===- llvm/ADT/scoped_ptr.h - basic smart pointer --------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the scoped_ptr smart pointer: scoped_ptr mimics a built-in
+// pointer except that it guarantees deletion of the object pointed to, either
+// on destruction of the scoped_ptr or via an explicit reset(). scoped_ptr is a
+// simple solution for simple needs.
+//
+//===----------------------------------------------------------------------===//
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file llvm/docs/BOOST_LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt )
+//
+// http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
+//
+
+#ifndef LLVM_SCOPED_PTR_HPP_INCLUDED
+#define LLVM_SCOPED_PTR_HPP_INCLUDED
+
+#include
+
+namespace llvm {
+
+// verify that types are complete for increased safety
+template inline void checked_delete(T * x) {
+ // intentionally complex - simplification causes regressions
+ typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
+ (void) sizeof(type_must_be_complete);
+ delete x;
+}
+
+// scoped_ptr mimics a built-in pointer except that it guarantees deletion
+// of the object pointed to, either on destruction of the scoped_ptr or via
+// an explicit reset(). scoped_ptr is a simple solution for simple needs;
+// use shared_ptr or std::auto_ptr if your needs are more complex.
+
+template class scoped_ptr // noncopyable
+{
+private:
+
+ T * ptr;
+
+ scoped_ptr(scoped_ptr const &);
+ scoped_ptr & operator=(scoped_ptr const &);
+
+ typedef scoped_ptr this_type;
+
+public:
+
+ typedef T element_type;
+
+ explicit scoped_ptr(T * p = 0): ptr(p) // never throws
+ {
+ }
+
+ ~scoped_ptr() // never throws
+ {
+ llvm::checked_delete(ptr);
+ }
+
+ void reset(T * p = 0) // never throws
+ {
+ assert( (p == 0 || p != ptr) && "scoped_ptr: self-reset error"); // catch self-reset errors
+ this_type(p).swap(*this);
+ }
+
+ T & operator*() const // never throws
+ {
+ assert(ptr != 0 && "scoped_ptr: Trying to dereference a null pointeur");
+ return *ptr;
+ }
+
+ T * operator->() const // never throws
+ {
+ assert(ptr != 0 && "scoped_ptr: Trying to dereference a null pointeur");
+ return ptr;
+ }
+
+ T * get() const // never throws
+ {
+ return ptr;
+ }
+
+ // implicit conversion to "bool"
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return ptr == 0? 0: &this_type::ptr;
+ }
+
+ bool operator! () const // never throws
+ {
+ return ptr == 0;
+ }
+
+ void swap(scoped_ptr & b) // never throws
+ {
+ T * tmp = b.ptr;
+ b.ptr = ptr;
+ ptr = tmp;
+ }
+};
+
+template inline void swap(scoped_ptr & a, scoped_ptr & b) // never throws
+{
+ a.swap(b);
+}
+
+// get_pointer(p) is a generic way to say p.get()
+
+template inline T * get_pointer(scoped_ptr const & p)
+{
+ return p.get();
+}
+
+} // namespace llvm
+
+#endif // #ifndef LLVM_SCOPED_PTR_HPP_INCLUDED
From sabre at nondot.org Thu Nov 15 00:10:55 2007
From: sabre at nondot.org (Chris Lattner)
Date: Thu, 15 Nov 2007 06:10:55 -0000
Subject: [llvm-commits] [llvm] r44162 -
/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
Message-ID: <200711150610.lAF6At0w024696@zion.cs.uiuc.edu>
Author: lattner
Date: Thu Nov 15 00:10:55 2007
New Revision: 44162
URL: http://llvm.org/viewvc/llvm-project?rev=44162&view=rev
Log:
Fix PR1788 by taking the approach suggested by Richard Smith.
Thanks to him for his detailed analysis of the problem.
Modified:
llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=44162&r1=44161&r2=44162&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Nov 15 00:10:55 2007
@@ -604,23 +604,28 @@
}
bool DAE::runOnModule(Module &M) {
- // First phase: loop through the module, determining which arguments are live.
- // We assume all arguments are dead unless proven otherwise (allowing us to
- // determine that dead arguments passed into recursive functions are dead).
- //
- DOUT << "DAE - Determining liveness\n";
+ bool Changed = false;
+ // First pass: Do a simple check to see if any functions can have their "..."
+ // removed. We can do this if they never call va_start. This loop cannot be
+ // fused with the next loop, because deleting a function invalidates
+ // information computed while surveying other functions.
+ DOUT << "DAE - Deleting dead varargs\n";
for (Module::iterator I = M.begin(), E = M.end(); I != E; ) {
Function &F = *I++;
if (F.getFunctionType()->isVarArg())
- if (DeleteDeadVarargs(F))
- continue;
-
- SurveyFunction(F);
+ Changed |= DeleteDeadVarargs(F);
}
+
+ // Second phase:loop through the module, determining which arguments are live.
+ // We assume all arguments are dead unless proven otherwise (allowing us to
+ // determine that dead arguments passed into recursive functions are dead).
+ //
+ DOUT << "DAE - Determining liveness\n";
+ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
+ SurveyFunction(*I);
// Loop over the instructions to inspect, propagating liveness among arguments
// and return values which are MaybeLive.
-
while (!InstructionsToInspect.empty()) {
Instruction *I = InstructionsToInspect.back();
InstructionsToInspect.pop_back();
@@ -680,7 +685,7 @@
// to do.
if (MaybeLiveArguments.empty() && DeadArguments.empty() &&
MaybeLiveRetVal.empty() && DeadRetVal.empty())
- return false;
+ return Changed;
// Otherwise, compact into one set, and start eliminating the arguments from
// the functions.
From nicholas at mxc.ca Thu Nov 15 00:30:50 2007
From: nicholas at mxc.ca (Nick Lewycky)
Date: Thu, 15 Nov 2007 06:30:50 -0000
Subject: [llvm-commits] [llvm] r44163 - in /llvm/trunk:
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionExpander.h
include/llvm/Analysis/ScalarEvolutionExpressions.h
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
Message-ID: <200711150630.lAF6UoQH025607@zion.cs.uiuc.edu>
Author: nicholas
Date: Thu Nov 15 00:30:50 2007
New Revision: 44163
URL: http://llvm.org/viewvc/llvm-project?rev=44163&view=rev
Log:
Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEV
is disabled in the sense that it will refuse to create one from a UDiv
instruction, until the code is better tested.
Added:
llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=44163&r1=44162&r2=44163&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Thu Nov 15 00:30:50 2007
@@ -226,6 +226,7 @@
return getMulExpr(Ops);
}
SCEVHandle getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
+ SCEVHandle getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
SCEVHandle getAddRecExpr(const SCEVHandle &Start, const SCEVHandle &Step,
const Loop *L);
SCEVHandle getAddRecExpr(std::vector &Operands,
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=44163&r1=44162&r2=44163&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Thu Nov 15 00:30:50 2007
@@ -132,6 +132,12 @@
return InsertBinop(Instruction::SDiv, LHS, RHS, InsertPt);
}
+ Value *visitUDivExpr(SCEVUDivExpr *S) {
+ Value *LHS = expand(S->getLHS());
+ Value *RHS = expand(S->getRHS());
+ return InsertBinop(Instruction::UDiv, LHS, RHS, InsertPt);
+ }
+
Value *visitAddRecExpr(SCEVAddRecExpr *S);
Value *visitUnknown(SCEVUnknown *S) {
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=44163&r1=44162&r2=44163&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Thu Nov 15 00:30:50 2007
@@ -25,7 +25,7 @@
// These should be ordered in terms of increasing complexity to make the
// folders simpler.
scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr,
- scSDivExpr, scAddRecExpr, scUnknown, scCouldNotCompute
+ scSDivExpr, scUDivExpr, scAddRecExpr, scUnknown, scCouldNotCompute
};
//===--------------------------------------------------------------------===//
@@ -370,6 +370,55 @@
//===--------------------------------------------------------------------===//
+ /// SCEVUDivExpr - This class represents a binary unsigned division operation.
+ ///
+ class SCEVUDivExpr : public SCEV {
+ friend class ScalarEvolution;
+
+ SCEVHandle LHS, RHS;
+ SCEVUDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs)
+ : SCEV(scUDivExpr), LHS(lhs), RHS(rhs) {}
+
+ virtual ~SCEVUDivExpr();
+ public:
+ const SCEVHandle &getLHS() const { return LHS; }
+ const SCEVHandle &getRHS() const { return RHS; }
+
+ virtual bool isLoopInvariant(const Loop *L) const {
+ return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L);
+ }
+
+ virtual bool hasComputableLoopEvolution(const Loop *L) const {
+ return LHS->hasComputableLoopEvolution(L) &&
+ RHS->hasComputableLoopEvolution(L);
+ }
+
+ SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
+ const SCEVHandle &Conc,
+ ScalarEvolution &SE) const {
+ SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
+ if (L == LHS && R == RHS)
+ return this;
+ else
+ return SE.getUDivExpr(L, R);
+ }
+
+
+ virtual const Type *getType() const;
+
+ void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
+
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const SCEVUDivExpr *S) { return true; }
+ static inline bool classof(const SCEV *S) {
+ return S->getSCEVType() == scUDivExpr;
+ }
+ };
+
+
+ //===--------------------------------------------------------------------===//
/// SCEVAddRecExpr - This node represents a polynomial recurrence on the trip
/// count of the specified loop.
///
@@ -519,6 +568,8 @@
return ((SC*)this)->visitMulExpr((SCEVMulExpr*)S);
case scSDivExpr:
return ((SC*)this)->visitSDivExpr((SCEVSDivExpr*)S);
+ case scUDivExpr:
+ return ((SC*)this)->visitUDivExpr((SCEVUDivExpr*)S);
case scAddRecExpr:
return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S);
case scUnknown:
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=44163&r1=44162&r2=44163&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Nov 15 00:30:50 2007
@@ -344,6 +344,24 @@
return LHS->getType();
}
+// SCEVUDivs - Only allow the creation of one SCEVUDivExpr for any particular
+// input. Don't use a SCEVHandle here, or else the object will never be
+// deleted!
+static ManagedStatic,
+ SCEVUDivExpr*> > SCEVUDivs;
+
+SCEVUDivExpr::~SCEVUDivExpr() {
+ SCEVUDivs->erase(std::make_pair(LHS, RHS));
+}
+
+void SCEVUDivExpr::print(std::ostream &OS) const {
+ OS << "(" << *LHS << " /u " << *RHS << ")";
+}
+
+const Type *SCEVUDivExpr::getType() const {
+ return LHS->getType();
+}
+
// SCEVAddRecExprs - Only allow the creation of one SCEVAddRecExpr for any
// particular input. Don't use a SCEVHandle here, or else the object will never
// be deleted!
@@ -573,7 +591,7 @@
for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
SCEVHandle BC = PartialFact(It, i, SE);
Divisor *= i;
- SCEVHandle Val = SE.getSDivExpr(SE.getMulExpr(BC, getOperand(i)),
+ SCEVHandle Val = SE.getUDivExpr(SE.getMulExpr(BC, getOperand(i)),
SE.getIntegerSCEV(Divisor,Ty));
Result = SE.getAddExpr(Result, Val);
}
@@ -1037,7 +1055,8 @@
return Result;
}
-SCEVHandle ScalarEvolution::getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) {
+SCEVHandle ScalarEvolution::getSDivExpr(const SCEVHandle &LHS,
+ const SCEVHandle &RHS) {
if (SCEVConstant *RHSC = dyn_cast(RHS)) {
if (RHSC->getValue()->equalsInt(1))
return LHS; // X sdiv 1 --> x
@@ -1058,6 +1077,26 @@
return Result;
}
+SCEVHandle ScalarEvolution::getUDivExpr(const SCEVHandle &LHS,
+ const SCEVHandle &RHS) {
+ if (SCEVConstant *RHSC = dyn_cast(RHS)) {
+ if (RHSC->getValue()->equalsInt(1))
+ return LHS; // X udiv 1 --> x
+
+ if (SCEVConstant *LHSC = dyn_cast(LHS)) {
+ Constant *LHSCV = LHSC->getValue();
+ Constant *RHSCV = RHSC->getValue();
+ return getUnknown(ConstantExpr::getUDiv(LHSCV, RHSCV));
+ }
+ }
+
+ // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't overflow.
+
+ SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)];
+ if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS);
+ return Result;
+}
+
/// SCEVAddRecExpr::get - Get a add recurrence expression for the
/// specified loop. Simplify the expression as much as possible.
@@ -1484,8 +1523,6 @@
case Instruction::SDiv:
return SE.getSDivExpr(getSCEV(I->getOperand(0)),
getSCEV(I->getOperand(1)));
- break;
-
case Instruction::Sub:
return SE.getMinusSCEV(getSCEV(I->getOperand(0)),
getSCEV(I->getOperand(1)));
@@ -2145,6 +2182,16 @@
return SE.getSDivExpr(LHS, RHS);
}
+ if (SCEVUDivExpr *Div = dyn_cast(V)) {
+ SCEVHandle LHS = getSCEVAtScope(Div->getLHS(), L);
+ if (LHS == UnknownValue) return LHS;
+ SCEVHandle RHS = getSCEVAtScope(Div->getRHS(), L);
+ if (RHS == UnknownValue) return RHS;
+ if (LHS == Div->getLHS() && RHS == Div->getRHS())
+ return Div; // must be loop invariant
+ return SE.getUDivExpr(LHS, RHS);
+ }
+
// If this is a loop recurrence for a loop that does not contain L, then we
// are dealing with the final value computed by the loop.
if (SCEVAddRecExpr *AddRec = dyn_cast(V)) {
Added: llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll?rev=44163&view=auto
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll (added)
+++ llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll Thu Nov 15 00:30:50 2007
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
+; PR1798
+
+declare void @printd(i32)
+
+define i32 @test() {
+entry:
+ br label %bb6
+
+bb: ; preds = %bb6
+ %tmp3 = add i32 %x.0, %i.0 ; [#uses=1]
+ %tmp5 = add i32 %i.0, 1 ; [#uses=1]
+ br label %bb6
+
+bb6: ; preds = %bb, %entry
+ %i.0 = phi i32 [ 0, %entry ], [ %tmp5, %bb ] ; [#uses=3]
+ %x.0 = phi i32 [ 0, %entry ], [ %tmp3, %bb ] ; [#uses=3]
+ %tmp8 = icmp slt i32 %i.0, 123456789 ; [#uses=1]
+ br i1 %tmp8, label %bb, label %bb10
+
+bb10: ; preds = %bb6
+ call void @printd(i32 %x.0)
+ ret i32 0
+}
From dberlin at dberlin.org Thu Nov 15 01:30:41 2007
From: dberlin at dberlin.org (Daniel Berlin)
Date: Thu, 15 Nov 2007 02:30:41 -0500
Subject: [llvm-commits] [llvm] r44082 -
/llvm/trunk/include/llvm/ADT/SparseBitVector.h
In-Reply-To: <4DEEF6D7-4433-4B64-9FDB-6633B748CF4F@mac.com>
References: <200711132304.lADN46TY019042@zion.cs.uiuc.edu>
<4DEEF6D7-4433-4B64-9FDB-6633B748CF4F@mac.com>
Message-ID: <4aca3dc20711142330y7456f4e1yaf75243d74076ae8@mail.gmail.com>
On 11/13/07, Owen Anderson wrote:
> On Nov 13, 2007, at 5:04 PM, Hartmut Kaiser wrote:
> > - return iterator(this, ~0);
> > + return iterator(this, true);
>
> I'm not sure this is right. Is "true" guaranteed to be all-ones when
> cast to an integer, or just to contain at least one 1 bit? If the
> latter, then this patch changes the meaning.
At one point, this patch would have been very broken (also, ~0 is not
strange for unsigned int, it's used all the time to get the largest
unsigned number that fits in the datatype).
I have since changed the iterator to track the end differently, and
removed the ability to get an iterator at any random point in the
bitmap, so the parameter ~0 is being passed for is now a true/false
variable.
>
> --Owen
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
From nicholas at mxc.ca Thu Nov 15 01:48:20 2007
From: nicholas at mxc.ca (Nick Lewycky)
Date: Thu, 15 Nov 2007 07:48:20 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r44165 - in
/llvm-gcc-4.0/trunk/gcc/config/rs6000: linux.h sysv4.h
Message-ID: <200711150748.lAF7mKcN029649@zion.cs.uiuc.edu>
Author: nicholas
Date: Thu Nov 15 01:48:19 2007
New Revision: 44165
URL: http://llvm.org/viewvc/llvm-project?rev=44165&view=rev
Log:
A cleaner fix for the PowerPC Linux build issues. Patch by Eric Christopher.
Modified:
llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h
llvm-gcc-4.0/trunk/gcc/config/rs6000/sysv4.h
Modified: llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h?rev=44165&r1=44164&r2=44165&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h (original)
+++ llvm-gcc-4.0/trunk/gcc/config/rs6000/linux.h Thu Nov 15 01:48:19 2007
@@ -110,13 +110,3 @@
#define TARGET_HAS_F_SETLKW
#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
-
-#undef ADJUST_FIELD_ALIGN
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
- (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
- (((COMPUTED) == RS6000_VECTOR_ALIGNMENT) \
- ? RS6000_VECTOR_ALIGNMENT \
- : (MIN ((COMPUTED), \
- (TARGET_ALIGN_MAC68K ? 16 \
- : ((FIRST_FIELD_P) ? (COMPUTED) \
- : 32))))))
Modified: llvm-gcc-4.0/trunk/gcc/config/rs6000/sysv4.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/rs6000/sysv4.h?rev=44165&r1=44164&r2=44165&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/rs6000/sysv4.h (original)
+++ llvm-gcc-4.0/trunk/gcc/config/rs6000/sysv4.h Thu Nov 15 01:48:19 2007
@@ -415,7 +415,7 @@
/* An expression for the alignment of a structure field FIELD if the
alignment computed in the usual way is COMPUTED. */
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
? 128 : COMPUTED)
From evan.cheng at apple.com Thu Nov 15 02:13:29 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Thu, 15 Nov 2007 08:13:29 -0000
Subject: [llvm-commits] [llvm] r44166 - in /llvm/trunk:
lib/CodeGen/LiveIntervalAnalysis.cpp
test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
Message-ID: <200711150813.lAF8DTAi030739@zion.cs.uiuc.edu>
Author: evancheng
Date: Thu Nov 15 02:13:29 2007
New Revision: 44166
URL: http://llvm.org/viewvc/llvm-project?rev=44166&view=rev
Log:
Fix a thinko in post-allocation coalescer.
Added:
llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
Modified:
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44166&r1=44165&r2=44166&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Nov 15 02:13:29 2007
@@ -168,15 +168,22 @@
if (index == end) break;
MachineInstr *MI = getInstructionFromIndex(index);
+ unsigned SrcReg, DstReg;
+ if (tii_->isMoveInstr(*MI, SrcReg, DstReg))
+ if (SrcReg == li.reg || DstReg == li.reg)
+ continue;
for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
MachineOperand& mop = MI->getOperand(i);
- if (!mop.isRegister() || !mop.isDef())
+ if (!mop.isRegister())
continue;
unsigned PhysReg = mop.getReg();
- if (PhysReg == 0)
+ if (PhysReg == 0 || PhysReg == li.reg)
continue;
- if (MRegisterInfo::isVirtualRegister(PhysReg))
+ if (MRegisterInfo::isVirtualRegister(PhysReg)) {
+ if (!vrm.hasPhys(PhysReg))
+ continue;
PhysReg = vrm.getPhys(PhysReg);
+ }
if (PhysReg && mri_->regsOverlap(PhysReg, reg))
return true;
}
Added: llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll?rev=44166&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll Thu Nov 15 02:13:29 2007
@@ -0,0 +1,67 @@
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | grep 4
+
+ %struct.double_int = type { i64, i64 }
+ %struct.tree_common = type <{ i8, [3 x i8] }>
+ %struct.tree_int_cst = type { %struct.tree_common, %struct.double_int }
+ %struct.tree_node = type { %struct.tree_int_cst }
+ at tree_code_type = external constant [0 x i32] ; <[0 x i32]*> [#uses=1]
+
+define i32 @simple_cst_equal(%struct.tree_node* %t1, %struct.tree_node* %t2) {
+entry:
+ %tmp2526 = bitcast %struct.tree_node* %t1 to i32* ; [#uses=1]
+ br i1 false, label %UnifiedReturnBlock, label %bb21
+
+bb21: ; preds = %entry
+ %tmp27 = load i32* %tmp2526, align 4 ; [#uses=1]
+ %tmp29 = and i32 %tmp27, 255 ; [#uses=3]
+ %tmp2930 = trunc i32 %tmp29 to i8 ; [#uses=1]
+ %tmp37 = load i32* null, align 4 ; [#uses=1]
+ %tmp39 = and i32 %tmp37, 255 ; [#uses=2]
+ %tmp3940 = trunc i32 %tmp39 to i8 ; [#uses=1]
+ %tmp43 = add i32 %tmp29, -3 ; [#uses=1]
+ %tmp44 = icmp ult i32 %tmp43, 3 ; [#uses=1]
+ br i1 %tmp44, label %bb47.split, label %bb76
+
+bb47.split: ; preds = %bb21
+ ret i32 0
+
+bb76: ; preds = %bb21
+ br i1 false, label %bb82, label %bb146.split
+
+bb82: ; preds = %bb76
+ %tmp94 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %tmp39 ; [#uses=1]
+ %tmp95 = load i32* %tmp94, align 4 ; [#uses=1]
+ %tmp9596 = trunc i32 %tmp95 to i8 ; [#uses=1]
+ %tmp98 = add i8 %tmp9596, -4 ; [#uses=1]
+ %tmp99 = icmp ugt i8 %tmp98, 5 ; [#uses=1]
+ br i1 %tmp99, label %bb102, label %bb106
+
+bb102: ; preds = %bb82
+ ret i32 0
+
+bb106: ; preds = %bb82
+ ret i32 0
+
+bb146.split: ; preds = %bb76
+ %tmp149 = icmp eq i8 %tmp2930, %tmp3940 ; [#uses=1]
+ br i1 %tmp149, label %bb153, label %UnifiedReturnBlock
+
+bb153: ; preds = %bb146.split
+ switch i32 %tmp29, label %UnifiedReturnBlock [
+ i32 0, label %bb155
+ i32 1, label %bb187
+ ]
+
+bb155: ; preds = %bb153
+ ret i32 0
+
+bb187: ; preds = %bb153
+ %tmp198 = icmp eq %struct.tree_node* %t1, %t2 ; [#uses=1]
+ br i1 %tmp198, label %bb201, label %UnifiedReturnBlock
+
+bb201: ; preds = %bb187
+ ret i32 0
+
+UnifiedReturnBlock: ; preds = %bb187, %bb153, %bb146.split, %entry
+ ret i32 0
+}
From baldrick at free.fr Thu Nov 15 03:19:16 2007
From: baldrick at free.fr (Duncan Sands)
Date: Thu, 15 Nov 2007 10:19:16 +0100
Subject: [llvm-commits] [llvm-gcc-4.0] r44138 -
/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
In-Reply-To: <200711142139.lAELdsUp030543@zion.cs.uiuc.edu>
References: <200711142139.lAELdsUp030543@zion.cs.uiuc.edu>
Message-ID: <200711151019.17141.baldrick@free.fr>
> Small improvement in asm handling; not enough
> to get 5599110 working, but a step.
4.2?
Ciao,
Duncan.
From baldrick at free.fr Thu Nov 15 03:54:38 2007
From: baldrick at free.fr (Duncan Sands)
Date: Thu, 15 Nov 2007 09:54:38 -0000
Subject: [llvm-commits] [llvm] r44167 -
/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200711150954.lAF9scSM010031@zion.cs.uiuc.edu>
Author: baldrick
Date: Thu Nov 15 03:54:37 2007
New Revision: 44167
URL: http://llvm.org/viewvc/llvm-project?rev=44167&view=rev
Log:
This assertion was bogus.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=44167&r1=44166&r2=44167&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Nov 15 03:54:37 2007
@@ -4492,14 +4492,13 @@
static void copyCatchInfo(BasicBlock *SrcBB, BasicBlock *DestBB,
MachineModuleInfo *MMI, FunctionLoweringInfo &FLI) {
- assert(!FLI.MBBMap[SrcBB]->isLandingPad() &&
- "Copying catch info out of a landing pad!");
for (BasicBlock::iterator I = SrcBB->begin(), E = --SrcBB->end(); I != E; ++I)
if (isSelector(I)) {
// Apply the catch info to DestBB.
addCatchInfo(cast(*I), MMI, FLI.MBBMap[DestBB]);
#ifndef NDEBUG
- FLI.CatchInfoFound.insert(I);
+ if (!FLI.MBBMap[SrcBB]->isLandingPad())
+ FLI.CatchInfoFound.insert(I);
#endif
}
}
From dberlin at dberlin.org Thu Nov 15 12:06:49 2007
From: dberlin at dberlin.org (Daniel Berlin)
Date: Thu, 15 Nov 2007 18:06:49 -0000
Subject: [llvm-commits] [llvm] r44174 -
/llvm/trunk/include/llvm/ADT/SparseBitVector.h
Message-ID: <200711151806.lAFI6nb3003981@zion.cs.uiuc.edu>
Author: dannyb
Date: Thu Nov 15 12:06:49 2007
New Revision: 44174
URL: http://llvm.org/viewvc/llvm-project?rev=44174&view=rev
Log:
Fix bugs in iterator invalidation
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=44174&r1=44173&r2=44174&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Thu Nov 15 12:06:49 2007
@@ -614,8 +614,10 @@
// Loop through, intersecting as we go, erasing elements when necessary.
while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end())
+ if (Iter1 == Elements.end()) {
+ CurrElementIter = Elements.begin();
return changed;
+ }
if (Iter1->index() > Iter2->index()) {
++Iter2;
@@ -654,8 +656,10 @@
// Loop through, intersecting as we go, erasing elements when necessary.
while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end())
+ if (Iter1 == Elements.end()) {
+ CurrElementIter = Elements.begin();
return changed;
+ }
if (Iter1->index() > Iter2->index()) {
++Iter2;
@@ -689,6 +693,7 @@
const SparseBitVector &RHS2)
{
Elements.clear();
+ CurrElementIter = Elements.begin();
ElementListConstIter Iter1 = RHS1.Elements.begin();
ElementListConstIter Iter2 = RHS2.Elements.begin();
@@ -732,7 +737,6 @@
++Iter1;
}
- CurrElementIter = Elements.begin();
return;
}
From nlewycky at google.com Thu Nov 15 12:06:12 2007
From: nlewycky at google.com (Nicholas Lewycky)
Date: Thu, 15 Nov 2007 10:06:12 -0800
Subject: [llvm-commits] please revert r44163
In-Reply-To:
References:
Message-ID:
Hi,
Could someone please revert my patch to SCEV from last night? Patch to do
the revert is attached. It caused a regression of PR726 and so I'll need to
do some further analysis.
Nick Lewycky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071115/786c3de7/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revert.patch
Type: text/x-patch
Size: 8690 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20071115/786c3de7/attachment.bin
From asl at math.spbu.ru Thu Nov 15 12:33:16 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Thu, 15 Nov 2007 18:33:16 -0000
Subject: [llvm-commits] [llvm] r44177 - in /llvm/trunk:
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionExpander.h
include/llvm/Analysis/ScalarEvolutionExpressions.h
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
Message-ID: <200711151833.lAFIXGlB006221@zion.cs.uiuc.edu>
Author: asl
Date: Thu Nov 15 12:33:16 2007
New Revision: 44177
URL: http://llvm.org/viewvc/llvm-project?rev=44177&view=rev
Log:
Reverted r44163 per request
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=44177&r1=44176&r2=44177&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Thu Nov 15 12:33:16 2007
@@ -226,7 +226,6 @@
return getMulExpr(Ops);
}
SCEVHandle getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
- SCEVHandle getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
SCEVHandle getAddRecExpr(const SCEVHandle &Start, const SCEVHandle &Step,
const Loop *L);
SCEVHandle getAddRecExpr(std::vector &Operands,
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=44177&r1=44176&r2=44177&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Thu Nov 15 12:33:16 2007
@@ -132,12 +132,6 @@
return InsertBinop(Instruction::SDiv, LHS, RHS, InsertPt);
}
- Value *visitUDivExpr(SCEVUDivExpr *S) {
- Value *LHS = expand(S->getLHS());
- Value *RHS = expand(S->getRHS());
- return InsertBinop(Instruction::UDiv, LHS, RHS, InsertPt);
- }
-
Value *visitAddRecExpr(SCEVAddRecExpr *S);
Value *visitUnknown(SCEVUnknown *S) {
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=44177&r1=44176&r2=44177&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Thu Nov 15 12:33:16 2007
@@ -25,7 +25,7 @@
// These should be ordered in terms of increasing complexity to make the
// folders simpler.
scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr,
- scSDivExpr, scUDivExpr, scAddRecExpr, scUnknown, scCouldNotCompute
+ scSDivExpr, scAddRecExpr, scUnknown, scCouldNotCompute
};
//===--------------------------------------------------------------------===//
@@ -370,55 +370,6 @@
//===--------------------------------------------------------------------===//
- /// SCEVUDivExpr - This class represents a binary unsigned division operation.
- ///
- class SCEVUDivExpr : public SCEV {
- friend class ScalarEvolution;
-
- SCEVHandle LHS, RHS;
- SCEVUDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs)
- : SCEV(scUDivExpr), LHS(lhs), RHS(rhs) {}
-
- virtual ~SCEVUDivExpr();
- public:
- const SCEVHandle &getLHS() const { return LHS; }
- const SCEVHandle &getRHS() const { return RHS; }
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L);
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return LHS->hasComputableLoopEvolution(L) &&
- RHS->hasComputableLoopEvolution(L);
- }
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (L == LHS && R == RHS)
- return this;
- else
- return SE.getUDivExpr(L, R);
- }
-
-
- virtual const Type *getType() const;
-
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVUDivExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scUDivExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
/// SCEVAddRecExpr - This node represents a polynomial recurrence on the trip
/// count of the specified loop.
///
@@ -568,8 +519,6 @@
return ((SC*)this)->visitMulExpr((SCEVMulExpr*)S);
case scSDivExpr:
return ((SC*)this)->visitSDivExpr((SCEVSDivExpr*)S);
- case scUDivExpr:
- return ((SC*)this)->visitUDivExpr((SCEVUDivExpr*)S);
case scAddRecExpr:
return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S);
case scUnknown:
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=44177&r1=44176&r2=44177&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Nov 15 12:33:16 2007
@@ -344,24 +344,6 @@
return LHS->getType();
}
-// SCEVUDivs - Only allow the creation of one SCEVUDivExpr for any particular
-// input. Don't use a SCEVHandle here, or else the object will never be
-// deleted!
-static ManagedStatic,
- SCEVUDivExpr*> > SCEVUDivs;
-
-SCEVUDivExpr::~SCEVUDivExpr() {
- SCEVUDivs->erase(std::make_pair(LHS, RHS));
-}
-
-void SCEVUDivExpr::print(std::ostream &OS) const {
- OS << "(" << *LHS << " /u " << *RHS << ")";
-}
-
-const Type *SCEVUDivExpr::getType() const {
- return LHS->getType();
-}
-
// SCEVAddRecExprs - Only allow the creation of one SCEVAddRecExpr for any
// particular input. Don't use a SCEVHandle here, or else the object will never
// be deleted!
@@ -591,7 +573,7 @@
for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
SCEVHandle BC = PartialFact(It, i, SE);
Divisor *= i;
- SCEVHandle Val = SE.getUDivExpr(SE.getMulExpr(BC, getOperand(i)),
+ SCEVHandle Val = SE.getSDivExpr(SE.getMulExpr(BC, getOperand(i)),
SE.getIntegerSCEV(Divisor,Ty));
Result = SE.getAddExpr(Result, Val);
}
@@ -1055,8 +1037,7 @@
return Result;
}
-SCEVHandle ScalarEvolution::getSDivExpr(const SCEVHandle &LHS,
- const SCEVHandle &RHS) {
+SCEVHandle ScalarEvolution::getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) {
if (SCEVConstant *RHSC = dyn_cast(RHS)) {
if (RHSC->getValue()->equalsInt(1))
return LHS; // X sdiv 1 --> x
@@ -1077,26 +1058,6 @@
return Result;
}
-SCEVHandle ScalarEvolution::getUDivExpr(const SCEVHandle &LHS,
- const SCEVHandle &RHS) {
- if (SCEVConstant *RHSC = dyn_cast(RHS)) {
- if (RHSC->getValue()->equalsInt(1))
- return LHS; // X udiv 1 --> x
-
- if (SCEVConstant *LHSC = dyn_cast(LHS)) {
- Constant *LHSCV = LHSC->getValue();
- Constant *RHSCV = RHSC->getValue();
- return getUnknown(ConstantExpr::getUDiv(LHSCV, RHSCV));
- }
- }
-
- // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't overflow.
-
- SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)];
- if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS);
- return Result;
-}
-
/// SCEVAddRecExpr::get - Get a add recurrence expression for the
/// specified loop. Simplify the expression as much as possible.
@@ -1523,6 +1484,8 @@
case Instruction::SDiv:
return SE.getSDivExpr(getSCEV(I->getOperand(0)),
getSCEV(I->getOperand(1)));
+ break;
+
case Instruction::Sub:
return SE.getMinusSCEV(getSCEV(I->getOperand(0)),
getSCEV(I->getOperand(1)));
@@ -2182,16 +2145,6 @@
return SE.getSDivExpr(LHS, RHS);
}
- if (SCEVUDivExpr *Div = dyn_cast(V)) {
- SCEVHandle LHS = getSCEVAtScope(Div->getLHS(), L);
- if (LHS == UnknownValue) return LHS;
- SCEVHandle RHS = getSCEVAtScope(Div->getRHS(), L);
- if (RHS == UnknownValue) return RHS;
- if (LHS == Div->getLHS() && RHS == Div->getRHS())
- return Div; // must be loop invariant
- return SE.getUDivExpr(LHS, RHS);
- }
-
// If this is a loop recurrence for a loop that does not contain L, then we
// are dealing with the final value computed by the loop.
if (SCEVAddRecExpr *AddRec = dyn_cast(V)) {
@@ -2735,4 +2688,3 @@
for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I)
PrintLoopInfo(OS, this, *I);
}
-
Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll?rev=44177&r1=44176&r2=44177&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll Thu Nov 15 12:33:16 2007
@@ -1,5 +1,6 @@
; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
; PR1798
+; XFAIL: *
declare void @printd(i32)
From dpatel at apple.com Thu Nov 15 13:36:45 2007
From: dpatel at apple.com (Devang Patel)
Date: Thu, 15 Nov 2007 11:36:45 -0800
Subject: [llvm-commits] [llvm] r44097 - in /llvm/trunk:
include/llvm/Analysis/LoopInfo.h include/llvm/Analysis/LoopPass.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/FunctionUtils.h
lib/Analysis/LoopInfo.cpp
In-Reply-To: <200711140233.lAE2XxSQ028913@zion.cs.uiuc.edu>
References: <200711140233.lAE2XxSQ028913@zion.cs.uiuc.edu>
Message-ID: <1EA521AD-3DD4-497E-A6DD-13E6A98F45F6@apple.com>
On Nov 13, 2007, at 6:33 PM, Owen Anderson wrote:
> Start the process of making MachineLoopInfo possible by templating
> Loop.
Did you consider deriving MachineBasicBlock from BasicBlock to avoid
templating stuff ? Just curious.
-
Devang
From isanbard at gmail.com Thu Nov 15 14:41:01 2007
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 15 Nov 2007 12:41:01 -0800
Subject: [llvm-commits] [llvm] r44166 - in /llvm/trunk:
lib/CodeGen/LiveIntervalAnalysis.cpp
test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
In-Reply-To: <200711150813.lAF8DTAi030739@zion.cs.uiuc.edu>
References: <200711150813.lAF8DTAi030739@zion.cs.uiuc.edu>
Message-ID:
Evan,
Awesome! Did you try to compile 4.2 after this patch?
-bw
Am 15.11.2007 um 00:13 schrieb Evan Cheng :
> Author: evancheng
> Date: Thu Nov 15 02:13:29 2007
> New Revision: 44166
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44166&view=rev
> Log:
> Fix a thinko in post-allocation coalescer.
>
> Added:
> llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
> Modified:
> llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
>
> Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44166&r1=44165&r2=44166&view=diff
>
> ===
> ===
> ===
> =====================================================================
> --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Nov 15
> 02:13:29 2007
> @@ -168,15 +168,22 @@
> if (index == end) break;
>
> MachineInstr *MI = getInstructionFromIndex(index);
> + unsigned SrcReg, DstReg;
> + if (tii_->isMoveInstr(*MI, SrcReg, DstReg))
> + if (SrcReg == li.reg || DstReg == li.reg)
> + continue;
> for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
> MachineOperand& mop = MI->getOperand(i);
> - if (!mop.isRegister() || !mop.isDef())
> + if (!mop.isRegister())
> continue;
> unsigned PhysReg = mop.getReg();
> - if (PhysReg == 0)
> + if (PhysReg == 0 || PhysReg == li.reg)
> continue;
> - if (MRegisterInfo::isVirtualRegister(PhysReg))
> + if (MRegisterInfo::isVirtualRegister(PhysReg)) {
> + if (!vrm.hasPhys(PhysReg))
> + continue;
> PhysReg = vrm.getPhys(PhysReg);
> + }
> if (PhysReg && mri_->regsOverlap(PhysReg, reg))
> return true;
> }
>
> Added: llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll?rev=44166&view=auto
>
> ===
> ===
> ===
> =====================================================================
> --- llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll (added)
> +++ llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll Thu Nov
> 15 02:13:29 2007
> @@ -0,0 +1,67 @@
> +; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep
> movl | grep 4
> +
> + %struct.double_int = type { i64, i64 }
> + %struct.tree_common = type <{ i8, [3 x i8] }>
> + %struct.tree_int_cst = type { %struct.tree_common, %
> struct.double_int }
> + %struct.tree_node = type { %struct.tree_int_cst }
> + at tree_code_type = external constant [0 x i32] ; <[0 x i32]*>
> [#uses=1]
> +
> +define i32 @simple_cst_equal(%struct.tree_node* %t1, %
> struct.tree_node* %t2) {
> +entry:
> + %tmp2526 = bitcast %struct.tree_node* %t1 to i32* ;
> [#uses=1]
> + br i1 false, label %UnifiedReturnBlock, label %bb21
> +
> +bb21: ; preds = %entry
> + %tmp27 = load i32* %tmp2526, align 4 ; [#uses=1]
> + %tmp29 = and i32 %tmp27, 255 ; [#uses=3]
> + %tmp2930 = trunc i32 %tmp29 to i8 ; [#uses=1]
> + %tmp37 = load i32* null, align 4 ; [#uses=1]
> + %tmp39 = and i32 %tmp37, 255 ; [#uses=2]
> + %tmp3940 = trunc i32 %tmp39 to i8 ; [#uses=1]
> + %tmp43 = add i32 %tmp29, -3 ; [#uses=1]
> + %tmp44 = icmp ult i32 %tmp43, 3 ; [#uses=1]
> + br i1 %tmp44, label %bb47.split, label %bb76
> +
> +bb47.split: ; preds = %bb21
> + ret i32 0
> +
> +bb76: ; preds = %bb21
> + br i1 false, label %bb82, label %bb146.split
> +
> +bb82: ; preds = %bb76
> + %tmp94 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %
> tmp39 ; [#uses=1]
> + %tmp95 = load i32* %tmp94, align 4 ; [#uses=1]
> + %tmp9596 = trunc i32 %tmp95 to i8 ; [#uses=1]
> + %tmp98 = add i8 %tmp9596, -4 ; [#uses=1]
> + %tmp99 = icmp ugt i8 %tmp98, 5 ; [#uses=1]
> + br i1 %tmp99, label %bb102, label %bb106
> +
> +bb102: ; preds = %bb82
> + ret i32 0
> +
> +bb106: ; preds = %bb82
> + ret i32 0
> +
> +bb146.split: ; preds = %bb76
> + %tmp149 = icmp eq i8 %tmp2930, %tmp3940 ; [#uses=1]
> + br i1 %tmp149, label %bb153, label %UnifiedReturnBlock
> +
> +bb153: ; preds = %bb146.split
> + switch i32 %tmp29, label %UnifiedReturnBlock [
> + i32 0, label %bb155
> + i32 1, label %bb187
> + ]
> +
> +bb155: ; preds = %bb153
> + ret i32 0
> +
> +bb187: ; preds = %bb153
> + %tmp198 = icmp eq %struct.tree_node* %t1, %t2 ;
> [#uses=1]
> + br i1 %tmp198, label %bb201, label %UnifiedReturnBlock
> +
> +bb201: ; preds = %bb187
> + ret i32 0
> +
> +UnifiedReturnBlock: ; preds = %bb187, %bb153, %bb146.split, %
> entry
> + ret i32 0
> +}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From natebegeman at mac.com Thu Nov 15 15:15:27 2007
From: natebegeman at mac.com (Nate Begeman)
Date: Thu, 15 Nov 2007 21:15:27 -0000
Subject: [llvm-commits] [llvm] r44181 - in /llvm/trunk/lib:
AsmParser/llvmAsmParser.cpp.cvs AsmParser/llvmAsmParser.h.cvs
AsmParser/llvmAsmParser.y AsmParser/llvmAsmParser.y.cvs
CodeGen/SelectionDAG/LegalizeDAG.cpp VMCore/Type.cpp
Message-ID: <200711152115.lAFLFSwG019985@zion.cs.uiuc.edu>
Author: sampo
Date: Thu Nov 15 15:15:26 2007
New Revision: 44181
URL: http://llvm.org/viewvc/llvm-project?rev=44181&view=rev
Log:
Basic non-power-of-2 vector support
Modified:
llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
llvm/trunk/lib/AsmParser/llvmAsmParser.y
llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/VMCore/Type.cpp
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Thu Nov 15 15:15:26 2007
@@ -372,7 +372,7 @@
/* Copy the first part of user declarations. */
-#line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y"
#include "ParserInternals.h"
#include "llvm/CallingConv.h"
@@ -1347,7 +1347,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 968 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 968 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -1394,7 +1394,7 @@
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
}
-/* Line 187 of yacc.c. */
+/* Line 193 of yacc.c. */
#line 1399 "llvmAsmParser.tab.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -1458,7 +1458,7 @@
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -1847,24 +1847,24 @@
1246, 1247, 1250, 1251, 1256, 1257, 1258, 1259, 1260, 1261,
1264, 1265, 1272, 1273, 1279, 1280, 1288, 1296, 1297, 1302,
1303, 1304, 1309, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
- 1325, 1329, 1333, 1340, 1345, 1353, 1383, 1414, 1419, 1431,
- 1441, 1445, 1455, 1462, 1469, 1476, 1481, 1486, 1493, 1494,
- 1501, 1508, 1516, 1522, 1534, 1562, 1578, 1605, 1633, 1659,
- 1679, 1705, 1725, 1737, 1744, 1810, 1820, 1830, 1836, 1846,
- 1852, 1862, 1867, 1872, 1885, 1897, 1919, 1927, 1933, 1944,
- 1949, 1954, 1960, 1966, 1975, 1979, 1987, 1987, 1990, 1990,
- 1993, 2005, 2026, 2031, 2039, 2040, 2044, 2044, 2048, 2048,
- 2051, 2054, 2078, 2089, 2089, 2100, 2099, 2109, 2108, 2119,
- 2159, 2162, 2168, 2178, 2182, 2187, 2189, 2194, 2199, 2208,
- 2218, 2229, 2233, 2242, 2251, 2256, 2377, 2377, 2379, 2388,
- 2388, 2390, 2395, 2407, 2411, 2416, 2420, 2424, 2428, 2432,
- 2436, 2440, 2444, 2448, 2473, 2477, 2487, 2491, 2495, 2500,
- 2507, 2507, 2513, 2522, 2526, 2535, 2544, 2553, 2557, 2564,
- 2568, 2572, 2577, 2587, 2606, 2615, 2695, 2699, 2706, 2717,
- 2730, 2740, 2751, 2761, 2770, 2776, 2785, 2791, 2794, 2795,
- 2802, 2806, 2811, 2827, 2844, 2858, 2872, 2884, 2892, 2899,
- 2905, 2911, 2917, 2932, 3017, 3022, 3026, 3033, 3040, 3048,
- 3055, 3063, 3071, 3085, 3102
+ 1325, 1329, 1333, 1340, 1345, 1353, 1383, 1414, 1419, 1429,
+ 1439, 1443, 1453, 1460, 1467, 1474, 1479, 1484, 1491, 1492,
+ 1499, 1506, 1514, 1520, 1532, 1560, 1576, 1603, 1631, 1657,
+ 1677, 1703, 1723, 1735, 1742, 1808, 1818, 1828, 1834, 1844,
+ 1850, 1860, 1865, 1870, 1883, 1895, 1917, 1925, 1931, 1942,
+ 1947, 1952, 1958, 1964, 1973, 1977, 1985, 1985, 1988, 1988,
+ 1991, 2003, 2024, 2029, 2037, 2038, 2042, 2042, 2046, 2046,
+ 2049, 2052, 2076, 2087, 2087, 2098, 2097, 2107, 2106, 2117,
+ 2157, 2160, 2166, 2176, 2180, 2185, 2187, 2192, 2197, 2206,
+ 2216, 2227, 2231, 2240, 2249, 2254, 2375, 2375, 2377, 2386,
+ 2386, 2388, 2393, 2405, 2409, 2414, 2418, 2422, 2426, 2430,
+ 2434, 2438, 2442, 2446, 2471, 2475, 2485, 2489, 2493, 2498,
+ 2505, 2505, 2511, 2520, 2524, 2533, 2542, 2551, 2555, 2562,
+ 2566, 2570, 2575, 2585, 2604, 2613, 2693, 2697, 2704, 2715,
+ 2728, 2738, 2749, 2759, 2768, 2774, 2783, 2789, 2792, 2793,
+ 2800, 2804, 2809, 2825, 2842, 2856, 2870, 2882, 2890, 2897,
+ 2903, 2909, 2915, 2930, 3015, 3020, 3024, 3031, 3038, 3046,
+ 3053, 3061, 3069, 3083, 3100
};
#endif
@@ -2684,7 +2684,7 @@
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -3425,142 +3425,142 @@
switch (yyn)
{
case 29:
-#line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1134 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
break;
case 30:
-#line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1134 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
break;
case 31:
-#line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1135 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
break;
case 32:
-#line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1135 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
break;
case 33:
-#line 1136 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1136 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
break;
case 34:
-#line 1136 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1136 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
break;
case 35:
-#line 1137 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1137 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
break;
case 36:
-#line 1137 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1137 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
break;
case 37:
-#line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
break;
case 38:
-#line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
break;
case 39:
-#line 1142 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
break;
case 40:
-#line 1142 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
break;
case 41:
-#line 1143 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1143 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
break;
case 42:
-#line 1143 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1143 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
break;
case 43:
-#line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1144 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
break;
case 44:
-#line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1144 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
break;
case 45:
-#line 1145 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1145 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
break;
case 46:
-#line 1145 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1145 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
break;
case 47:
-#line 1146 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
break;
case 48:
-#line 1146 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
break;
case 49:
-#line 1147 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
break;
case 50:
-#line 1147 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
break;
case 51:
-#line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
break;
case 52:
-#line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
break;
case 53:
-#line 1149 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
break;
case 54:
-#line 1150 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1150 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
break;
case 65:
-#line 1159 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1159 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 66:
-#line 1163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1163 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
@@ -3568,7 +3568,7 @@
break;
case 67:
-#line 1167 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1167 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = 0;
CHECK_FOR_ERROR
@@ -3576,7 +3576,7 @@
break;
case 71:
-#line 1175 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1175 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = 0;
CHECK_FOR_ERROR
@@ -3584,7 +3584,7 @@
break;
case 72:
-#line 1180 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1180 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
@@ -3592,152 +3592,152 @@
break;
case 73:
-#line 1186 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1186 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 74:
-#line 1187 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 75:
-#line 1188 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1188 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 76:
-#line 1189 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1189 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
break;
case 77:
-#line 1190 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1190 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 78:
-#line 1194 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 79:
-#line 1195 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 80:
-#line 1196 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1196 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 81:
-#line 1200 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1200 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
break;
case 82:
-#line 1201 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1201 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
break;
case 83:
-#line 1202 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
break;
case 84:
-#line 1203 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
break;
case 85:
-#line 1207 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1207 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 86:
-#line 1208 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 87:
-#line 1209 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 88:
-#line 1213 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1213 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 89:
-#line 1214 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1214 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 90:
-#line 1215 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 91:
-#line 1216 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 92:
-#line 1217 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 93:
-#line 1221 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1221 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 94:
-#line 1222 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1222 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 95:
-#line 1223 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1223 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 96:
-#line 1226 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1226 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 97:
-#line 1227 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1227 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 98:
-#line 1228 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1228 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Fast; ;}
break;
case 99:
-#line 1229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Cold; ;}
break;
case 100:
-#line 1230 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
break;
case 101:
-#line 1231 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
break;
case 102:
-#line 1232 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1232 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
GEN_ERROR("Calling conv too large");
@@ -3747,111 +3747,111 @@
break;
case 103:
-#line 1239 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 104:
-#line 1240 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1240 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 105:
-#line 1241 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1241 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 106:
-#line 1242 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1242 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 107:
-#line 1243 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1243 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::InReg; ;}
break;
case 108:
-#line 1244 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1244 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
break;
case 109:
-#line 1245 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1245 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
break;
case 110:
-#line 1246 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1246 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
break;
case 111:
-#line 1247 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::Nest; ;}
break;
case 112:
-#line 1250 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1250 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::None; ;}
break;
case 113:
-#line 1251 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1251 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
;}
break;
case 114:
-#line 1256 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1256 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
break;
case 115:
-#line 1257 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1257 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
break;
case 116:
-#line 1258 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1258 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 117:
-#line 1259 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1259 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 118:
-#line 1260 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1260 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::Pure; ;}
break;
case 119:
-#line 1261 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1261 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::Const; ;}
break;
case 120:
-#line 1264 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1264 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::None; ;}
break;
case 121:
-#line 1265 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1265 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
;}
break;
case 122:
-#line 1272 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1272 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 123:
-#line 1273 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1273 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3861,12 +3861,12 @@
break;
case 124:
-#line 1279 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1279 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 125:
-#line 1280 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1280 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3876,7 +3876,7 @@
break;
case 126:
-#line 1288 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1288 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
@@ -3887,27 +3887,27 @@
break;
case 127:
-#line 1296 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1296 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 128:
-#line 1297 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1297 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
break;
case 129:
-#line 1302 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1302 "/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 130:
-#line 1303 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1303 "/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 131:
-#line 1304 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1304 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -3916,7 +3916,7 @@
break;
case 132:
-#line 1309 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1309 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Alignment must be a power of two");
@@ -3926,7 +3926,7 @@
break;
case 140:
-#line 1325 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1325 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
CHECK_FOR_ERROR
@@ -3934,7 +3934,7 @@
break;
case 141:
-#line 1329 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1329 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
CHECK_FOR_ERROR
@@ -3942,7 +3942,7 @@
break;
case 142:
-#line 1333 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1333 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Pointer type?
if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy)
GEN_ERROR("Cannot form a pointer to a basic block");
@@ -3953,7 +3953,7 @@
break;
case 143:
-#line 1340 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1340 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Named types are also simple types...
const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
CHECK_FOR_ERROR
@@ -3962,7 +3962,7 @@
break;
case 144:
-#line 1345 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1345 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Type UpReference
if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
@@ -3974,7 +3974,7 @@
break;
case 145:
-#line 1353 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1353 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::vector Params;
ParamAttrsVector Attrs;
@@ -4008,7 +4008,7 @@
break;
case 146:
-#line 1383 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1383 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::vector Params;
ParamAttrsVector Attrs;
@@ -4042,7 +4042,7 @@
break;
case 147:
-#line 1414 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1414 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Sized array type?
(yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
delete (yyvsp[(4) - (5)].TypeVal);
@@ -4051,15 +4051,13 @@
break;
case 148:
-#line 1419 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1419 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Vector type?
const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
GEN_ERROR("Unsigned result not equal to signed result");
if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
GEN_ERROR("Element type of a VectorType must be primitive");
- if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val)))
- GEN_ERROR("Vector length should be a power of 2");
(yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
delete (yyvsp[(4) - (5)].TypeVal);
CHECK_FOR_ERROR
@@ -4067,7 +4065,7 @@
break;
case 149:
-#line 1431 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1429 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Structure type?
std::vector Elements;
for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
@@ -4081,7 +4079,7 @@
break;
case 150:
-#line 1441 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1439 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
(yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector()));
CHECK_FOR_ERROR
@@ -4089,7 +4087,7 @@
break;
case 151:
-#line 1445 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1443 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::vector Elements;
for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
@@ -4103,7 +4101,7 @@
break;
case 152:
-#line 1455 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1453 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
(yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true));
CHECK_FOR_ERROR
@@ -4111,7 +4109,7 @@
break;
case 153:
-#line 1462 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1460 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
(yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs);
@@ -4119,7 +4117,7 @@
break;
case 154:
-#line 1469 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1467 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
@@ -4130,14 +4128,14 @@
break;
case 155:
-#line 1476 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1474 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
;}
break;
case 156:
-#line 1481 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1479 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList();
(yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
@@ -4146,7 +4144,7 @@
break;
case 157:
-#line 1486 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1484 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
CHECK_FOR_ERROR
@@ -4154,7 +4152,7 @@
break;
case 159:
-#line 1494 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1492 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
@@ -4165,7 +4163,7 @@
break;
case 160:
-#line 1501 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1499 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList;
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
@@ -4176,7 +4174,7 @@
break;
case 161:
-#line 1508 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1506 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList();
CHECK_FOR_ERROR
@@ -4184,7 +4182,7 @@
break;
case 162:
-#line 1516 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1514 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeList) = new std::list();
(yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
@@ -4194,7 +4192,7 @@
break;
case 163:
-#line 1522 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1520 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
delete (yyvsp[(3) - (3)].TypeVal);
@@ -4203,7 +4201,7 @@
break;
case 164:
-#line 1534 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1532 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
@@ -4235,7 +4233,7 @@
break;
case 165:
-#line 1562 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1560 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4255,7 +4253,7 @@
break;
case 166:
-#line 1578 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1576 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4286,7 +4284,7 @@
break;
case 167:
-#line 1605 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1603 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
@@ -4318,7 +4316,7 @@
break;
case 168:
-#line 1633 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1631 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
if (STy == 0)
@@ -4348,7 +4346,7 @@
break;
case 169:
-#line 1659 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1657 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4372,7 +4370,7 @@
break;
case 170:
-#line 1679 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1677 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get());
if (STy == 0)
@@ -4402,7 +4400,7 @@
break;
case 171:
-#line 1705 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1703 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
@@ -4426,7 +4424,7 @@
break;
case 172:
-#line 1725 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1723 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4442,7 +4440,7 @@
break;
case 173:
-#line 1737 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1735 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4453,7 +4451,7 @@
break;
case 174:
-#line 1744 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1742 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4523,7 +4521,7 @@
break;
case 175:
-#line 1810 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1808 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4537,7 +4535,7 @@
break;
case 176:
-#line 1820 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1818 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4551,7 +4549,7 @@
break;
case 177:
-#line 1830 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1828 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
@@ -4561,7 +4559,7 @@
break;
case 178:
-#line 1836 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1834 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // arbitrary precision integer constants
uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
@@ -4575,7 +4573,7 @@
break;
case 179:
-#line 1846 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1844 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
@@ -4585,7 +4583,7 @@
break;
case 180:
-#line 1852 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1850 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // arbitrary precision integer constants
uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
@@ -4599,7 +4597,7 @@
break;
case 181:
-#line 1862 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1860 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
(yyval.ConstVal) = ConstantInt::getTrue();
@@ -4608,7 +4606,7 @@
break;
case 182:
-#line 1867 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1865 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
(yyval.ConstVal) = ConstantInt::getFalse();
@@ -4617,7 +4615,7 @@
break;
case 183:
-#line 1872 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1870 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Floating point constants
if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
GEN_ERROR("Floating point constant invalid for type");
@@ -4632,7 +4630,7 @@
break;
case 184:
-#line 1885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1883 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
@@ -4648,7 +4646,7 @@
break;
case 185:
-#line 1897 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1895 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()))
GEN_ERROR("GetElementPtr requires a pointer operand");
@@ -4674,7 +4672,7 @@
break;
case 186:
-#line 1919 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1917 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
GEN_ERROR("Select condition must be of boolean type");
@@ -4686,7 +4684,7 @@
break;
case 187:
-#line 1927 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1925 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Binary operator types must match");
@@ -4696,7 +4694,7 @@
break;
case 188:
-#line 1933 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1931 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Logical operator types must match");
@@ -4711,7 +4709,7 @@
break;
case 189:
-#line 1944 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1942 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("icmp operand types must match");
@@ -4720,7 +4718,7 @@
break;
case 190:
-#line 1949 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1947 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("fcmp operand types must match");
@@ -4729,7 +4727,7 @@
break;
case 191:
-#line 1954 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1952 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
GEN_ERROR("Invalid extractelement operands");
@@ -4739,7 +4737,7 @@
break;
case 192:
-#line 1960 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1958 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid insertelement operands");
@@ -4749,7 +4747,7 @@
break;
case 193:
-#line 1966 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1964 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid shufflevector operands");
@@ -4759,7 +4757,7 @@
break;
case 194:
-#line 1975 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1973 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
CHECK_FOR_ERROR
@@ -4767,7 +4765,7 @@
break;
case 195:
-#line 1979 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1977 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ConstVector) = new std::vector();
(yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
@@ -4776,27 +4774,27 @@
break;
case 196:
-#line 1987 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 197:
-#line 1987 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 198:
-#line 1990 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 199:
-#line 1990 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 200:
-#line 1993 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 1991 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
@@ -4812,7 +4810,7 @@
break;
case 201:
-#line 2005 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2003 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
Constant *Val = (yyvsp[(3) - (6)].ConstVal);
const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
@@ -4828,7 +4826,7 @@
break;
case 202:
-#line 2026 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
@@ -4837,7 +4835,7 @@
break;
case 203:
-#line 2031 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2029 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
@@ -4846,12 +4844,12 @@
break;
case 206:
-#line 2044 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.isDeclare = false; ;}
break;
case 207:
-#line 2044 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurFun.FunctionDone();
CHECK_FOR_ERROR
@@ -4859,26 +4857,26 @@
break;
case 208:
-#line 2048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.isDeclare = true; ;}
break;
case 209:
-#line 2048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 210:
-#line 2051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2049 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 211:
-#line 2054 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2052 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
@@ -4906,7 +4904,7 @@
break;
case 212:
-#line 2078 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2076 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
@@ -4921,7 +4919,7 @@
break;
case 213:
-#line 2089 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2087 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
/* "Externally Visible" Linkage */
if ((yyvsp[(5) - (5)].ConstVal) == 0)
@@ -4933,14 +4931,14 @@
break;
case 214:
-#line 2096 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2094 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;}
break;
case 215:
-#line 2100 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2098 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(6) - (6)].ConstVal) == 0)
GEN_ERROR("Global value initializer is not a constant");
@@ -4950,14 +4948,14 @@
break;
case 216:
-#line 2105 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2103 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;}
break;
case 217:
-#line 2109 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2107 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (6)].TypeVal))->getDescription());
@@ -4968,7 +4966,7 @@
break;
case 218:
-#line 2115 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2113 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
@@ -4976,7 +4974,7 @@
break;
case 219:
-#line 2119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2117 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::string Name;
if ((yyvsp[(1) - (5)].StrVal)) {
@@ -5020,21 +5018,21 @@
break;
case 220:
-#line 2159 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2157 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 221:
-#line 2162 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2160 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 222:
-#line 2168 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2166 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
if (AsmSoFar.empty())
@@ -5047,7 +5045,7 @@
break;
case 223:
-#line 2178 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2176 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5055,7 +5053,7 @@
break;
case 224:
-#line 2182 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2180 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5063,7 +5061,7 @@
break;
case 226:
-#line 2189 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2187 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5072,7 +5070,7 @@
break;
case 227:
-#line 2194 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2192 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5081,14 +5079,14 @@
break;
case 228:
-#line 2199 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2197 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 229:
-#line 2208 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2206 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
@@ -5102,7 +5100,7 @@
break;
case 230:
-#line 2218 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2216 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -5116,7 +5114,7 @@
break;
case 231:
-#line 2229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2227 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
CHECK_FOR_ERROR
@@ -5124,7 +5122,7 @@
break;
case 232:
-#line 2233 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2231 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
struct ArgListEntry E;
@@ -5137,7 +5135,7 @@
break;
case 233:
-#line 2242 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2240 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = new ArgListType;
struct ArgListEntry E;
@@ -5150,7 +5148,7 @@
break;
case 234:
-#line 2251 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2249 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = 0;
CHECK_FOR_ERROR
@@ -5158,7 +5156,7 @@
break;
case 235:
-#line 2257 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2255 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::string FunctionName(*(yyvsp[(3) - (9)].StrVal));
delete (yyvsp[(3) - (9)].StrVal); // Free strdup'd memory!
@@ -5281,7 +5279,7 @@
break;
case 238:
-#line 2379 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2377 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
@@ -5293,7 +5291,7 @@
break;
case 241:
-#line 2390 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2388 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5301,7 +5299,7 @@
break;
case 242:
-#line 2395 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2393 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
@@ -5312,7 +5310,7 @@
break;
case 243:
-#line 2407 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2405 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -5320,7 +5318,7 @@
break;
case 244:
-#line 2411 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2409 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -5328,7 +5326,7 @@
break;
case 245:
-#line 2416 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2414 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A reference to a direct constant
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
CHECK_FOR_ERROR
@@ -5336,7 +5334,7 @@
break;
case 246:
-#line 2420 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2418 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
CHECK_FOR_ERROR
@@ -5344,7 +5342,7 @@
break;
case 247:
-#line 2424 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2422 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Perhaps it's an FP constant?
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
CHECK_FOR_ERROR
@@ -5352,7 +5350,7 @@
break;
case 248:
-#line 2428 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2426 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
CHECK_FOR_ERROR
@@ -5360,7 +5358,7 @@
break;
case 249:
-#line 2432 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2430 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
CHECK_FOR_ERROR
@@ -5368,7 +5366,7 @@
break;
case 250:
-#line 2436 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2434 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createNull();
CHECK_FOR_ERROR
@@ -5376,7 +5374,7 @@
break;
case 251:
-#line 2440 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2438 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createUndef();
CHECK_FOR_ERROR
@@ -5384,7 +5382,7 @@
break;
case 252:
-#line 2444 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2442 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A vector zero constant.
(yyval.ValIDVal) = ValID::createZeroInit();
CHECK_FOR_ERROR
@@ -5392,7 +5390,7 @@
break;
case 253:
-#line 2448 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2446 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
@@ -5421,7 +5419,7 @@
break;
case 254:
-#line 2473 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2471 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
CHECK_FOR_ERROR
@@ -5429,7 +5427,7 @@
break;
case 255:
-#line 2477 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2475 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
delete (yyvsp[(3) - (5)].StrVal);
@@ -5439,7 +5437,7 @@
break;
case 256:
-#line 2487 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2485 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it an integer reference...?
(yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
CHECK_FOR_ERROR
@@ -5447,7 +5445,7 @@
break;
case 257:
-#line 2491 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2489 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
CHECK_FOR_ERROR
@@ -5455,7 +5453,7 @@
break;
case 258:
-#line 2495 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2493 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
(yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5464,7 +5462,7 @@
break;
case 259:
-#line 2500 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2498 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
(yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5473,7 +5471,7 @@
break;
case 262:
-#line 2513 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2511 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -5484,7 +5482,7 @@
break;
case 263:
-#line 2522 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2520 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5492,7 +5490,7 @@
break;
case 264:
-#line 2526 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2524 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Do not allow functions with 0 basic blocks
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5500,7 +5498,7 @@
break;
case 265:
-#line 2535 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2533 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
CHECK_FOR_ERROR
@@ -5512,7 +5510,7 @@
break;
case 266:
-#line 2544 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2542 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal)))
if (CastInst *CI2 = dyn_cast(CI1->getOperand(0)))
@@ -5525,7 +5523,7 @@
break;
case 267:
-#line 2553 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2551 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty space between instruction lists
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
CHECK_FOR_ERROR
@@ -5533,7 +5531,7 @@
break;
case 268:
-#line 2557 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2555 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Labelled (named) basic block
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5543,7 +5541,7 @@
break;
case 269:
-#line 2564 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2562 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with a result...
(yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal));
CHECK_FOR_ERROR
@@ -5551,7 +5549,7 @@
break;
case 270:
-#line 2568 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2566 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with no result...
(yyval.TermInstVal) = new ReturnInst();
CHECK_FOR_ERROR
@@ -5559,7 +5557,7 @@
break;
case 271:
-#line 2572 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2570 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
CHECK_FOR_ERROR
@@ -5568,7 +5566,7 @@
break;
case 272:
-#line 2577 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2575 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
@@ -5582,7 +5580,7 @@
break;
case 273:
-#line 2587 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2585 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
CHECK_FOR_ERROR
@@ -5605,7 +5603,7 @@
break;
case 274:
-#line 2606 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2604 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
CHECK_FOR_ERROR
@@ -5618,7 +5616,7 @@
break;
case 275:
-#line 2616 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2614 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Handle the short syntax
@@ -5701,7 +5699,7 @@
break;
case 276:
-#line 2695 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2693 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnwindInst();
CHECK_FOR_ERROR
@@ -5709,7 +5707,7 @@
break;
case 277:
-#line 2699 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2697 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnreachableInst();
CHECK_FOR_ERROR
@@ -5717,7 +5715,7 @@
break;
case 278:
-#line 2706 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2704 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
@@ -5732,7 +5730,7 @@
break;
case 279:
-#line 2717 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2715 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = new std::vector >();
Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
@@ -5748,7 +5746,7 @@
break;
case 280:
-#line 2730 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2728 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Is this definition named?? if so, assign the name...
setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
@@ -5760,7 +5758,7 @@
break;
case 281:
-#line 2740 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2738 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Used for PHI nodes
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
@@ -5775,7 +5773,7 @@
break;
case 282:
-#line 2751 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2749 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
@@ -5787,7 +5785,7 @@
break;
case 283:
-#line 2761 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2759 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -5800,7 +5798,7 @@
break;
case 284:
-#line 2770 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2768 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Labels are only valid in ASMs
(yyval.ParamList) = new ParamList();
@@ -5810,7 +5808,7 @@
break;
case 285:
-#line 2776 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2774 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
@@ -5823,7 +5821,7 @@
break;
case 286:
-#line 2785 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2783 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ParamList) = (yyvsp[(1) - (5)].ParamList);
ParamListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getBBVal((yyvsp[(4) - (5)].ValIDVal));
@@ -5833,17 +5831,17 @@
break;
case 287:
-#line 2791 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2789 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamList) = new ParamList(); ;}
break;
case 288:
-#line 2794 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2792 "/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ValueList) = new std::vector(); ;}
break;
case 289:
-#line 2795 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2793 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
(yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
@@ -5852,7 +5850,7 @@
break;
case 290:
-#line 2802 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2800 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -5860,7 +5858,7 @@
break;
case 291:
-#line 2806 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2804 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -5868,7 +5866,7 @@
break;
case 292:
-#line 2811 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2809 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
@@ -5888,7 +5886,7 @@
break;
case 293:
-#line 2827 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2825 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
@@ -5909,7 +5907,7 @@
break;
case 294:
-#line 2844 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2842 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
@@ -5927,7 +5925,7 @@
break;
case 295:
-#line 2858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2856 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
@@ -5945,7 +5943,7 @@
break;
case 296:
-#line 2872 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2870 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
@@ -5961,7 +5959,7 @@
break;
case 297:
-#line 2884 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2882 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
GEN_ERROR("select condition must be boolean");
@@ -5973,7 +5971,7 @@
break;
case 298:
-#line 2892 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2890 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
@@ -5984,7 +5982,7 @@
break;
case 299:
-#line 2899 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2897 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
GEN_ERROR("Invalid extractelement operands");
@@ -5994,7 +5992,7 @@
break;
case 300:
-#line 2905 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2903 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid insertelement operands");
@@ -6004,7 +6002,7 @@
break;
case 301:
-#line 2911 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2909 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid shufflevector operands");
@@ -6014,7 +6012,7 @@
break;
case 302:
-#line 2917 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2915 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
if (!Ty->isFirstClassType())
@@ -6033,7 +6031,7 @@
break;
case 303:
-#line 2933 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 2931 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Handle the short syntax
@@ -6121,7 +6119,7 @@
break;
case 304:
-#line 3017 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3015 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
CHECK_FOR_ERROR
@@ -6129,7 +6127,7 @@
break;
case 305:
-#line 3022 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3020 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -6137,7 +6135,7 @@
break;
case 306:
-#line 3026 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3024 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -6145,7 +6143,7 @@
break;
case 307:
-#line 3033 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3031 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
@@ -6156,7 +6154,7 @@
break;
case 308:
-#line 3040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3038 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
@@ -6168,7 +6166,7 @@
break;
case 309:
-#line 3048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3046 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
@@ -6179,7 +6177,7 @@
break;
case 310:
-#line 3055 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3053 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
@@ -6191,7 +6189,7 @@
break;
case 311:
-#line 3063 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3061 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa((yyvsp[(2) - (2)].ValueVal)->getType()))
GEN_ERROR("Trying to free nonpointer type " +
@@ -6202,7 +6200,7 @@
break;
case 312:
-#line 3071 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3069 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
@@ -6220,7 +6218,7 @@
break;
case 313:
-#line 3085 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3083 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
@@ -6241,7 +6239,7 @@
break;
case 314:
-#line 3102 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3100 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
@@ -6261,7 +6259,7 @@
/* Line 1267 of yacc.c. */
-#line 6265 "llvmAsmParser.tab.c"
+#line 6263 "llvmAsmParser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -6475,7 +6473,7 @@
}
-#line 3119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 3117 "/llvm/lib/AsmParser/llvmAsmParser.y"
// common code from the two 'RunVMAsmParser' functions
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Thu Nov 15 15:15:26 2007
@@ -338,7 +338,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 968 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
+#line 968 "/llvm/lib/AsmParser/llvmAsmParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -385,7 +385,7 @@
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
}
-/* Line 1489 of yacc.c. */
+/* Line 1529 of yacc.c. */
#line 390 "llvmAsmParser.tab.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Thu Nov 15 15:15:26 2007
@@ -1422,8 +1422,6 @@
GEN_ERROR("Unsigned result not equal to signed result");
if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
GEN_ERROR("Element type of a VectorType must be primitive");
- if (!isPowerOf2_32($2))
- GEN_ERROR("Vector length should be a power of 2");
$$ = new PATypeHolder(HandleUpRefs(VectorType::get(*$4, (unsigned)$2)));
delete $4;
CHECK_FOR_ERROR
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Thu Nov 15 15:15:26 2007
@@ -1422,8 +1422,6 @@
GEN_ERROR("Unsigned result not equal to signed result");
if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
GEN_ERROR("Element type of a VectorType must be primitive");
- if (!isPowerOf2_32($2))
- GEN_ERROR("Vector length should be a power of 2");
$$ = new PATypeHolder(HandleUpRefs(VectorType::get(*$4, (unsigned)$2)));
delete $4;
CHECK_FOR_ERROR
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Nov 15 15:15:26 2007
@@ -2158,7 +2158,8 @@
break;
} else {
SplitVectorOp(Node->getOperand(1), Lo, Hi);
- IncrementSize = NumElems/2 * MVT::getSizeInBits(EVT)/8;
+ IncrementSize = MVT::getVectorNumElements(Lo.Val->getValueType(0)) *
+ MVT::getSizeInBits(EVT)/8;
}
} else {
ExpandOp(Node->getOperand(1), Lo, Hi);
@@ -6226,10 +6227,15 @@
SDNode *Node = Op.Val;
unsigned NumElements = MVT::getVectorNumElements(Op.getValueType());
assert(NumElements > 1 && "Cannot split a single element vector!");
- unsigned NewNumElts = NumElements/2;
+
MVT::ValueType NewEltVT = MVT::getVectorElementType(Op.getValueType());
- MVT::ValueType NewVT = MVT::getVectorType(NewEltVT, NewNumElts);
-
+
+ unsigned NewNumElts_Lo = 1 << Log2_32(NumElements-1);
+ unsigned NewNumElts_Hi = NumElements - NewNumElts_Lo;
+
+ MVT::ValueType NewVT_Lo = MVT::getVectorType(NewEltVT, NewNumElts_Lo);
+ MVT::ValueType NewVT_Hi = MVT::getVectorType(NewEltVT, NewNumElts_Hi);
+
// See if we already split it.
std::map >::iterator I
= SplitNodes.find(Op);
@@ -6253,25 +6259,27 @@
SplitVectorOp(Node->getOperand(0), Lo, Hi);
unsigned Index = cast(Node->getOperand(2))->getValue();
SDOperand ScalarOp = Node->getOperand(1);
- if (Index < NewNumElts)
- Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Lo, ScalarOp,
+ if (Index < NewNumElts_Lo)
+ Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Lo, Lo, ScalarOp,
DAG.getConstant(Index, TLI.getPointerTy()));
else
- Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Hi, ScalarOp,
- DAG.getConstant(Index - NewNumElts, TLI.getPointerTy()));
+ Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Hi, Hi, ScalarOp,
+ DAG.getConstant(Index - NewNumElts_Lo,
+ TLI.getPointerTy()));
break;
}
case ISD::BUILD_VECTOR: {
SmallVector LoOps(Node->op_begin(),
- Node->op_begin()+NewNumElts);
- Lo = DAG.getNode(ISD::BUILD_VECTOR, NewVT, &LoOps[0], LoOps.size());
+ Node->op_begin()+NewNumElts_Lo);
+ Lo = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &LoOps[0], LoOps.size());
- SmallVector HiOps(Node->op_begin()+NewNumElts,
+ SmallVector HiOps(Node->op_begin()+NewNumElts_Lo,
Node->op_end());
- Hi = DAG.getNode(ISD::BUILD_VECTOR, NewVT, &HiOps[0], HiOps.size());
+ Hi = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Hi, &HiOps[0], HiOps.size());
break;
}
case ISD::CONCAT_VECTORS: {
+ // FIXME: Handle non-power-of-two vectors?
unsigned NewNumSubvectors = Node->getNumOperands() / 2;
if (NewNumSubvectors == 1) {
Lo = Node->getOperand(0);
@@ -6279,11 +6287,11 @@
} else {
SmallVector LoOps(Node->op_begin(),
Node->op_begin()+NewNumSubvectors);
- Lo = DAG.getNode(ISD::CONCAT_VECTORS, NewVT, &LoOps[0], LoOps.size());
+ Lo = DAG.getNode(ISD::CONCAT_VECTORS, NewVT_Lo, &LoOps[0], LoOps.size());
SmallVector HiOps(Node->op_begin()+NewNumSubvectors,
Node->op_end());
- Hi = DAG.getNode(ISD::CONCAT_VECTORS, NewVT, &HiOps[0], HiOps.size());
+ Hi = DAG.getNode(ISD::CONCAT_VECTORS, NewVT_Hi, &HiOps[0], HiOps.size());
}
break;
}
@@ -6298,12 +6306,12 @@
// Handle a vector merge.
SDOperand CL, CH;
SplitVectorOp(Cond, CL, CH);
- Lo = DAG.getNode(Node->getOpcode(), NewVT, CL, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT, CH, LH, RH);
+ Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, CL, LL, RL);
+ Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, CH, LH, RH);
} else {
// Handle a simple select with vector operands.
- Lo = DAG.getNode(Node->getOpcode(), NewVT, Cond, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT, Cond, LH, RH);
+ Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, Cond, LL, RL);
+ Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, Cond, LH, RH);
}
break;
}
@@ -6324,16 +6332,16 @@
SplitVectorOp(Node->getOperand(0), LL, LH);
SplitVectorOp(Node->getOperand(1), RL, RH);
- Lo = DAG.getNode(Node->getOpcode(), NewVT, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT, LH, RH);
+ Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, LL, RL);
+ Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, LH, RH);
break;
}
case ISD::FPOWI: {
SDOperand L, H;
SplitVectorOp(Node->getOperand(0), L, H);
- Lo = DAG.getNode(Node->getOpcode(), NewVT, L, Node->getOperand(1));
- Hi = DAG.getNode(Node->getOpcode(), NewVT, H, Node->getOperand(1));
+ Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, L, Node->getOperand(1));
+ Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, H, Node->getOperand(1));
break;
}
case ISD::CTTZ:
@@ -6347,8 +6355,8 @@
SDOperand L, H;
SplitVectorOp(Node->getOperand(0), L, H);
- Lo = DAG.getNode(Node->getOpcode(), NewVT, L);
- Hi = DAG.getNode(Node->getOpcode(), NewVT, H);
+ Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, L);
+ Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, H);
break;
}
case ISD::LOAD: {
@@ -6360,13 +6368,13 @@
unsigned Alignment = LD->getAlignment();
bool isVolatile = LD->isVolatile();
- Lo = DAG.getLoad(NewVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
- unsigned IncrementSize = NewNumElts * MVT::getSizeInBits(NewEltVT)/8;
+ Lo = DAG.getLoad(NewVT_Lo, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
+ unsigned IncrementSize = NewNumElts_Lo * MVT::getSizeInBits(NewEltVT)/8;
Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
getIntPtrConstant(IncrementSize));
SVOffset += IncrementSize;
Alignment = MinAlign(Alignment, IncrementSize);
- Hi = DAG.getLoad(NewVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
+ Hi = DAG.getLoad(NewVT_Hi, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
// Build a factor node to remember that this load is independent of the
// other one.
@@ -6394,8 +6402,8 @@
}
// Split the vector and convert each of the pieces now.
SplitVectorOp(InOp, Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NewVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NewVT, Hi);
+ Lo = DAG.getNode(ISD::BIT_CONVERT, NewVT_Lo, Lo);
+ Hi = DAG.getNode(ISD::BIT_CONVERT, NewVT_Hi, Hi);
break;
}
}
Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=44181&r1=44180&r2=44181&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Thu Nov 15 15:15:26 2007
@@ -1209,7 +1209,6 @@
VectorType *VectorType::get(const Type *ElementType, unsigned NumElements) {
assert(ElementType && "Can't get vector of null types!");
- assert(isPowerOf2_32(NumElements) && "Vector length should be a power of 2!");
VectorValType PVT(ElementType, NumElements);
VectorType *PT = VectorTypes->get(PVT);
From asl at math.spbu.ru Thu Nov 15 17:25:34 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Thu, 15 Nov 2007 23:25:34 -0000
Subject: [llvm-commits] [llvm] r44182 - in /llvm/trunk:
include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/Intrinsics.td
lib/CodeGen/IntrinsicLowering.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <200711152325.lAFNPYB0032713@zion.cs.uiuc.edu>
Author: asl
Date: Thu Nov 15 17:25:33 2007
New Revision: 44182
URL: http://llvm.org/viewvc/llvm-project?rev=44182&view=rev
Log:
Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/include/llvm/Intrinsics.td
llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Nov 15 17:25:33 2007
@@ -390,6 +390,14 @@
// precision down to the specified precision (currently always 64->32).
FP_ROUND,
+ // FLT_ROUNDS - Returns current rounding mode:
+ // -1 Undefined
+ // 0 Round to 0
+ // 1 Round to nearest
+ // 2 Round to +inf
+ // 3 Round to -inf
+ FLT_ROUNDS,
+
// FP_ROUND_INREG - This operator takes a floating point register, and
// rounds it to a floating point value. It then promotes it and returns it
// in a register of the same size. This operation effectively just discards
Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Thu Nov 15 17:25:33 2007
@@ -262,6 +262,11 @@
llvm_ptr_ty], []>,
GCCBuiltin<"__builtin_init_trampoline">;
+//===-------------------------- Other Intrinsics --------------------------===//
+//
+def int_flt_rounds : Intrinsic<[llvm_i32_ty]>,
+ GCCBuiltin<"__builtin_flt_rounds">;
+
//===----------------------------------------------------------------------===//
// Target-specific intrinsics
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp Thu Nov 15 17:25:33 2007
@@ -856,6 +856,11 @@
}
break;
}
+ case Intrinsic::flt_rounds:
+ // Lower to "round to the nearest"
+ if (CI->getType() != Type::VoidTy)
+ CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
+ break;
}
assert(CI->use_empty() &&
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Nov 15 17:25:33 2007
@@ -3677,6 +3677,20 @@
AddLegalizedOperand(SDOperand(Node, 1), Tmp1);
return Op.ResNo ? Tmp1 : Result;
}
+ case ISD::FLT_ROUNDS: {
+ MVT::ValueType VT = Node->getValueType(0);
+ switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
+ default: assert(0 && "This action not supported for this op yet!");
+ case TargetLowering::Custom:
+ Result = TLI.LowerOperation(Op, DAG);
+ if (Result.Val) break;
+ // Fall Thru
+ case TargetLowering::Legal:
+ // If this operation is not supported, lower it to constant 1
+ Result = DAG.getConstant(1, VT);
+ break;
+ }
+ }
}
assert(Result.getValueType() == Op.getValueType() &&
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Nov 15 17:25:33 2007
@@ -3739,6 +3739,7 @@
case ISD::SIGN_EXTEND_INREG: return "sign_extend_inreg";
case ISD::TRUNCATE: return "truncate";
case ISD::FP_ROUND: return "fp_round";
+ case ISD::FLT_ROUNDS: return "flt_rounds";
case ISD::FP_ROUND_INREG: return "fp_round_inreg";
case ISD::FP_EXTEND: return "fp_extend";
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=44182&r1=44181&r2=44182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Nov 15 17:25:33 2007
@@ -2930,6 +2930,10 @@
DAG.setRoot(Tmp.getValue(1));
return 0;
}
+ case Intrinsic::flt_rounds: {
+ setValue(&I, DAG.getNode(ISD::FLT_ROUNDS, MVT::i32));
+ return 0;
+ }
}
}
From asl at math.spbu.ru Thu Nov 15 19:31:52 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Fri, 16 Nov 2007 01:31:52 -0000
Subject: [llvm-commits] [llvm] r44183 - in /llvm/trunk/lib/Target/X86:
X86ISelLowering.cpp X86ISelLowering.h X86InstrFPStack.td
Message-ID: <200711160131.lAG1Vres008271@zion.cs.uiuc.edu>
Author: asl
Date: Thu Nov 15 19:31:51 2007
New Revision: 44183
URL: http://llvm.org/viewvc/llvm-project?rev=44183&view=rev
Log:
Implement codegen for flt_rounds on x86
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
llvm/trunk/lib/Target/X86/X86InstrFPStack.td
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=44183&r1=44182&r2=44183&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Nov 15 19:31:51 2007
@@ -205,7 +205,8 @@
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
setOperationAction(ISD::FP_ROUND_INREG , MVT::f32 , Expand);
setOperationAction(ISD::FREM , MVT::f64 , Expand);
-
+ setOperationAction(ISD::FLT_ROUNDS , MVT::i32 , Custom);
+
setOperationAction(ISD::CTPOP , MVT::i8 , Expand);
setOperationAction(ISD::CTTZ , MVT::i8 , Expand);
setOperationAction(ISD::CTLZ , MVT::i8 , Expand);
@@ -4940,6 +4941,66 @@
}
}
+SDOperand X86TargetLowering::LowerFLT_ROUNDS(SDOperand Op, SelectionDAG &DAG) {
+ /*
+ The rounding mode is in bits 11:10 of FPSR, and has the following
+ settings:
+ 00 Round to nearest
+ 01 Round to -inf
+ 10 Round to +inf
+ 11 Round to 0
+
+ FLT_ROUNDS, on the other hand, expects the following:
+ -1 Undefined
+ 0 Round to 0
+ 1 Round to nearest
+ 2 Round to +inf
+ 3 Round to -inf
+
+ To perform the conversion, we do:
+ (((((FPSR & 0x800) >> 11) | ((FPSR & 0x400) >> 9)) + 1) & 3)
+ */
+
+ MachineFunction &MF = DAG.getMachineFunction();
+ const TargetMachine &TM = MF.getTarget();
+ const TargetFrameInfo &TFI = *TM.getFrameInfo();
+ unsigned StackAlignment = TFI.getStackAlignment();
+ MVT::ValueType VT = Op.getValueType();
+
+ // Save FP Control Word to stack slot
+ int SSFI = MF.getFrameInfo()->CreateStackObject(2, StackAlignment);
+ SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
+
+ SDOperand Chain = DAG.getNode(X86ISD::FNSTCW16m, MVT::Other,
+ DAG.getEntryNode(), StackSlot);
+
+ // Load FP Control Word from stack slot
+ SDOperand CWD = DAG.getLoad(MVT::i16, Chain, StackSlot, NULL, 0);
+
+ // Transform as necessary
+ SDOperand CWD1 =
+ DAG.getNode(ISD::SRL, MVT::i16,
+ DAG.getNode(ISD::AND, MVT::i16,
+ CWD, DAG.getConstant(0x800, MVT::i16)),
+ DAG.getConstant(11, MVT::i8));
+ SDOperand CWD2 =
+ DAG.getNode(ISD::SRL, MVT::i16,
+ DAG.getNode(ISD::AND, MVT::i16,
+ CWD, DAG.getConstant(0x400, MVT::i16)),
+ DAG.getConstant(9, MVT::i8));
+
+ SDOperand RetVal =
+ DAG.getNode(ISD::AND, MVT::i16,
+ DAG.getNode(ISD::ADD, MVT::i16,
+ DAG.getNode(ISD::OR, MVT::i16, CWD1, CWD2),
+ DAG.getConstant(1, MVT::i16)),
+ DAG.getConstant(3, MVT::i16));
+
+
+ return DAG.getNode((MVT::getSizeInBits(VT) < 16 ?
+ ISD::TRUNCATE : ISD::ZERO_EXTEND), VT, RetVal);
+}
+
/// LowerOperation - Provide custom lowering hooks for some operations.
///
SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
@@ -4982,6 +5043,7 @@
case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG);
case ISD::EH_RETURN: return LowerEH_RETURN(Op, DAG);
case ISD::TRAMPOLINE: return LowerTRAMPOLINE(Op, DAG);
+ case ISD::FLT_ROUNDS: return LowerFLT_ROUNDS(Op, DAG);
}
return SDOperand();
}
@@ -5029,6 +5091,7 @@
case X86ISD::THREAD_POINTER: return "X86ISD::THREAD_POINTER";
case X86ISD::EH_RETURN: return "X86ISD::EH_RETURN";
case X86ISD::TC_RETURN: return "X86ISD::TC_RETURN";
+ case X86ISD::FNSTCW16m: return "X86ISD::FNSTCW16m";
}
}
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=44183&r1=44182&r2=44183&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Thu Nov 15 19:31:51 2007
@@ -188,7 +188,10 @@
// operand #1 callee (register or absolute)
// operand #2 stack adjustment
// operand #3 optional in flag
- TC_RETURN
+ TC_RETURN,
+
+ // Store FP control world into i16 memory
+ FNSTCW16m
};
}
@@ -477,6 +480,7 @@
SDOperand LowerFRAME_TO_ARGS_OFFSET(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerEH_RETURN(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerTRAMPOLINE(SDOperand Op, SelectionDAG &DAG);
+ SDOperand LowerFLT_ROUNDS(SDOperand Op, SelectionDAG &DAG);
};
}
Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=44183&r1=44182&r2=44183&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Thu Nov 15 19:31:51 2007
@@ -29,6 +29,8 @@
SDTCisVT<2, OtherVT>]>;
def SDTX86FpToIMem : SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>;
+def SDTX86CwdStore : SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>;
+
def X86fpget : SDNode<"X86ISD::FP_GET_RESULT", SDTX86FpGet,
[SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
def X86fpset : SDNode<"X86ISD::FP_SET_RESULT", SDTX86FpSet,
@@ -47,6 +49,8 @@
[SDNPHasChain]>;
def X86fp_to_i64mem : SDNode<"X86ISD::FP_TO_INT64_IN_MEM", SDTX86FpToIMem,
[SDNPHasChain]>;
+def X86fp_cwd_get16 : SDNode<"X86ISD::FNSTCW16m", SDTX86CwdStore,
+ [SDNPHasChain]>;
//===----------------------------------------------------------------------===//
// FPStack pattern fragments
@@ -524,7 +528,8 @@
(outs), (ins), "fnstsw", []>, DF;
def FNSTCW16m : I<0xD9, MRM7m, // [mem16] = X87 control world
- (outs), (ins i16mem:$dst), "fnstcw\t$dst", []>;
+ (outs), (ins i16mem:$dst), "fnstcw\t$dst",
+ [(X86fp_cwd_get16 addr:$dst)]>;
def FLDCW16m : I<0xD9, MRM5m, // X87 control world = [mem16]
(outs), (ins i16mem:$dst), "fldcw\t$dst", []>;
From clattner at apple.com Thu Nov 15 19:32:32 2007
From: clattner at apple.com (Chris Lattner)
Date: Thu, 15 Nov 2007 17:32:32 -0800
Subject: [llvm-commits] [llvm] r44097 - in /llvm/trunk:
include/llvm/Analysis/LoopInfo.h include/llvm/Analysis/LoopPass.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/FunctionUtils.h lib/Analysis/LoopInfo.cpp
In-Reply-To: <1EA521AD-3DD4-497E-A6DD-13E6A98F45F6@apple.com>
References: <200711140233.lAE2XxSQ028913@zion.cs.uiuc.edu>
<1EA521AD-3DD4-497E-A6DD-13E6A98F45F6@apple.com>
Message-ID:
On Nov 15, 2007, at 11:36 AM, Devang Patel wrote:
>
> On Nov 13, 2007, at 6:33 PM, Owen Anderson wrote:
>
>> Start the process of making MachineLoopInfo possible by templating
>> Loop.
>
> Did you consider deriving MachineBasicBlock from BasicBlock to avoid
> templating stuff ? Just curious.
Please don't do this, they are different concepts.
-Chris
From clattner at apple.com Thu Nov 15 19:35:50 2007
From: clattner at apple.com (Chris Lattner)
Date: Thu, 15 Nov 2007 17:35:50 -0800
Subject: [llvm-commits] [llvm] r44183 - in /llvm/trunk/lib/Target/X86:
X86ISelLowering.cpp X86ISelLowering.h X86InstrFPStack.td
In-Reply-To: <200711160131.lAG1Vres008271@zion.cs.uiuc.edu>
References: <200711160131.lAG1Vres008271@zion.cs.uiuc.edu>
Message-ID:
On Nov 15, 2007, at 5:31 PM, Anton Korobeynikov wrote:
> Author: asl
> Date: Thu Nov 15 19:31:51 2007
> New Revision: 44183
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44183&view=rev
> Log:
> Implement codegen for flt_rounds on x86
>
Wow cool, thanks Anton!
-Chris
From asl at math.spbu.ru Thu Nov 15 19:37:14 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Fri, 16 Nov 2007 01:37:14 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44184 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <200711160137.lAG1bEhQ008580@zion.cs.uiuc.edu>
Author: asl
Date: Thu Nov 15 19:37:13 2007
New Revision: 44184
URL: http://llvm.org/viewvc/llvm-project?rev=44184&view=rev
Log:
Lower __builtin_flt_rounds into LLVM intrinsic
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44184&r1=44183&r2=44184&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Nov 15 19:37:13 2007
@@ -3911,7 +3911,15 @@
}
switch (DECL_FUNCTION_CODE(fndecl)) {
- default: return false;
+ default:
+#ifndef NDEBUG
+ std::cerr << "Unhandled builtin!\n"
+ << "DECL_FUNCTION_CODE: " << DECL_FUNCTION_CODE(fndecl) << "\n";
+ debug_tree(fndecl);
+ abort();
+#else
+ return false;
+#endif
// Varargs builtins.
case BUILT_IN_VA_START:
case BUILT_IN_STDARG_START: return EmitBuiltinVAStart(exp);
@@ -4028,7 +4036,13 @@
Result, "tmp");
return true;
}
-
+ case BUILT_IN_FLT_ROUNDS: {
+ Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
+ Intrinsic::flt_rounds),
+ "tmp");
+ Result = BitCastToType(Result, ConvertType(TREE_TYPE(exp)));
+ return true;
+ }
#if 1 // FIXME: Should handle these GCC extensions eventually.
case BUILT_IN_APPLY_ARGS:
case BUILT_IN_APPLY:
From asl at math.spbu.ru Thu Nov 15 19:53:52 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Fri, 16 Nov 2007 01:53:52 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44185 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <200711160153.lAG1rqki009402@zion.cs.uiuc.edu>
Author: asl
Date: Thu Nov 15 19:53:52 2007
New Revision: 44185
URL: http://llvm.org/viewvc/llvm-project?rev=44185&view=rev
Log:
Oops, don't commit debugging code :)
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44185&r1=44184&r2=44185&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Nov 15 19:53:52 2007
@@ -3911,15 +3911,7 @@
}
switch (DECL_FUNCTION_CODE(fndecl)) {
- default:
-#ifndef NDEBUG
- std::cerr << "Unhandled builtin!\n"
- << "DECL_FUNCTION_CODE: " << DECL_FUNCTION_CODE(fndecl) << "\n";
- debug_tree(fndecl);
- abort();
-#else
- return false;
-#endif
+ default: return false;
// Varargs builtins.
case BUILT_IN_VA_START:
case BUILT_IN_STDARG_START: return EmitBuiltinVAStart(exp);
From dalej at apple.com Thu Nov 15 20:02:30 2007
From: dalej at apple.com (Dale Johannesen)
Date: Fri, 16 Nov 2007 02:02:30 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r44186 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <200711160202.lAG22UBn009888@zion.cs.uiuc.edu>
Author: johannes
Date: Thu Nov 15 20:02:30 2007
New Revision: 44186
URL: http://llvm.org/viewvc/llvm-project?rev=44186&view=rev
Log:
A small step forward in asm handling.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44186&r1=44185&r2=44186&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Nov 15 20:02:30 2007
@@ -3570,6 +3570,8 @@
NewConstraint[RegNameLen+2] = '}';
NewConstraint[RegNameLen+3] = 0;
SimplifiedConstraint = NewConstraint;
+ // We should no longer consider mem constraints.
+ AllowsMem = false;
} else {
// If we can simplify the constraint into something else, do so now. This
// avoids LLVM having to know about all the (redundant) GCC constraints.
From sabre at nondot.org Thu Nov 15 23:32:07 2007
From: sabre at nondot.org (Chris Lattner)
Date: Fri, 16 Nov 2007 05:32:07 -0000
Subject: [llvm-commits] [llvm] r44187 -
/llvm/trunk/docs/WritingAnLLVMPass.html
Message-ID: <200711160532.lAG5W7CH019720@zion.cs.uiuc.edu>
Author: lattner
Date: Thu Nov 15 23:32:05 2007
New Revision: 44187
URL: http://llvm.org/viewvc/llvm-project?rev=44187&view=rev
Log:
fix a typo
Modified:
llvm/trunk/docs/WritingAnLLVMPass.html
Modified: llvm/trunk/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=44187&r1=44186&r2=44187&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Thu Nov 15 23:32:05 2007
@@ -1187,7 +1187,7 @@
-
Now that we understand the basics of how passes are defined, how the are
+
Now that we understand the basics of how passes are defined, how they are
used, and how they are required from other passes, it's time to get a little bit
fancier. All of the pass relationships that we have seen so far are very
simple: one pass depends on one other specific pass to be run before it can run.
From sabre at nondot.org Fri Nov 16 00:04:18 2007
From: sabre at nondot.org (Chris Lattner)
Date: Fri, 16 Nov 2007 06:04:18 -0000
Subject: [llvm-commits] [llvm] r44188 - in /llvm/trunk:
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll
Message-ID: <200711160604.lAG64IRp021430@zion.cs.uiuc.edu>
Author: lattner
Date: Fri Nov 16 00:04:17 2007
New Revision: 44188
URL: http://llvm.org/viewvc/llvm-project?rev=44188&view=rev
Log:
Fix PR1800 by correcting mistaken logic.
Added:
llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.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=44188&r1=44187&r2=44188&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri Nov 16 00:04:17 2007
@@ -3577,8 +3577,7 @@
case ICmpInst::ICMP_SGT:
switch (RHSCC) {
default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X s> 13
- return ReplaceInstUsesWith(I, LHS);
+ case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X == 15
case ICmpInst::ICMP_SGT: // (X s> 13 & X s> 15) -> X s> 15
return ReplaceInstUsesWith(I, RHS);
case ICmpInst::ICMP_UGT: // (X s> 13 & X u> 15) -> no change
Added: llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll?rev=44188&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll Fri Nov 16 00:04:17 2007
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %In, 1}
+; PR1800
+
+define i1 @test(i32 %In) {
+ %c1 = icmp sgt i32 %In, -1
+ %c2 = icmp eq i32 %In, 1
+ %V = and i1 %c1, %c2
+ ret i1 %V
+}
+
From sabre at nondot.org Fri Nov 16 00:46:38 2007
From: sabre at nondot.org (Chris Lattner)
Date: Fri, 16 Nov 2007 00:46:38 -0600
Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html
Message-ID: <200711160646.lAG6kcLD023209@zion.cs.uiuc.edu>
Changes in directory llvm-www:
OpenProjects.html updated: 1.28 -> 1.29
---
Log message:
GVN-PRE is implemented.
---
Diffs of the changes: (+1 -3)
OpenProjects.html | 4 +---
1 files changed, 1 insertion(+), 3 deletions(-)
Index: llvm-www/OpenProjects.html
diff -u llvm-www/OpenProjects.html:1.28 llvm-www/OpenProjects.html:1.29
--- llvm-www/OpenProjects.html:1.28 Thu Aug 16 23:47:33 2007
+++ llvm-www/OpenProjects.html Fri Nov 16 00:45:55 2007
@@ -319,8 +319,6 @@
- - Implement GVN-PRE, a powerful and simple Partial Redundancy Elimination
- algorithm for SSA form (in progress, ask on llvmdev)
- Implement a Dependence Analysis Infrastructure
- Design some way to represent and query dep analysis
- Value range propagation pass
@@ -402,7 +400,7 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Compiler Infrastructure
- Last modified: $Date: 2007/08/17 04:47:33 $
+ Last modified: $Date: 2007/11/16 06:45:55 $
From gordonhenriksen at mac.com Fri Nov 16 04:24:45 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Fri, 16 Nov 2007 05:24:45 -0500
Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html
In-Reply-To: <200711160646.lAG6kcLD023209@zion.cs.uiuc.edu>
References: <200711160646.lAG6kcLD023209@zion.cs.uiuc.edu>
Message-ID: <904A33CE-E212-420C-A0B3-E37B714831C8@mac.com>
On Nov 16, 2007, at 01:46, Chris Lattner wrote:
> - Implement a Dependence Analysis Infrastructure
> - Design some way to represent and query dep analysis
> - Value range propagation pass
This is invalid now.
? Gordon
From asl at math.spbu.ru Fri Nov 16 05:02:02 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Fri, 16 Nov 2007 14:02:02 +0300
Subject: [llvm-commits] [llvm] r44166 - in
/llvm/trunk: lib/CodeGen/LiveIntervalAnalysis.cpp test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
In-Reply-To:
References: <200711150813.lAF8DTAi030739@zion.cs.uiuc.edu>
Message-ID: <1195210922.10807.237.camel@asl.dorms.spbu.ru>
Bill,
> Awesome! Did you try to compile 4.2 after this patch?
Now 4.2. bootstraps for me!
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From asl at math.spbu.ru Fri Nov 16 05:12:03 2007
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Fri, 16 Nov 2007 11:12:03 -0000
Subject: [llvm-commits] [llvm] r44189 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <200711161112.lAGBC4J0011753@zion.cs.uiuc.edu>
Author: asl
Date: Fri Nov 16 05:12:01 2007
New Revision: 44189
URL: http://llvm.org/viewvc/llvm-project?rev=44189&view=rev
Log:
These were implemented
Modified:
llvm/trunk/docs/ReleaseNotes.html
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=44189&r1=44188&r2=44189&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Fri Nov 16 05:12:01 2007
@@ -537,15 +537,16 @@
Declaring that functions have no side effects or that they can never
return.
- Supported: alias, always_inline, cdecl,
- constructor, destructor,
+ Supported: alias, always_inline, cdecl,
+ const, constructor, destructor,
deprecated, fastcall, format,
- format_arg, non_null, noinline, noreturn, regparm
+ format_arg, non_null, noinline,
+ noreturn, pure, regparm
section, stdcall, unused, used,
visibility, warn_unused_result, weak
- Ignored: pure, const, nothrow,
- malloc, no_instrument_function
+ Ignored: nothrow, malloc,
+ no_instrument_function
From clattner at apple.com Fri Nov 16 11:16:42 2007
From: clattner at apple.com (Chris Lattner)
Date: Fri, 16 Nov 2007 09:16:42 -0800
Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html
In-Reply-To: <904A33CE-E212-420C-A0B3-E37B714831C8@mac.com>
References: <200711160646.lAG6kcLD023209@zion.cs.uiuc.edu>
<904A33CE-E212-420C-A0B3-E37B714831C8@mac.com>
Message-ID: <32BC1654-E1DA-4D9D-A4D0-8BCFD1E0C6A5@apple.com>
On Nov 16, 2007, at 2:24 AM, Gordon Henriksen wrote:
> On Nov 16, 2007, at 01:46, Chris Lattner wrote:
>
>>
Implement a Dependence Analysis Infrastructure
>> - Design some way to represent and query dep analysis
>>
Value range propagation pass
>
> This is invalid now.
Actually, this was meant to be for loop dependence analysis. I
clarified the page, thanks!
-chris
From sabre at nondot.org Fri Nov 16 11:17:33 2007
From: sabre at nondot.org (Chris Lattner)
Date: Fri, 16 Nov 2007 11:17:33 -0600
Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html
Message-ID: <200711161717.lAGHHXlM015891@zion.cs.uiuc.edu>
Changes in directory llvm-www:
OpenProjects.html updated: 1.29 -> 1.30
---
Log message:
clarify what sort of dependence analysis
---
Diffs of the changes: (+2 -2)
OpenProjects.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm-www/OpenProjects.html
diff -u llvm-www/OpenProjects.html:1.29 llvm-www/OpenProjects.html:1.30
--- llvm-www/OpenProjects.html:1.29 Fri Nov 16 00:45:55 2007
+++ llvm-www/OpenProjects.html Fri Nov 16 11:16:15 2007
@@ -319,7 +319,7 @@
- - Implement a Dependence Analysis Infrastructure
+ - Implement a Loop Dependence Analysis Infrastructure
- Design some way to represent and query dep analysis
- Value range propagation pass
- More fun with loops:
@@ -400,7 +400,7 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Compiler Infrastructure
- Last modified: $Date: 2007/11/16 06:45:55 $
+ Last modified: $Date: 2007/11/16 17:16:15 $
From gordonhenriksen at mac.com Fri Nov 16 11:25:36 2007
From: gordonhenriksen at mac.com (Gordon Henriksen)
Date: Fri, 16 Nov 2007 12:25:36 -0500
Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html
In-Reply-To: <32BC1654-E1DA-4D9D-A4D0-8BCFD1E0C6A5@apple.com>
References: <200711160646.lAG6kcLD023209@zion.cs.uiuc.edu>
<904A33CE-E212-420C-A0B3-E37B714831C8@mac.com>
<32BC1654-E1DA-4D9D-A4D0-8BCFD1E0C6A5@apple.com>
Message-ID: <4CC49D7E-8446-448D-84F9-798D692CFFAB@mac.com>
On Nov 16, 2007, at 12:16, Chris Lattner wrote:
>
> On Nov 16, 2007, at 2:24 AM, Gordon Henriksen wrote:
>
>> On Nov 16, 2007, at 01:46, Chris Lattner wrote:
>>
>>> - Implement a Dependence Analysis Infrastructure
>>> - Design some way to represent and query dep analysis
>>> - Value range propagation pass
>>
>> This is invalid now.
>
> Actually, this was meant to be for loop dependence analysis. I
> clarified the page, thanks!
Ugh, misread the patch. But glad I caught an unrelated typo. It was
early. :)
? Gordon
From clattner at apple.com Fri Nov 16 12:56:45 2007
From: clattner at apple.com (Chris Lattner)
Date: Fri, 16 Nov 2007 10:56:45 -0800
Subject: [llvm-commits] [llvm-gcc-4.2] r43909 -
in /llvm-gcc-4.2/trunk/gcc: config/arm/arm.h llvm-convert.cpp
In-Reply-To: <9c10c9f0711101210j6c50ace1g4c5a7b4ec9c35438@mail.gmail.com>
References: <200711082210.lA8MADNK016192@zion.cs.uiuc.edu>
<7A671DDF-4CDB-42CB-B29A-CB229841B780@apple.com>
<9c10c9f0711081458j27d99082j5809dd94133a4e4a@mail.gmail.com>
<9c10c9f0711101210j6c50ace1g4c5a7b4ec9c35438@mail.gmail.com>
Message-ID:
On Nov 10, 2007, at 12:10 PM, Lauro Ramos Venancio wrote:
>>
>> Does it make sense to make this work? It seems much better than
>> having to hack arm.h for every subtarget that doesn't use @ as a
>> comment character.
>>
>
> I'm afraid I didn't understand your point. I think the problem is
> - Target can have inline asm extensions (not only comments - ARM
> target has two extensions: '%@' and '%r').
> So we need a way to define this extensions. To do this, I copied the
> idea used by the gcc codegen.
>
> arm.h code for gcc codegen:
>
> /* These are a couple of extensions to the formats accepted
> by asm_fprintf:
> %@ prints out ASM_COMMENT_START
> %r prints out REGISTER_PREFIX reg_names[arg] */
> #define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P) \
> case '@': \
> fputs (ASM_COMMENT_START, FILE); \
> break; \
> \
> case 'r': \
> fputs (REGISTER_PREFIX, FILE); \
> fputs (reg_names [va_arg (ARGS, int)], FILE); \
> break;
Hi Lauro,
It seems like there is two options: when lowering from GCC asm to
llvm asm, we can either change %@ (for example) into
ASM_COMMENT_START. Alternatively, we can lower it to "${:comment}",
which llvm asm already expands out to the right thing. Does this
make sense? The important point here is that not all arm targets use
@ for their comment character, and we don't want to break that.
-Chris
From clattner at apple.com Fri Nov 16 12:58:59 2007
From: clattner at apple.com (Chris Lattner)
Date: Fri, 16 Nov 2007 10:58:59 -0800
Subject: [llvm-commits] [llvm] r43997 - in /llvm/trunk: lib/Target/
lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/
lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/
lib/Target/X86/ utils/TableGen/
In-Reply-To: <200711111950.lABJoBmV002313@zion.cs.uiuc.edu>
References: <200711111950.lABJoBmV002313@zion.cs.uiuc.edu>
Message-ID: <698F8F74-E369-4B6F-8209-62F8A82B9170@apple.com>
On Nov 11, 2007, at 11:50 AM, Anton Korobeynikov wrote:
> Author: asl
> Date: Sun Nov 11 13:50:10 2007
> New Revision: 43997
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43997&view=rev
> Log:
> Use TableGen to emit information for dwarf register numbers.
> This makes DwarfRegNum to accept list of numbers instead.
> Added three different "flavours", but only slightly tested on
> x86-32/linux.
> Please check another subtargets if possible,
Very nice Anton! Thanks for tackling this,
-Chris
From lauro.venancio at gmail.com Fri Nov 16 14:20:18 2007
From: lauro.venancio at gmail.com (Lauro Ramos Venancio)
Date: Fri, 16 Nov 2007 17:20:18 -0300
Subject: [llvm-commits] [llvm-gcc-4.2] r43909 - in
/llvm-gcc-4.2/trunk/gcc: config/arm/arm.h llvm-convert.cpp
In-Reply-To:
References: <200711082210.lA8MADNK016192@zion.cs.uiuc.edu>
<7A671DDF-4CDB-42CB-B29A-CB229841B780@apple.com>
<9c10c9f0711081458j27d99082j5809dd94133a4e4a@mail.gmail.com>
<9c10c9f0711101210j6c50ace1g4c5a7b4ec9c35438@mail.gmail.com>
Message-ID: <9c10c9f0711161220p1cb6d8dne39da74f29699080@mail.gmail.com>
>
> It seems like there is two options: when lowering from GCC asm to
> llvm asm, we can either change %@ (for example) into
> ASM_COMMENT_START. Alternatively, we can lower it to "${:comment}",
> which llvm asm already expands out to the right thing.
Nowadays, LLVM doesn't expand this in inline asm. I tested this.
> Does this
> make sense? The important point here is that not all arm targets use
> @ for their comment character, and we don't want to break that.
>
I will use ASM_COMMENT_START. Nowadays, LLVM doesn't support any ARM
target that doesn't use '@' as comment character. So, I think it
doesn't worth to implement "${:comment}" now.
Lauro
From tonic at nondot.org Fri Nov 16 16:44:51 2007
From: tonic at nondot.org (Tanya Lattner)
Date: Fri, 16 Nov 2007 22:44:51 -0000
Subject: [llvm-commits] [llvm] r44193 -
/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Message-ID: <200711162244.lAGMipTs032513@zion.cs.uiuc.edu>
Author: tbrethou
Date: Fri Nov 16 16:44:50 2007
New Revision: 44193
URL: http://llvm.org/viewvc/llvm-project?rev=44193&view=rev
Log:
Fix for PR1801
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=44193&r1=44192&r2=44193&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Fri Nov 16 16:44:50 2007
@@ -929,6 +929,9 @@
}
ValueName *Name = F->getValueName();
+ if (!Name)
+ return UnknownModRefBehavior;
+
unsigned NameLen = Name->getKeyLength();
const char *NamePtr = Name->getKeyData();
From dalej at apple.com Fri Nov 16 17:16:35 2007
From: dalej at apple.com (Dale Johannesen)
Date: Fri, 16 Nov 2007 23:16:35 -0000
Subject: [llvm-commits] [llvm] r44194 -
/llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
Message-ID: <200711162316.lAGNGZ3c001348@zion.cs.uiuc.edu>
Author: johannes
Date: Fri Nov 16 17:16:35 2007
New Revision: 44194
URL: http://llvm.org/viewvc/llvm-project?rev=44194&view=rev
Log:
Testcase from PR 1508 (although its's somewhat
orthogonal to the main problem there)
Added:
llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
Added: llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll?rev=44194&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll Fri Nov 16 17:16:35 2007
@@ -0,0 +1,133 @@
+; RUN: llvm-as < %s | opt -std-compile-opts | llc -enable-eh
+;; Formerly crashed, see PR 1508
+; ModuleID = '5550437.c'
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
+target triple = "powerpc64-apple-darwin8"
+ %struct.Range = type { i64, i64 }
+
+define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) {
+entry:
+ %range_addr = alloca %struct.Range ; <%struct.Range*> [#uses=5]
+ %size_addr = alloca i64 ; [#uses=2]
+ %size.0 = alloca i64, align 8 ; [#uses=6]
+ %additionalKeys.5 = alloca i8** ; [#uses=2]
+ %saved_stack.7 = alloca i8* ; [#uses=3]
+ %eh_exception = alloca i8* ; [#uses=3]
+ %eh_selector = alloca i64 ; [#uses=1]
+ %effectiveRange = alloca %struct.Range, align 8 ; <%struct.Range*> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ %tmp = bitcast %struct.Range* %range_addr to { [2 x i64] }* ; <{ [2 x i64] }*> [#uses=1]
+ %tmp1 = getelementptr { [2 x i64] }* %tmp, i32 0, i32 0 ; <[2 x i64]*> [#uses=2]
+ %tmp2 = getelementptr [2 x i64]* %tmp1, i32 0, i32 0 ; [#uses=1]
+ store i64 %range.0.0, i64* %tmp2
+ %tmp3 = getelementptr [2 x i64]* %tmp1, i32 0, i32 1 ; [#uses=1]
+ store i64 %range.0.1, i64* %tmp3
+ store i64 %size, i64* %size_addr
+ %tmp4 = call i8* @llvm.stacksave( ) ; [#uses=1]
+ store i8* %tmp4, i8** %saved_stack.7, align 8
+ %tmp5 = load i64* %size_addr, align 8 ; [#uses=1]
+ store i64 %tmp5, i64* %size.0, align 8
+ %tmp6 = load i64* %size.0, align 8 ; [#uses=1]
+ %tmp7 = sub i64 %tmp6, 1 ; [#uses=0]
+ %tmp8 = load i64* %size.0, align 8 ; [#uses=1]
+ %tmp9 = mul i64 %tmp8, 64 ; [#uses=0]
+ %tmp10 = load i64* %size.0, align 8 ; [#uses=1]
+ %tmp11 = mul i64 %tmp10, 8 ; [#uses=0]
+ %tmp12 = load i64* %size.0, align 8 ; [#uses=1]
+ %tmp13 = mul i64 %tmp12, 64 ; [#uses=0]
+ %tmp14 = load i64* %size.0, align 8 ; [#uses=1]
+ %tmp15 = mul i64 %tmp14, 8 ; [#uses=1]
+ %tmp1516 = trunc i64 %tmp15 to i32 ; [#uses=1]
+ %tmp17 = alloca i8, i32 %tmp1516 ; [#uses=1]
+ %tmp1718 = bitcast i8* %tmp17 to i8** ; [#uses=1]
+ store i8** %tmp1718, i8*** %additionalKeys.5, align 8
+ %tmp19 = load i8*** %additionalKeys.5, align 8 ; [#uses=1]
+ invoke void @Foo( i8** %tmp19 )
+ to label %invcont unwind label %unwind
+
+unwind: ; preds = %bb, %entry
+ %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=1]
+ store i8* %eh_ptr, i8** %eh_exception
+ %eh_ptr20 = load i8** %eh_exception ; [#uses=1]
+ %eh_select = call i64 (i8*, i8*, ...)* @llvm.eh.selector.i64( i8* %eh_ptr20, i8* bitcast (void ()* @__gxx_personality_v0 to i8*), i8* null ) ; [#uses=1]
+ store i64 %eh_select, i64* %eh_selector
+ br label %cleanup37
+
+invcont: ; preds = %entry
+ br label %bb30
+
+bb: ; preds = %cond_true
+ %tmp21 = getelementptr %struct.Range* %range_addr, i32 0, i32 0 ; [#uses=1]
+ %tmp22 = load i64* %tmp21, align 8 ; [#uses=1]
+ invoke void @Bar( i64 %tmp22, %struct.Range* %effectiveRange )
+ to label %invcont23 unwind label %unwind
+
+invcont23: ; preds = %bb
+ %tmp24 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; [#uses=1]
+ %tmp25 = load i64* %tmp24, align 8 ; [#uses=1]
+ %tmp26 = getelementptr %struct.Range* %effectiveRange, i32 0, i32 1 ; [#uses=1]
+ %tmp27 = load i64* %tmp26, align 8 ; [#uses=1]
+ %tmp28 = sub i64 %tmp25, %tmp27 ; [#uses=1]
+ %tmp29 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; [#uses=1]
+ store i64 %tmp28, i64* %tmp29, align 8
+ br label %bb30
+
+bb30: ; preds = %invcont23, %invcont
+ %tmp31 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; [#uses=1]
+ %tmp32 = load i64* %tmp31, align 8 ; [#uses=1]
+ %tmp33 = icmp ne i64 %tmp32, 0 ; [#uses=1]
+ %tmp3334 = zext i1 %tmp33 to i8 ; [#uses=1]
+ %toBool = icmp ne i8 %tmp3334, 0 ; [#uses=1]
+ br i1 %toBool, label %cond_true, label %cond_false
+
+cond_true: ; preds = %bb30
+ br label %bb
+
+cond_false: ; preds = %bb30
+ br label %bb35
+
+cond_next: ; No predecessors!
+ br label %bb35
+
+bb35: ; preds = %cond_next, %cond_false
+ br label %cleanup
+
+cleanup: ; preds = %bb35
+ %tmp36 = load i8** %saved_stack.7, align 8 ; [#uses=1]
+ call void @llvm.stackrestore( i8* %tmp36 )
+ br label %finally
+
+cleanup37: ; preds = %unwind
+ %tmp38 = load i8** %saved_stack.7, align 8 ; [#uses=1]
+ call void @llvm.stackrestore( i8* %tmp38 )
+ br label %Unwind
+
+finally: ; preds = %cleanup
+ br label %return
+
+return: ; preds = %finally
+ ret void
+
+Unwind: ; preds = %cleanup37
+ %eh_ptr39 = load i8** %eh_exception ; [#uses=1]
+ call void @_Unwind_Resume( i8* %eh_ptr39 )
+ unreachable
+}
+
+declare i8* @llvm.stacksave()
+
+declare void @Foo(i8**)
+
+declare i8* @llvm.eh.exception()
+
+declare i64 @llvm.eh.selector.i64(i8*, i8*, ...)
+
+declare i64 @llvm.eh.typeid.for.i64(i8*)
+
+declare void @__gxx_personality_v0()
+
+declare void @_Unwind_Resume(i8*)
+
+declare void @Bar(i64, %struct.Range*)
+
+declare void @llvm.stackrestore(i8*)
From evan.cheng at apple.com Fri Nov 16 17:25:06 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Fri, 16 Nov 2007 23:25:06 -0000
Subject: [llvm-commits] [test-suite] r44195 - in
/test-suite/trunk/SingleSource/Benchmarks/Dhrystone: dry.c fldry.c
Message-ID: <200711162325.lAGNP6bL001716@zion.cs.uiuc.edu>
Author: evancheng
Date: Fri Nov 16 17:25:06 2007
New Revision: 44195
URL: http://llvm.org/viewvc/llvm-project?rev=44195&view=rev
Log:
Increase test sizes.
Modified:
test-suite/trunk/SingleSource/Benchmarks/Dhrystone/dry.c
test-suite/trunk/SingleSource/Benchmarks/Dhrystone/fldry.c
Modified: test-suite/trunk/SingleSource/Benchmarks/Dhrystone/dry.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Dhrystone/dry.c?rev=44195&r1=44194&r2=44195&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Benchmarks/Dhrystone/dry.c (original)
+++ test-suite/trunk/SingleSource/Benchmarks/Dhrystone/dry.c Fri Nov 16 17:25:06 2007
@@ -91,7 +91,7 @@
#ifdef SMALL_PROBLEM_SIZE
#define LOOPS 2000000
#else
-#define LOOPS 20000000
+#define LOOPS 100000000
#endif
/* Compiler dependent options */
Modified: test-suite/trunk/SingleSource/Benchmarks/Dhrystone/fldry.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Dhrystone/fldry.c?rev=44195&r1=44194&r2=44195&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Benchmarks/Dhrystone/fldry.c (original)
+++ test-suite/trunk/SingleSource/Benchmarks/Dhrystone/fldry.c Fri Nov 16 17:25:06 2007
@@ -91,7 +91,7 @@
#ifdef SMALL_PROBLEM_SIZE
#define LOOPS 2000000
#else
-#define LOOPS 20000000
+#define LOOPS 100000000
#endif
/* Compiler dependent options */
From evan.cheng at apple.com Fri Nov 16 17:55:09 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Fri, 16 Nov 2007 23:55:09 -0000
Subject: [llvm-commits] [llvm] r44196 -
/llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
Message-ID: <200711162355.lAGNt9eF003293@zion.cs.uiuc.edu>
Author: evancheng
Date: Fri Nov 16 17:55:08 2007
New Revision: 44196
URL: http://llvm.org/viewvc/llvm-project?rev=44196&view=rev
Log:
Typo.
Modified:
llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
Modified: llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll?rev=44196&r1=44195&r2=44196&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll Fri Nov 16 17:55:08 2007
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | grep 4
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 4
%struct.double_int = type { i64, i64 }
%struct.tree_common = type <{ i8, [3 x i8] }>
From evan.cheng at apple.com Fri Nov 16 18:31:17 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Sat, 17 Nov 2007 00:31:17 -0000
Subject: [llvm-commits] [llvm] r44197 -
/llvm/trunk/include/llvm/CodeGen/MachineInstr.h
Message-ID: <200711170031.lAH0VHGk004856@zion.cs.uiuc.edu>
Author: evancheng
Date: Fri Nov 16 18:31:16 2007
New Revision: 44197
URL: http://llvm.org/viewvc/llvm-project?rev=44197&view=rev
Log:
Shrinkfy.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=44197&r1=44196&r2=44197&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Fri Nov 16 18:31:16 2007
@@ -79,7 +79,7 @@
/// subReg - SubRegister number, only valid for MO_Register. A value of 0
/// indicates the MO_Register has no subReg.
- unsigned subReg;
+ unsigned char subReg;
} auxInfo;
MachineOperand() {}
@@ -188,7 +188,7 @@
}
unsigned getSubReg() const {
assert(isRegister() && "Wrong MachineOperand accessor");
- return auxInfo.subReg;
+ return (unsigned)auxInfo.subReg;
}
const char *getSymbolName() const {
assert(isExternalSymbol() && "Wrong MachineOperand accessor");
@@ -277,7 +277,7 @@
}
void setSubReg(unsigned subReg) {
assert(isRegister() && "Wrong MachineOperand accessor");
- auxInfo.subReg = subReg;
+ auxInfo.subReg = (unsigned char)subReg;
}
void setConstantPoolIndex(unsigned Idx) {
assert(isConstantPoolIndex() && "Wrong MachineOperand accessor");
@@ -472,7 +472,7 @@
Op.IsKill = IsKill;
Op.IsDead = IsDead;
Op.contents.RegNo = Reg;
- Op.auxInfo.subReg = SubReg;
+ Op.auxInfo.subReg = (unsigned char)SubReg;
}
/// addImmOperand - Add a zero extended constant argument to the
From evan.cheng at apple.com Fri Nov 16 18:40:41 2007
From: evan.cheng at apple.com (Evan Cheng)
Date: Sat, 17 Nov 2007 00:40:41 -0000
Subject: [llvm-commits] [llvm] r44198 - in /llvm/trunk:
include/llvm/CodeGen/LiveIntervalAnalysis.h
include/llvm/CodeGen/LiveVariables.h lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/LiveVariables.cpp lib/CodeGen/RegAllocLinearScan.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/VirtRegMap.cpp
lib/CodeGen/VirtRegMap.h
Message-ID: <200711170040.lAH0ef9i005195@zion.cs.uiuc.edu>
Author: evancheng
Date: Fri Nov 16 18:40:40 2007
New Revision: 44198
URL: http://llvm.org/viewvc/llvm-project?rev=44198&view=rev
Log:
Live interval splitting:
When a live interval is being spilled, rather than creating short, non-spillable
intervals for every def / use, split the interval at BB boundaries. That is, for
every BB where the live interval is defined or used, create a new interval that
covers all the defs and uses in the BB.
This is designed to eliminate one common problem: multiple reloads of the same
value in a single basic block. Note, it does *not* decrease the number of spills
since no copies are inserted so the split intervals are *connected* through
spill and reloads (or rematerialization). The newly created intervals can be
spilled again, in that case, since it does not span multiple basic blocks, it's
spilled in the usual manner. However, it can reuse the same stack slot as the
previously split interval.
This is currently controlled by -split-intervals-at-bb.
Modified:
llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
llvm/trunk/include/llvm/CodeGen/LiveVariables.h
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/LiveVariables.cpp
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
llvm/trunk/lib/CodeGen/VirtRegMap.h
Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=44198&r1=44197&r2=44198&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Fri Nov 16 18:40:40 2007
@@ -32,6 +32,7 @@
namespace llvm {
class LiveVariables;
+ class LoopInfo;
class MRegisterInfo;
class SSARegMap;
class TargetInstrInfo;
@@ -104,8 +105,8 @@
return getBaseIndex(index) + InstrSlots::STORE;
}
- static float getSpillWeight(const MachineOperand &mop, unsigned loopDepth) {
- return (mop.isUse()+mop.isDef()) * powf(10.0F, (float)loopDepth);
+ static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
+ return (isDef + isUse) * powf(10.0F, (float)loopDepth);
}
typedef Reg2IntervalMap::iterator iterator;
@@ -229,7 +230,8 @@
/// addIntervalsForSpills - Create new intervals for spilled defs / uses of
/// the given interval.
std::vector
- addIntervalsForSpills(const LiveInterval& i, VirtRegMap& vrm);
+ addIntervalsForSpills(const LiveInterval& i,
+ const LoopInfo *loopInfo, VirtRegMap& vrm);
private:
/// computeIntervals - Compute live intervals.
@@ -275,21 +277,32 @@
MachineInstr *DefMI, unsigned index, unsigned i,
bool isSS, int slot, unsigned reg);
+ bool anyKillInMBBAfterIdx(const LiveInterval &li,
+ MachineBasicBlock *MBB, unsigned Idx,
+ const VNInfo *VNI = NULL) const;
+
+ bool intervalIsInOneMBB(const LiveInterval &li) const;
+
/// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper functions
/// for addIntervalsForSpills to rewrite uses / defs for the given live range.
- void rewriteInstructionForSpills(const LiveInterval &li,
+ void rewriteInstructionForSpills(const LiveInterval &li, bool TrySplit,
unsigned id, unsigned index, unsigned end, MachineInstr *MI,
MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
VirtRegMap &vrm, SSARegMap *RegMap, const TargetRegisterClass* rc,
SmallVector &ReMatIds,
+ unsigned &NewVReg, bool &HasDef, bool &HasUse, const LoopInfo *loopInfo,
+ std::vector &NewVRegs,
std::vector &NewLIs);
- void rewriteInstructionsForSpills(const LiveInterval &li,
+ void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
LiveInterval::Ranges::const_iterator &I,
MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
VirtRegMap &vrm, SSARegMap *RegMap, const TargetRegisterClass* rc,
- SmallVector &ReMatIds,
+ SmallVector &ReMatIds, const LoopInfo *loopInfo,
+ BitVector &SpillMBBs,
+ std::vector > &SpillIdxes,
+ std::vector &NewVRegs,
std::vector &NewLIs);
static LiveInterval createInterval(unsigned Reg);
Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=44198&r1=44197&r2=44198&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Fri Nov 16 18:40:40 2007
@@ -154,20 +154,6 @@
SmallVector *PHIVarInfo;
- /// addRegisterKilled - We have determined MI kills a register. Look for the
- /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
- /// add a implicit operand if it's not found. Returns true if the operand
- /// exists / is added.
- bool addRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false);
-
- /// addRegisterDead - We have determined MI defined a register without a use.
- /// Look for the operand that defines it and mark it as IsDead. If
- /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
- /// true if the operand exists / is added.
- bool addRegisterDead(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false);
-
void addRegisterKills(unsigned Reg, MachineInstr *MI,
SmallSet &SubKills);
@@ -210,15 +196,28 @@
/// the records for NewMI.
void instructionChanged(MachineInstr *OldMI, MachineInstr *NewMI);
+ /// transferKillDeadInfo - Similar to instructionChanged except it does not
+ /// update live variables internal data structures.
+ static void transferKillDeadInfo(MachineInstr *OldMI, MachineInstr *NewMI,
+ const MRegisterInfo *RegInfo);
+
+ /// addRegisterKilled - We have determined MI kills a register. Look for the
+ /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
+ /// add a implicit operand if it's not found. Returns true if the operand
+ /// exists / is added.
+ static bool addRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
+ const MRegisterInfo *RegInfo,
+ bool AddIfNotFound = false);
+
/// addVirtualRegisterKilled - Add information about the fact that the
/// specified register is killed after being used by the specified
/// instruction. If AddIfNotFound is true, add a implicit operand if it's
/// not found.
void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
bool AddIfNotFound = false) {
- if (addRegisterKilled(IncomingReg, MI, AddIfNotFound))
+ if (addRegisterKilled(IncomingReg, MI, RegInfo, AddIfNotFound))
getVarInfo(IncomingReg).Kills.push_back(MI);
- }
+ }
/// removeVirtualRegisterKilled - Remove the specified virtual
/// register from the live variable information. Returns true if the
@@ -248,12 +247,20 @@
/// instruction.
void removeVirtualRegistersKilled(MachineInstr *MI);
+ /// addRegisterDead - We have determined MI defined a register without a use.
+ /// Look for the operand that defines it and mark it as IsDead. If
+ /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
+ /// true if the operand exists / is added.
+ static bool addRegisterDead(unsigned IncomingReg, MachineInstr *MI,
+ const MRegisterInfo *RegInfo,
+ bool AddIfNotFound = false);
+
/// addVirtualRegisterDead - Add information about the fact that the specified
/// register is dead after being used by the specified instruction. If
/// AddIfNotFound is true, add a implicit operand if it's not found.
void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI,
bool AddIfNotFound = false) {
- if (addRegisterDead(IncomingReg, MI, AddIfNotFound))
+ if (addRegisterDead(IncomingReg, MI, RegInfo, AddIfNotFound))
getVarInfo(IncomingReg).Kills.push_back(MI);
}
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44198&r1=44197&r2=44198&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Nov 16 18:40:40 2007
@@ -19,6 +19,7 @@
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "VirtRegMap.h"
#include "llvm/Value.h"
+#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
@@ -39,6 +40,9 @@
// Hidden options for help debugging.
cl::opt DisableReMat("disable-rematerialization",
cl::init(false), cl::Hidden);
+
+ cl::opt SplitAtBB("split-intervals-at-bb",
+ cl::init(false), cl::Hidden);
}
STATISTIC(numIntervals, "Number of original intervals");
@@ -632,7 +636,8 @@
/// slot / to reg or any rematerialized load into ith operand of specified
/// MI. If it is successul, MI is updated with the newly created MI and
/// returns true.
-bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
+bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
+ VirtRegMap &vrm,
MachineInstr *DefMI,
unsigned index, unsigned i,
bool isSS, int slot, unsigned reg) {
@@ -644,8 +649,11 @@
// we can do this, we don't need to insert spill code.
if (lv_)
lv_->instructionChanged(MI, fmi);
+ else
+ LiveVariables::transferKillDeadInfo(MI, fmi, mri_);
MachineBasicBlock &MBB = *MI->getParent();
vrm.virtFolded(reg, MI, i, fmi);
+ vrm.transferSpillPts(MI, fmi);
mi2iMap_.erase(MI);
i2miMap_[index/InstrSlots::NUM] = fmi;
mi2iMap_[fmi] = index;
@@ -656,17 +664,50 @@
return false;
}
+bool LiveIntervals::intervalIsInOneMBB(const LiveInterval &li) const {
+ SmallPtrSet MBBs;
+ for (LiveInterval::Ranges::const_iterator
+ I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
+ std::vector::const_iterator II =
+ std::lower_bound(Idx2MBBMap.begin(), Idx2MBBMap.end(), I->start);
+ if (II == Idx2MBBMap.end())
+ continue;
+ if (I->end > II->first) // crossing a MBB.
+ return false;
+ MBBs.insert(II->second);
+ if (MBBs.size() > 1)
+ return false;
+ }
+ return true;
+}
+
+static
+bool hasALaterUse(MachineBasicBlock *MBB, MachineInstr *MI, unsigned Reg) {
+ MachineBasicBlock::iterator I = MI;
+ if (I == MBB->end())
+ return false;
+ ++I;
+ while (I != MBB->end()) {
+ if (I->findRegisterUseOperandIdx(Reg) != -1)
+ return true;
+ ++I;
+ }
+ return false;
+}
+
/// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper functions
/// for addIntervalsForSpills to rewrite uses / defs for the given live range.
void LiveIntervals::
-rewriteInstructionForSpills(const LiveInterval &li,
- unsigned id, unsigned index, unsigned end,
- MachineInstr *MI, MachineInstr *OrigDefMI, MachineInstr *DefMI,
+rewriteInstructionForSpills(const LiveInterval &li, bool TrySplit,
+ unsigned id, unsigned index, unsigned end, MachineInstr *MI,
+ MachineInstr *ReMatOrigDefMI, MachineInstr *ReMatDefMI,
unsigned Slot, int LdSlot,
bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
VirtRegMap &vrm, SSARegMap *RegMap,
const TargetRegisterClass* rc,
SmallVector &ReMatIds,
+ unsigned &NewVReg, bool &HasDef, bool &HasUse,
+ const LoopInfo *loopInfo, std::vector