Remove unused parameter from parseMSInlineAsm.

No implementation uses the `LocCookie` parameter at all. Errors are
reported from inside that function by `llvm::SourceMgr`, and the
instance of that at the clang call site arranges to pass the error
messages back to a `ClangAsmParserCallback`, which is where the clang
SourceLocation for the error is computed.

(This is part of a patch series working towards the ability to make
SourceLocation into a 64-bit type to handle larger translation units.
But this particular change seems beneficial in its own right.)

Reviewed By: miyuki

Differential Revision: https://reviews.llvm.org/D105490
This commit is contained in:
Simon Tatham 2021-07-12 15:05:12 +01:00
parent 1af97c9d0b
commit e49985bb60
4 changed files with 15 additions and 15 deletions

View File

@ -633,9 +633,9 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
SmallVector<std::pair<void *, bool>, 4> OpExprs; SmallVector<std::pair<void *, bool>, 4> OpExprs;
SmallVector<std::string, 4> Constraints; SmallVector<std::string, 4> Constraints;
SmallVector<std::string, 4> Clobbers; SmallVector<std::string, 4> Clobbers;
if (Parser->parseMSInlineAsm(AsmLoc.getPtrEncoding(), AsmStringIR, NumOutputs, if (Parser->parseMSInlineAsm(AsmStringIR, NumOutputs, NumInputs, OpExprs,
NumInputs, OpExprs, Constraints, Clobbers, Constraints, Clobbers, MII.get(), IP.get(),
MII.get(), IP.get(), Callback)) Callback))
return StmtError(); return StmtError();
// Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber // Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber

View File

@ -202,8 +202,8 @@ public:
/// Parse MS-style inline assembly. /// Parse MS-style inline assembly.
virtual bool parseMSInlineAsm( virtual bool parseMSInlineAsm(
void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs,
unsigned &NumInputs, SmallVectorImpl<std::pair<void *, bool>> &OpDecls, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
SmallVectorImpl<std::string> &Constraints, SmallVectorImpl<std::string> &Constraints,
SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII, SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII,
const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) = 0; const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) = 0;

View File

@ -258,8 +258,8 @@ public:
return LTODiscardSymbols.contains(Name); return LTODiscardSymbols.contains(Name);
} }
bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString, bool parseMSInlineAsm(std::string &AsmString, unsigned &NumOutputs,
unsigned &NumOutputs, unsigned &NumInputs, unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
SmallVectorImpl<std::string> &Constraints, SmallVectorImpl<std::string> &Constraints,
SmallVectorImpl<std::string> &Clobbers, SmallVectorImpl<std::string> &Clobbers,
@ -5927,8 +5927,8 @@ static int rewritesSort(const AsmRewrite *AsmRewriteA,
} }
bool AsmParser::parseMSInlineAsm( bool AsmParser::parseMSInlineAsm(
void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs,
unsigned &NumInputs, SmallVectorImpl<std::pair<void *, bool>> &OpDecls, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
SmallVectorImpl<std::string> &Constraints, SmallVectorImpl<std::string> &Constraints,
SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII, SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII,
const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) { const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) {

View File

@ -514,8 +514,8 @@ public:
bool lookUpType(StringRef Name, AsmTypeInfo &Info) const override; bool lookUpType(StringRef Name, AsmTypeInfo &Info) const override;
bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString, bool parseMSInlineAsm(std::string &AsmString, unsigned &NumOutputs,
unsigned &NumOutputs, unsigned &NumInputs, unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
SmallVectorImpl<std::string> &Constraints, SmallVectorImpl<std::string> &Constraints,
SmallVectorImpl<std::string> &Clobbers, SmallVectorImpl<std::string> &Clobbers,
@ -7257,8 +7257,8 @@ bool MasmParser::lookUpType(StringRef Name, AsmTypeInfo &Info) const {
} }
bool MasmParser::parseMSInlineAsm( bool MasmParser::parseMSInlineAsm(
void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs,
unsigned &NumInputs, SmallVectorImpl<std::pair<void *, bool>> &OpDecls, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
SmallVectorImpl<std::string> &Constraints, SmallVectorImpl<std::string> &Constraints,
SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII, SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII,
const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) { const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) {