Home
last modified time | relevance | path

Searched refs:sourceMgr (Results 1 – 25 of 36) sorted by relevance

12

/llvm-project-15.0.7/mlir/lib/Parser/
H A DParser.cpp19 LogicalResult mlir::parseSourceFile(const llvm::SourceMgr &sourceMgr, in parseSourceFile() argument
22 const auto *sourceBuf = sourceMgr.getMemoryBuffer(sourceMgr.getMainFileID()); in parseSourceFile()
28 return parseAsmSourceFile(sourceMgr, block, config); in parseSourceFile()
34 llvm::SourceMgr sourceMgr; in parseSourceFile() local
35 return parseSourceFile(filename, sourceMgr, block, config, sourceFileLoc); in parseSourceFile()
42 if (sourceMgr.getNumBuffers() != 0) { in parseSourceFile()
53 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), SMLoc()); in parseSourceFile()
54 return parseSourceFile(sourceMgr, block, config, sourceFileLoc); in parseSourceFile()
64 llvm::SourceMgr sourceMgr; in parseSourceString() local
65 sourceMgr.AddNewSourceBuffer(std::move(memBuffer), SMLoc()); in parseSourceString()
[all …]
/llvm-project-15.0.7/mlir/lib/Tools/lsp-server-support/
H A DSourceMgrUtils.cpp82 void lsp::gatherIncludeFiles(llvm::SourceMgr &sourceMgr, in gatherIncludeFiles() argument
84 for (unsigned i = 1, e = sourceMgr.getNumBuffers(); i < e; ++i) { in gatherIncludeFiles()
86 SMLoc includeLoc = sourceMgr.getBufferInfo(i + 1).IncludeLoc; in gatherIncludeFiles()
87 if (!includeLoc.isValid() || sourceMgr.FindBufferContainingLoc( in gatherIncludeFiles()
88 includeLoc) != sourceMgr.getMainFileID()) in gatherIncludeFiles()
92 auto *buffer = sourceMgr.getMemoryBuffer(i + 1); in gatherIncludeFiles()
107 includes.emplace_back(*includedFileURI, Range(sourceMgr, includeRange)); in gatherIncludeFiles()
/llvm-project-15.0.7/mlir/lib/Tools/mlir-translate/
H A DTranslation.cpp59 auto wrappedFn = [function](llvm::SourceMgr &sourceMgr, raw_ostream &output, in registerTranslateToMLIRFunction()
61 OwningOpRef<ModuleOp> module = function(sourceMgr, context); in registerTranslateToMLIRFunction()
80 name, [function](llvm::SourceMgr &sourceMgr, MLIRContext *ctx) { in TranslateToMLIRRegistration() argument
82 sourceMgr.getMemoryBuffer(sourceMgr.getMainFileID()); in TranslateToMLIRRegistration()
95 llvm::SourceMgr &sourceMgr, raw_ostream &output, in TranslateFromMLIRRegistration()
100 auto module = parseSourceFile<ModuleOp>(sourceMgr, context); in TranslateFromMLIRRegistration()
H A DMlirTranslateMain.cpp85 llvm::SourceMgr sourceMgr; in mlirTranslateMain() local
86 sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), SMLoc()); in mlirTranslateMain()
89 SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); in mlirTranslateMain()
90 return (*translationRequested)(sourceMgr, os, &context); in mlirTranslateMain()
96 SourceMgrDiagnosticVerifierHandler sourceMgrHandler(sourceMgr, &context); in mlirTranslateMain()
97 (void)(*translationRequested)(sourceMgr, os, &context); in mlirTranslateMain()
/llvm-project-15.0.7/mlir/lib/AsmParser/
H A DLexer.cpp30 Lexer::Lexer(const llvm::SourceMgr &sourceMgr, MLIRContext *context, in Lexer() argument
32 : sourceMgr(sourceMgr), context(context), codeCompleteLoc(nullptr) { in Lexer()
33 auto bufferID = sourceMgr.getMainFileID(); in Lexer()
34 curBuffer = sourceMgr.getMemoryBuffer(bufferID)->getBuffer(); in Lexer()
45 auto &sourceMgr = getSourceMgr(); in getEncodedSourceLocation() local
46 unsigned mainFileID = sourceMgr.getMainFileID(); in getEncodedSourceLocation()
50 auto &bufferInfo = sourceMgr.getBufferInfo(mainFileID); in getEncodedSourceLocation()
54 auto *buffer = sourceMgr.getMemoryBuffer(mainFileID); in getEncodedSourceLocation()
H A DLexer.h25 explicit Lexer(const llvm::SourceMgr &sourceMgr, MLIRContext *context,
28 const llvm::SourceMgr &getSourceMgr() { return sourceMgr; } in getSourceMgr()
66 const llvm::SourceMgr &sourceMgr; variable
H A DParserState.h48 ParserState(const llvm::SourceMgr &sourceMgr, const ParserConfig &config, in ParserState()
52 lex(sourceMgr, config.getContext(), codeCompleteContext), in ParserState()
H A DDialectSymbolParser.cpp303 SourceMgr sourceMgr; in parseSymbol() local
307 sourceMgr.AddNewSourceBuffer(std::move(memBuffer), SMLoc()); in parseSymbol()
310 ParserState state(sourceMgr, config, aliasState, /*asmState=*/nullptr, in parseSymbol()
/llvm-project-15.0.7/mlir/lib/Tools/mlir-lsp-server/
H A DMLIRServer.cpp54 SMLoc loc = sourceMgr.FindLocForLineAndColumn( in getLocationFromLoc()
309 llvm::SourceMgr sourceMgr; member
343 SMLoc posLoc = defPos.getAsSMLoc(sourceMgr); in getLocationsOf()
349 locations.emplace_back(uri, sourceMgr, def.loc); in getLocationsOf()
384 references.emplace_back(uri, sourceMgr, def.loc); in findReferencesOf()
386 references.emplace_back(uri, sourceMgr, use); in findReferencesOf()
389 SMLoc posLoc = pos.getAsSMLoc(sourceMgr); in findReferencesOf()
430 SMLoc posLoc = hoverPos.getAsSMLoc(sourceMgr); in findHover()
477 lsp::Hover hover(lsp::Range(sourceMgr, hoverRange)); in buildHoverForOperation()
787 SMLoc posLoc = completePos.getAsSMLoc(sourceMgr); in getCodeCompletion()
[all …]
/llvm-project-15.0.7/mlir/lib/Tools/mlir-pdll-lsp-server/
H A DPDLLServer.cpp402 llvm::SourceMgr sourceMgr; member
435 sourceMgr.setIncludeDirs(includeDirs); in PDLDocument()
462 SMLoc posLoc = defPos.getAsSMLoc(sourceMgr); in getLocationsOf()
473 SMLoc posLoc = pos.getAsSMLoc(sourceMgr); in findReferencesOf()
678 lsp::Range(sourceMgr, bodyLoc), lsp::Range(sourceMgr, nameLoc)); in findDocumentSymbols()
686 lsp::Range(sourceMgr, bodyLoc), lsp::Range(sourceMgr, nameLoc)); in findDocumentSymbols()
694 lsp::Range(sourceMgr, bodyLoc), lsp::Range(sourceMgr, nameLoc)); in findDocumentSymbols()
710 : CodeCompleteContext(completeLoc), sourceMgr(sourceMgr), in LSPCodeCompleteContext()
1016 llvm::SourceMgr &sourceMgr; member in __anon9e2fdad81011::LSPCodeCompleteContext
1055 : CodeCompleteContext(completeLoc), sourceMgr(sourceMgr), in LSPSignatureHelpContext()
[all …]
/llvm-project-15.0.7/mlir/lib/Tools/mlir-opt/
H A DMlirOptMain.cpp48 bool verifyPasses, SourceMgr &sourceMgr, in performActions() argument
73 OwningOpRef<ModuleOp> module(parseSourceFile<ModuleOp>(sourceMgr, config)); in performActions()
103 SourceMgr sourceMgr; in processBuffer() local
104 sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), SMLoc()); in processBuffer()
123 SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); in processBuffer()
124 return performActions(os, verifyDiagnostics, verifyPasses, sourceMgr, in processBuffer()
128 SourceMgrDiagnosticVerifierHandler sourceMgrHandler(sourceMgr, &context); in processBuffer()
133 (void)performActions(os, verifyDiagnostics, verifyPasses, sourceMgr, &context, in processBuffer()
/llvm-project-15.0.7/mlir/include/mlir/Parser/
H A DParser.h82 LogicalResult parseSourceFile(const llvm::SourceMgr &sourceMgr, Block *block,
105 llvm::SourceMgr &sourceMgr, Block *block,
146 parseSourceFile(const llvm::SourceMgr &sourceMgr, const ParserConfig &config) { in parseSourceFile() argument
147 return detail::parseSourceFile<ContainerOpT>(config, sourceMgr); in parseSourceFile()
174 llvm::SourceMgr &sourceMgr, in parseSourceFile() argument
176 return detail::parseSourceFile<ContainerOpT>(config, filename, sourceMgr); in parseSourceFile()
/llvm-project-15.0.7/mlir/examples/toy/Ch3/
H A Dtoyc.cpp74 int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, in loadMLIR() argument
95 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in loadMLIR()
96 module = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in loadMLIR()
110 llvm::SourceMgr sourceMgr; in dumpMLIR() local
111 mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); in dumpMLIR()
112 if (int error = loadMLIR(sourceMgr, context, module)) in dumpMLIR()
/llvm-project-15.0.7/mlir/examples/toy/Ch4/
H A Dtoyc.cpp75 int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, in loadMLIR() argument
96 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in loadMLIR()
97 module = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in loadMLIR()
111 llvm::SourceMgr sourceMgr; in dumpMLIR() local
112 mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); in dumpMLIR()
113 if (int error = loadMLIR(sourceMgr, context, module)) in dumpMLIR()
/llvm-project-15.0.7/mlir/lib/Tools/tblgen-lsp-server/
H A DTableGenServer.cpp59 auto *sourceMgr = const_cast<llvm::SourceMgr *>(diag.getSourceMgr()); in getLspDiagnoticFromDiag() local
60 if (!sourceMgr || !diag.getLoc().isValid()) in getLspDiagnoticFromDiag()
292 llvm::SourceMgr sourceMgr; member in __anond136bf7d0411::TableGenTextFile
339 sourceMgr = llvm::SourceMgr(); in initialize()
348 sourceMgr.setIncludeDirs(includeDirs); in initialize()
349 sourceMgr.AddNewSourceBuffer(std::move(memBuffer), SMLoc()); in initialize()
359 sourceMgr.setDiagHandler( in initialize()
369 lsp::gatherIncludeFiles(sourceMgr, parsedIncludes); in initialize()
384 SMLoc posLoc = defPos.getAsSMLoc(sourceMgr); in getLocationsOf()
395 SMLoc posLoc = pos.getAsSMLoc(sourceMgr); in findReferencesOf()
[all …]
/llvm-project-15.0.7/mlir/tools/mlir-pdll/
H A Dmlir-pdll.cpp42 llvm::SourceMgr sourceMgr; in processBuffer() local
43 sourceMgr.setIncludeDirs(includeDirs); in processBuffer()
44 sourceMgr.AddNewSourceBuffer(std::move(chunkBuffer), SMLoc()); in processBuffer()
53 parsePDLLAST(astContext, sourceMgr, enableDocumentation); in processBuffer()
59 for (unsigned i = 1, e = sourceMgr.getNumBuffers(); i < e; ++i) { in processBuffer()
61 sourceMgr.getMemoryBuffer(i + 1)->getBufferIdentifier().str()); in processBuffer()
77 codegenPDLLToMLIR(&mlirContext, astContext, sourceMgr, **module); in processBuffer()
/llvm-project-15.0.7/mlir/examples/toy/Ch5/
H A Dtoyc.cpp79 int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, in loadMLIR() argument
100 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in loadMLIR()
101 module = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in loadMLIR()
115 llvm::SourceMgr sourceMgr; in dumpMLIR() local
116 mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); in dumpMLIR()
117 if (int error = loadMLIR(sourceMgr, context, module)) in dumpMLIR()
/llvm-project-15.0.7/mlir/lib/Target/SPIRV/
H A DTranslateRegistration.cpp71 [](llvm::SourceMgr &sourceMgr, MLIRContext *context) { in registerFromSPIRVTranslation() argument
72 assert(sourceMgr.getNumBuffers() == 1 && "expected one buffer"); in registerFromSPIRVTranslation()
74 sourceMgr.getMemoryBuffer(sourceMgr.getMainFileID()), context); in registerFromSPIRVTranslation()
/llvm-project-15.0.7/mlir/examples/toy/Ch2/
H A Dtoyc.cpp98 llvm::SourceMgr sourceMgr; in dumpMLIR() local
99 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in dumpMLIR()
101 mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in dumpMLIR()
/llvm-project-15.0.7/mlir/test/lib/IR/
H A DTestDiagnostics.cpp48 llvm::SourceMgr sourceMgr; in runOnOperation() local
49 SourceMgrDiagnosticHandler handler(sourceMgr, &getContext(), llvm::errs(), in runOnOperation()
/llvm-project-15.0.7/flang/tools/tco/
H A Dtco.cpp76 SourceMgr sourceMgr; in compileFIR() local
77 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), SMLoc()); in compileFIR()
83 auto owningRef = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in compileFIR()
/llvm-project-15.0.7/mlir/include/mlir/Tools/mlir-translate/
H A DTranslation.h37 llvm::SourceMgr &sourceMgr, MLIRContext *)>;
57 llvm::SourceMgr &sourceMgr, llvm::raw_ostream &output, MLIRContext *)>;
/llvm-project-15.0.7/mlir/lib/Tools/PDLL/CodeGen/
H A DMLIRGen.cpp37 const llvm::SourceMgr &sourceMgr) in CodeGen() argument
39 sourceMgr(sourceMgr) { in CodeGen()
127 const llvm::SourceMgr &sourceMgr; member in __anon537d7da60111::CodeGen
144 unsigned fileID = sourceMgr.FindBufferContainingLoc(loc); in genLoc()
148 auto &bufferInfo = sourceMgr.getBufferInfo(fileID); in genLoc()
152 auto *buffer = sourceMgr.getMemoryBuffer(fileID); in genLoc()
609 const llvm::SourceMgr &sourceMgr, const ast::Module &module) { in codegenPDLLToMLIR() argument
610 CodeGen codegen(mlirContext, context, sourceMgr); in codegenPDLLToMLIR()
/llvm-project-15.0.7/mlir/examples/toy/Ch6/
H A Dtoyc.cpp120 llvm::SourceMgr sourceMgr; in loadMLIR() local
121 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in loadMLIR()
122 module = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in loadMLIR()
/llvm-project-15.0.7/mlir/examples/toy/Ch7/
H A Dtoyc.cpp120 llvm::SourceMgr sourceMgr; in loadMLIR() local
121 sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); in loadMLIR()
122 module = mlir::parseSourceFile<mlir::ModuleOp>(sourceMgr, &context); in loadMLIR()

12