[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. afb8696bbb49ebc188949cda7a0950d63d70e1b5 |
Date: |
Sat, 25 Jul 2009 13:57:54 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".
The branch, master has been updated
via afb8696bbb49ebc188949cda7a0950d63d70e1b5 (commit)
via 1207bfcca24c01c227523b8620b8200f1b1508db (commit)
via d25b24d761eac6a5866018e5c80a4d497e67000a (commit)
via 0e2ee7a8722b74bd16f49584ded4d256da06def1 (commit)
from 2ad1d8b6dfd91a47814dfdd09ac33f4ac76fd74d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=afb8696bbb49ebc188949cda7a0950d63d70e1b5
commit afb8696bbb49ebc188949cda7a0950d63d70e1b5
Author: Klaus Treichel <address@hidden>
Date: Sat Jul 25 15:55:00 2009 +0200
Add discard code generation for ILNode_AsIs and ILNode_ToConst for java too.
Set the system image in the context if it is loaded during cscc
initialization.
diff --git a/ChangeLog b/ChangeLog
index 7f5f552..9583d9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-25 Klaus Treichel <address@hidden>
+
+ * codegen/jv_misc.tc: Add operations JavaGenDiscard for ILNode_AsIs
+ and ILNode_ToConst.
+
+ * cscc/common/cc_main.c (LoadLibrary, LoadLibraryFromPath): Return the
+ image or 0 on error instead of simply 0 or 1.
+ (LoadLib): Added wrapper for compatibility and error output.
+ (InitCodeGen): Set the system image in the context if it is loaded.
+
2009-07-12 Klaus Treichel <address@hidden>
* codegen/cg_misg.tc: Add operations ILNode_GenDiscard for ILNode_AsIs
diff --git a/codegen/jv_misc.tc b/codegen/jv_misc.tc
index 8ddfdfd..38a502c 100644
--- a/codegen/jv_misc.tc
+++ b/codegen/jv_misc.tc
@@ -28,6 +28,16 @@ JavaGenDiscard(ILNode_Comma)
}
/*
+ * Generate discard code for an "as is" expression.
+ */
+JavaGenDiscard(ILNode_AsIs),
+JavaGenDiscard(ILNode_ToConst)
+{
+ /* Evaluate the expression for its side effects only */
+ return JavaGenDiscard(node->expr, info);
+}
+
+/*
* Generate discard code for an "overflow" expression.
*/
JavaGenDiscard(ILNode_Overflow)
diff --git a/cscc/common/cc_main.c b/cscc/common/cc_main.c
index c9cfa1b..59240af 100644
--- a/cscc/common/cc_main.c
+++ b/cscc/common/cc_main.c
@@ -349,7 +349,7 @@ static void PreprocessClose(void)
* Load a library from a specific path. Returns zero on failure.
* If "freePath" is non-zero, then free "path" afterwards.
*/
-static int LoadLibraryFromPath(const char *path, int freePath)
+static ILImage *LoadLibraryFromPath(const char *path, int freePath)
{
ILImage *image;
int loadError;
@@ -364,20 +364,25 @@ static int LoadLibraryFromPath(const char *path, int
freePath)
CCOutOfMemory();
}
}
+ else
+ {
+ image = 0;
+ }
/* Clean up and exit */
if(freePath)
{
ILFree((char *)path);
}
- return (loadError == 0);
+ return image;
}
/*
* Load the contents of a library into the code generator's context.
* Returns zero if the library load failed.
*/
-static int LoadLibrary(const char *name, int nostdlib_flag, int later_load)
+static ILImage *LoadLibrary(const char *name, int nostdlib_flag,
+ int later_load)
{
int len;
int index;
@@ -442,7 +447,7 @@ static int LoadLibrary(const char *name, int nostdlib_flag,
int later_load)
if(assemName[index] == '\0' && index == len)
{
/* The assembly is already loaded */
- return 1;
+ return image;
}
}
}
@@ -456,23 +461,38 @@ static int LoadLibrary(const char *name, int
nostdlib_flag, int later_load)
return LoadLibraryFromPath(path, 1);
}
- /* If this is the C compiler, then ignore the missing library,
- since libraries are normally fixed up at link time */
- if(CCPluginUsesPreproc == CC_PREPROC_C)
+ return 0;
+}
+
+/*
+ * Same as LoadLibrary except that the C compiler is handled and an
+ * int is returned.
+ */
+static int LoadLib(const char *name, int nostdlib_flag, int later_load)
+{
+ if(!LoadLibrary(name, nostdlib_flag, later_load))
{
- if(later_load)
+ /* If this is the C compiler, then ignore the missing library,
+ since libraries are normally fixed up at link time */
+ if(CCPluginUsesPreproc == CC_PREPROC_C)
{
- return 0;
+ if(later_load)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
}
else
{
- return 1;
+ /* Could not locate the library */
+ fprintf(stderr, _("%s: No such library\n"), name);
}
+ return 0;
}
-
- /* Could not locate the library */
- fprintf(stderr, _("%s: No such library\n"), name);
- return 0;
+ return 1;
}
/*
@@ -557,13 +577,19 @@ static int InitCodeGen(void)
/* Load the "mscorlib" library, to get the standard library */
if(!nostdlib_flag || (CCPluginForceStdlib && !useBuiltinLibrary))
{
+ ILImage *corlibImage;
+
char *name = CCStringListGetValue(extension_flags,
num_extension_flags,
"stdlib-name");
if(!name)
{
name = "mscorlib";
}
- if(!LoadLibrary(name, 0, 0))
+ if((corlibImage = LoadLibrary(name, 0, 0)) != 0)
+ {
+ ILContextSetSystem(CCCodeGen.context, corlibImage);
+ }
+ else
{
return 1;
}
@@ -607,7 +633,7 @@ static int InitCodeGen(void)
/* Load all of the other libraries, in reverse order */
for(library = num_libraries - 1; library >= 0; --library)
{
- if(!LoadLibrary(libraries[library], nostdlib_flag, 0))
+ if(!LoadLib(libraries[library], nostdlib_flag, 0))
{
return 1;
}
@@ -1456,7 +1482,7 @@ void CCPluginAddStandaloneAttrs(ILNode *node)
int CCLoadLibrary(const char *name)
{
- return LoadLibrary(name, nostdlib_flag, 1);
+ return LoadLib(name, nostdlib_flag, 1);
}
/*
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=1207bfcca24c01c227523b8620b8200f1b1508db
commit 1207bfcca24c01c227523b8620b8200f1b1508db
Author: Klaus Treichel <address@hidden>
Date: Sun Jul 12 12:49:33 2009 +0200
Return the scope of the first declaration of a type too on attempt to
redeclare the same type.
diff --git a/ChangeLog b/ChangeLog
index c8e61f9..7f5f552 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* codegen/cg_misg.tc: Add operations ILNode_GenDiscard for ILNode_AsIs
and ILNode_ToConst.
+ * codegen/cg_scope.c (ILScopeDeclareType): Return the scope where a type
+ was declared the first time on attempt to redeclare the same type.
+
* cscc/common/cc_preproc.c (RefillLineBuffer): Ignore lines with the
#pragma directive in builds with a version > 1.
diff --git a/codegen/cg_scope.c b/codegen/cg_scope.c
index 2ab254d..c5b6e63 100644
--- a/codegen/cg_scope.c
+++ b/codegen/cg_scope.c
@@ -634,6 +634,8 @@ int ILScopeDeclareType(ILScope *scope, ILNode *node, const
char *name,
{
/* Declaration conflicts with a type the user already
declared */
*origDefn = data->node;
+ /* return the type scope of the declared type too */
+ *resultScope = (ILScope *)(data->data);
return IL_SCOPE_ERROR_REDECLARED;
}
else if(data->rbnode.kind == IL_SCOPE_SUBSCOPE)
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=d25b24d761eac6a5866018e5c80a4d497e67000a
commit d25b24d761eac6a5866018e5c80a4d497e67000a
Author: Klaus Treichel <address@hidden>
Date: Sun Jul 12 12:40:17 2009 +0200
Add operation ILNode_GenDiscard for ILNode_AsIs and ILNode_ToConst.
diff --git a/ChangeLog b/ChangeLog
index 195ad49..c8e61f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-07-12 Klaus Treichel <address@hidden>
+ * codegen/cg_misg.tc: Add operations ILNode_GenDiscard for ILNode_AsIs
+ and ILNode_ToConst.
+
* cscc/common/cc_preproc.c (RefillLineBuffer): Ignore lines with the
#pragma directive in builds with a version > 1.
diff --git a/codegen/cg_misc.tc b/codegen/cg_misc.tc
index 8c4e183..508c7a4 100644
--- a/codegen/cg_misc.tc
+++ b/codegen/cg_misc.tc
@@ -436,6 +436,16 @@ ILNode_GenDiscard(ILNode_ArgList)
}
/*
+ * Generate discard code for an "as is" expression.
+ */
+ILNode_GenDiscard(ILNode_AsIs),
+ILNode_GenDiscard(ILNode_ToConst)
+{
+ /* Evaluate the expression for its side effects only */
+ return ILNode_GenDiscard(node->expr, info);
+}
+
+/*
* Generate discard code for a vararg list expression.
*/
ILNode_GenDiscard(ILNode_VarArgList)
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=0e2ee7a8722b74bd16f49584ded4d256da06def1
commit 0e2ee7a8722b74bd16f49584ded4d256da06def1
Author: Klaus Treichel <address@hidden>
Date: Sun Jul 12 12:15:41 2009 +0200
Ignore lines with the #pragma compiler directive in builds with a version >
1.
diff --git a/ChangeLog b/ChangeLog
index 9ede381..195ad49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-12 Klaus Treichel <address@hidden>
+
+ * cscc/common/cc_preproc.c (RefillLineBuffer): Ignore lines with the
+ #pragma directive in builds with a version > 1.
+
2009-06-28 Klaus Treichel <address@hidden>
* codegen/cg_nodes.tc (ILParameterModifier): Add ILParamMod_methodgroup.
diff --git a/cscc/common/cc_preproc.c b/cscc/common/cc_preproc.c
index 621eecb..de9df32 100644
--- a/cscc/common/cc_preproc.c
+++ b/cscc/common/cc_preproc.c
@@ -1366,6 +1366,15 @@ static int RefillLineBuffer(CCPreProc *preproc)
should also check that #region and
#endregion lines
are properly matched, but we don't do that
yet */
}
+#if IL_VERSION_MAJOR > 1
+ else if(MATCH_DIRECTIVE(dirname, "pragma", 6))
+ {
+ /*
+ * We don't handle #pragma at the moment so
simply skip this
+ * line.
+ */
+ }
+#endif /* IL_VERSION_MAJOR > 1 */
else
{
/* Unknown directive */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 21 ++++++++++++++++
codegen/cg_misc.tc | 10 +++++++
codegen/cg_scope.c | 2 +
codegen/jv_misc.tc | 10 +++++++
cscc/common/cc_main.c | 60 +++++++++++++++++++++++++++++++++-------------
cscc/common/cc_preproc.c | 9 +++++++
6 files changed, 95 insertions(+), 17 deletions(-)
hooks/post-receive
--
DotGNU Portable.NET engine, compilers and tools (pnet)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. afb8696bbb49ebc188949cda7a0950d63d70e1b5,
Klaus Treichel <=