mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-06 01:22:41 +00:00
969e7edd88
Summary: This introduces a new SourceMgr::FindLocForLineAndColumn method that uses the OffsetCache in SourceMgr::SrcBuffer to do do a constant time lookup for the line number (once the cache is populated). Use this method in MLIR's SourceMgrDiagnosticHandler::convertLocToSMLoc, replacing the O(n) scanning logic. This resolves a long standing TODO in MLIR, and makes one of my usecases go dramatically faster (which is currently producing many diagnostics in a 40MB SourceBuffer). NFC, this is just a performance speedup and cleanup. Reviewers: rriddle!, ftynse! Subscribers: hiraditya, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78868
The LLVM Compiler Infrastructure ================================ This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. Please see the documentation provided in docs/ for further assistance with LLVM, and in particular docs/GettingStarted.rst for getting started with LLVM and docs/README.txt for an overview of LLVM's documentation setup. If you are writing a package for LLVM, see docs/Packaging.rst for our suggestions.