mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 04:43:14 +01:00
another merge
This commit is contained in:
@@ -151,7 +151,7 @@ void AggregateDeclaration::alignmember(
|
||||
unsigned size, // alignment requirement of field
|
||||
unsigned *poffset)
|
||||
{
|
||||
//printf("salign = %d, size = %d, offset = %d\n",salign,size,offset);
|
||||
//printf("salign = %d, size = %d, offset = %d\n",salign,size, *poffset);
|
||||
if (salign > 1)
|
||||
{
|
||||
assert(size != 3);
|
||||
@@ -160,7 +160,7 @@ void AggregateDeclaration::alignmember(
|
||||
sa = salign;
|
||||
*poffset = (*poffset + sa - 1) & ~(sa - 1);
|
||||
}
|
||||
//printf("result = %d\n",offset);
|
||||
//printf("result = %d\n", *poffset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,6 +100,10 @@ cl::opt<bool> output_s("output-s",
|
||||
cl::opt<cl::boolOrDefault> output_o("output-o",
|
||||
cl::desc("Write native object"));
|
||||
|
||||
// Disabling Red Zone
|
||||
cl::opt<bool> disableRedZone("disable-red-zone",
|
||||
cl::desc("Do not emit code that uses the red zone."),
|
||||
cl::init(false));
|
||||
|
||||
// DDoc options
|
||||
static cl::opt<bool, true> doDdoc("D",
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace opts {
|
||||
extern cl::opt<bool> output_ll;
|
||||
extern cl::opt<bool> output_s;
|
||||
extern cl::opt<cl::boolOrDefault> output_o;
|
||||
extern cl::opt<bool> disableRedZone;
|
||||
extern cl::opt<std::string> ddocDir;
|
||||
extern cl::opt<std::string> ddocFile;
|
||||
extern cl::opt<std::string> jsonFile;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -494,6 +495,9 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
||||
// parameter attributes
|
||||
if (!fdecl->isIntrinsic()) {
|
||||
set_param_attrs(f, func, fdecl);
|
||||
if (opts::disableRedZone) {
|
||||
func->addFnAttr(NoRedZone);
|
||||
}
|
||||
}
|
||||
|
||||
// main
|
||||
|
||||
Reference in New Issue
Block a user