summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-08 09:46:57 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-08 09:46:57 +0000
commitd702c8c98064733bd69c636466b502ea1a3a2337 (patch)
tree85ad1ee973627f1ac2b7ace96929e1b8c2bfa0cd /lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
parent539e187acbcf7d2b3567aa4f81f70dc93b2b3dd8 (diff)
downloadllvm-d702c8c98064733bd69c636466b502ea1a3a2337.tar.gz
llvm-d702c8c98064733bd69c636466b502ea1a3a2337.tar.bz2
llvm-d702c8c98064733bd69c636466b502ea1a3a2337.tar.xz
Remove ByteswapSCANFResults, it is dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp76
1 files changed, 0 insertions, 76 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 68f70b5208..a620de59cf 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -419,82 +419,6 @@ GenericValue lle_X_printf(const FunctionType *FT,
return GV;
}
-static void ByteswapSCANFResults(LLVMContext &C,
- const char *Fmt, void *Arg0, void *Arg1,
- void *Arg2, void *Arg3, void *Arg4, void *Arg5,
- void *Arg6, void *Arg7, void *Arg8) {
- void *Args[] = { Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, 0 };
-
- // Loop over the format string, munging read values as appropriate (performs
- // byteswaps as necessary).
- unsigned ArgNo = 0;
- while (*Fmt) {
- if (*Fmt++ == '%') {
- // Read any flag characters that may be present...
- bool Suppress = false;
- bool Half = false;
- bool Long = false;
- bool LongLong = false; // long long or long double
-
- while (1) {
- switch (*Fmt++) {
- case '*': Suppress = true; break;
- case 'a': /*Allocate = true;*/ break; // We don't need to track this
- case 'h': Half = true; break;
- case 'l': Long = true; break;
- case 'q':
- case 'L': LongLong = true; break;
- default:
- if (Fmt[-1] > '9' || Fmt[-1] < '0') // Ignore field width specs
- goto Out;
- }
- }
- Out:
-
- // Read the conversion character
- if (!Suppress && Fmt[-1] != '%') { // Nothing to do?
- unsigned Size = 0;
- const Type *Ty = 0;
-
- switch (Fmt[-1]) {
- case 'i': case 'o': case 'u': case 'x': case 'X': case 'n': case 'p':
- case 'd':
- if (Long || LongLong) {
- Size = 8; Ty = Type::getInt64Ty(C);
- } else if (Half) {
- Size = 4; Ty = Type::getInt16Ty(C);
- } else {
- Size = 4; Ty = Type::getInt32Ty(C);
- }
- break;
-
- case 'e': case 'g': case 'E': case 'f':
- if (Long || LongLong) {
- Size = 8; Ty = Type::getDoubleTy(C);
- } else {
- Size = 4; Ty = Type::getFloatTy(C);
- }
- break;
-
- case 's': case 'c': case '[': // No byteswap needed
- Size = 1;
- Ty = Type::getInt8Ty(C);
- break;
-
- default: break;
- }
-
- if (Size) {
- GenericValue GV;
- void *Arg = Args[ArgNo++];
- memcpy(&GV, Arg, Size);
- TheInterpreter->StoreValueToMemory(GV, (GenericValue*)Arg, Ty);
- }
- }
- }
- }
-}
-
// int sscanf(const char *format, ...);
GenericValue lle_X_sscanf(const FunctionType *FT,
const std::vector<GenericValue> &args) {