From f2bf96d30fe08965ffd53a28099131ac030e43d5 Mon Sep 17 00:00:00 2001
From: Jung-uk Kim <jkim@FreeBSD.org>
Date: Fri, 28 May 2010 18:46:48 +0000
Subject: Import ACPICA 20100528.

---
 compiler/aslutils.c | 56 +++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 41 insertions(+), 15 deletions(-)

(limited to 'compiler/aslutils.c')

diff --git a/compiler/aslutils.c b/compiler/aslutils.c
index 01db90a3066c..e8d61babc785 100644
--- a/compiler/aslutils.c
+++ b/compiler/aslutils.c
@@ -214,6 +214,8 @@ UtLocalCalloc (
             Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
             Gbl_InputByteCount, Gbl_CurrentColumn,
             Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+
+        CmCleanupAndExit ();
         exit (1);
     }
 
@@ -523,33 +525,57 @@ UtDisplaySummary (
             CompilerId, (UINT32) ACPI_CA_VERSION, __DATE__);
     }
 
-    /* Input/Output summary */
-
-    FlPrintFile (FileId,
-        "ASL Input:  %s - %d lines, %d bytes, %d keywords\n",
-        Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
-        Gbl_InputByteCount, TotalKeywords);
-
-    /* AML summary */
+    if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
+    {
+        FlPrintFile (FileId,
+            "Table Input:   %s - %u lines, %u bytes, %u fields\n",
+            Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
+            Gbl_InputByteCount, Gbl_InputFieldCount);
 
-    if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+        if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+        {
+            FlPrintFile (FileId,
+                "Binary Output: %s - %u bytes\n\n",
+                Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength);
+        }
+    }
+    else
     {
+        /* Input/Output summary */
+
         FlPrintFile (FileId,
-            "AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n",
-            Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
-            TotalNamedObjects, TotalExecutableOpcodes);
+            "ASL Input:  %s - %u lines, %u bytes, %u keywords\n",
+            Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
+            Gbl_InputByteCount, TotalKeywords);
+
+        /* AML summary */
+
+        if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+        {
+            FlPrintFile (FileId,
+                "AML Output: %s - %u bytes, %u named objects, %u executable opcodes\n\n",
+                Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
+                TotalNamedObjects, TotalExecutableOpcodes);
+        }
     }
 
     /* Error summary */
 
     FlPrintFile (FileId,
-        "Compilation complete. %d Errors, %d Warnings, %d Remarks, %d Optimizations\n",
+        "Compilation complete. %u Errors, %u Warnings, %u Remarks",
         Gbl_ExceptionCount[ASL_ERROR],
         Gbl_ExceptionCount[ASL_WARNING] +
             Gbl_ExceptionCount[ASL_WARNING2] +
             Gbl_ExceptionCount[ASL_WARNING3],
-        Gbl_ExceptionCount[ASL_REMARK],
-        Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+        Gbl_ExceptionCount[ASL_REMARK]);
+
+    if (Gbl_FileType != ASL_INPUT_TYPE_ASCII_DATA)
+    {
+        FlPrintFile (FileId,
+            ", %u Optimizations", Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+    }
+
+    FlPrintFile (FileId, "\n");
 }
 
 
-- 
cgit v1.2.3