[PATCH] D125272: [clang] Add -fcheck-new support

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 24 19:05:43 PDT 2022


jrtc27 added inline comments.


================
Comment at: clang/test/CodeGenCXX/fcheck-new.cpp:3
+// RUN: %clang_cc1 -fcheck-new -triple x86_64-linux-gnu -S -disable-O0-optnone \
+// RUN: -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
----------------
MaskRay wrote:
> Please remove `opt`. Optimizations should be tested in the llvm/ layer, not in clang codegen.
> 
> If utils/update_cc_test_checks.py does not generate good looking IR, write it by hand.
Disagree. This is a pattern that is extremely useful for testing Clang's IR generation whilst cleaning up the alloca so the IR is readable. This is not about the generated checks, this is about alloca/load/store everywhere being a pain to inspect, whereas a simple mem2reg cleans this up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125272/new/

https://reviews.llvm.org/D125272



More information about the cfe-commits mailing list