[ECL-513348] delegates with create() signatures different from proxies' create() signatures
diff --git a/src/packages/xdc/runtime/knl/Semaphore.xdc b/src/packages/xdc/runtime/knl/Semaphore.xdc
index 2959536..338983f 100644
--- a/src/packages/xdc/runtime/knl/Semaphore.xdc
+++ b/src/packages/xdc/runtime/knl/Semaphore.xdc
@@ -1,5 +1,5 @@
 /* --COPYRIGHT--,ESD
- *  Copyright (c) 2008 Texas Instruments. All rights reserved.
+ *  Copyright (c) 2008-2017 Texas Instruments Incorporated
  *  This program and the accompanying materials are made available under the
  *  terms of the Eclipse Public License v1.0 and Eclipse Distribution License
  *  v. 1.0 which accompanies this distribution. The Eclipse Public License is
@@ -48,11 +48,12 @@
     /*!
      *  Proxy used for optimization.
      *
-     *  If ALL ISemaphore.Handles were created using the same module 
-     *  (e.g SemProcess) then setting this Proxy to SemProcess and 
-     *  setting Semaphore.Proxy.abstractInstances$ = false, 
+     *  If ALL ISemaphore.Handles were created using the same module
+     *  (e.g SemProcess) then setting this Proxy to SemProcess and
+     *  setting Semaphore.Proxy.abstractInstances$ = false,
      *  Semaphore APIs can have better performance.
      */
+    @NoProxyCreate
     proxy Proxy inherits ISemaphore;
 
     /*!
diff --git a/src/packages/xdc/services/intern/gen/Config.java b/src/packages/xdc/services/intern/gen/Config.java
index f27c767..1f5e132 100644
--- a/src/packages/xdc/services/intern/gen/Config.java
+++ b/src/packages/xdc/services/intern/gen/Config.java
@@ -2368,7 +2368,10 @@
         glob.out.printf("xdc_Bool %1Module__startupDone__S( void ) \n{%+\n", glob.cname);
         glob.out.printf("%treturn %1Module__startupDone__S();\n}\n%-", dcname);
 
-        if (unit.isInst()) {
+        /* There are proxies that don't support create() because their
+         * delegates might have different create signatures.
+         */
+        if (unit.isInst() && !unit.hasAttr(Attr.A_NoProxyCreate)) {
             glob.genTitleD("create");
             glob.out.printf("%1Handle %1create(", glob.cname);
             glob.genCreArgDecls(unit, Glob.Type$LCL, " ");
diff --git a/src/packages/xdc/services/spec/Attr.java b/src/packages/xdc/services/spec/Attr.java
index 49e46d2..97f8ffc 100644
--- a/src/packages/xdc/services/spec/Attr.java
+++ b/src/packages/xdc/services/spec/Attr.java
@@ -1,5 +1,5 @@
 /* --COPYRIGHT--,EPL
- *  Copyright (c) 2008 Texas Instruments and others.
+ *  Copyright (c) 2008-2017 Texas Instruments Incorporated
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -35,6 +35,7 @@
     final public static String A_InstanceInitStatic = "@InstanceInitStatic";
     final public static String A_Macro = "@Macro";
     final public static String A_ModuleStartup = "@ModuleStartup";
+    final public static String A_NoProxyCreate = "@NoProxyCreate";
     final public static String A_NoRuntime = "@NoRuntime";
     final public static String A_Opaque = "@Opaque";
     final public static String A_Prefix = "@Prefix";
diff --git a/src/packages/xdc/services/spec/Decl.java b/src/packages/xdc/services/spec/Decl.java
index da2c91a..e0135a1 100644
--- a/src/packages/xdc/services/spec/Decl.java
+++ b/src/packages/xdc/services/spec/Decl.java
@@ -1,5 +1,5 @@
 /* --COPYRIGHT--,EPL
- *  Copyright (c) 2008 Texas Instruments and others.
+ *  Copyright (c) 2008-2017 Texas Instruments Incorporated
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -846,9 +846,9 @@
         // resolve
         void resolve( Unit uspec )
         {
-            
+
             /* If a module is NoRuntime or if the module has DirectCall
-             * attribute, we have to add the DirectCall attribute for all 
+             * attribute, we have to add the DirectCall attribute for all
              * functions, except the ones that are already Macro.
              */
             boolean noRuntime = !((Unit)this.parent).needsRuntime();
@@ -881,7 +881,7 @@
                     }
                 }
             }
-            
+
             this.enterAttrs(Decl.Fxn.reservedAttrs);
 
             if (this.hasAttr(Attr.A_Macro)) {
@@ -913,7 +913,7 @@
                 }
                 arg.resolve(uspec);
             }
-            
+
             Decl.checkSig(this);
         }
     }
@@ -949,6 +949,11 @@
 
         Unit              unit;
 
+        static private HashSet<String> reservedAttrs =
+            new HashSet(Arrays.asList(new String[] {
+                Attr.A_NoProxyCreate,
+            }));
+
         Proxy( Atom name, EnumSet<Qual> quals, Sup sup )
         {
             this.name = name;
@@ -970,6 +975,11 @@
 
             return u == null ? this.sup.unit : u;
         }
+
+        void resolve( Unit uspec )
+        {
+            this.enterAttrs(Decl.Proxy.reservedAttrs);
+        }
     }
 
     // Decl.Struct
