Fix build with LLVM 3.1 ToT
This commit is contained in:
2
Makefile
2
Makefile
@@ -13,7 +13,7 @@ ARCH_TYPE = $(shell arch)
|
||||
ifeq ($(shell llvm-config --version), 3.1svn)
|
||||
LLVM_LIBS=-lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker \
|
||||
-lLLVMArchive -lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT -lLLVMipo \
|
||||
-lLLVMBitWriter -lLLVMTableGen -lLLVMCBackendInfo \
|
||||
-lLLVMBitWriter -lLLVMTableGen \
|
||||
-lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG \
|
||||
-lLLVMAsmPrinter -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info \
|
||||
-lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCDisassembler -lLLVMMCParser \
|
||||
|
||||
14
cbackend.cpp
14
cbackend.cpp
@@ -933,6 +933,20 @@ void CWriter::printConstantDataSequential(ConstantDataSequential *CDS,
|
||||
}
|
||||
#endif // LLVM_3_1svn
|
||||
|
||||
#ifdef LLVM_3_1svn
|
||||
static inline std::string ftostr(const APFloat& V) {
|
||||
std::string Buf;
|
||||
if (&V.getSemantics() == &APFloat::IEEEdouble) {
|
||||
raw_string_ostream(Buf) << V.convertToDouble();
|
||||
return Buf;
|
||||
} else if (&V.getSemantics() == &APFloat::IEEEsingle) {
|
||||
raw_string_ostream(Buf) << (double)V.convertToFloat();
|
||||
return Buf;
|
||||
}
|
||||
return "<unknown format in ftostr>"; // error
|
||||
}
|
||||
#endif // LLVM_3_1svn
|
||||
|
||||
// isFPCSafeToPrint - Returns true if we may assume that CFP may be written out
|
||||
// textually as a double (rather than as a reference to a stack-allocated
|
||||
// variable). We decide this by converting CFP to a string and back into a
|
||||
|
||||
Reference in New Issue
Block a user