You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/07/01 08:18:24 UTC

[lucy-commits] svn commit: r1141827 - in /incubator/lucy/branches/0.1: ./ charmonizer/src/Charmonizer/Core/Compiler.c

Author: marvin
Date: Fri Jul  1 06:18:23 2011
New Revision: 1141827

URL: http://svn.apache.org/viewvc?rev=1141827&view=rev
Log:
LUCY-169 Consolidate litterbug code away.

Refactor a routine in Charmonizer's Compiler module to eliminate code which
was spewing extra debris.

Modified:
    incubator/lucy/branches/0.1/   (props changed)
    incubator/lucy/branches/0.1/charmonizer/src/Charmonizer/Core/Compiler.c

Propchange: incubator/lucy/branches/0.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul  1 06:18:23 2011
@@ -1 +1 @@
-/incubator/lucy/trunk:1126586,1134011,1134355,1134472,1134843-1134848,1134953,1134956,1139709,1139711,1139714,1140001,1140287,1140296,1140387,1140393,1140400,1140418,1140420,1140422,1140437,1140440,1140894,1140924,1140964
+/incubator/lucy/trunk:1126586,1134011,1134355,1134472,1134843-1134848,1134953,1134956,1139709,1139711,1139714,1140001,1140287,1140296,1140387,1140393,1140400,1140418,1140420,1140422,1140437,1140440,1140894,1140924,1140930,1140964

Modified: incubator/lucy/branches/0.1/charmonizer/src/Charmonizer/Core/Compiler.c
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/0.1/charmonizer/src/Charmonizer/Core/Compiler.c?rev=1141827&r1=1141826&r2=1141827&view=diff
==============================================================================
--- incubator/lucy/branches/0.1/charmonizer/src/Charmonizer/Core/Compiler.c (original)
+++ incubator/lucy/branches/0.1/charmonizer/src/Charmonizer/Core/Compiler.c Fri Jul  1 06:18:23 2011
@@ -60,6 +60,8 @@ S_do_test_compile(void);
 
 void
 CC_init(const char *compiler_command, const char *compiler_flags) {
+    const char *code = "int main() { return 0; }\n";
+
     if (Util_verbosity) { printf("Creating compiler object...\n"); }
 
     /* Assign. */
@@ -81,7 +83,12 @@ CC_init(const char *compiler_command, co
     }
 
     /* If we can't compile anything, game over. */
-    S_do_test_compile();
+    if (Util_verbosity) {
+        printf("Trying to compile a small test file...\n");
+    }
+    if (!CC_test_compile(code, strlen(code))) {
+         Util_die("Failed to compile a small test file");
+    }
 }
 
 void
@@ -262,25 +269,6 @@ S_clean_up_try(void) {
     remove(TARGET_PATH);
 }
 
-static void
-S_do_test_compile(void) {
-    const char *code = "int main() { return 0; }\n";
-    chaz_bool_t success;
-
-    if (Util_verbosity) {
-        printf("Trying to compile a small test file...\n");
-    }
-
-    /* Attempt compilation. */
-    success = CC_compile_exe("_charm_try.c", "_charm_try",
-                             code, strlen(code));
-    if (!success) { Util_die("Failed to compile a small test file"); }
-
-    /* Clean up. */
-    remove("_charm_try.c");
-    OS_remove_exe("_charm_try");
-}
-
 void
 CC_add_inc_dir(const char *dir) {
     size_t num_dirs = 0;