diff options
author | Sven Gothel <[email protected]> | 2015-03-06 07:39:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-06 07:39:30 +0100 |
commit | 4183867b055e99762d9b1a9163012657738be31a (patch) | |
tree | a35cf0c4d399bd8a71c4a2de717209b0ef0eb94d /src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java | |
parent | 54dcf4271abf188585b248473cab11b0b4d93854 (diff) |
Bug 1134 - Utilize AliasedSymbol where required in *Configuration; Clarify ProcAddressEmitter criteria
Diffstat (limited to 'src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java index 0c5692b..50334c6 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java @@ -38,7 +38,11 @@ */ package com.jogamp.gluegen.procaddress; +import static java.util.logging.Level.INFO; + import com.jogamp.gluegen.JavaConfiguration; +import com.jogamp.gluegen.cgram.types.AliasedSymbol; + import java.io.*; import java.text.*; import java.util.*; @@ -269,8 +273,15 @@ public class ProcAddressConfiguration extends JavaConfiguration { return tableClassName; } - public boolean skipProcAddressGen(final String name) { - return skipProcAddressGen.contains(name); + public boolean skipProcAddressGen(final AliasedSymbol symbol) { + if ( skipProcAddressGen.contains( symbol.getName() ) || + oneInSet(skipProcAddressGen, symbol.getAliasedNames()) + ) + { + LOG.log(INFO, "Skip ProcAddress: {0}", symbol.getAliasedString()); + return true; + } + return false; } public boolean isForceProcAddressGen4All() { @@ -298,9 +309,25 @@ public class ProcAddressConfiguration extends JavaConfiguration { return procAddressNameConverter.convert(funcName); } - public boolean forceProcAddressGen(final String funcName) { - return forceProcAddressGen4All || forceProcAddressGenSet.contains(funcName); + public boolean forceProcAddressGen(final AliasedSymbol symbol) { + if( forceProcAddressGen4All ) { + if(!forceProcAddressGen4AllOnce) { + forceProcAddressGen4AllOnce = true; + LOG.log(INFO, "Force ALL ProcAddress"); + } + return true; + } + + if ( forceProcAddressGenSet.contains( symbol.getName() ) || + oneInSet(forceProcAddressGenSet, symbol.getAliasedNames()) + ) + { + LOG.log(INFO, "Force ProcAddress: {0}", symbol.getAliasedString()); + return true; + } + return false; } + private static boolean forceProcAddressGen4AllOnce = false; public void addForceProcAddressGen(final String funcName) { forceProcAddressGen.add(funcName); @@ -311,11 +338,15 @@ public class ProcAddressConfiguration extends JavaConfiguration { localProcAddressCallingConventionMap.put(funcName, callingConvention); } - public String getLocalProcAddressCallingConvention(final String funcName) { - if (isLocalProcAddressCallingConvention4All()) { + public String getLocalProcAddressCallingConvention(final AliasedSymbol symbol) { + if ( isLocalProcAddressCallingConvention4All() ) { return getLocalProcAddressCallingConvention4All(); } - return localProcAddressCallingConventionMap.get(funcName); + final String res = localProcAddressCallingConventionMap.get(symbol.getName()); + if( null != res ) { + return res; + } + return oneInMap(localProcAddressCallingConventionMap, symbol.getAliasedNames()); } public boolean isLocalProcAddressCallingConvention4All() { |