[all-commits] [llvm/llvm-project] 395c8b: [MC] Make MCStreamer aware of AsmParser's StartTokLoc

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Nov 2 12:32:25 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 395c8bed64509a951b94d30aa8caff034d7b542e
      https://github.com/llvm/llvm-project/commit/395c8bed64509a951b94d30aa8caff034d7b542e
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M llvm/include/llvm/MC/MCELFStreamer.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCWasmStreamer.h
    M llvm/include/llvm/MC/MCWinCOFFStreamer.h
    M llvm/include/llvm/MC/MCXCOFFStreamer.h
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCELFStreamer.cpp
    M llvm/lib/MC/MCMachOStreamer.cpp
    M llvm/lib/MC/MCNullStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/lib/MC/MCWasmStreamer.cpp
    M llvm/lib/MC/MCWinCOFFStreamer.cpp
    M llvm/lib/MC/MCXCOFFStreamer.cpp
    M llvm/lib/Object/RecordStreamer.cpp
    M llvm/lib/Object/RecordStreamer.h
    M llvm/test/MC/ELF/symbol-binding-changed.s
    M llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
    M llvm/tools/llvm-mca/CodeRegionGenerator.cpp
    M llvm/unittests/CodeGen/TestAsmPrinter.h

  Log Message:
  -----------
  [MC] Make MCStreamer aware of AsmParser's StartTokLoc

A SMLoc allows MCStreamer to report location-aware diagnostics, which
were previously done by adding SMLoc to various methods (e.g. emit*) in an ad-hoc way.

Since the file:line is most important, the column is less important and
the start token location suffices in many cases, this patch reverts
b7e7131af2dd7bdb03fa42a3bc1b4bc72ab95ce1

```
// old
symbol-binding-changed.s:6:8: error: local changed binding to STB_GLOBAL
.globl local
       ^
// new
symbol-binding-changed.s:6:1: error: local changed binding to STB_GLOBAL
.globl local
^
```

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D90511




More information about the All-commits mailing list