Commit dddaf9ca by Jim Stichnoth

Subzero: Fix the g++ build (e.g. Windows).

parent 2a7fcbb4
......@@ -55,6 +55,7 @@ void ELFSymbolTableSection::createDefinedSym(const IceString &Name,
else
Unique = GlobalSymbols.insert(std::make_pair(Key, NewSymbol)).second;
assert(Unique);
(void)Unique;
}
void ELFSymbolTableSection::noteUndefinedSym(const IceString &Name,
......
......@@ -26,12 +26,14 @@
#include "IceTimerTree.h"
#include "IceTypes.h"
template <> struct std::hash<Ice::RelocatableTuple> {
std::size_t operator()(const Ice::RelocatableTuple &Key) const {
return std::hash<Ice::IceString>()(Key.Name) +
std::hash<Ice::RelocOffsetT>()(Key.Offset);
namespace std {
template <> struct hash<Ice::RelocatableTuple> {
size_t operator()(const Ice::RelocatableTuple &Key) const {
return hash<Ice::IceString>()(Key.Name) +
hash<Ice::RelocOffsetT>()(Key.Offset);
}
};
} // end of namespace std
namespace Ice {
......
......@@ -128,8 +128,17 @@ public:
// result in any native instructions, and a target-specific
// instruction results in a single native instruction.
virtual uint32_t getEmitInstCount() const { return 0; }
virtual void emit(const Cfg *Func) const = 0;
virtual void emitIAS(const Cfg *Func) const = 0;
// TODO(stichnot): Change Inst back to abstract once the g++ build
// issue is fixed. llvm::ilist<Ice::Inst> doesn't work under g++
// because the resize(size_t, Ice::Inst) method is incorrectly
// declared and thus doesn't allow the abstract class Ice::Inst.
// The method should be declared resize(size_t, const Ice::Inst &).
// virtual void emit(const Cfg *Func) const = 0;
// virtual void emitIAS(const Cfg *Func) const = 0;
virtual void emit(const Cfg *) const {
llvm_unreachable("emit on abstract class");
}
virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const;
virtual void dumpExtras(const Cfg *Func) const;
void dumpDecorated(const Cfg *Func) const;
......@@ -835,11 +844,12 @@ protected:
} // end of namespace Ice
namespace llvm {
// Override the default ilist traits so that Inst's private ctor and
// deleted dtor aren't invoked.
template <>
struct llvm::ilist_traits<Ice::Inst>
: public llvm::ilist_default_traits<Ice::Inst> {
struct ilist_traits<Ice::Inst> : public ilist_default_traits<Ice::Inst> {
Ice::Inst *createSentinel() const {
return static_cast<Ice::Inst *>(&Sentinel);
}
......@@ -853,4 +863,6 @@ private:
mutable ilist_half_node<Ice::Inst> Sentinel;
};
} // end of namespace llvm
#endif // SUBZERO_SRC_ICEINST_H
......@@ -253,6 +253,7 @@ const Inst *VariableTracking::getFirstDefinition() const {
assert(FirstOrSingleDefinition);
return FirstOrSingleDefinition;
}
return NULL;
}
const Inst *VariableTracking::getSingleDefinition() const {
......@@ -265,6 +266,7 @@ const Inst *VariableTracking::getSingleDefinition() const {
assert(FirstOrSingleDefinition);
return FirstOrSingleDefinition;
}
return NULL;
}
void VariablesMetadata::init(MetadataKind TrackingKind) {
......
......@@ -1681,6 +1681,8 @@ private:
Cond = Ice::InstIcmp::Sle;
return true;
default:
// Make sure Cond is always initialized.
Cond = static_cast<Ice::InstIcmp::ICond>(0);
return false;
}
}
......@@ -1739,6 +1741,8 @@ private:
Cond = Ice::InstFcmp::True;
return true;
default:
// Make sure Cond is always initialized.
Cond = static_cast<Ice::InstFcmp::FCond>(0);
return false;
}
}
......
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