#include "llvm/System/Signals.h"
#include "llvm/Config/config.h"
#include "llvm/LinkAllVMCore.h"
+#include "llvm/InitializeAllTargets.h"
+#include "llvm/InitializeAllAsmPrinters.h"
#include <fstream>
#include <iostream>
#include <memory>
cl::desc("Do not verify input module"));
+static cl::opt<bool>
+DisableRedZone("disable-red-zone",
+ cl::desc("Do not emit code that uses the red zone."),
+ cl::init(false));
+
+static cl::opt<bool>
+NoImplicitFloats("no-implicit-float",
+ cl::desc("Don't generate implicit floating point instructions (x86-only)"),
+ cl::init(false));
+
// GetFileNameRoot - Helper function to get the basename of a filename.
static inline std::string
GetFileNameRoot(const std::string &InputFilename) {
// Run our queue of passes all at once now, efficiently.
// TODO: this could lazily stream functions out of the module.
for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I)
- if (!I->isDeclaration())
+ if (!I->isDeclaration()) {
+ if (DisableRedZone)
+ I->addFnAttr(Attribute::NoRedZone);
+ if (NoImplicitFloats)
+ I->addFnAttr(Attribute::NoImplicitFloat);
Passes.run(*I);
+ }
Passes.doFinalization();
}