#include "llvm/Support/MathExtras.h"
#include "llvm/Support/OutputBuffer.h"
#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstring>
using namespace llvm;
/// AddMachOWriter - Concrete function to add the Mach-O writer to the function
/// pass manager.
MachineCodeEmitter *llvm::AddMachOWriter(PassManagerBase &PM,
- std::ostream &O,
+ raw_ostream &O,
TargetMachine &TM) {
MachOWriter *MOW = new MachOWriter(O, TM);
PM.add(MOW);
//===----------------------------------------------------------------------===//
char MachOWriter::ID = 0;
-MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
+MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm)
+ : MachineFunctionPass(&ID), O(o), TM(tm) {
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
isLittleEndian = TM.getTargetData()->isLittleEndian();
break;
}
case Type::FloatTyID: {
- uint32_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+ uint32_t val = cast<ConstantFP>(PC)->getValueAPF().bitcastToAPInt().
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_32(val);
break;
}
case Type::DoubleTyID: {
- uint64_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+ uint64_t val = cast<ConstantFP>(PC)->getValueAPF().bitcastToAPInt().
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_64(val);