Skip to content

Commit

Permalink
Fix uses of reserved identifiers starting with an underscore followed…
Browse files Browse the repository at this point in the history
… by an uppercase letter

This covers essentially all of llvm's headers and libs. One or two weird
cases I wasn't sure were worth/appropriate to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232394 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Mar 16, 2015
1 parent ed7120e commit 7610ba7
Show file tree
Hide file tree
Showing 40 changed files with 172 additions and 205 deletions.
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/LivePhysRegs.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class LivePhysRegs {
}

/// \brief Clear and initialize the LivePhysRegs set.
void init(const TargetRegisterInfo *_TRI) {
assert(_TRI && "Invalid TargetRegisterInfo pointer.");
TRI = _TRI;
void init(const TargetRegisterInfo *TRI) {
assert(TRI && "Invalid TargetRegisterInfo pointer.");
this->TRI = TRI;
LiveRegs.clear();
LiveRegs.setUniverse(TRI->getNumRegs());
}
Expand Down
17 changes: 8 additions & 9 deletions include/llvm/IR/InstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ namespace llvm {
// This class implements inst_begin() & inst_end() for
// inst_iterator and const_inst_iterator's.
//
template <class _BB_t, class _BB_i_t, class _BI_t, class _II_t>
class InstIterator {
typedef _BB_t BBty;
typedef _BB_i_t BBIty;
typedef _BI_t BIty;
typedef _II_t IIty;
_BB_t *BBs; // BasicBlocksType
_BB_i_t BB; // BasicBlocksType::iterator
_BI_t BI; // BasicBlock::iterator
template <class BB_t, class BB_i_t, class BI_t, class II_t> class InstIterator {
typedef BB_t BBty;
typedef BB_i_t BBIty;
typedef BI_t BIty;
typedef II_t IIty;
BB_t *BBs; // BasicBlocksType
BB_i_t BB; // BasicBlocksType::iterator
BI_t BI; // BasicBlock::iterator
public:
typedef std::bidirectional_iterator_tag iterator_category;
typedef IIty value_type;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/MC/MCAsmLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MCAsmLayout {
uint64_t FOffset, uint64_t FSize);

public:
MCAsmLayout(MCAssembler &_Assembler);
MCAsmLayout(MCAssembler &Assembler);

/// Get the assembler object this is a layout for.
MCAssembler &getAssembler() const { return Assembler; }
Expand Down
48 changes: 22 additions & 26 deletions include/llvm/MC/MCAssembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class MCFragment : public ilist_node<MCFragment> {
/// @}

protected:
MCFragment(FragmentType _Kind, MCSectionData *_Parent = nullptr);
MCFragment(FragmentType Kind, MCSectionData *Parent = nullptr);

public:
// Only for sentinel.
Expand Down Expand Up @@ -307,11 +307,9 @@ class MCRelaxableFragment : public MCEncodedFragmentWithFixups {
SmallVector<MCFixup, 1> Fixups;

public:
MCRelaxableFragment(const MCInst &_Inst,
const MCSubtargetInfo &_STI,
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI,
MCSectionData *SD = nullptr)
: MCEncodedFragmentWithFixups(FT_Relaxable, SD), Inst(_Inst), STI(_STI) {
}
: MCEncodedFragmentWithFixups(FT_Relaxable, SD), Inst(Inst), STI(STI) {}

SmallVectorImpl<char> &getContents() override { return Contents; }
const SmallVectorImpl<char> &getContents() const override { return Contents; }
Expand Down Expand Up @@ -364,11 +362,10 @@ class MCAlignFragment : public MCFragment {
bool EmitNops : 1;

public:
MCAlignFragment(unsigned _Alignment, int64_t _Value, unsigned _ValueSize,
unsigned _MaxBytesToEmit, MCSectionData *SD = nullptr)
: MCFragment(FT_Align, SD), Alignment(_Alignment),
Value(_Value),ValueSize(_ValueSize),
MaxBytesToEmit(_MaxBytesToEmit), EmitNops(false) {}
MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize,
unsigned MaxBytesToEmit, MCSectionData *SD = nullptr)
: MCFragment(FT_Align, SD), Alignment(Alignment), Value(Value),
ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit), EmitNops(false) {}

/// @name Accessors
/// @{
Expand Down Expand Up @@ -405,10 +402,10 @@ class MCFillFragment : public MCFragment {
uint64_t Size;

public:
MCFillFragment(int64_t _Value, unsigned _ValueSize, uint64_t _Size,
MCFillFragment(int64_t Value, unsigned ValueSize, uint64_t Size,
MCSectionData *SD = nullptr)
: MCFragment(FT_Fill, SD),
Value(_Value), ValueSize(_ValueSize), Size(_Size) {
: MCFragment(FT_Fill, SD), Value(Value), ValueSize(ValueSize),
Size(Size) {
assert((!ValueSize || (Size % ValueSize) == 0) &&
"Fill size must be a multiple of the value size!");
}
Expand Down Expand Up @@ -439,10 +436,8 @@ class MCOrgFragment : public MCFragment {
int8_t Value;

public:
MCOrgFragment(const MCExpr &_Offset, int8_t _Value,
MCSectionData *SD = nullptr)
: MCFragment(FT_Org, SD),
Offset(&_Offset), Value(_Value) {}
MCOrgFragment(const MCExpr &Offset, int8_t Value, MCSectionData *SD = nullptr)
: MCFragment(FT_Org, SD), Offset(&Offset), Value(Value) {}

/// @name Accessors
/// @{
Expand Down Expand Up @@ -505,10 +500,11 @@ class MCDwarfLineAddrFragment : public MCFragment {
SmallString<8> Contents;

public:
MCDwarfLineAddrFragment(int64_t _LineDelta, const MCExpr &_AddrDelta,
MCSectionData *SD = nullptr)
: MCFragment(FT_Dwarf, SD),
LineDelta(_LineDelta), AddrDelta(&_AddrDelta) { Contents.push_back(0); }
MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta,
MCSectionData *SD = nullptr)
: MCFragment(FT_Dwarf, SD), LineDelta(LineDelta), AddrDelta(&AddrDelta) {
Contents.push_back(0);
}

/// @name Accessors
/// @{
Expand Down Expand Up @@ -537,10 +533,10 @@ class MCDwarfCallFrameFragment : public MCFragment {
SmallString<8> Contents;

public:
MCDwarfCallFrameFragment(const MCExpr &_AddrDelta,
MCSectionData *SD = nullptr)
: MCFragment(FT_DwarfFrame, SD),
AddrDelta(&_AddrDelta) { Contents.push_back(0); }
MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSectionData *SD = nullptr)
: MCFragment(FT_DwarfFrame, SD), AddrDelta(&AddrDelta) {
Contents.push_back(0);
}

/// @name Accessors
/// @{
Expand Down Expand Up @@ -722,7 +718,7 @@ class MCSymbolData : public ilist_node<MCSymbolData> {
public:
// Only for use as sentinel.
MCSymbolData();
MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
MCSymbolData(const MCSymbol &Symbol, MCFragment *Fragment, uint64_t Offset,
MCAssembler *A = nullptr);

/// @name Accessors
Expand Down
14 changes: 7 additions & 7 deletions include/llvm/MC/MCExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MCExpr {
const SectionAddrMap *Addrs, bool InSet) const;

protected:
explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {}
explicit MCExpr(ExprKind Kind) : Kind(Kind) {}

bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
const MCAsmLayout *Layout,
Expand Down Expand Up @@ -133,8 +133,8 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
class MCConstantExpr : public MCExpr {
int64_t Value;

explicit MCConstantExpr(int64_t _Value)
: MCExpr(MCExpr::Constant), Value(_Value) {}
explicit MCConstantExpr(int64_t Value)
: MCExpr(MCExpr::Constant), Value(Value) {}

public:
/// @name Construction
Expand Down Expand Up @@ -354,8 +354,8 @@ class MCUnaryExpr : public MCExpr {
Opcode Op;
const MCExpr *Expr;

MCUnaryExpr(Opcode _Op, const MCExpr *_Expr)
: MCExpr(MCExpr::Unary), Op(_Op), Expr(_Expr) {}
MCUnaryExpr(Opcode Op, const MCExpr *Expr)
: MCExpr(MCExpr::Unary), Op(Op), Expr(Expr) {}

public:
/// @name Construction
Expand Down Expand Up @@ -425,8 +425,8 @@ class MCBinaryExpr : public MCExpr {
Opcode Op;
const MCExpr *LHS, *RHS;

MCBinaryExpr(Opcode _Op, const MCExpr *_LHS, const MCExpr *_RHS)
: MCExpr(MCExpr::Binary), Op(_Op), LHS(_LHS), RHS(_RHS) {}
MCBinaryExpr(Opcode Op, const MCExpr *LHS, const MCExpr *RHS)
: MCExpr(MCExpr::Binary), Op(Op), LHS(LHS), RHS(RHS) {}

public:
/// @name Construction
Expand Down
7 changes: 3 additions & 4 deletions include/llvm/MC/MCMachObjectWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ class MachObjectWriter : public MCObjectWriter {
MachSymbolData *findSymbolData(const MCSymbol &Sym);

public:
MachObjectWriter(MCMachObjectTargetWriter *MOTW, raw_ostream &_OS,
bool _IsLittleEndian)
: MCObjectWriter(_OS, _IsLittleEndian), TargetObjectWriter(MOTW) {
}
MachObjectWriter(MCMachObjectTargetWriter *MOTW, raw_ostream &OS,
bool IsLittleEndian)
: MCObjectWriter(OS, IsLittleEndian), TargetObjectWriter(MOTW) {}

/// @name Lifetime management Methods
/// @{
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/MC/MCObjectStreamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class MCObjectStreamer : public MCStreamer {
void flushPendingLabels(MCFragment *F);

protected:
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &_OS,
MCCodeEmitter *_Emitter);
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &_OS,
MCCodeEmitter *_Emitter, MCAssembler *_Assembler);
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS,
MCCodeEmitter *Emitter);
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS,
MCCodeEmitter *Emitter, MCAssembler *Assembler);
~MCObjectStreamer();

public:
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/MC/MCObjectWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class MCObjectWriter {
unsigned IsLittleEndian : 1;

protected: // Can only create subclasses.
MCObjectWriter(raw_ostream &_OS, bool _IsLittleEndian)
: OS(_OS), IsLittleEndian(_IsLittleEndian) {}
MCObjectWriter(raw_ostream &OS, bool IsLittleEndian)
: OS(OS), IsLittleEndian(IsLittleEndian) {}

public:
virtual ~MCObjectWriter();
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/MC/MCParser/MCAsmLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ class AsmToken {

public:
AsmToken() {}
AsmToken(TokenKind _Kind, StringRef _Str, APInt _IntVal)
: Kind(_Kind), Str(_Str), IntVal(_IntVal) {}
AsmToken(TokenKind _Kind, StringRef _Str, int64_t _IntVal = 0)
: Kind(_Kind), Str(_Str), IntVal(64, _IntVal, true) {}
AsmToken(TokenKind Kind, StringRef Str, APInt IntVal)
: Kind(Kind), Str(Str), IntVal(IntVal) {}
AsmToken(TokenKind Kind, StringRef Str, int64_t IntVal = 0)
: Kind(Kind), Str(Str), IntVal(64, IntVal, true) {}

TokenKind getKind() const { return Kind; }
bool is(TokenKind K) const { return Kind == K; }
Expand Down
4 changes: 1 addition & 3 deletions include/llvm/Option/Arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ class Arg {
const Arg &getBaseArg() const {
return BaseArg ? *BaseArg : *this;
}
void setBaseArg(const Arg *_BaseArg) {
BaseArg = _BaseArg;
}
void setBaseArg(const Arg *BaseArg) { this->BaseArg = BaseArg; }

bool getOwnsValues() const { return OwnsValues; }
void setOwnsValues(bool Value) const { OwnsValues = Value; }
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Option/ArgList.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class arg_iterator {
typedef std::forward_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;

arg_iterator(SmallVectorImpl<Arg*>::const_iterator it,
const ArgList &_Args, OptSpecifier _Id0 = 0U,
OptSpecifier _Id1 = 0U, OptSpecifier _Id2 = 0U)
: Current(it), Args(_Args), Id0(_Id0), Id1(_Id1), Id2(_Id2) {
arg_iterator(SmallVectorImpl<Arg *>::const_iterator it, const ArgList &Args,
OptSpecifier Id0 = 0U, OptSpecifier Id1 = 0U,
OptSpecifier Id2 = 0U)
: Current(it), Args(Args), Id0(Id0), Id1(Id1), Id2(Id2) {
SkipToNextArg();
}

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Option/OptSpecifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace opt {

public:
OptSpecifier() : ID(0) {}
/*implicit*/ OptSpecifier(unsigned _ID) : ID(_ID) {}
/*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {}
/*implicit*/ OptSpecifier(const Option *Opt);

bool isValid() const { return ID != 0; }
Expand Down
5 changes: 3 additions & 2 deletions include/llvm/Option/OptTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ class OptTable {
}

protected:
OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos,
bool _IgnoreCase = false);
OptTable(const Info *OptionInfos, unsigned NumOptionInfos,
bool IgnoreCase = false);

public:
~OptTable();

Expand Down
12 changes: 6 additions & 6 deletions include/llvm/Support/TargetRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace llvm {
MCContext &Ctx);
typedef MCStreamer *(*MCObjectStreamerCtorTy)(
const Target &T, StringRef TT, MCContext &Ctx, MCAsmBackend &TAB,
raw_ostream &_OS, MCCodeEmitter *_Emitter, const MCSubtargetInfo &STI,
raw_ostream &OS, MCCodeEmitter *Emitter, const MCSubtargetInfo &STI,
bool RelaxAll);
typedef MCStreamer *(*AsmStreamerCtorTy)(MCContext &Ctx,
formatted_raw_ostream &OS,
Expand Down Expand Up @@ -416,17 +416,17 @@ namespace llvm {
/// \param TT The target triple.
/// \param Ctx The target context.
/// \param TAB The target assembler backend object. Takes ownership.
/// \param _OS The stream object.
/// \param _Emitter The target independent assembler object.Takes ownership.
/// \param OS The stream object.
/// \param Emitter The target independent assembler object.Takes ownership.
/// \param RelaxAll Relax all fixups?
MCStreamer *createMCObjectStreamer(StringRef TT, MCContext &Ctx,
MCAsmBackend &TAB, raw_ostream &_OS,
MCCodeEmitter *_Emitter,
MCAsmBackend &TAB, raw_ostream &OS,
MCCodeEmitter *Emitter,
const MCSubtargetInfo &STI,
bool RelaxAll) const {
if (!MCObjectStreamerCtorFn)
return nullptr;
return MCObjectStreamerCtorFn(*this, TT, Ctx, TAB, _OS, _Emitter, STI,
return MCObjectStreamerCtorFn(*this, TT, Ctx, TAB, OS, Emitter, STI,
RelaxAll);
}

Expand Down
12 changes: 6 additions & 6 deletions lib/CodeGen/StackMapLivenessAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ void StackMapLiveness::getAnalysisUsage(AnalysisUsage &AU) const {
}

/// Calculate the liveness information for the given machine function.
bool StackMapLiveness::runOnMachineFunction(MachineFunction &_MF) {
bool StackMapLiveness::runOnMachineFunction(MachineFunction &MF) {
if (!EnablePatchPointLiveness)
return false;

DEBUG(dbgs() << "********** COMPUTING STACKMAP LIVENESS: "
<< _MF.getName() << " **********\n");
MF = &_MF;
TRI = MF->getSubtarget().getRegisterInfo();
DEBUG(dbgs() << "********** COMPUTING STACKMAP LIVENESS: " << MF.getName()
<< " **********\n");
this->MF = &MF;
TRI = MF.getSubtarget().getRegisterInfo();
++NumStackMapFuncVisited;

// Skip this function if there are no patchpoints to process.
if (!MF->getFrameInfo()->hasPatchPoint()) {
if (!MF.getFrameInfo()->hasPatchPoint()) {
++NumStackMapFuncSkipped;
return false;
}
Expand Down
16 changes: 8 additions & 8 deletions lib/ExecutionEngine/Interpreter/Execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,14 @@ static GenericValue executeFCMP_OGT(GenericValue Src1, GenericValue Src2,
return Dest; \
}

#define IMPLEMENT_VECTOR_UNORDERED(TY, X,Y, _FUNC) \
if (TY->isVectorTy()) { \
GenericValue DestMask = Dest; \
Dest = _FUNC(Src1, Src2, Ty); \
for( size_t _i=0; _i<Src1.AggregateVal.size(); _i++) \
if (DestMask.AggregateVal[_i].IntVal == true) \
Dest.AggregateVal[_i].IntVal = APInt(1,true); \
return Dest; \
#define IMPLEMENT_VECTOR_UNORDERED(TY, X, Y, FUNC) \
if (TY->isVectorTy()) { \
GenericValue DestMask = Dest; \
Dest = FUNC(Src1, Src2, Ty); \
for (size_t _i = 0; _i < Src1.AggregateVal.size(); _i++) \
if (DestMask.AggregateVal[_i].IntVal == true) \
Dest.AggregateVal[_i].IntVal = APInt(1, true); \
return Dest; \
}

static GenericValue executeFCMP_UEQ(GenericValue Src1, GenericValue Src2,
Expand Down
4 changes: 2 additions & 2 deletions lib/MC/ELFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ class ELFObjectWriter : public MCObjectWriter {
}

public:
ELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_ostream &_OS,
ELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_ostream &OS,
bool IsLittleEndian)
: MCObjectWriter(_OS, IsLittleEndian), FWriter(IsLittleEndian),
: MCObjectWriter(OS, IsLittleEndian), FWriter(IsLittleEndian),
TargetObjectWriter(MOTW), NeedsGOT(false) {}

virtual ~ELFObjectWriter();
Expand Down
Loading

0 comments on commit 7610ba7

Please sign in to comment.