summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-08 10:16:40 +0000
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-08 10:16:40 +0000
commit23849470517f5cd045a65babfe38c8e72fe1e57b (patch)
tree429b0c715642898a00e6ca79a5852be1005eab5f
parentbc33b23da1387bbdd1501d1f0b62f6bd98e125a3 (diff)
downloadedk2-platforms-23849470517f5cd045a65babfe38c8e72fe1e57b.tar.xz
Corrected some comments for the changed code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2194 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java27
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java21
2 files changed, 34 insertions, 14 deletions
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
index 6d6794d474..11469a6c49 100644
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
+++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
@@ -76,12 +76,11 @@ public class AutogenLibOrder {
String[] libClassDeclList = null;
String[] libClassConsmList = null;
- libInstanceList = new ModuleIdentification[libraryList.length];
+ libInstanceList = libraryList;
for (int i = 0; i < libraryList.length; i++) {
libInstance = libraryList[i];
- libInstanceList[i] = libInstance;
//
- // Add libraryInstance in to libInstanceList.
+ // Fetch the constructor & destructor.
//
Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstance, arch);
SurfaceAreaQuery saq = new SurfaceAreaQuery(libDoc);
@@ -89,17 +88,10 @@ public class AutogenLibOrder {
libInstance.setDestructor(saq.getLibDestructorName());
//
- // Add library instance and consumed library class list to
- // libInstanceConsumes.
+ // Create library class consume database.
//
libClassConsmList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, arch);
if (libClassConsmList != null) {
- /*
- String[] classStr = new String[libClassConsmList.length];
- for (int k = 0; k < libClassConsmList.length; k++) {
- classStr[k] = libClassConsmList[k];
- }
- */
if (this.libInstanceConsumes.containsKey(libInstance)) {
throw new AutoGenException(
libraryList[i].getName()
@@ -110,7 +102,7 @@ public class AutogenLibOrder {
}
//
- // Add library class and library instance map.
+ // Create library class implementer database
//
libClassDeclList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, arch);
if (libClassDeclList != null) {
@@ -129,6 +121,9 @@ public class AutogenLibOrder {
}
}
+ //
+ // Create a consumed-by database
+ //
for (Iterator it = libClassProducer.keySet().iterator(); it.hasNext();) {
String className = (String)it.next();
libInstance = libClassProducer.get(className);
@@ -151,7 +146,7 @@ public class AutogenLibOrder {
orderLibInstance
This function reorder the library instance according the library class
- dependency.
+ dependency, using DAG anaylysis algothim
@return List which content the ordered library instance.
**/
@@ -159,6 +154,9 @@ public class AutogenLibOrder {
LinkedList<ModuleIdentification> orderList = new LinkedList<ModuleIdentification>();
LinkedList<ModuleIdentification> noConsumerList = new LinkedList<ModuleIdentification>();
+ //
+ // First, add the library instance without consumers to the Q
+ //
for (int i = 0; i < libInstanceList.length; ++i) {
if (libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) {
noConsumerList.add(libInstanceList[i]);
@@ -221,6 +219,9 @@ public class AutogenLibOrder {
}
}
+ //
+ // Append the remaining library instance to the end of sorted list
+ //
for (int i = 0; i < libInstanceList.length; ++i) {
if (!orderList.contains(libInstanceList[i])) {
orderList.add(libInstanceList[i]);
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
index dfcbeae76a..dc5f87bab4 100644
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
+++ b/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
@@ -189,25 +189,44 @@ public class ModuleIdentification extends Identification {
public void setModuleType(String moduleType) {
this.moduleType = moduleType;
}
-
+
+ /**
+ @return String The module name
+ **/
public String getName() {
return name;
}
+ /**
+ @return boolean
+ **/
public boolean hasConstructor() {
return constructor != "";
}
+ /**
+ @return boolean
+ */
public boolean hasDestructor() {
return destructor != "";
}
+ /**
+ Set the constructor function name if this module is a library
+
+ @param name
+ */
public void setConstructor(String name) {
if (name != null) {
constructor = name;
}
}
+ /**
+ Set the destructor function name if this module is a library
+
+ @param name
+ */
public void setDestructor(String name) {
if (name != null) {
destructor = name;