+ }
+ }
+
+ // Handle cases where no arguments are passed first.
+ if (ArgValues.empty()) {
+ GenericValue rv;
+ switch (RetTy->getTypeID()) {
+ default: assert(0 && "Unknown return type for function call!");
+ case Type::BoolTyID:
+ rv.BoolVal = ((bool(*)())FPtr)();
+ return rv;
+ case Type::SByteTyID:
+ case Type::UByteTyID:
+ rv.SByteVal = ((char(*)())FPtr)();
+ return rv;
+ case Type::ShortTyID:
+ case Type::UShortTyID:
+ rv.ShortVal = ((short(*)())FPtr)();
+ return rv;
+ case Type::VoidTyID:
+ case Type::IntTyID:
+ case Type::UIntTyID:
+ rv.IntVal = ((int(*)())FPtr)();
+ return rv;
+ case Type::LongTyID:
+ case Type::ULongTyID:
+ rv.LongVal = ((int64_t(*)())FPtr)();
+ return rv;
+ case Type::FloatTyID:
+ rv.FloatVal = ((float(*)())FPtr)();
+ return rv;
+ case Type::DoubleTyID:
+ rv.DoubleVal = ((double(*)())FPtr)();