llvm.org GIT mirror llvm / 634763c
Cleanup places that passed SMLoc by const reference to pass it by value instead. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248135 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 4 years ago
14 changed file(s) with 23 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
6868 void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
6969 unsigned ByteAlignment = 0) override;
7070 void EmitValueImpl(const MCExpr *Value, unsigned Size,
71 const SMLoc &Loc = SMLoc()) override;
71 SMLoc Loc = SMLoc()) override;
7272
7373 void EmitFileDirective(StringRef Filename) override;
7474
9191 void EmitLabel(MCSymbol *Symbol) override;
9292 void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
9393 void EmitValueImpl(const MCExpr *Value, unsigned Size,
94 const SMLoc &Loc = SMLoc()) override;
94 SMLoc Loc = SMLoc()) override;
9595 void EmitULEB128Value(const MCExpr *Value) override;
9696 void EmitSLEB128Value(const MCExpr *Value) override;
9797 void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
134134
135135 virtual AsmToken LexToken() = 0;
136136
137 void SetError(const SMLoc &errLoc, const std::string &err) {
137 void SetError(SMLoc errLoc, const std::string &err) {
138138 ErrLoc = errLoc;
139139 Err = err;
140140 }
178178 bool ShouldSkipSpace = true) = 0;
179179
180180 /// Get the current error location
181 const SMLoc &getErrLoc() {
181 SMLoc getErrLoc() {
182182 return ErrLoc;
183183 }
184184
521521 /// match a native machine width.
522522 /// \param Loc - The location of the expression for error reporting.
523523 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
524 const SMLoc &Loc = SMLoc());
525
526 void EmitValue(const MCExpr *Value, unsigned Size,
527 const SMLoc &Loc = SMLoc());
524 SMLoc Loc = SMLoc());
525
526 void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc());
528527
529528 /// \brief Special case of EmitValue that avoids the client having
530529 /// to pass in a MCExpr for constant integers.
162162 void EmitBytes(StringRef Data) override;
163163
164164 void EmitValueImpl(const MCExpr *Value, unsigned Size,
165 const SMLoc &Loc = SMLoc()) override;
165 SMLoc Loc = SMLoc()) override;
166166 void EmitIntValue(uint64_t Value, unsigned Size) override;
167167
168168 void EmitULEB128Value(const MCExpr *Value) override;
686686 }
687687
688688 void MCAsmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
689 const SMLoc &Loc) {
689 SMLoc Loc) {
690690 assert(Size <= 8 && "Invalid size");
691691 assert(getCurrentSection().first &&
692692 "Cannot emit contents before setting section!");
342342 }
343343
344344 void MCELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
345 const SMLoc &Loc) {
345 SMLoc Loc) {
346346 if (isBundleLocked())
347347 report_fatal_error("Emitting values inside a locked bundle is forbidden");
348348 fixSymbolsInTLSFixups(Value);
120120 }
121121
122122 void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
123 const SMLoc &Loc) {
123 SMLoc Loc) {
124124 MCStreamer::EmitValueImpl(Value, Size, Loc);
125125 MCDataFragment *DF = getOrCreateDataFragment();
126126 flushPendingLabels(DF, DF->getContents().size());
250250 bool parseStatement(ParseStatementInfo &Info,
251251 MCAsmParserSemaCallback *SI);
252252 void eatToEndOfLine();
253 bool parseCppHashLineFilenameComment(const SMLoc &L);
253 bool parseCppHashLineFilenameComment(SMLoc L);
254254
255255 void checkForBadMacro(SMLoc DirectiveLoc, StringRef Name, StringRef Body,
256256 ArrayRef Parameters);
257257 bool expandMacro(raw_svector_ostream &OS, StringRef Body,
258258 ArrayRef Parameters,
259259 ArrayRef A, bool EnableAtPseudoVariable,
260 const SMLoc &L);
260 SMLoc L);
261261
262262 /// \brief Are macros enabled in the parser?
263263 bool areMacrosEnabled() {return MacrosEnabledFlag;}
17051705 /// parseCppHashLineFilenameComment as this:
17061706 /// ::= # number "filename"
17071707 /// or just as a full line comment if it doesn't have a number and a string.
1708 bool AsmParser::parseCppHashLineFilenameComment(const SMLoc &L) {
1708 bool AsmParser::parseCppHashLineFilenameComment(SMLoc L) {
17091709 Lex(); // Eat the hash token.
17101710
17111711 if (getLexer().isNot(AsmToken::Integer)) {
17451745 raw_ostream &OS = errs();
17461746
17471747 const SourceMgr &DiagSrcMgr = *Diag.getSourceMgr();
1748 const SMLoc &DiagLoc = Diag.getLoc();
1748 SMLoc DiagLoc = Diag.getLoc();
17491749 unsigned DiagBuf = DiagSrcMgr.FindBufferContainingLoc(DiagLoc);
17501750 unsigned CppHashBuf =
17511751 Parser->SrcMgr.FindBufferContainingLoc(Parser->CppHashLoc);
18041804 bool AsmParser::expandMacro(raw_svector_ostream &OS, StringRef Body,
18051805 ArrayRef Parameters,
18061806 ArrayRef A,
1807 bool EnableAtPseudoVariable, const SMLoc &L) {
1807 bool EnableAtPseudoVariable, SMLoc L) {
18081808 unsigned NParameters = Parameters.size();
18091809 bool HasVararg = NParameters ? Parameters.back().Vararg : false;
18101810 if ((!IsDarwin || NParameters != 0) && NParameters != A.size())
106106 EmitBytes(OSE.str());
107107 }
108108
109 void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size,
110 const SMLoc &Loc) {
109 void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
111110 EmitValueImpl(Value, Size, Loc);
112111 }
113112
680679 void MCStreamer::ChangeSection(MCSection *, const MCExpr *) {}
681680 void MCStreamer::EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
682681 void MCStreamer::EmitBytes(StringRef Data) {}
683 void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
684 const SMLoc &Loc) {
682 void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
685683 visitUsedExpr(*Value);
686684 }
687685 void MCStreamer::EmitULEB128Value(const MCExpr *Value) {}
127127 /// This is one of the functions used to emit data into an ELF section, so the
128128 /// AArch64 streamer overrides it to add the appropriate mapping symbol ($d)
129129 /// if necessary.
130 void EmitValueImpl(const MCExpr *Value, unsigned Size,
131 const SMLoc &Loc) override {
130 void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
132131 EmitDataMappingSymbol();
133132 MCELFStreamer::EmitValueImpl(Value, Size);
134133 }
506506 /// This is one of the functions used to emit data into an ELF section, so the
507507 /// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
508508 /// necessary.
509 void EmitValueImpl(const MCExpr *Value, unsigned Size,
510 const SMLoc &Loc) override {
509 void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
511510 if (const MCSymbolRefExpr *SRE = dyn_cast_or_null(Value))
512511 if (SRE->getKind() == MCSymbolRefExpr::VK_ARM_SBREL && !(Size == 4))
513512 getContext().reportFatalError(Loc, "relocated expression must be 32-bit");
6262 }
6363
6464 void MipsELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
65 const SMLoc &Loc) {
65 SMLoc Loc) {
6666 MCELFStreamer::EmitValueImpl(Value, Size, Loc);
6767 Labels.clear();
6868 }
5959
6060 /// Overriding this function allows us to dismiss all labels that are
6161 /// candidates for marking as microMIPS when .word directive is emitted.
62 void EmitValueImpl(const MCExpr *Value, unsigned Size,
63 const SMLoc &Loc) override;
62 void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
6463
6564 /// Emits all the option records stored up until the point it's called.
6665 void EmitMipsOptionRecords();
974974 return false;
975975 }
976976
977 static void PrintCheckFailed(const SourceMgr &SM, const SMLoc &Loc,
977 static void PrintCheckFailed(const SourceMgr &SM, SMLoc Loc,
978978 const Pattern &Pat, StringRef Buffer,
979979 StringMap &VariableTable) {
980980 // Otherwise, we have an error, emit an error message.