@Test public void testGetTarget() throws Exception { Target arm = Target.getTarget("arm"); assertNotNull(arm); assertEquals("arm", arm.getName()); assertEquals("ARM", arm.getDescription()); Target x86 = Target.getTarget("x86"); assertNotNull(x86); assertEquals("x86", x86.getName()); assertEquals("32-bit X86: Pentium-Pro and above", x86.getDescription()); try { Target.getTarget("foobar"); fail("LlvmException expected"); } catch (LlvmException e) {} }
public static Target getTarget(String name) { if (name == null) { throw new NullPointerException("name"); } TargetRef ref = LLVM.GetFirstTarget(); while (ref != null) { if (name.equals(LLVM.GetTargetName(ref))) { return new Target(ref); } ref = LLVM.GetNextTarget(ref); } throw new LlvmException("No target with name '" + name + "' found"); }
Target { public static Target getTarget(String name) { if (name == null) { throw new NullPointerException("name"); } TargetRef ref = LLVM.GetFirstTarget(); while (ref != null) { if (name.equals(LLVM.GetTargetName(ref))) { return new Target(ref); } ref = LLVM.GetNextTarget(ref); } throw new LlvmException("No target with name '" + name + "' found"); } }
Target { public static Target getTarget(String name) { if (name == null) { throw new NullPointerException("name"); } TargetRef ref = LLVM.GetFirstTarget(); while (ref != null) { if (name.equals(LLVM.GetTargetName(ref))) { return new Target(ref); } ref = LLVM.GetNextTarget(ref); } throw new LlvmException("No target with name '" + name + "' found"); } Target(TargetRef ref); }
Target { public static Target getTarget(String name) { if (name == null) { throw new NullPointerException("name"); } TargetRef ref = LLVM.GetFirstTarget(); while (ref != null) { if (name.equals(LLVM.GetTargetName(ref))) { return new Target(ref); } ref = LLVM.GetNextTarget(ref); } throw new LlvmException("No target with name '" + name + "' found"); } Target(TargetRef ref); String getName(); String getDescription(); boolean hasJIT(); boolean hasTargetMachine(); boolean hasAsmBackend(); TargetMachine createTargetMachine(String triple); TargetMachine createTargetMachine(String triple, String cpu, String features, 
            CodeGenOptLevel optLevel, RelocMode relocMode, CodeModel codeModel); @Override int hashCode(); @Override boolean equals(Object obj); static String getHostTriple(); static Target getHostTarget(); static Target getTarget(String name); static Target lookupTarget(String triple); static List<Target> getTargets(); static Map<String, Target> getTargetsMap(); }
Target { public static Target getTarget(String name) { if (name == null) { throw new NullPointerException("name"); } TargetRef ref = LLVM.GetFirstTarget(); while (ref != null) { if (name.equals(LLVM.GetTargetName(ref))) { return new Target(ref); } ref = LLVM.GetNextTarget(ref); } throw new LlvmException("No target with name '" + name + "' found"); } Target(TargetRef ref); String getName(); String getDescription(); boolean hasJIT(); boolean hasTargetMachine(); boolean hasAsmBackend(); TargetMachine createTargetMachine(String triple); TargetMachine createTargetMachine(String triple, String cpu, String features, 
            CodeGenOptLevel optLevel, RelocMode relocMode, CodeModel codeModel); @Override int hashCode(); @Override boolean equals(Object obj); static String getHostTriple(); static Target getHostTarget(); static Target getTarget(String name); static Target lookupTarget(String triple); static List<Target> getTargets(); static Map<String, Target> getTargetsMap();  }