Commit efdf4120 by Jim Stichnoth

Subzero: Fix build errors with LLVM trunk.

1. Some explicit conversions between Inst* and InstList::iterator are needed. 2. llvm::sys::PrintStackTraceOnErrorSignal() has a new argument. 3. A previous CL neglected to plumb in SUBZERO_REVISION for the cmake build. BUG= none R=eholk@chromium.org Review URL: https://codereview.chromium.org/2247253005 .
parent 48a568db
......@@ -50,4 +50,11 @@ else()
add_compile_options(-Wno-undefined-var-template)
endif()
execute_process(COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE SUBZERO_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions(-DSUBZERO_REVISION=${SUBZERO_REVISION})
target_link_libraries(pnacl-sz pthread)
......@@ -828,7 +828,7 @@ void Cfg::floatConstantCSE() {
auto Current = Node->getInsts().begin();
auto End = Node->getInsts().end();
while (Current != End) {
CfgUnorderedMap<Constant *, CfgVector<Inst *>> FloatUses;
CfgUnorderedMap<Constant *, CfgVector<InstList::iterator>> FloatUses;
if (llvm::isa<InstCall>(iteratorToInst(Current))) {
++Current;
assert(Current != End);
......@@ -868,7 +868,7 @@ void Cfg::floatConstantCSE() {
InstAssign::create(Node->getCfg(), NewVar, ConstCache[Pair.first]);
Insts.insert(Pair.second[0], Assign);
for (auto *InstUse : Pair.second) {
for (auto InstUse : Pair.second) {
for (SizeT i = 0; i < InstUse->getSrcSize(); ++i) {
if (auto *Const = llvm::dyn_cast<Constant>(InstUse->getSrc(i))) {
if (Const == Pair.first) {
......
......@@ -171,7 +171,11 @@ void dumpBuildAttributes(Ostream &Str) {
void CLCompileServer::run() {
if (BuildDefs::dump()) {
#ifdef PNACL_LLVM
llvm::sys::PrintStackTraceOnErrorSignal();
#else // !PNACL_LLVM
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
#endif // !PNACL_LLVM
}
ClFlags::parseFlags(argc, argv);
ClFlags &Flags = ClFlags::Flags;
......
......@@ -809,7 +809,7 @@ template <typename TraitsType> void TargetX86Base<TraitsType>::doLoadOpt() {
while (!Context.atEnd()) {
Variable *LoadDest = nullptr;
Operand *LoadSrc = nullptr;
Inst *CurInst = Context.getCur();
Inst *CurInst = iteratorToInst(Context.getCur());
Inst *Next = Context.getNextInst();
// Determine whether the current instruction is a Load instruction or
// equivalent.
......@@ -5680,7 +5680,7 @@ template <typename TraitsType>
void TargetX86Base<TraitsType>::doAddressOptOther() {
// Inverts some Icmp instructions which helps doAddressOptLoad later.
// TODO(manasijm): Refactor to unify the conditions for Var0 and Var1
Inst *Instr = Context.getCur();
Inst *Instr = iteratorToInst(Context.getCur());
auto *VMetadata = Func->getVMetadata();
if (auto *Icmp = llvm::dyn_cast<InstIcmp>(Instr)) {
if (llvm::isa<Constant>(Icmp->getSrc(0)) ||
......@@ -5711,7 +5711,7 @@ void TargetX86Base<TraitsType>::doAddressOptOther() {
template <typename TraitsType>
void TargetX86Base<TraitsType>::doAddressOptLoad() {
Inst *Instr = Context.getCur();
Inst *Instr = iteratorToInst(Context.getCur());
Operand *Addr = Instr->getSrc(0);
Variable *Dest = Instr->getDest();
if (auto *OptAddr = computeAddressOpt(Instr, Dest->getType(), Addr)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment