//===-- BFtoLLVM.cpp - BF language Front End for LLVM ---------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This is a simple front end for the BF language. It is compatible with the
std::string ptr = gensym (op + "ptr"),
val = gensym (op + "val"),
result = gensym (op + "result");
- dest << ptr << " = load sbyte** %ptrbox\n"
+ dest << ptr << " = load sbyte** %ptrbox\n"
<< val << " = load sbyte* " << ptr << "\n"
<< result << " = add sbyte " << val << ", " << (int)delta << "\n"
<< "store sbyte " << result << ", sbyte* " << ptr << "\n";
char *sourceFileName = argv[1];
char *destFileName = argv[2];
-
+
std::ifstream src (sourceFileName);
if (!src.good()) {
std::cerr << sourceFileName << ": " << strerror(errno) << "\n";
std::cerr << destFileName << ": " << strerror(errno) << "\n";
return 1;
}
-
+
emitDeclarations(dest);
emitMainFunctionProlog(dest);
repeatCount = 0;
}
consume (lastCh, repeatCount, dest);
-
+
emitMainFunctionEpilog(dest);
src.close();