[llvm-commits] [llvm] r117111 - in /llvm/trunk: lib/Analysis/RegionInfo.cpp lib/MC/MCDisassembler/EDOperand.cpp lib/Target/PTX/PTXISelLowering.cpp lib/VMCore/PassRegistry.cpp lib/VMCore/Verifier.cpp utils/TableGen/X86DisassemblerTables.cpp
Benjamin Kramer
benny.kra at googlemail.com
Fri Oct 22 10:35:07 PDT 2010
Author: d0k
Date: Fri Oct 22 12:35:07 2010
New Revision: 117111
URL: http://llvm.org/viewvc/llvm-project?rev=117111&view=rev
Log:
Make some symbols static, move classes into anonymous namespaces.
Modified:
llvm/trunk/lib/Analysis/RegionInfo.cpp
llvm/trunk/lib/MC/MCDisassembler/EDOperand.cpp
llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp
llvm/trunk/lib/VMCore/PassRegistry.cpp
llvm/trunk/lib/VMCore/Verifier.cpp
llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp
Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/RegionInfo.cpp Fri Oct 22 12:35:07 2010
@@ -45,7 +45,7 @@
/// PrintStyle - Print region in difference ways.
enum PrintStyle { PrintNone, PrintBB, PrintRN };
-cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
+static cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
cl::desc("style of printing regions"),
cl::values(
clEnumValN(PrintNone, "none", "print no details"),
Modified: llvm/trunk/lib/MC/MCDisassembler/EDOperand.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/EDOperand.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/EDOperand.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/EDOperand.cpp Fri Oct 22 12:35:07 2010
@@ -260,23 +260,20 @@
}
#ifdef __BLOCKS__
-struct RegisterReaderWrapper {
- EDOperand::EDRegisterBlock_t regBlock;
-};
+namespace {
+ struct RegisterReaderWrapper {
+ EDOperand::EDRegisterBlock_t regBlock;
+ };
+}
-int readerWrapperCallback(uint64_t *value,
- unsigned regID,
- void *arg) {
- struct RegisterReaderWrapper *wrapper = (struct RegisterReaderWrapper *)arg;
+static int readerWrapperCallback(uint64_t *value, unsigned regID, void *arg) {
+ RegisterReaderWrapper *wrapper = (RegisterReaderWrapper *)arg;
return wrapper->regBlock(value, regID);
}
-int EDOperand::evaluate(uint64_t &result,
- EDRegisterBlock_t regBlock) {
- struct RegisterReaderWrapper wrapper;
+int EDOperand::evaluate(uint64_t &result, EDRegisterBlock_t regBlock) {
+ RegisterReaderWrapper wrapper;
wrapper.regBlock = regBlock;
- return evaluate(result,
- readerWrapperCallback,
- (void*)&wrapper);
+ return evaluate(result, readerWrapperCallback, (void*)&wrapper);
}
#endif
Modified: llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp Fri Oct 22 12:35:07 2010
@@ -44,7 +44,8 @@
// Calling Convention Implementation
//===----------------------------------------------------------------------===//
-static struct argmap_entry {
+namespace {
+struct argmap_entry {
MVT::SimpleValueType VT;
TargetRegisterClass *RC;
TargetRegisterClass::iterator loc;
@@ -52,12 +53,13 @@
argmap_entry(MVT::SimpleValueType _VT, TargetRegisterClass *_RC)
: VT(_VT), RC(_RC), loc(_RC->begin()) {}
- void reset(void) { loc = RC->begin(); }
- bool operator==(MVT::SimpleValueType _VT) { return VT == _VT; }
+ void reset() { loc = RC->begin(); }
+ bool operator==(MVT::SimpleValueType _VT) const { return VT == _VT; }
} argmap[] = {
argmap_entry(MVT::i1, PTX::PredsRegisterClass),
argmap_entry(MVT::i32, PTX::RRegs32RegisterClass)
};
+} // end anonymous namespace
static SDValue lower_kernel_argument(int i,
SDValue Chain,
Modified: llvm/trunk/lib/VMCore/PassRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassRegistry.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassRegistry.cpp (original)
+++ llvm/trunk/lib/VMCore/PassRegistry.cpp Fri Oct 22 12:35:07 2010
@@ -40,6 +40,7 @@
// PassRegistryImpl
//
+namespace {
struct PassRegistryImpl {
/// PassInfoMap - Keep track of the PassInfo object for each registered pass.
typedef DenseMap<const void*, const PassInfo*> MapType;
@@ -57,6 +58,7 @@
std::vector<const PassInfo*> ToFree;
std::vector<PassRegistrationListener*> Listeners;
};
+} // end anonymous namespace
void *PassRegistry::getImpl() const {
if (!pImpl)
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Oct 22 12:35:07 2010
@@ -106,7 +106,7 @@
char PreVerifier::ID = 0;
INITIALIZE_PASS(PreVerifier, "preverify", "Preliminary module verification",
false, false)
-char &PreVerifyID = PreVerifier::ID;
+static char &PreVerifyID = PreVerifier::ID;
namespace {
class TypeSet : public AbstractTypeUser {
Modified: llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp?rev=117111&r1=117110&r2=117111&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp (original)
+++ llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp Fri Oct 22 12:35:07 2010
@@ -365,7 +365,7 @@
uint32_t &i2,
ContextDecision &decision,
const char* name) const {
- o2.indent(i2) << "struct ContextDecision " << name << " = {" << "\n";
+ o2.indent(i2) << "static struct ContextDecision " << name << " = {\n";
i2++;
o2.indent(i2) << "{ /* opcodeDecisions */" << "\n";
i2++;
@@ -392,8 +392,7 @@
void DisassemblerTables::emitInstructionInfo(raw_ostream &o, uint32_t &i)
const {
- o.indent(i * 2) << "struct InstructionSpecifier ";
- o << INSTRUCTIONS_STR << "[";
+ o.indent(i * 2) << "static struct InstructionSpecifier " INSTRUCTIONS_STR "[";
o << InstructionSpecifiers.size();
o << "] = {" << "\n";
@@ -456,8 +455,7 @@
void DisassemblerTables::emitContextTable(raw_ostream &o, uint32_t &i) const {
uint16_t index;
- o.indent(i * 2) << "InstructionContext ";
- o << CONTEXTS_STR << "[256] = {" << "\n";
+ o.indent(i * 2) << "static InstructionContext " CONTEXTS_STR "[256] = {\n";
i++;
for (index = 0; index < 256; ++index) {
More information about the llvm-commits
mailing list