summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2012-03-01 13:53:02 +0800
committerShih-wei Liao <sliao@google.com>2012-03-01 11:51:51 -0800
commit8ee03b5f4fce36047927191f7cc48c0ed2382445 (patch)
tree69b9cc5ea456b628f282c0515b8bd75f98424d77 /src
parentbfe4ea4463848ccb91e0848d35d79539d52c627a (diff)
downloadart-8ee03b5f4fce36047927191f7cc48c0ed2382445.zip
art-8ee03b5f4fce36047927191f7cc48c0ed2382445.tar.gz
art-8ee03b5f4fce36047927191f7cc48c0ed2382445.tar.bz2
Use switch statement to select target triple.
Change-Id: I40a77c816231663bf19c635af69f48f5e10363fc
Diffstat (limited to 'src')
-rw-r--r--src/compiler_llvm/compilation_unit.cc19
1 files changed, 14 insertions, 5 deletions
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 @@ bool CompilationUnit::Materialize() {
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_;
}