diff options
author | jkim <jkim@FreeBSD.org> | 2012-03-20 21:37:52 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-03-20 21:37:52 +0000 |
commit | 9807567995352b475fd7e23ea58b7512a20e7bd3 (patch) | |
tree | 2a460dab9bb8e6fffc77dcd3749cddbe16ec0ab6 /sys/contrib/dev/acpica/compiler/aslcompile.c | |
parent | 107d21a0f4a0fa5f29290cca23e94c24fe945998 (diff) | |
parent | f65c4f80d1c60e597f67836e51986ebf3cd669f7 (diff) | |
download | FreeBSD-src-9807567995352b475fd7e23ea58b7512a20e7bd3.zip FreeBSD-src-9807567995352b475fd7e23ea58b7512a20e7bd3.tar.gz |
Merge ACPICA 20120320.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslcompile.c')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslcompile.c | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c index ad44a9e..bd17dba 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompile.c +++ b/sys/contrib/dev/acpica/compiler/aslcompile.c @@ -457,6 +457,17 @@ CmDoCompile ( Event = UtBeginEvent ("Open input and output files"); UtEndEvent (Event); + /* Preprocessor */ + + Event = UtBeginEvent ("Preprocess input file"); + PrDoPreprocess (); + UtEndEvent (Event); + if (Gbl_PreprocessOnly) + { + CmCleanupAndExit (); + return 0; + } + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -474,8 +485,7 @@ CmDoCompile ( { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "- Could not resolve parse tree root node"); - CmCleanupAndExit (); - return -1; + goto ErrorExit; } /* Optional parse tree dump, compiler debug output only */ @@ -508,12 +518,12 @@ CmDoCompile ( */ Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); + UtEndEvent (Event); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } - UtEndEvent (Event); /* Interpret and generate all compile-time constants */ @@ -552,6 +562,7 @@ CmDoCompile ( AePrintErrorLog (ASL_FILE_STDERR); UtDisplaySummary (ASL_FILE_STDERR); } + UtEndEvent (FullCompile); return 0; } @@ -566,7 +577,7 @@ CmDoCompile ( UtEndEvent (Event); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace cross-reference */ @@ -575,7 +586,7 @@ CmDoCompile ( Status = LkCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace - Check for non-referenced objects */ @@ -646,6 +657,11 @@ CmDoCompile ( UtEndEvent (FullCompile); CmCleanupAndExit (); return 0; + +ErrorExit: + UtEndEvent (FullCompile); + CmCleanupAndExit (); + return (-1); } @@ -799,7 +815,9 @@ CmCleanupAndExit ( /* Close all open files */ - for (i = 2; i < ASL_MAX_FILE_TYPE; i++) + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } @@ -817,6 +835,18 @@ CmCleanupAndExit ( } } + /* Delete the preprocessor output file (.i) unless -li flag is set */ + + if (!Gbl_PreprocessorOutputFlag && Gbl_Files[ASL_FILE_PREPROCESSOR].Filename) + { + if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)) + { + printf ("%s: ", + Gbl_Files[ASL_FILE_PREPROCESSOR].Filename); + perror ("Could not delete preprocessor .i file"); + } + } + /* * Delete intermediate ("combined") source file (if -ls flag not set) * This file is created during normal ASL/AML compiles. It is not |