Skip to content

Commit 1d49eb0

Browse files
committed
[AsmPrinter] De-capitalize all AsmPrinter::Emit* but EmitInstruction
Similar to rL328848.
1 parent 918e905 commit 1d49eb0

33 files changed

+164
-165
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
21642164
AlignmentCI = ConstantInt::get(AlignmentCI->getType(),
21652165
llvm::Value::MaximumAlignment);
21662166

2167-
EmitAlignmentAssumption(PtrValue, Ptr,
2167+
emitAlignmentAssumption(PtrValue, Ptr,
21682168
/*The expr loc is sufficient.*/ SourceLocation(),
21692169
AlignmentCI, OffsetValue);
21702170
return RValue::get(PtrValue);
@@ -14555,7 +14555,7 @@ RValue CodeGenFunction::EmitBuiltinAlignTo(const CallExpr *E, bool AlignUp) {
1455514555
Result = Builder.CreatePointerCast(Result, Args.SrcType);
1455614556
// Emit an alignment assumption to ensure that the new alignment is
1455714557
// propagated to loads/stores, etc.
14558-
EmitAlignmentAssumption(Result, E, E->getExprLoc(), Args.Alignment);
14558+
emitAlignmentAssumption(Result, E, E->getExprLoc(), Args.Alignment);
1455914559
}
1456014560
assert(Result->getType() == Args.SrcType);
1456114561
return RValue::get(Result);

clang/lib/CodeGen/CGCall.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3906,7 +3906,7 @@ template <typename AlignedAttrTy> class AbstractAssumeAlignedAttrEmitter {
39063906
void EmitAsAnAssumption(SourceLocation Loc, QualType RetTy, RValue &Ret) {
39073907
if (!AA)
39083908
return;
3909-
CGF.EmitAlignmentAssumption(Ret.getScalarVal(), RetTy, Loc,
3909+
CGF.emitAlignmentAssumption(Ret.getScalarVal(), RetTy, Loc,
39103910
AA->getLocation(), Alignment, OffsetCI);
39113911
AA = nullptr; // We're done. Disallow doing anything else.
39123912
}

clang/lib/CodeGen/CGExprScalar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class ScalarExprEmitter
297297

298298
Value *AlignmentValue = CGF.EmitScalarExpr(AVAttr->getAlignment());
299299
llvm::ConstantInt *AlignmentCI = cast<llvm::ConstantInt>(AlignmentValue);
300-
CGF.EmitAlignmentAssumption(V, E, AVAttr->getLocation(), AlignmentCI);
300+
CGF.emitAlignmentAssumption(V, E, AVAttr->getLocation(), AlignmentCI);
301301
}
302302

303303
/// EmitLoadOfLValue - Given an expression with complex type that represents a

clang/lib/CodeGen/CGStmtOpenMP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ static void emitAlignedClause(CodeGenFunction &CGF,
17701770
"alignment is not power of 2");
17711771
if (Alignment != 0) {
17721772
llvm::Value *PtrValue = CGF.EmitScalarExpr(E);
1773-
CGF.EmitAlignmentAssumption(
1773+
CGF.emitAlignmentAssumption(
17741774
PtrValue, E, /*No second loc needed*/ SourceLocation(),
17751775
llvm::ConstantInt::get(CGF.getLLVMContext(), Alignment));
17761776
}

clang/lib/CodeGen/CodeGenFunction.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ void CodeGenFunction::unprotectFromPeepholes(PeepholeProtection protection) {
21702170
protection.Inst->eraseFromParent();
21712171
}
21722172

2173-
void CodeGenFunction::EmitAlignmentAssumption(llvm::Value *PtrValue,
2173+
void CodeGenFunction::emitAlignmentAssumption(llvm::Value *PtrValue,
21742174
QualType Ty, SourceLocation Loc,
21752175
SourceLocation AssumptionLoc,
21762176
llvm::Value *Alignment,
@@ -2179,12 +2179,12 @@ void CodeGenFunction::EmitAlignmentAssumption(llvm::Value *PtrValue,
21792179
llvm::Instruction *Assumption = Builder.CreateAlignmentAssumption(
21802180
CGM.getDataLayout(), PtrValue, Alignment, OffsetValue, &TheCheck);
21812181
if (SanOpts.has(SanitizerKind::Alignment)) {
2182-
EmitAlignmentAssumptionCheck(PtrValue, Ty, Loc, AssumptionLoc, Alignment,
2182+
emitAlignmentAssumptionCheck(PtrValue, Ty, Loc, AssumptionLoc, Alignment,
21832183
OffsetValue, TheCheck, Assumption);
21842184
}
21852185
}
21862186

2187-
void CodeGenFunction::EmitAlignmentAssumption(llvm::Value *PtrValue,
2187+
void CodeGenFunction::emitAlignmentAssumption(llvm::Value *PtrValue,
21882188
const Expr *E,
21892189
SourceLocation AssumptionLoc,
21902190
llvm::Value *Alignment,
@@ -2194,7 +2194,7 @@ void CodeGenFunction::EmitAlignmentAssumption(llvm::Value *PtrValue,
21942194
QualType Ty = E->getType();
21952195
SourceLocation Loc = E->getExprLoc();
21962196

2197-
EmitAlignmentAssumption(PtrValue, Ty, Loc, AssumptionLoc, Alignment,
2197+
emitAlignmentAssumption(PtrValue, Ty, Loc, AssumptionLoc, Alignment,
21982198
OffsetValue);
21992199
}
22002200

@@ -2462,7 +2462,7 @@ void CodeGenFunction::EmitMultiVersionResolver(
24622462
// Loc), the diagnostic will additionally point a "Note:" to this location.
24632463
// It should be the location where the __attribute__((assume_aligned))
24642464
// was written e.g.
2465-
void CodeGenFunction::EmitAlignmentAssumptionCheck(
2465+
void CodeGenFunction::emitAlignmentAssumptionCheck(
24662466
llvm::Value *Ptr, QualType Ty, SourceLocation Loc,
24672467
SourceLocation SecondaryLoc, llvm::Value *Alignment,
24682468
llvm::Value *OffsetValue, llvm::Value *TheCheck,

clang/lib/CodeGen/CodeGenFunction.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -2827,21 +2827,22 @@ class CodeGenFunction : public CodeGenTypeCache {
28272827
PeepholeProtection protectFromPeepholes(RValue rvalue);
28282828
void unprotectFromPeepholes(PeepholeProtection protection);
28292829

2830-
void EmitAlignmentAssumptionCheck(llvm::Value *Ptr, QualType Ty,
2830+
void emitAlignmentAssumptionCheck(llvm::Value *Ptr, QualType Ty,
28312831
SourceLocation Loc,
28322832
SourceLocation AssumptionLoc,
28332833
llvm::Value *Alignment,
28342834
llvm::Value *OffsetValue,
28352835
llvm::Value *TheCheck,
28362836
llvm::Instruction *Assumption);
28372837

2838-
void EmitAlignmentAssumption(llvm::Value *PtrValue, QualType Ty,
2838+
void emitAlignmentAssumption(llvm::Value *PtrValue, QualType Ty,
28392839
SourceLocation Loc, SourceLocation AssumptionLoc,
28402840
llvm::Value *Alignment,
28412841
llvm::Value *OffsetValue = nullptr);
28422842

2843-
void EmitAlignmentAssumption(llvm::Value *PtrValue, const Expr *E,
2844-
SourceLocation AssumptionLoc, llvm::Value *Alignment,
2843+
void emitAlignmentAssumption(llvm::Value *PtrValue, const Expr *E,
2844+
SourceLocation AssumptionLoc,
2845+
llvm::Value *Alignment,
28452846
llvm::Value *OffsetValue = nullptr);
28462847

28472848
//===--------------------------------------------------------------------===//

llvm/docs/GarbageCollection.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ a realistic example:
958958
// } __gcmap_<FUNCTIONNAME>;
959959

960960
// Align to address width.
961-
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);
961+
AP.emitAlignment(IntPtrSize == 4 ? 2 : 3);
962962

963963
// Emit PointCount.
964964
OS.AddComment("safe point count");

llvm/include/llvm/CodeGen/AsmPrinter.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -354,30 +354,30 @@ class AsmPrinter : public MachineFunctionPass {
354354
/// Print to the current output stream assembly representations of the
355355
/// constants in the constant pool MCP. This is used to print out constants
356356
/// which have been "spilled to memory" by the code generator.
357-
virtual void EmitConstantPool();
357+
virtual void emitConstantPool();
358358

359359
/// Print assembly representations of the jump tables used by the current
360360
/// function to the current output stream.
361-
virtual void EmitJumpTableInfo();
361+
virtual void emitJumpTableInfo();
362362

363363
/// Emit the specified global variable to the .s file.
364-
virtual void EmitGlobalVariable(const GlobalVariable *GV);
364+
virtual void emitGlobalVariable(const GlobalVariable *GV);
365365

366366
/// Check to see if the specified global is a special global used by LLVM. If
367367
/// so, emit it and return true, otherwise do nothing and return false.
368-
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
368+
bool emitSpecialLLVMGlobal(const GlobalVariable *GV);
369369

370370
/// Emit an alignment directive to the specified power of two boundary. If a
371371
/// global value is specified, and if that global has an explicit alignment
372372
/// requested, it will override the alignment request if required for
373373
/// correctness.
374-
void EmitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
374+
void emitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
375375

376376
/// Lower the specified LLVM Constant to an MCExpr.
377377
virtual const MCExpr *lowerConstant(const Constant *CV);
378378

379379
/// Print a general LLVM constant to the .s file.
380-
void EmitGlobalConstant(const DataLayout &DL, const Constant *CV);
380+
void emitGlobalConstant(const DataLayout &DL, const Constant *CV);
381381

382382
/// Unnamed constant global variables solely contaning a pointer to
383383
/// another globals variable act like a global variable "proxy", or GOT
@@ -443,12 +443,12 @@ class AsmPrinter : public MachineFunctionPass {
443443
llvm_unreachable("Function descriptor is target-specific.");
444444
}
445445

446-
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
446+
virtual void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
447447

448448
/// Targets can override this to change how global constants that are part of
449449
/// a C++ static/global constructor list are emitted.
450-
virtual void EmitXXStructor(const DataLayout &DL, const Constant *CV) {
451-
EmitGlobalConstant(DL, CV);
450+
virtual void emitXXStructor(const DataLayout &DL, const Constant *CV) {
451+
emitGlobalConstant(DL, CV);
452452
}
453453

454454
/// Return true if the basic block has exactly one predecessor and the control
@@ -549,13 +549,13 @@ class AsmPrinter : public MachineFunctionPass {
549549
/// Emit a .byte 42 directive that corresponds to an encoding. If verbose
550550
/// assembly output is enabled, we output comments describing the encoding.
551551
/// Desc is a string saying what the encoding is specifying (e.g. "LSDA").
552-
void EmitEncodingByte(unsigned Val, const char *Desc = nullptr) const;
552+
void emitEncodingByte(unsigned Val, const char *Desc = nullptr) const;
553553

554554
/// Return the size of the encoding in bytes.
555555
unsigned GetSizeOfEncodedValue(unsigned Encoding) const;
556556

557557
/// Emit reference to a ttype global with a specified encoding.
558-
void EmitTTypeReference(const GlobalValue *GV, unsigned Encoding) const;
558+
void emitTTypeReference(const GlobalValue *GV, unsigned Encoding) const;
559559

560560
/// Emit a reference to a symbol for use in dwarf. Different object formats
561561
/// represent this in different ways. Some use a relocation others encode
@@ -683,14 +683,14 @@ class AsmPrinter : public MachineFunctionPass {
683683

684684
/// Emit a blob of inline asm to the output streamer.
685685
void
686-
EmitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
686+
emitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
687687
const MCTargetOptions &MCOptions,
688688
const MDNode *LocMDNode = nullptr,
689689
InlineAsm::AsmDialect AsmDialect = InlineAsm::AD_ATT) const;
690690

691691
/// This method formats and emits the specified machine instruction that is an
692692
/// inline asm.
693-
void EmitInlineAsm(const MachineInstr *MI) const;
693+
void emitInlineAsm(const MachineInstr *MI) const;
694694

695695
/// Add inline assembly info to the diagnostics machinery, so we can
696696
/// emit file and position info. Returns SrcMgr memory buffer position.
@@ -701,14 +701,14 @@ class AsmPrinter : public MachineFunctionPass {
701701
// Internal Implementation Details
702702
//===------------------------------------------------------------------===//
703703

704-
void EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
704+
void emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
705705
const MachineBasicBlock *MBB, unsigned uid) const;
706-
void EmitLLVMUsedList(const ConstantArray *InitList);
706+
void emitLLVMUsedList(const ConstantArray *InitList);
707707
/// Emit llvm.ident metadata in an '.ident' directive.
708-
void EmitModuleIdents(Module &M);
708+
void emitModuleIdents(Module &M);
709709
/// Emit bytes for llvm.commandline metadata.
710-
void EmitModuleCommandLines(Module &M);
711-
void EmitXXStructorList(const DataLayout &DL, const Constant *List,
710+
void emitModuleCommandLines(Module &M);
711+
void emitXXStructorList(const DataLayout &DL, const Constant *List,
712712
bool isCtor);
713713

714714
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &S);

llvm/include/llvm/ExecutionEngine/ExecutionEngine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class ExecutionEngine {
499499

500500
void emitGlobals();
501501

502-
void EmitGlobalVariable(const GlobalVariable *GV);
502+
void emitGlobalVariable(const GlobalVariable *GV);
503503

504504
GenericValue getConstantValue(const Constant *C);
505505
void LoadValueFromMemory(GenericValue &Result, GenericValue *Ptr,

llvm/lib/CodeGen/AsmPrinter/ARMException.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding,
109109
for (const GlobalValue *GV : reverse(TypeInfos)) {
110110
if (VerboseAsm)
111111
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
112-
Asm->EmitTTypeReference(GV, TTypeEncoding);
112+
Asm->emitTTypeReference(GV, TTypeEncoding);
113113
}
114114

115115
Asm->OutStreamer->EmitLabel(TTBaseLabel);
@@ -129,7 +129,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding,
129129
Asm->OutStreamer->AddComment("FilterInfo " + Twine(Entry));
130130
}
131131

132-
Asm->EmitTTypeReference((TypeID == 0 ? nullptr : TypeInfos[TypeID - 1]),
132+
Asm->emitTTypeReference((TypeID == 0 ? nullptr : TypeInfos[TypeID - 1]),
133133
TTypeEncoding);
134134
}
135135
}

0 commit comments

Comments
 (0)