Skip to content

Commit 13760bd

Browse files
author
Jim Grosbach
committed
MC: Clean up MCExpr naming. NFC.
llvm-svn: 238634
1 parent 14e6867 commit 13760bd

File tree

97 files changed

+730
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+730
-730
lines changed

llvm/include/llvm/MC/MCExpr.h

+65-65
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class MCExpr {
4646
MCExpr(const MCExpr&) = delete;
4747
void operator=(const MCExpr&) = delete;
4848

49-
bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
49+
bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
5050
const MCAsmLayout *Layout,
5151
const SectionAddrMap *Addrs) const;
5252

@@ -57,7 +57,7 @@ class MCExpr {
5757
protected:
5858
explicit MCExpr(ExprKind Kind) : Kind(Kind) {}
5959

60-
bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
60+
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
6161
const MCAsmLayout *Layout,
6262
const MCFixup *Fixup,
6363
const SectionAddrMap *Addrs, bool InSet) const;
@@ -86,11 +86,11 @@ class MCExpr {
8686
/// values. If not given, then only non-symbolic expressions will be
8787
/// evaluated.
8888
/// \return - True on success.
89-
bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
89+
bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
9090
const SectionAddrMap &Addrs) const;
91-
bool EvaluateAsAbsolute(int64_t &Res) const;
92-
bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
93-
bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
91+
bool evaluateAsAbsolute(int64_t &Res) const;
92+
bool evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
93+
bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
9494

9595
bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
9696

@@ -101,21 +101,21 @@ class MCExpr {
101101
/// \param Layout - The assembler layout object to use for evaluating values.
102102
/// \param Fixup - The Fixup object if available.
103103
/// \return - True on success.
104-
bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout,
104+
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout,
105105
const MCFixup *Fixup) const;
106106

107107
/// \brief Try to evaluate the expression to the form (a - b + constant) where
108108
/// neither a nor b are variables.
109109
///
110-
/// This is a more aggressive variant of EvaluateAsRelocatable. The intended
110+
/// This is a more aggressive variant of evaluateAsRelocatable. The intended
111111
/// use is for when relocations are not available, like the .size directive.
112112
bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const;
113113

114114
/// \brief Find the "associated section" for this expression, which is
115115
/// currently defined as the absolute section for constants, or
116116
/// otherwise the section associated with the first defined symbol in the
117117
/// expression.
118-
MCSection *FindAssociatedSection() const;
118+
MCSection *findAssociatedSection() const;
119119

