#include "LegalizeTypes.h"
#include "llvm/CallingConv.h"
+#include "llvm/Target/TargetData.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
static cl::opt<bool>
if (I->getNodeId() != Processed) {
if (Mapped != 0) {
- cerr << "Unprocessed value in a map!";
+ errs() << "Unprocessed value in a map!";
Failed = true;
}
} else if (isTypeLegal(Res.getValueType()) || IgnoreNodeResults(I)) {
if (Mapped > 1) {
- cerr << "Value with legal type was transformed!";
+ errs() << "Value with legal type was transformed!";
Failed = true;
}
} else {
if (Mapped == 0) {
- cerr << "Processed value not in any map!";
+ errs() << "Processed value not in any map!";
Failed = true;
} else if (Mapped & (Mapped - 1)) {
- cerr << "Value in multiple maps!";
+ errs() << "Value in multiple maps!";
Failed = true;
}
}
if (Failed) {
if (Mapped & 1)
- cerr << " ReplacedValues";
+ errs() << " ReplacedValues";
if (Mapped & 2)
- cerr << " PromotedIntegers";
+ errs() << " PromotedIntegers";
if (Mapped & 4)
- cerr << " SoftenedFloats";
+ errs() << " SoftenedFloats";
if (Mapped & 8)
- cerr << " ScalarizedVectors";
+ errs() << " ScalarizedVectors";
if (Mapped & 16)
- cerr << " ExpandedIntegers";
+ errs() << " ExpandedIntegers";
if (Mapped & 32)
- cerr << " ExpandedFloats";
+ errs() << " ExpandedFloats";
if (Mapped & 64)
- cerr << " SplitVectors";
+ errs() << " SplitVectors";
if (Mapped & 128)
- cerr << " WidenedVectors";
- cerr << "\n";
+ errs() << " WidenedVectors";
+ errs() << "\n";
llvm_unreachable(0);
}
}
}
if (i == NumOperands) {
- DEBUG(cerr << "Legally typed node: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Legally typed node: "; N->dump(&DAG); errs() << "\n");
}
}
NodeDone:
if (!IgnoreNodeResults(I))
for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
if (!isTypeLegal(I->getValueType(i))) {
- cerr << "Result type " << i << " illegal!\n";
+ errs() << "Result type " << i << " illegal!\n";
Failed = true;
}
for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
if (!IgnoreNodeResults(I->getOperand(i).getNode()) &&
!isTypeLegal(I->getOperand(i).getValueType())) {
- cerr << "Operand type " << i << " illegal!\n";
+ errs() << "Operand type " << i << " illegal!\n";
Failed = true;
}
if (I->getNodeId() != Processed) {
if (I->getNodeId() == NewNode)
- cerr << "New node not analyzed?\n";
+ errs() << "New node not analyzed?\n";
else if (I->getNodeId() == Unanalyzed)
- cerr << "Unanalyzed node not noticed?\n";
+ errs() << "Unanalyzed node not noticed?\n";
else if (I->getNodeId() > 0)
- cerr << "Operand not processed?\n";
+ errs() << "Operand not processed?\n";
else if (I->getNodeId() == ReadyToProcess)
- cerr << "Not added to worklist?\n";
+ errs() << "Not added to worklist?\n";
Failed = true;
}
if (Failed) {
- I->dump(&DAG); cerr << "\n";
+ I->dump(&DAG); errs() << "\n";
llvm_unreachable(0);
}
}
namespace {
/// NodeUpdateListener - This class is a DAGUpdateListener that listens for
/// updates to nodes and recomputes their ready state.
- class VISIBILITY_HIDDEN NodeUpdateListener :
- public SelectionDAG::DAGUpdateListener {
+ class NodeUpdateListener : public SelectionDAG::DAGUpdateListener {
DAGTypeLegalizer &DTL;
SmallSetVector<SDNode*, 16> &NodesToAnalyze;
public:
const Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
std::pair<SDValue,SDValue> CallInfo =
TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false,
- false, 0, CallingConv::C, false,
+ false, 0, TLI.getLibcallCallingConv(LC), false,
/*isReturnValueUsed=*/true,
Callee, Args, DAG, dl);
return CallInfo.first;