mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-27 01:25:21 +02:00
[svn r233] Added: -oq command line option for writing fully qualified object names.
Added: started support for x86 80bit floating point. Changed: aggregates passed by value now use the llvm 'byval' parameter attribute, also lays ground work for using other attributes. Changed: eliminated a lot more std::vectorS, these showed up pretty much at the top when profiling! Changed: performed other misc. cleanups. Changed: halt expression now call the new llvm trap intrinsic instead of an assert(0). Changed: dstress suite now passes -O0 by default, this only eliminates unreferenced globals, which speeds up linking quite a bit.
This commit is contained in:
20
dmd/mars.c
20
dmd/mars.c
@@ -202,6 +202,7 @@ Usage:\n\
|
||||
-od<objdir> write object files to directory <objdir>\n\
|
||||
-of<filename> name output file to <filename>\n\
|
||||
-op do not strip paths from source file\n\
|
||||
-oq write object files with fully qualified names\n\
|
||||
-profile profile runtime performance of generated code\n\
|
||||
-quiet suppress unnecessary messages\n\
|
||||
-release compile release version\n\
|
||||
@@ -214,6 +215,7 @@ Usage:\n\
|
||||
-version=level compile in version code >= level\n\
|
||||
-version=ident compile in version code identified by ident\n\
|
||||
-w enable warnings\n\
|
||||
-fp80 enable 80bit reals on x86 32bit (EXPERIMENTAL)\n\
|
||||
",
|
||||
#if WIN32
|
||||
" @cmdfile read arguments from cmdfile\n"
|
||||
@@ -397,6 +399,8 @@ int main(int argc, char *argv[])
|
||||
global.params.disassemble = 1;
|
||||
else if (strcmp(p + 1, "annotate") == 0)
|
||||
global.params.llvmAnnotate = 1;
|
||||
else if (strcmp(p + 1, "fp80") == 0)
|
||||
global.params.useFP80 = 1;
|
||||
else if (p[1] == 'o')
|
||||
{
|
||||
switch (p[2])
|
||||
@@ -423,6 +427,12 @@ int main(int argc, char *argv[])
|
||||
global.params.preservePaths = 1;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
if (p[3])
|
||||
goto Lerror;
|
||||
global.params.fqnPaths = 1;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
error("-o no longer supported, use -of or -od");
|
||||
break;
|
||||
@@ -691,6 +701,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
bool is_x86 = false;
|
||||
if (strcmp(global.params.llvmArch,"x86")==0) {
|
||||
VersionCondition::addPredefinedGlobalIdent("X86");
|
||||
//VersionCondition::addPredefinedGlobalIdent("LLVM_InlineAsm_X86");
|
||||
@@ -698,6 +709,7 @@ int main(int argc, char *argv[])
|
||||
global.params.is64bit = false;
|
||||
tt_arch = "i686";
|
||||
data_layout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:8";
|
||||
is_x86 = true;
|
||||
}
|
||||
else if (strcmp(global.params.llvmArch,"x86-64")==0) {
|
||||
VersionCondition::addPredefinedGlobalIdent("X86_64");
|
||||
@@ -740,6 +752,14 @@ int main(int argc, char *argv[])
|
||||
VersionCondition::addPredefinedGlobalIdent("LLVM64");
|
||||
}
|
||||
|
||||
if (global.params.useFP80) {
|
||||
if (!is_x86) {
|
||||
error("the -fp80 option is only valid for the x86 32bit architecture");
|
||||
fatal();
|
||||
}
|
||||
VersionCondition::addPredefinedGlobalIdent("LLVM_X86_FP80");
|
||||
}
|
||||
|
||||
assert(tt_arch != 0);
|
||||
assert(tt_os != 0);
|
||||
assert(data_layout != 0);
|
||||
|
||||
@@ -133,6 +133,8 @@ struct Param
|
||||
char llvmInline;
|
||||
char llvmAnnotate;
|
||||
char *runtimePath;
|
||||
char useFP80;
|
||||
char fqnPaths; // use fully qualified object names
|
||||
};
|
||||
|
||||
struct Global
|
||||
|
||||
@@ -2538,7 +2538,9 @@ Type *TypeFunction::syntaxCopy()
|
||||
{
|
||||
Type *treturn = next ? next->syntaxCopy() : NULL;
|
||||
Arguments *params = Argument::arraySyntaxCopy(parameters);
|
||||
Type *t = new TypeFunction(params, treturn, varargs, linkage);
|
||||
TypeFunction *t = new TypeFunction(params, treturn, varargs, linkage);
|
||||
t->llvmRetInPtr = llvmRetInPtr;
|
||||
t->llvmUsesThis = llvmUsesThis;
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -5062,6 +5064,7 @@ Argument::Argument(unsigned storageClass, Type *type, Identifier *ident, Express
|
||||
this->ident = ident;
|
||||
this->storageClass = storageClass;
|
||||
this->defaultArg = defaultArg;
|
||||
this->llvmByVal = false;
|
||||
}
|
||||
|
||||
Argument *Argument::syntaxCopy()
|
||||
@@ -5070,6 +5073,7 @@ Argument *Argument::syntaxCopy()
|
||||
type ? type->syntaxCopy() : NULL,
|
||||
ident,
|
||||
defaultArg ? defaultArg->syntaxCopy() : NULL);
|
||||
a->llvmByVal = llvmByVal;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
@@ -681,6 +681,9 @@ struct Argument : Object
|
||||
static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments);
|
||||
static size_t dim(Arguments *arguments);
|
||||
static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL);
|
||||
|
||||
// LLVMDC
|
||||
bool llvmByVal;
|
||||
};
|
||||
|
||||
extern int PTRSIZE;
|
||||
|
||||
Reference in New Issue
Block a user