[flang][cuda] Add c_devloc as intrinsic and inline it during lowering (#120648)
[llvm-project.git] / llvm / tools / llvm-reduce / deltas / ReduceModuleData.cpp
blob17930abe6dbfe552f52a4ef5c4209a14dc64ff35
1 //===- ReduceModuleData.cpp -----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements a reduce pass to reduce various module data.
11 //===----------------------------------------------------------------------===//
13 #include "ReduceModuleData.h"
15 using namespace llvm;
17 static void clearModuleData(Oracle &O, ReducerWorkItem &WorkItem) {
18 Module &Program = WorkItem.getModule();
20 if (!Program.getModuleIdentifier().empty() && !O.shouldKeep())
21 Program.setModuleIdentifier("");
22 if (!Program.getSourceFileName().empty() && !O.shouldKeep())
23 Program.setSourceFileName("");
24 // TODO: clear line by line rather than all at once
25 if (!Program.getModuleInlineAsm().empty() && !O.shouldKeep())
26 Program.setModuleInlineAsm("");
29 void llvm::reduceModuleDataDeltaPass(TestRunner &Test) {
30 runDeltaPass(Test, clearModuleData, "Reducing Module Data");