Added -disable-red-zone flag.

This will disable the usage of the 'red-zone' in ABIs that make use of it (like x86). This mimics the exact flag used by clang. It is comparable to the -mno-red-zone flag in gcc. - thanks to wilkie
This commit is contained in:
Moritz Warning
2011-02-23 23:50:53 +01:00
parent 9e59fea83e
commit fb418bf2e6
3 changed files with 9 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
#include "gen/dvalue.h"
#include "gen/abi.h"
#include "gen/nested.h"
#include "gen/cl_options.h"
using namespace llvm::Attribute;
@@ -501,6 +502,9 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
// parameter attributes
if (!fdecl->isIntrinsic()) {
set_param_attrs(f, func, fdecl);
if (opts::disableRedZone) {
func->addFnAttr(NoRedZone);
}
}
// main