@@ -1026,19 +1036,19 @@
         {
             return this.fldSizes;
         }
-        
+
         // getXmlTag
         public String getXmlTag()
         {
             return this.uflag ? "union" : "struct";
         }
-        
+
         // isAnon
         public final boolean isAnon()
         {
             return this.name.text.startsWith("__struct__");
         }
-        
+
         // isUnion
         public final boolean isUnion()
         {
@@ -1053,14 +1063,14 @@
             if (this.flds == null) {
                 return;
             }
-            
+
             boolean isState =
                 this.getName().equals("Module_State") || this.getName().equals("Instance_State");
-            
+
             for (Field fld : this.flds) {
                 fld.resolve(uspec);
             }
-            
+
             if (isState) {
                 List<Field> fL = new ArrayList<Field>();
                 for (ListIterator<Field> it = this.flds.listIterator(); it.hasNext(); ) {
@@ -1150,7 +1160,7 @@
                 }
                 t = ((Typedef) n).getType();
             }
-            
+
             Decl.checkSig(this);
         }
 
diff --git a/src/packages/xdc/services/spec/Unit.java b/src/packages/xdc/services/spec/Unit.java
index 0ab865c..20394ea 100644
--- a/src/packages/xdc/services/spec/Unit.java
+++ b/src/packages/xdc/services/spec/Unit.java
@@ -63,6 +63,7 @@
             Attr.A_InstanceInitStatic,
             Attr.A_InstanceFinalize,
             Attr.A_ModuleStartup,
+            Attr.A_NoProxyCreate,
             Attr.A_NoRuntime,
             Attr.A_Prefix,
             Attr.A_Proxy,
@@ -137,6 +138,17 @@
                       prx.sup, null);
 
         pu.bindParent(this.getParent());
+        ArrayList<Attr> aL = new ArrayList();
+        /* The attribute NoProxyCreate has to be transferred from the proxy
+         * config parameter to the new unit because the attribute will be
+         * queried at the config time when it will be more difficult to get
+         * from the proxy unit to the original config declaration.
+         */
+        if (prx.hasAttr(Attr.A_NoProxyCreate)) {
+            aL.add(new Attr(new Atom(Attr.A_NoProxyCreate),
+                            new Expr.Const(new Atom("true"))));
+        }
+        pu.bindAttrs(aL);
         pu.proxy = true;
         pu.pass1Check();
         pu.pass2Check(strict);
@@ -194,12 +206,12 @@
 
             /* The type is null for JavaScript functions. */
             if (otype != null && dtype != null) {
-	    
+
 	        String otypeCode = otype.tspec().code();
 	        String dtypeCode = dtype.tspec().code();
 	        /* Only for structs and enums we know that the type cannot be
 	         * changed in XDCspec files. Modules, Instances and other types
-	         * that can be extended in XDCspec cannot have any type along
+	         * that can be extended in XDCspec can have any type along
 	         * the inheritance chain be used interchangeably.
 	         */
                 if ((otypeCode == "S" || otypeCode == "E" || otypeCode == "e")
@@ -213,7 +225,7 @@
 	             */
 	            Node otypeParent = otype.tspec().getRef().getNode();
 	            Node dtypeParent = dtype.tspec().getRef().getNode();
-                
+
                     if (otypeParent == dtypeParent) {
                         inherited = true;
                     }
@@ -709,7 +721,7 @@
         if (ses.msg.hasErrors()) {
             return;
         }
-        
+
         Unit u2 = this.getSuper();
 
         if (u2 != null) {
@@ -771,13 +783,13 @@
             EnumSet<Qual> quals = EnumSet.noneOf(Qual.class);
             quals.add(Qual.INTERNAL);
             quals.add(Qual.SYSTEM);
-            
+
             ArrayList<Decl.Field> flds = new ArrayList(0);
             Decl.Struct s = new Decl.Struct(
                 new Atom("Instance_State"), quals, flds, false);
             this.decls.add(s);
             s.bindParent(this);
-            
+
             /* This flag is set to false, so we won't require Instance_init
              * function in modules that did not even declare Instance_State.
              */
@@ -795,7 +807,7 @@
         if (this.hasAttr(Attr.A_Facet) && !this.isMeta()) {
             ses.msg.error(this.name, "@Facet units must be metaonly");
         }
-        
+
         if (this.attrBool(Attr.A_NoRuntime)) {
             this.rtsFlag = false;
         }
@@ -876,19 +888,18 @@
                     "@TargetHeader must be used in metaonly units");
             }
         }
-
         if (this.creator != null) {
             this.decls.remove(this.creator);
         }
         else if (this.isa != null) {
             this.creator = this.isa.unit.creator;
         }
-        
+
         this.iobjFlag |= this.isMeta();
         this.sizeFlag &= !this.proxy;
-       
+
     }
-    
+
     /**
      *  Query unit for the specified facet type
      *
@@ -898,7 +909,7 @@
     public String queryFacet(String tName)
     {
         String res = null;
-        
+
         for (Decl.Config cfg : this.cfgs) {
             if (cfg.hasAttr(Attr.A_Facet)
                 && cfg.type.tspec().getRef().getNode().getQualName().equals(tName)) {
@@ -906,7 +917,7 @@
                 break;
             }
         }
-        
+
         return res;
     }
 }