mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 18:09:29 +00:00
BrainF example: fixing output buffering issue
Differential Revision: https://reviews.llvm.org/D27824 llvm-svn: 292216
This commit is contained in:
parent
ba571c82ea
commit
9fe65bc2ad
@ -166,6 +166,10 @@ int main(int argc, char **argv) {
|
||||
std::vector<GenericValue> args;
|
||||
Function *brainf_func = M.getFunction("brainf");
|
||||
GenericValue gv = ee->runFunction(brainf_func, args);
|
||||
// Genereated code calls putchar, and output is not guaranteed without fflush.
|
||||
// The better place for fflush(stdout) call would be the generated code, but it
|
||||
// is unmanageable because stdout linkage name depends on stdlib implementation.
|
||||
fflush(stdout);
|
||||
} else {
|
||||
WriteBitcodeToFile(Mod.get(), *out);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user