diff dmd/attrib.c @ 486:a34078905d01

Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in. Reimplemented support for nested functions/class using a new approach. Added error on taking address of intrinsic. Fixed problems with the ->syntaxCopy of TypeFunction delegate exp. Removed DtoDType and replaced all uses with ->toBasetype() instead. Removed unused inplace stuff. Fixed a bunch of issues in the runtime unittests, not complete yet. Added mini tests.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 10 Aug 2008 08:37:38 +0200
parents cc40db549aea
children cecfee2d01a8
line wrap: on
line diff
--- a/dmd/attrib.c	Sat Aug 09 09:03:52 2008 +0200
+++ b/dmd/attrib.c	Sun Aug 10 08:37:38 2008 +0200
@@ -831,7 +831,7 @@
 // LLVMDC
 #if IN_LLVM
 
-    // pragma(intrinsic, string) { funcdecl(s) }
+    // pragma(intrinsic, "string") { funcdecl(s) }
     else if (ident == Id::intrinsic)
     {
         Expression* expr = (Expression *)args->data[0];
@@ -920,6 +920,27 @@
         }
         llvm_internal = LLVMva_arg;
     }
+    
+    // pragma(llvmdc, "string") { templdecl(s) }
+    else if (ident == Id::llvmdc)
+    {
+        Expression* expr = (Expression *)args->data[0];
+        expr = expr->semantic(sc);
+        if (!args || args->dim != 1 || !parseStringExp(expr, arg1str))
+        {
+             error("pragma llvmdc requires exactly 1 string literal parameter");
+             fatal();
+        }
+        else if (arg1str == "verbose")
+        {
+            sc->module->llvmForceLogging = true;
+        }
+        else
+        {
+            error("pragma llvmdc command '%s' invalid");
+            fatal();
+        }
+    }
 
 #endif // LLVMDC