From e49985bb6065d4f5ea69fe578e326ec6d43a6b24 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 12 Jul 2021 15:05:12 +0100 Subject: [PATCH] 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 --- clang/lib/Parse/ParseStmtAsm.cpp | 6 +++--- llvm/include/llvm/MC/MCParser/MCAsmParser.h | 4 ++-- llvm/lib/MC/MCParser/AsmParser.cpp | 10 +++++----- llvm/lib/MC/MCParser/MasmParser.cpp | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index 9037895a3bbf..e520151dcad7 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -633,9 +633,9 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { SmallVector, 4> OpExprs; SmallVector Constraints; SmallVector Clobbers; - if (Parser->parseMSInlineAsm(AsmLoc.getPtrEncoding(), AsmStringIR, NumOutputs, - NumInputs, OpExprs, Constraints, Clobbers, - MII.get(), IP.get(), Callback)) + if (Parser->parseMSInlineAsm(AsmStringIR, NumOutputs, NumInputs, OpExprs, + Constraints, Clobbers, MII.get(), IP.get(), + Callback)) return StmtError(); // Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h index 56188b7ebaec..c9b3ab3256da 100644 --- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h +++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h @@ -202,8 +202,8 @@ public: /// Parse MS-style inline assembly. virtual bool parseMSInlineAsm( - void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, - unsigned &NumInputs, SmallVectorImpl> &OpDecls, + std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, + SmallVectorImpl> &OpDecls, SmallVectorImpl &Constraints, SmallVectorImpl &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) = 0; diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 3bc668e699cb..45e6dfee4ca4 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -258,9 +258,9 @@ public: return LTODiscardSymbols.contains(Name); } - bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString, - unsigned &NumOutputs, unsigned &NumInputs, - SmallVectorImpl> &OpDecls, + bool parseMSInlineAsm(std::string &AsmString, unsigned &NumOutputs, + unsigned &NumInputs, + SmallVectorImpl> &OpDecls, SmallVectorImpl &Constraints, SmallVectorImpl &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, @@ -5927,8 +5927,8 @@ static int rewritesSort(const AsmRewrite *AsmRewriteA, } bool AsmParser::parseMSInlineAsm( - void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, - unsigned &NumInputs, SmallVectorImpl> &OpDecls, + std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, + SmallVectorImpl> &OpDecls, SmallVectorImpl &Constraints, SmallVectorImpl &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) { diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp index a91623770116..a5a48d4b1e9d 100644 --- a/llvm/lib/MC/MCParser/MasmParser.cpp +++ b/llvm/lib/MC/MCParser/MasmParser.cpp @@ -514,9 +514,9 @@ public: bool lookUpType(StringRef Name, AsmTypeInfo &Info) const override; - bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString, - unsigned &NumOutputs, unsigned &NumInputs, - SmallVectorImpl> &OpDecls, + bool parseMSInlineAsm(std::string &AsmString, unsigned &NumOutputs, + unsigned &NumInputs, + SmallVectorImpl> &OpDecls, SmallVectorImpl &Constraints, SmallVectorImpl &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, @@ -7257,8 +7257,8 @@ bool MasmParser::lookUpType(StringRef Name, AsmTypeInfo &Info) const { } bool MasmParser::parseMSInlineAsm( - void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, - unsigned &NumInputs, SmallVectorImpl> &OpDecls, + std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, + SmallVectorImpl> &OpDecls, SmallVectorImpl &Constraints, SmallVectorImpl &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) {