summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-29 07:32:35 +0000
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-29 07:32:35 +0000
commit323e2ffc21aadcd77f6e505f3a27957d94484059 (patch)
treea51b90571ac2da54fd1dc31737e18d0b9bd4e96c
parentb88170614f5c89173d7b9672369980c62a678cb9 (diff)
downloadedk2-323e2ffc21aadcd77f6e505f3a27957d94484059.zip
edk2-323e2ffc21aadcd77f6e505f3a27957d94484059.tar.gz
edk2-323e2ffc21aadcd77f6e505f3a27957d94484059.tar.bz2
enhance ModuleInfo.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1642 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/Guid.java6
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java6
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java32
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java12
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java6
5 files changed, 44 insertions, 18 deletions
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java b/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
index 8152e7b..e6fd4c3 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
@@ -48,11 +48,11 @@ public class Guid {
if (MigrationTool.db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database
type = MigrationTool.db.getGuidType(temp);
if (type.matches("Protocol")) {
- mi.protocol.add(temp);
+ mi.protocols.add(temp);
} else if (type.matches("Ppi")) {
- mi.ppi.add(temp);
+ mi.ppis.add(temp);
} else if (type.matches("Guid")) {
- mi.guid.add(temp);
+ mi.guids.add(temp);
}
return temp;
}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
index ee3b36f..016b153 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
@@ -39,9 +39,9 @@ public class MigrationTool {
if (MigrationTool.printModuleInfo) {
MigrationTool.ui.println("\nModule Information : ");
MigrationTool.ui.println("Entrypoint : " + mi.entrypoint);
- show(mi.protocol, "Protocol : ");
- show(mi.ppi, "Ppi : ");
- show(mi.guid, "Guid : ");
+ show(mi.protocols, "Protocol : ");
+ show(mi.ppis, "Ppi : ");
+ show(mi.guids, "Guid : ");
show(mi.hashfuncc, "call : ");
show(mi.hashfuncd, "def : ");
show(mi.hashEFIcall, "EFIcall : ");
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
index cf42d9c..9624eee 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
@@ -15,6 +15,8 @@ package org.tianocore.migration;
import java.io.*;
import java.util.*;
+import org.tianocore.UsageTypes;
+
/*
Class ModuleInfo is built for scanning the source files, it contains all the needed
information and all the temporary data.
@@ -50,10 +52,34 @@ public final class ModuleInfo {
public final Set<String> hashmacro = new HashSet<String>();
public final Set<String> hashrequiredr9libs = new HashSet<String>(); // hashrequiredr9libs is now all added in SourceFileReplacer
- public final Set<String> guid = new HashSet<String>();
- public final Set<String> protocol = new HashSet<String>();
- public final Set<String> ppi = new HashSet<String>();
+ public final Set<String> guids = new HashSet<String>();
+ public final Set<String> protocols = new HashSet<String>();
+ public final Set<String> ppis = new HashSet<String>();
+
+ //-----------------------------------------------------------------------------------//
+ public final boolean addProtocol (String proname, UsageTypes.Enum usage) {
+ protocols.add(proname);
+ return msaowner.addProtocol(proname, usage);
+ }
+
+ public final boolean addPpi (String ppiname, UsageTypes.Enum usage) {
+ ppis.add(ppiname);
+ return msaowner.addPpi(ppiname, usage);
+ }
+
+ public final boolean addGuid (String guidname, UsageTypes.Enum usage) {
+ guids.add(guidname);
+ return msaowner.addGuid(guidname, usage);
+ }
+
+ public final boolean addLibraryClass(String name, UsageTypes.Enum usage) {
+ hashrequiredr9libs.add(name);
+ return msaowner.addLibraryClass(name, usage);
+ }
+
+ //-----------------------------------------------------------------------------------//
+
public final String getModuleType() {
if (moduletype.contains("PEI")) {
return "PEIM";
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java b/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
index 72fa067..589fb56 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
@@ -132,9 +132,9 @@ public class MsaWriter {
while (it.hasNext()) {
addSourceFiles(it.next());
}
- if (!mi.protocol.isEmpty()) {
+ if (!mi.protocols.isEmpty()) {
protocols = msa.addNewProtocols();
- it = mi.protocol.iterator();
+ it = mi.protocols.iterator();
while (it.hasNext()) {
if ((temp = it.next()) != null) {
ProtocolsDocument.Protocols.Protocol pr = protocols.addNewProtocol();
@@ -143,9 +143,9 @@ public class MsaWriter {
}
}
}
- if (!mi.ppi.isEmpty()) {
+ if (!mi.ppis.isEmpty()) {
ppis = msa.addNewPPIs();
- it = mi.ppi.iterator();
+ it = mi.ppis.iterator();
while (it.hasNext()) {
if ((temp = it.next()) != null) {
PPIsDocument.PPIs.Ppi pp = ppis.addNewPpi();
@@ -154,9 +154,9 @@ public class MsaWriter {
}
}
}
- if (!mi.guid.isEmpty()) {
+ if (!mi.guids.isEmpty()) {
guids = msa.addNewGuids();
- it = mi.guid.iterator();
+ it = mi.guids.iterator();
while (it.hasNext()) {
if ((temp = it.next()) != null) {
GuidsDocument.Guids.GuidCNames gcn = guids.addNewGuidCNames();
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java b/Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
index 9d4c85c..01678a3 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
@@ -127,9 +127,9 @@ public final class SourceFileReplacer implements Common.ForDoAll {
wholeline = replaceMacro (wholeline, mi.hashnonlocalmacro);
// Converting guid
- replaceGuid(wholeline, mi.guid, "guid", fileguid);
- replaceGuid(wholeline, mi.ppi, "ppi", fileppi);
- replaceGuid(wholeline, mi.protocol, "protocol", fileprotocol);
+ replaceGuid(wholeline, mi.guids, "guid", fileguid);
+ replaceGuid(wholeline, mi.ppis, "ppi", fileppi);
+ replaceGuid(wholeline, mi.protocols, "protocol", fileprotocol);
// Converting Pei
if (mi.getModuleType().matches("PEIM")) {