Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision 1048b31f5b050d15213318bad3c6c6b904db14b4)
+++ src/SynTree/Declaration.h	(revision 4e2461096b7c7d12f2ee84f0cef534e05aa25d48)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Declaration.h -- 
+// Declaration.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  2 17:28:11 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Fri May 06 11:16:45 2016
 // Update Count     : 33
 //
@@ -106,5 +106,10 @@
 	typedef DeclarationWithType Parent;
   public:
-	FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn );
+	// temporary - merge this into general GCC attributes
+	enum Attribute {
+		NoAttribute, Constructor, Destructor,
+	};
+
+	FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute = NoAttribute );
 	FunctionDecl( const FunctionDecl &other );
 	virtual ~FunctionDecl();
@@ -119,4 +124,6 @@
 	std::list< std::string >& get_oldIdents() { return oldIdents; }
 	std::list< Declaration* >& get_oldDecls() { return oldDecls; }
+	Attribute get_attribute() const { return attribute; }
+	void set_attribute( Attribute newValue ) { attribute = newValue; }
 
 	virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
@@ -130,4 +137,5 @@
 	std::list< std::string > oldIdents;
 	std::list< Declaration* > oldDecls;
+	Attribute attribute;
 };
 
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision 1048b31f5b050d15213318bad3c6c6b904db14b4)
+++ src/SynTree/FunctionDecl.cc	(revision 4e2461096b7c7d12f2ee84f0cef534e05aa25d48)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri Apr 01 11:40:07 2016
+// Last Modified On : Fri May 06 11:35:09 2016
 // Update Count     : 19
 //
@@ -21,12 +21,16 @@
 #include "Common/utility.h"
 
-FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn )
-		: Parent( name, sc, linkage ), type( type ), statements( statements ) {
+FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute )
+		: Parent( name, sc, linkage ), type( type ), statements( statements ), attribute( attribute ) {
 	set_isInline( isInline );
 	set_isNoreturn( isNoreturn );
+	// this is a brazen hack to force the function "main" to have C linkage
+	if ( name == "main" ) {
+		set_linkage( LinkageSpec::C );
+	} // if
 }
 
 FunctionDecl::FunctionDecl( const FunctionDecl &other )
-	: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
+	: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), attribute( other.attribute ) {
 }
 
@@ -61,4 +65,14 @@
 		os << "_Noreturn ";
 	} // if
+	switch ( attribute ) {
+		case Constructor:
+			os << "Global Constructor ";
+			break;
+		case Destructor:
+			os << "Global Destructor ";
+			break;
+		default:
+			break;
+	}
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
 		os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
@@ -100,4 +114,14 @@
 		os << "_Noreturn ";
 	} // if
+	switch ( attribute ) {
+		case Constructor:
+			os << " Global Constructor ";
+			break;
+		case Destructor:
+			os << " Global Destructor ";
+			break;
+		default:
+			break;
+	}
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
 		os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
