using std::cout;
using std::cerr;
-cl::Flag QuietMode ("quiet" , "Do not emit any non-program output");
-cl::Alias QuietModeA("q" , "Alias for -quiet", cl::NoFlags, QuietMode);
-cl::Flag ArrayChecksEnabled("array-checks", "Enable array bound checks");
-cl::Flag AbortOnExceptions("abort-on-exception", "Halt execution on a machine exception");
+static cl::opt<bool>
+QuietMode("quiet", cl::desc("Do not emit any non-program output"));
+
+static cl::alias
+QuietModeA("q", cl::desc("Alias for -quiet"), cl::aliasopt(QuietMode));
+
+static cl::opt<bool>
+ArrayChecksEnabled("array-checks", cl::desc("Enable array bound checks"));
+
+static cl::opt<bool>
+AbortOnExceptions("abort-on-exception",
+ cl::desc("Halt execution on a machine exception"));
// Create a TargetData structure to handle memory addressing and size/alignment
// computations
#ifdef PROFILE_STRUCTURE_FIELDS
-static cl::Flag ProfileStructureFields("profilestructfields",
- "Profile Structure Field Accesses");
+static cl::opt<bool>
+ProfileStructureFields("profilestructfields",
+ cl::desc("Profile Structure Field Accesses"));
#include <map>
static std::map<const StructType *, vector<unsigned> > FieldAccessCounts;
#endif
IMPLEMENT_SHIFT(<<, Int);
IMPLEMENT_SHIFT(<<, ULong);
IMPLEMENT_SHIFT(<<, Long);
+ IMPLEMENT_SHIFT(<<, Pointer);
default:
cout << "Unhandled type for Shl instruction: " << Ty << "\n";
}
IMPLEMENT_SHIFT(>>, Int);
IMPLEMENT_SHIFT(>>, ULong);
IMPLEMENT_SHIFT(>>, Long);
+ IMPLEMENT_SHIFT(>>, Pointer);
default:
cout << "Unhandled type for Shr instruction: " << Ty << "\n";
}
IMPLEMENT_CAST_CASE(UByte , (unsigned char));
IMPLEMENT_CAST_CASE(SByte , ( signed char));
IMPLEMENT_CAST_CASE(UShort , (unsigned short));
- IMPLEMENT_CAST_CASE(Short , ( signed char));
+ IMPLEMENT_CAST_CASE(Short , ( signed short));
IMPLEMENT_CAST_CASE(UInt , (unsigned int ));
IMPLEMENT_CAST_CASE(Int , ( signed int ));
IMPLEMENT_CAST_CASE(ULong , (uint64_t));
void Interpreter::printValue(const Type *Ty, GenericValue V) {
switch (Ty->getPrimitiveID()) {
case Type::BoolTyID: cout << (V.BoolVal?"true":"false"); break;
- case Type::SByteTyID: cout << V.SByteVal; break;
- case Type::UByteTyID: cout << V.UByteVal; break;
+ case Type::SByteTyID:
+ cout << (int)V.SByteVal << " '" << V.SByteVal << "'"; break;
+ case Type::UByteTyID:
+ cout << (unsigned)V.UByteVal << " '" << V.UByteVal << "'"; break;
case Type::ShortTyID: cout << V.ShortVal; break;
case Type::UShortTyID: cout << V.UShortVal; break;
case Type::IntTyID: cout << V.IntVal; break;
// printStackFrame - Print information about the specified stack frame, or -1
// for the default one.
//
-void Interpreter::printStackFrame(int FrameNo = -1) {
+void Interpreter::printStackFrame(int FrameNo) {
if (FrameNo == -1) FrameNo = CurFrame;
Function *F = ECStack[FrameNo].CurMethod;
const Type *RetTy = F->getReturnType();