aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2014-06-29 15:46:09 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-24 11:55:39 -0700
commitf50cfd5c757ddea34d6e2b867cb73c1f3c23c4f3 (patch)
tree76045909683da086771f3d02a6dde2c3a37e07b4
parentb6c0bb74a4f77b0aace74cf1dc88d4c3755661a4 (diff)
downloadllvm-f50cfd5c757ddea34d6e2b867cb73c1f3c23c4f3.tar.gz
[ndk][mips] Old binutils does not support nan directive.
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 50c0441e0dd..ffa2fe22694 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -42,6 +42,7 @@
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
@@ -53,6 +54,8 @@ using namespace llvm;
#define DEBUG_TYPE "mips-asm-printer"
+cl::opt<bool> NoNanDirective("mips-no-nan-directive", cl::init(false));
+
MipsTargetStreamer &MipsAsmPrinter::getTargetStreamer() const {
return static_cast<MipsTargetStreamer &>(*OutStreamer.getTargetStreamer());
}
@@ -709,8 +712,9 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
// NaN: At the moment we only support:
// 1. .nan legacy (default)
// 2. .nan 2008
- Subtarget->isNaN2008() ? getTargetStreamer().emitDirectiveNaN2008()
- : getTargetStreamer().emitDirectiveNaNLegacy();
+ if (!NoNanDirective)
+ Subtarget->isNaN2008() ? getTargetStreamer().emitDirectiveNaN2008()
+ : getTargetStreamer().emitDirectiveNaNLegacy();
// TODO: handle O64 ABI