Erik Schmauss 997f6ca123 iASL: perform analysis and code generation after parsing all tables
Performing parse tree analysis on all definition blocks
simultaneously results in more effective namespace cross-reference.
This enables iASL static analysis to determine unresolved external
declarations and namespace collisions during compilation.

In order to take advantage of this, compile definition blocks
with the following command:

iasl dsdt.asl ssdt1.asl ssdt2.asl ...

*** Changes related to multiple files:

Keep track of all files in a global list that is persistent
throughout compilation of both files. This is done in order to
compile multiple ASL files in the same namespace and parse tree.

This also resulted in moving the file handle assignment for the -vi
option during file initialization rather than commandline processing.

As each definition block is parsed, it is connected as a sibling node
to the previous definiton block.

*** Changes related to iASL error reporting:

Also, more error messages were added by replacing the fprintf to
stderr with AslError. By doing so, an error can be logged properly
and AML output files will be cleaned if there is a compiler error.

Adds the ability to print the correct source line by logging the .src
filename in each error node. This is necessary for errors that point
to an include file.

New iASL error: emitting an error when compiling duplicate files.

Ignore max error count when compiling with -f because
compilation needs to continue.

Fix parser error path to correctly abort compilation rather
than trying to proceed with more compilation.

*** Changes related to codegen behavior:

Seek to the end of the AML output file after codegen in case multiple
definition blocks need to be encoded in the same AML file. This makes
other parts of the codebase a little more convinent since it doesn't
have to seek to the correct place in the AML.

*** Misc changes:

Remove a call to ACPI_FREE. We should never be calling ACPI_FREE in
memory allocated in caches.

Display compilation summaries for multiple input files. Files that
have parser errors are reported as having parser errors. The summary
is based on the global file list.

Encapsulate global variables in global file nodes used for summary
reporting.

Final cleanup functions for iASL has been consolidated to the main()
function for simplicity.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
..