summaryrefslogtreecommitdiff
path: root/compiler/llvm/llvm_compilation_unit.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2014-04-16 15:18:13 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-04-16 15:18:14 +0000
commitb94fae66dac14be955c68028447cdad84ee22bf9 (patch)
treec6af9a1d373b4f8763c9001b8e81c9ae772011ab /compiler/llvm/llvm_compilation_unit.cc
parent2faf284e072230d4fd447955fa72ac4d9a3b51a0 (diff)
parentaf13ad9fd18b6f75fe82e7995224c55654594f93 (diff)
Merge "Centralize instruction-set pointer-size, alignment, 64b-width code in instruction_set.h/cc"
Diffstat (limited to 'compiler/llvm/llvm_compilation_unit.cc')
-rw-r--r--compiler/llvm/llvm_compilation_unit.cc19
1 files changed, 2 insertions, 17 deletions
diff --git a/compiler/llvm/llvm_compilation_unit.cc b/compiler/llvm/llvm_compilation_unit.cc
index 1d027f9d3b..fe609593dc 100644
--- a/compiler/llvm/llvm_compilation_unit.cc
+++ b/compiler/llvm/llvm_compilation_unit.cc
@@ -314,23 +314,8 @@ bool LlvmCompilationUnit::MaterializeToRawOStream(::llvm::raw_ostream& out_strea
// section if the section alignment is greater than kArchAlignment.
void LlvmCompilationUnit::CheckCodeAlign(uint32_t align) const {
InstructionSet insn_set = GetInstructionSet();
- switch (insn_set) {
- case kThumb2:
- case kArm:
- CHECK_LE(align, static_cast<uint32_t>(kArmAlignment));
- break;
-
- case kX86:
- CHECK_LE(align, static_cast<uint32_t>(kX86Alignment));
- break;
-
- case kMips:
- CHECK_LE(align, static_cast<uint32_t>(kMipsAlignment));
- break;
-
- default:
- LOG(FATAL) << "Unknown instruction set: " << insn_set;
- }
+ size_t insn_set_align = GetInstructionSetAlignment(insn_set);
+ CHECK_LE(align, static_cast<uint32_t>(insn_set_align));
}