[Hexagon] Fix compilation error with GCC 6

Compiling Hexagon target with GCC 6 produces "error: should have been
declared inside" due to GCC PR c++/69657 which was merged.

Properly wrapping operator<<() definitions within the namespace llvm
fixes the issue.

Author: domagoj.stolfa

Differential Revision: http://reviews.llvm.org/D17281


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Krzysztof Parzyszek 2016-02-18 16:10:27 +00:00
parent bfe4c5ff7e
commit 5270eb997f

View File

@ -84,7 +84,8 @@ namespace {
}
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::BitValue &BV) {
namespace llvm {
raw_ostream &operator<<(raw_ostream &OS, const BT::BitValue &BV) {
switch (BV.Type) {
case BT::BitValue::Top:
OS << 'T';
@ -102,7 +103,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::BitValue &BV) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::RegisterCell &RC) {
raw_ostream &operator<<(raw_ostream &OS, const BT::RegisterCell &RC) {
unsigned n = RC.Bits.size();
OS << "{ w:" << n;
// Instead of printing each bit value individually, try to group them
@ -166,6 +167,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::RegisterCell &RC) {
return OS;
}
}
BitTracker::BitTracker(const MachineEvaluator &E, MachineFunction &F)
: Trace(false), ME(E), MF(F), MRI(F.getRegInfo()), Map(*new CellMapType) {}