mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Move symbols from the global namespace into (anonymous) namespaces. NFC.
llvm-svn: 294837
This commit is contained in:
parent
6e91ba68a2
commit
bfaa3adccc
@ -567,7 +567,7 @@ public:
|
|||||||
void shrinkTo(unsigned N) { MetadataList.shrinkTo(N); }
|
void shrinkTo(unsigned N) { MetadataList.shrinkTo(N); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Error error(const Twine &Message) {
|
static Error error(const Twine &Message) {
|
||||||
return make_error<StringError>(
|
return make_error<StringError>(
|
||||||
Message, make_error_code(BitcodeError::CorruptedBitcode));
|
Message, make_error_code(BitcodeError::CorruptedBitcode));
|
||||||
}
|
}
|
||||||
|
@ -3739,7 +3739,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
|
|||||||
|
|
||||||
/// Create the "IDENTIFICATION_BLOCK_ID" containing a single string with the
|
/// Create the "IDENTIFICATION_BLOCK_ID" containing a single string with the
|
||||||
/// current llvm version, and a record for the epoch number.
|
/// current llvm version, and a record for the epoch number.
|
||||||
void writeIdentificationBlock(BitstreamWriter &Stream) {
|
static void writeIdentificationBlock(BitstreamWriter &Stream) {
|
||||||
Stream.EnterSubblock(bitc::IDENTIFICATION_BLOCK_ID, 5);
|
Stream.EnterSubblock(bitc::IDENTIFICATION_BLOCK_ID, 5);
|
||||||
|
|
||||||
// Write the "user readable" string identifying the bitcode producer
|
// Write the "user readable" string identifying the bitcode producer
|
||||||
|
@ -24,14 +24,14 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void writeInteger(T Integer, raw_ostream &OS, bool IsLittleEndian) {
|
static void writeInteger(T Integer, raw_ostream &OS, bool IsLittleEndian) {
|
||||||
if (IsLittleEndian != sys::IsLittleEndianHost)
|
if (IsLittleEndian != sys::IsLittleEndianHost)
|
||||||
sys::swapByteOrder(Integer);
|
sys::swapByteOrder(Integer);
|
||||||
OS.write(reinterpret_cast<char *>(&Integer), sizeof(T));
|
OS.write(reinterpret_cast<char *>(&Integer), sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeVariableSizedInteger(uint64_t Integer, size_t Size, raw_ostream &OS,
|
static void writeVariableSizedInteger(uint64_t Integer, size_t Size,
|
||||||
bool IsLittleEndian) {
|
raw_ostream &OS, bool IsLittleEndian) {
|
||||||
if (8 == Size)
|
if (8 == Size)
|
||||||
writeInteger((uint64_t)Integer, OS, IsLittleEndian);
|
writeInteger((uint64_t)Integer, OS, IsLittleEndian);
|
||||||
else if (4 == Size)
|
else if (4 == Size)
|
||||||
@ -44,7 +44,7 @@ void writeVariableSizedInteger(uint64_t Integer, size_t Size, raw_ostream &OS,
|
|||||||
assert(false && "Invalid integer write size.");
|
assert(false && "Invalid integer write size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
static void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
||||||
std::vector<uint8_t> FillData;
|
std::vector<uint8_t> FillData;
|
||||||
FillData.insert(FillData.begin(), Size, 0);
|
FillData.insert(FillData.begin(), Size, 0);
|
||||||
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
||||||
@ -236,7 +236,7 @@ void DWARFYAML::EmitDebugInfo(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) {
|
static void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) {
|
||||||
OS.write(File.Name.data(), File.Name.size());
|
OS.write(File.Name.data(), File.Name.size());
|
||||||
OS.write('\0');
|
OS.write('\0');
|
||||||
encodeULEB128(File.DirIdx, OS);
|
encodeULEB128(File.DirIdx, OS);
|
||||||
@ -245,7 +245,7 @@ void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
||||||
for (const auto LineTable : DI.DebugLines) {
|
for (const auto &LineTable : DI.DebugLines) {
|
||||||
writeInteger((uint32_t)LineTable.TotalLength, OS, DI.IsLittleEndian);
|
writeInteger((uint32_t)LineTable.TotalLength, OS, DI.IsLittleEndian);
|
||||||
uint64_t SizeOfPrologueLength = 4;
|
uint64_t SizeOfPrologueLength = 4;
|
||||||
if (LineTable.TotalLength == UINT32_MAX) {
|
if (LineTable.TotalLength == UINT32_MAX) {
|
||||||
@ -333,9 +333,10 @@ void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
|||||||
|
|
||||||
typedef void (*EmitFuncType)(raw_ostream &, const DWARFYAML::Data &);
|
typedef void (*EmitFuncType)(raw_ostream &, const DWARFYAML::Data &);
|
||||||
|
|
||||||
void EmitDebugSectionImpl(
|
static void
|
||||||
const DWARFYAML::Data &DI, EmitFuncType EmitFunc, StringRef Sec,
|
EmitDebugSectionImpl(const DWARFYAML::Data &DI, EmitFuncType EmitFunc,
|
||||||
StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) {
|
StringRef Sec,
|
||||||
|
StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) {
|
||||||
std::string Data;
|
std::string Data;
|
||||||
raw_string_ostream DebugInfoStream(Data);
|
raw_string_ostream DebugInfoStream(Data);
|
||||||
EmitFunc(DebugInfoStream, DI);
|
EmitFunc(DebugInfoStream, DI);
|
||||||
|
@ -101,10 +101,7 @@ StringRef Hexagon_MC::selectHexagonCPU(const Triple &TT, StringRef CPU) {
|
|||||||
return ArchV;
|
return ArchV;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned HexagonGetLastSlot() {
|
unsigned llvm::HexagonGetLastSlot() { return HexagonItinerariesV4FU::SLOT3; }
|
||||||
return HexagonItinerariesV4FU::SLOT3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -65,10 +65,11 @@ MCAsmBackend *createHexagonAsmBackend(const Target &T,
|
|||||||
|
|
||||||
MCObjectWriter *createHexagonELFObjectWriter(raw_pwrite_stream &OS,
|
MCObjectWriter *createHexagonELFObjectWriter(raw_pwrite_stream &OS,
|
||||||
uint8_t OSABI, StringRef CPU);
|
uint8_t OSABI, StringRef CPU);
|
||||||
} // End llvm namespace
|
|
||||||
|
|
||||||
unsigned HexagonGetLastSlot();
|
unsigned HexagonGetLastSlot();
|
||||||
|
|
||||||
|
} // End llvm namespace
|
||||||
|
|
||||||
// Define symbolic names for Hexagon registers. This defines a mapping from
|
// Define symbolic names for Hexagon registers. This defines a mapping from
|
||||||
// register name to register number.
|
// register name to register number.
|
||||||
//
|
//
|
||||||
|
@ -42,6 +42,7 @@ static cl::opt<bool>
|
|||||||
cl::desc("Enable generating the ISEL instruction."),
|
cl::desc("Enable generating the ISEL instruction."),
|
||||||
cl::init(true), cl::Hidden);
|
cl::init(true), cl::Hidden);
|
||||||
|
|
||||||
|
namespace {
|
||||||
class PPCExpandISEL : public MachineFunctionPass {
|
class PPCExpandISEL : public MachineFunctionPass {
|
||||||
DebugLoc dl;
|
DebugLoc dl;
|
||||||
MachineFunction *MF;
|
MachineFunction *MF;
|
||||||
@ -143,6 +144,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
void PPCExpandISEL::initialize(MachineFunction &MFParam) {
|
void PPCExpandISEL::initialize(MachineFunction &MFParam) {
|
||||||
MF = &MFParam;
|
MF = &MFParam;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
|
namespace {
|
||||||
/// \brief This class holds necessary information to represent an interleaved
|
/// \brief This class holds necessary information to represent an interleaved
|
||||||
/// access group and supports utilities to lower the group into
|
/// access group and supports utilities to lower the group into
|
||||||
/// X86-specific instructions/intrinsics.
|
/// X86-specific instructions/intrinsics.
|
||||||
@ -27,7 +28,6 @@ using namespace llvm;
|
|||||||
/// %wide.vec = load <8 x i32>, <8 x i32>* %ptr
|
/// %wide.vec = load <8 x i32>, <8 x i32>* %ptr
|
||||||
/// %v0 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <0, 2, 4, 6>
|
/// %v0 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <0, 2, 4, 6>
|
||||||
/// %v1 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <1, 3, 5, 7>
|
/// %v1 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <1, 3, 5, 7>
|
||||||
|
|
||||||
class X86InterleavedAccessGroup {
|
class X86InterleavedAccessGroup {
|
||||||
/// \brief Reference to the wide-load instruction of an interleaved access
|
/// \brief Reference to the wide-load instruction of an interleaved access
|
||||||
/// group.
|
/// group.
|
||||||
@ -95,6 +95,7 @@ public:
|
|||||||
/// instructions/intrinsics.
|
/// instructions/intrinsics.
|
||||||
bool lowerIntoOptimizedSequence();
|
bool lowerIntoOptimizedSequence();
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
bool X86InterleavedAccessGroup::isSupported() const {
|
bool X86InterleavedAccessGroup::isSupported() const {
|
||||||
VectorType *ShuffleVecTy = Shuffles[0]->getType();
|
VectorType *ShuffleVecTy = Shuffles[0]->getType();
|
||||||
|
@ -200,6 +200,7 @@ template <> struct DenseMapInfo<const Expression *> {
|
|||||||
};
|
};
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
|
namespace {
|
||||||
class NewGVN : public FunctionPass {
|
class NewGVN : public FunctionPass {
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
const DataLayout *DL;
|
const DataLayout *DL;
|
||||||
@ -380,6 +381,7 @@ private:
|
|||||||
void verifyMemoryCongruency() const;
|
void verifyMemoryCongruency() const;
|
||||||
bool singleReachablePHIPath(const MemoryAccess *, const MemoryAccess *) const;
|
bool singleReachablePHIPath(const MemoryAccess *, const MemoryAccess *) const;
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
char NewGVN::ID = 0;
|
char NewGVN::ID = 0;
|
||||||
|
|
||||||
@ -749,15 +751,6 @@ const StoreExpression *NewGVN::createStoreExpression(StoreInst *SI,
|
|||||||
return E;
|
return E;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utility function to check whether the congruence class has a member other
|
|
||||||
// than the given instruction.
|
|
||||||
bool hasMemberOtherThanUs(const CongruenceClass *CC, Instruction *I) {
|
|
||||||
// Either it has more than one store, in which case it must contain something
|
|
||||||
// other than us (because it's indexed by value), or if it only has one store
|
|
||||||
// right now, that member should not be us.
|
|
||||||
return CC->StoreCount > 1 || CC->Members.count(I) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Expression *NewGVN::performSymbolicStoreEvaluation(Instruction *I) {
|
const Expression *NewGVN::performSymbolicStoreEvaluation(Instruction *I) {
|
||||||
// Unlike loads, we never try to eliminate stores, so we do not check if they
|
// Unlike loads, we never try to eliminate stores, so we do not check if they
|
||||||
// are simple and avoid value numbering them.
|
// are simple and avoid value numbering them.
|
||||||
|
@ -24,8 +24,8 @@ using llvm::yaml::Input;
|
|||||||
using XRayRecordStorage =
|
using XRayRecordStorage =
|
||||||
std::aligned_storage<sizeof(XRayRecord), alignof(XRayRecord)>::type;
|
std::aligned_storage<sizeof(XRayRecord), alignof(XRayRecord)>::type;
|
||||||
|
|
||||||
Error NaiveLogLoader(StringRef Data, XRayFileHeader &FileHeader,
|
static Error NaiveLogLoader(StringRef Data, XRayFileHeader &FileHeader,
|
||||||
std::vector<XRayRecord> &Records) {
|
std::vector<XRayRecord> &Records) {
|
||||||
// FIXME: Maybe deduce whether the data is little or big-endian using some
|
// FIXME: Maybe deduce whether the data is little or big-endian using some
|
||||||
// magic bytes in the beginning of the file?
|
// magic bytes in the beginning of the file?
|
||||||
|
|
||||||
@ -98,8 +98,8 @@ Error NaiveLogLoader(StringRef Data, XRayFileHeader &FileHeader,
|
|||||||
return Error::success();
|
return Error::success();
|
||||||
}
|
}
|
||||||
|
|
||||||
Error YAMLLogLoader(StringRef Data, XRayFileHeader &FileHeader,
|
static Error YAMLLogLoader(StringRef Data, XRayFileHeader &FileHeader,
|
||||||
std::vector<XRayRecord> &Records) {
|
std::vector<XRayRecord> &Records) {
|
||||||
|
|
||||||
// Load the documents from the MappedFile.
|
// Load the documents from the MappedFile.
|
||||||
YAMLXRayTrace Trace;
|
YAMLXRayTrace Trace;
|
||||||
|
Loading…
Reference in New Issue
Block a user