diff options
author | Renato Golin <renato.golin@linaro.org> | 2013-05-19 20:10:10 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2013-05-19 20:10:10 +0000 |
commit | cf6979d8961b37fe64ae6e88a67b23078253ed75 (patch) | |
tree | a20bd7e2343c3416465cc5a70072ab402c477da1 /llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h | |
parent | 3320e5a92117b0651b397fc00a789786e18d6968 (diff) | |
download | bcm5719-llvm-cf6979d8961b37fe64ae6e88a67b23078253ed75.tar.gz bcm5719-llvm-cf6979d8961b37fe64ae6e88a67b23078253ed75.zip |
SubArch support in MCJIT unittest
llvm-svn: 182220
Diffstat (limited to 'llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h')
-rw-r--r-- | llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h index 8160a186f41..7b6e39fb238 100644 --- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h +++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h @@ -49,11 +49,23 @@ protected: /// Returns true if the host architecture is known to support MCJIT bool ArchSupportsMCJIT() { Triple Host(HostTriple); + // If ARCH is not supported, bail if (std::find(SupportedArchs.begin(), SupportedArchs.end(), Host.getArch()) - == SupportedArchs.end()) { + == SupportedArchs.end()) return false; - } - return true; + + // If ARCH is supported and has no specific sub-arch support + if (std::find(HasSubArchs.begin(), HasSubArchs.end(), Host.getArch()) + == HasSubArchs.end()) + return true; + + // If ARCH has sub-arch support, find it + SmallVectorImpl<std::string>::const_iterator I = SupportedSubArchs.begin(); + for(; I != SupportedSubArchs.end(); ++I) + if (Host.getArchName().startswith(I->c_str())) + return true; + + return false; } /// Returns true if the host OS is known to support MCJIT @@ -68,6 +80,8 @@ protected: std::string HostTriple; SmallVector<Triple::ArchType, 4> SupportedArchs; + SmallVector<Triple::ArchType, 1> HasSubArchs; + SmallVector<std::string, 2> SupportedSubArchs; // We need to own the memory SmallVector<Triple::OSType, 4> UnsupportedOSs; }; |