[libunwind] [libcxx] [clang] [clang-tools-extra] [llvm] [libc++] Allow running the test suite with optimizations (PR #68753)

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 11:54:41 PST 2023


================
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUPPORT_ESCAPE_H
+#define SUPPORT_ESCAPE_H
+
+#include "test_macros.h"
+
+namespace support {
+// This function can be used to hide some objects from compiler optimizations.
+//
+// For example, this is useful to hide the result of a call to `new` and ensure
+// ensure that the compiler doesn't elide the call to new/delete. Otherwise,
----------------
mordante wrote:

```suggestion
// For example, this is useful to hide the result of a call to `new` and ensure
// that the compiler doesn't elide the call to new/delete. Otherwise,
```

https://github.com/llvm/llvm-project/pull/68753


More information about the cfe-commits mailing list