aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commitb83eb6447ba155342598f0fabe1f08f5baa9164a (patch)
treea5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/Bytecode/Writer/Writer.cpp
parent6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff)
downloadexternal_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.zip
external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.gz
external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.bz2
For PR950:
This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 48cccda..d5c4840 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -293,7 +293,7 @@ void BytecodeWriter::outputConstant(const Constant *CPV) {
assert(CE->getNumOperands() > 0 && "ConstantExpr with 0 operands");
assert(CE->getNumOperands() != 1 || CE->getOpcode() == Instruction::Cast);
output_vbr(1+CE->getNumOperands()); // flags as an expr
- output_vbr(CE->getOpcode()); // flags as an expr
+ output_vbr(CE->getOpcode()); // Put out the CE op code
for (User::const_op_iterator OI = CE->op_begin(); OI != CE->op_end(); ++OI){
int Slot = Table.getSlot(*OI);
@@ -307,7 +307,7 @@ void BytecodeWriter::outputConstant(const Constant *CPV) {
output_vbr(1U); // 1 -> UndefValue constant.
return;
} else {
- output_vbr(0U); // flag as not a ConstantExpr
+ output_vbr(0U); // flag as not a ConstantExpr (i.e. 0 operands)
}
switch (CPV->getType()->getTypeID()) {
@@ -322,14 +322,14 @@ void BytecodeWriter::outputConstant(const Constant *CPV) {
case Type::UShortTyID:
case Type::UIntTyID:
case Type::ULongTyID:
- output_vbr(cast<ConstantUInt>(CPV)->getValue());
+ output_vbr(cast<ConstantInt>(CPV)->getZExtValue());
break;
case Type::SByteTyID: // Signed integer types...
case Type::ShortTyID:
case Type::IntTyID:
case Type::LongTyID:
- output_vbr(cast<ConstantSInt>(CPV)->getValue());
+ output_vbr(cast<ConstantInt>(CPV)->getSExtValue());
break;
case Type::ArrayTyID: {
@@ -881,11 +881,11 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector<const Value*>
// FIXME: Most slabs only have 1 or 2 entries! We should encode this much
// more compactly.
- // Output type header: [num entries][type id number]
+ // Put out type header: [num entries][type id number]
//
output_vbr(NC);
- // Output the Type ID Number...
+ // Put out the Type ID Number...
int Slot = Table.getSlot(Plane.front()->getType());
assert (Slot != -1 && "Type in constant pool but not in function!!");
output_typeid((unsigned)Slot);