Use switch statement to select target triple.
Change-Id: I40a77c816231663bf19c635af69f48f5e10363fc
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc
index 5ab56c4..08c3dfc 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/compilation_unit.cc
@@ -101,19 +101,28 @@
char const* target_triple = NULL;
char const* target_attr = NULL;
- if (insn_set_ == kThumb2) {
+ switch (insn_set_) {
+ case kThumb2:
target_triple = "thumb-none-linux-gnueabi";
target_attr = "+thumb2,+neon,+neonfp,+vfp3";
- } else if (insn_set_ == kArm) {
+ break;
+
+ case kArm:
target_triple = "armv7-none-linux-gnueabi";
target_attr = "+v7,+neon,+neonfp,+vfp3";
- } else if (insn_set_ == kX86) {
+ break;
+
+ case kX86:
target_triple = "i386-pc-linux-gnu";
target_attr = "";
- // } else if (insn_set_ == kMips) {
+ break;
+
+ //case kMips:
// target_triple = "mipsel-unknown-linux";
// target_attr = "";
- } else {
+ // break;
+
+ default:
LOG(FATAL) << "Unknown instruction set: " << insn_set_;
}