MCFixup: Improve location accuracy and remove MCFixup::Loc Remove the redundant MCFixup::Loc member and instead use MCExpr::Loc to determine the location for fixups. Previously, many target MCCodeEmitter would use the beginning of an instruction for fixup locations, which often resulted in inaccurate column information. ``` // RISCVMCCodeEmitter::getImmOpValue Fixups.push_back(MCFixup::create(0, Expr, FixupKind, MI.getLoc())); // X86MCCodeEmitter::emitImmediate Fixups.push_back(MCFixup::create(static_cast<uint32_t>(CB.size() - StartByte), Expr, FixupKind, Loc)); ``` While MCExpr::Loc generally provides more meaningful location data, tests should avoid over-relying on it. For instance, MCBinaryExpr's location refers to its operator, and for operands with sigils (like `$foo`), the location often omits the sigils. https://llvm-compile-time-tracker.com/compare.php?from=8740ff822d462844506134bb7c425e1778518b95&to=831a11f75d22d64982b13dba132d656ac8567612&stat=instructions%3Au I've also considered removing MCExpr::Loc (revert https://reviews.llvm.org/D28861), but we'd lose too much information. It's also difficult to carry location information to improve location tracking in target MCCodeEmitter. This change utilizes previous MCExpr::Loc improvement like 7e3e2e1b8c6ff21e68782a56164139cca334fcf3 7b517cf743f112f980cf6a4d6e6190c2a5b3e451
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.