[all-commits] [llvm/llvm-project] 301d92: [AsmParser][SystemZ][z/OS] Re-introduce HLASM comm...

Anirudh Prasad via All-commits all-commits at lists.llvm.org
Wed Mar 24 07:17:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 301d9261b787b25a3b1a80af425fea4366f9330d
      https://github.com/llvm/llvm-project/commit/301d9261b787b25a3b1a80af425fea4366f9330d
  Author: Anirudh Prasad <anirudh_prasad at hotmail.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/lib/MC/MCParser/AsmLexer.cpp
    M llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
    A llvm/unittests/MC/SystemZ/CMakeLists.txt
    A llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp

  Log Message:
  -----------
  [AsmParser][SystemZ][z/OS] Re-introduce HLASM comment syntax

- https://reviews.llvm.org/rGb605cfb336989705f391d255b7628062d3dfe9c3 was reverted due to sanitizer bugs in the introduced unit-test (specifically in the Address sanitizer https://lab.llvm.org/buildbot/#/builders/5/builds/5697)
- This patch attempts to rectify that, as well as re-factor parts of the test
- The issue was previously, within the `setupCallToAsmParser` function in the unit-test, `SrcMgr` was declared as a local variable. `SrcMgr` owns a unique pointer. Since the variable goes out of scope at the end of the function, the unique pointer is released.
- This patch, moves the declaration of the `SrcMgr` variable to a class field, since the scope will remain until the class's destructor is invoked (which in this case is at the end of the unit test)
- Furthermore, this patch also moves the `MCContext Ctx` declaration from a local variable instance inside a function, to a unique pointer class field. This ensures the instantiation of the MCContext remains until the tear down of the test.

Reviewed By: abhina.sreeskantharajan

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




More information about the All-commits mailing list