mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Use the autoconf macro John wrote
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b716f66ad
commit
4946a8cf56
@ -20,13 +20,10 @@
|
|||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
#include "Config/config.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: This should be autoconf'd! */
|
|
||||||
#define HAS_C99_HEXADECIMAL_CONSTANTS 1
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CWriter : public Pass, public InstVisitor<CWriter> {
|
class CWriter : public Pass, public InstVisitor<CWriter> {
|
||||||
std::ostream &Out;
|
std::ostream &Out;
|
||||||
@ -341,7 +338,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
|
|||||||
// only deal in IEEE FP).
|
// only deal in IEEE FP).
|
||||||
//
|
//
|
||||||
static bool isFPCSafeToPrint(const ConstantFP *CFP) {
|
static bool isFPCSafeToPrint(const ConstantFP *CFP) {
|
||||||
#if HAS_C99_HEXADECIMAL_CONSTANTS
|
#if HAVE_PRINTF_A
|
||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
sprintf(Buffer, "%a", CFP->getValue());
|
sprintf(Buffer, "%a", CFP->getValue());
|
||||||
|
|
||||||
@ -457,7 +454,7 @@ void CWriter::printConstant(Constant *CPV) {
|
|||||||
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
|
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
|
||||||
<< "*)&FPConstant" << I->second << ")";
|
<< "*)&FPConstant" << I->second << ")";
|
||||||
} else {
|
} else {
|
||||||
#if HAS_C99_HEXADECIMAL_CONSTANTS
|
#if HAVE_PRINTF_A
|
||||||
// Print out the constant as a floating point number.
|
// Print out the constant as a floating point number.
|
||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
sprintf(Buffer, "%a", FPC->getValue());
|
sprintf(Buffer, "%a", FPC->getValue());
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
#include "Config/config.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: This should be autoconf'd! */
|
|
||||||
#define HAS_C99_HEXADECIMAL_CONSTANTS 1
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CWriter : public Pass, public InstVisitor<CWriter> {
|
class CWriter : public Pass, public InstVisitor<CWriter> {
|
||||||
std::ostream &Out;
|
std::ostream &Out;
|
||||||
@ -341,7 +338,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
|
|||||||
// only deal in IEEE FP).
|
// only deal in IEEE FP).
|
||||||
//
|
//
|
||||||
static bool isFPCSafeToPrint(const ConstantFP *CFP) {
|
static bool isFPCSafeToPrint(const ConstantFP *CFP) {
|
||||||
#if HAS_C99_HEXADECIMAL_CONSTANTS
|
#if HAVE_PRINTF_A
|
||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
sprintf(Buffer, "%a", CFP->getValue());
|
sprintf(Buffer, "%a", CFP->getValue());
|
||||||
|
|
||||||
@ -457,7 +454,7 @@ void CWriter::printConstant(Constant *CPV) {
|
|||||||
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
|
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
|
||||||
<< "*)&FPConstant" << I->second << ")";
|
<< "*)&FPConstant" << I->second << ")";
|
||||||
} else {
|
} else {
|
||||||
#if HAS_C99_HEXADECIMAL_CONSTANTS
|
#if HAVE_PRINTF_A
|
||||||
// Print out the constant as a floating point number.
|
// Print out the constant as a floating point number.
|
||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
sprintf(Buffer, "%a", FPC->getValue());
|
sprintf(Buffer, "%a", FPC->getValue());
|
||||||
|
Loading…
Reference in New Issue
Block a user