120120
/// @}
121121
};
@@ -136,7 +136,7 @@ class MCConstantExpr : public MCExpr {
136136
/// \name Construction
137137
/// @{
138138

139-
static const MCConstantExpr *Create(int64_t Value, MCContext &Ctx);
139+
static const MCConstantExpr *create(int64_t Value, MCContext &Ctx);
140140

141141
/// @}
142142
/// \name Accessors
@@ -312,13 +312,13 @@ class MCSymbolRefExpr : public MCExpr {
312312
/// \name Construction
313313
/// @{
314314

315-
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx) {
316-
return MCSymbolRefExpr::Create(Symbol, VK_None, Ctx);
315+
static const MCSymbolRefExpr *create(const MCSymbol *Symbol, MCContext &Ctx) {
316+
return MCSymbolRefExpr::create(Symbol, VK_None, Ctx);
317317
}
318318

319-
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, VariantKind Kind,
319+
static const MCSymbolRefExpr *create(const MCSymbol *Symbol, VariantKind Kind,
320320
MCContext &Ctx);
321-
static const MCSymbolRefExpr *Create(StringRef Name, VariantKind Kind,
321+
static const MCSymbolRefExpr *create(StringRef Name, VariantKind Kind,
322322
MCContext &Ctx);
323323

324324
/// @}
@@ -369,19 +369,19 @@ class MCUnaryExpr : public MCExpr {
369369
/// \name Construction
370370
/// @{
371371

372-
static const MCUnaryExpr *Create(Opcode Op, const MCExpr *Expr,
372+
static const MCUnaryExpr *create(Opcode Op, const MCExpr *Expr,
373373
MCContext &Ctx);
374-
static const MCUnaryExpr *CreateLNot(const MCExpr *Expr, MCContext &Ctx) {
375-
return Create(LNot, Expr, Ctx);
374+
static const MCUnaryExpr *createLNot(const MCExpr *Expr, MCContext &Ctx) {
375+
return create(LNot, Expr, Ctx);
376376
}
377-
static const MCUnaryExpr *CreateMinus(const MCExpr *Expr, MCContext &Ctx) {
378-
return Create(Minus, Expr, Ctx);
377+
static const MCUnaryExpr *createMinus(const MCExpr *Expr, MCContext &Ctx) {
378+
return create(Minus, Expr, Ctx);
379379
}
380-
static const MCUnaryExpr *CreateNot(const MCExpr *Expr, MCContext &Ctx) {
381-
return Create(Not, Expr, Ctx);
380+
static const MCUnaryExpr *createNot(const MCExpr *Expr, MCContext &Ctx) {
381+
return create(Not, Expr, Ctx);
382382
}
383-
static const MCUnaryExpr *CreatePlus(const MCExpr *Expr, MCContext &Ctx) {
384-
return Create(Plus, Expr, Ctx);
383+
static const MCUnaryExpr *createPlus(const MCExpr *Expr, MCContext &Ctx) {
384+
return create(Plus, Expr, Ctx);
385385
}
386386

387387
/// @}
@@ -441,83 +441,83 @@ class MCBinaryExpr : public MCExpr {
441441
/// \name Construction
442442
/// @{
443443

444-
static const MCBinaryExpr *Create(Opcode Op, const MCExpr *LHS,
444+
static const MCBinaryExpr *create(Opcode Op, const MCExpr *LHS,
445445
const MCExpr *RHS, MCContext &Ctx);
446-
static const MCBinaryExpr *CreateAdd(const MCExpr *LHS, const MCExpr *RHS,
446+
static const MCBinaryExpr *createAdd(const MCExpr *LHS, const MCExpr *RHS,
447447
MCContext &Ctx) {
448-
return Create(Add, LHS, RHS, Ctx);
448+
return create(Add, LHS, RHS, Ctx);
449449
}
450-
static const MCBinaryExpr *CreateAnd(const MCExpr *LHS, const MCExpr *RHS,
450+
static const MCBinaryExpr *createAnd(const MCExpr *LHS, const MCExpr *RHS,
451451
MCContext &Ctx) {
452-
return Create(And, LHS, RHS, Ctx);
452+
return create(And, LHS, RHS, Ctx);
453453
}
454-
static const MCBinaryExpr *CreateDiv(const MCExpr *LHS, const MCExpr *RHS,
454+
static const MCBinaryExpr *createDiv(const MCExpr *LHS, const MCExpr *RHS,
455455
MCContext &Ctx) {
456-
return Create(Div, LHS, RHS, Ctx);
456+
return create(Div, LHS, RHS, Ctx);
457457
}
458-
static const MCBinaryExpr *CreateEQ(const MCExpr *LHS, const MCExpr *RHS,
458+
static const MCBinaryExpr *createEQ(const MCExpr *LHS, const MCExpr *RHS,
459459
MCContext &Ctx) {
460-
return Create(EQ, LHS, RHS, Ctx);
460+
return create(EQ, LHS, RHS, Ctx);
461461
}
462-
static const MCBinaryExpr *CreateGT(const MCExpr *LHS, const MCExpr *RHS,
462+
static const MCBinaryExpr *createGT(const MCExpr *LHS, const MCExpr *RHS,
463463
MCContext &Ctx) {
464-
return Create(GT, LHS, RHS, Ctx);
464+
return create(GT, LHS, RHS, Ctx);
465465
}
466-
static const MCBinaryExpr *CreateGTE(const MCExpr *LHS, const MCExpr *RHS,
466+
static const MCBinaryExpr *createGTE(const MCExpr *LHS, const MCExpr *RHS,
467467
MCContext &Ctx) {
468-
return Create(GTE, LHS, RHS, Ctx);
468+
return create(GTE, LHS, RHS, Ctx);
469469
}
470-
static const MCBinaryExpr *CreateLAnd(const MCExpr *LHS, const MCExpr *RHS,
470+
static const MCBinaryExpr *createLAnd(const MCExpr *LHS, const MCExpr *RHS,
471471
MCContext &Ctx) {
472-
return Create(LAnd, LHS, RHS, Ctx);
472+
return create(LAnd, LHS, RHS, Ctx);
473473
}
474-
static const MCBinaryExpr *CreateLOr(const MCExpr *LHS, const MCExpr *RHS,
474+
static const MCBinaryExpr *createLOr(const MCExpr *LHS, const MCExpr *RHS,
475475
MCContext &Ctx) {
476-
return Create(LOr, LHS, RHS, Ctx);
476+
return create(LOr, LHS, RHS, Ctx);
477477
}
478-
static const MCBinaryExpr *CreateLT(const MCExpr *LHS, const MCExpr *RHS,
478+
static const MCBinaryExpr *createLT(const MCExpr *LHS, const MCExpr *RHS,
479479
MCContext &Ctx) {
480-
return Create(LT, LHS, RHS, Ctx);
480+
return create(LT, LHS, RHS, Ctx);
481481
}
482-
static const MCBinaryExpr *CreateLTE(const MCExpr *LHS, const MCExpr *RHS,
482+
static const MCBinaryExpr *createLTE(const MCExpr *LHS, const MCExpr *RHS,
483483
MCContext &Ctx) {
484-
return Create(LTE, LHS, RHS, Ctx);
484+
return create(LTE, LHS, RHS, Ctx);
485485
}
486-
static const MCBinaryExpr *CreateMod(const MCExpr *LHS, const MCExpr *RHS,
486+
static const MCBinaryExpr *createMod(const MCExpr *LHS, const MCExpr *RHS,
487487
MCContext &Ctx) {
488-
return Create(Mod, LHS, RHS, Ctx);
488+
return create(Mod, LHS, RHS, Ctx);
489489
}
490-
static const MCBinaryExpr *CreateMul(const MCExpr *LHS, const MCExpr *RHS,
490+
static const MCBinaryExpr *createMul(const MCExpr *LHS, const MCExpr *RHS,
491491
MCContext &Ctx) {
492-
return Create(Mul, LHS, RHS, Ctx);
492+
return create(Mul, LHS, RHS, Ctx);
493493
}
494-
static const MCBinaryExpr *CreateNE(const MCExpr *LHS, const MCExpr *RHS,
494+
static const MCBinaryExpr *createNE(const MCExpr *LHS, const MCExpr *RHS,
495495
MCContext &Ctx) {
496-
return Create(NE, LHS, RHS, Ctx);
496+
return create(NE, LHS, RHS, Ctx);
497497
}
498-
static const MCBinaryExpr *CreateOr(const MCExpr *LHS, const MCExpr *RHS,
498+
static const MCBinaryExpr *createOr(const MCExpr *LHS, const MCExpr *RHS,
499499
MCContext &Ctx) {
500-
return Create(Or, LHS, RHS, Ctx);
500+
return create(Or, LHS, RHS, Ctx);
501501
}
502-
static const MCBinaryExpr *CreateShl(const MCExpr *LHS, const MCExpr *RHS,
502+
static const MCBinaryExpr *createShl(const MCExpr *LHS, const MCExpr *RHS,
503503
MCContext &Ctx) {
504-
return Create(Shl, LHS, RHS, Ctx);
504+
return create(Shl, LHS, RHS, Ctx);
505505
}
506-
static const MCBinaryExpr *CreateAShr(const MCExpr *LHS, const MCExpr *RHS,
506+
static const MCBinaryExpr *createAShr(const MCExpr *LHS, const MCExpr *RHS,
507507
MCContext &Ctx) {
508-
return Create(AShr, LHS, RHS, Ctx);
508+
return create(AShr, LHS, RHS, Ctx);
509509
}
510-
static const MCBinaryExpr *CreateLShr(const MCExpr *LHS, const MCExpr *RHS,
510+
static const MCBinaryExpr *createLShr(const MCExpr *LHS, const MCExpr *RHS,
511511
MCContext &Ctx) {
512-
return Create(LShr, LHS, RHS, Ctx);
512+
return create(LShr, LHS, RHS, Ctx);
513513
}
514-
static const MCBinaryExpr *CreateSub(const MCExpr *LHS, const MCExpr *RHS,
514+
static const MCBinaryExpr *createSub(const MCExpr *LHS, const MCExpr *RHS,
515515
MCContext &Ctx) {
516-
return Create(Sub, LHS, RHS, Ctx);
516+
return create(Sub, LHS, RHS, Ctx);
517517
}
518-
static const MCBinaryExpr *CreateXor(const MCExpr *LHS, const MCExpr *RHS,
518+
static const MCBinaryExpr *createXor(const MCExpr *LHS, const MCExpr *RHS,
519519
MCContext &Ctx) {
520-
return Create(Xor, LHS, RHS, Ctx);
520+
return create(Xor, LHS, RHS, Ctx);
521521
}
522522

523523
/// @}
@@ -552,12 +552,12 @@ class MCTargetExpr : public MCExpr {
552552
virtual ~MCTargetExpr() {}
553553
public:
554554

555-
virtual void PrintImpl(raw_ostream &OS) const = 0;
556-
virtual bool EvaluateAsRelocatableImpl(MCValue &Res,
555+
virtual void printImpl(raw_ostream &OS) const = 0;
556+
virtual bool evaluateAsRelocatableImpl(MCValue &Res,
557557
const MCAsmLayout *Layout,
558558
const MCFixup *Fixup) const = 0;
559559
virtual void visitUsedExpr(MCStreamer& Streamer) const = 0;
560-
virtual MCSection *FindAssociatedSection() const = 0;
560+
virtual MCSection *findAssociatedSection() const = 0;
561561

562562
virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const = 0;
563563

llvm/include/llvm/MC/MCSymbol.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class MCSymbol {
108108
MCSection *getSectionPtr() const {
109109
if (Section || !Value)
110110
return Section;
111-
return Section = Value->FindAssociatedSection();
111+
return Section = Value->findAssociatedSection();
112112
}
113113

114114
public:

llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) {
3838
Entries[I.second.Number] =
3939
I.second.TLS
4040
? Asm.getObjFileLowering().getDebugThreadLocalSymbol(I.first)
41-
: MCSymbolRefExpr::Create(I.first, Asm.OutContext);
41+
: MCSymbolRefExpr::create(I.first, Asm.OutContext);
4242

4343
for (const MCExpr *Entry : Entries)
4444
Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize());

0 commit comments

Comments
 (0)