[llvm] Introduce DIExpression::foldConstantMath() (PR #71718)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 17:46:18 PDT 2024


================
@@ -0,0 +1,81 @@
+//===- llvm/IR/DIExpressionOptimizer.h - Constant folding of DIExpressions --*-
+//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
+//
+//===----------------------------------------------------------------------===//
+//
+// Declarations for functions to constant fold DIExpressions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_DIEXPRESSIONOPTIMIZER_H
+#define LLVM_IR_DIEXPRESSIONOPTIMIZER_H
+
+#include "llvm/IR/DebugInfoMetadata.h"
+
+using namespace llvm;
+
+/// Returns true if the Op is a DW_OP_constu.
+bool isConstantVal(uint64_t Op);
----------------
adrian-prantl wrote:

And then you probably don't even need a new header file.

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


More information about the llvm-commits mailing list