brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 4aeaef6 Raw
28 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file implements a reduce pass to reduce various module data.10//11//===----------------------------------------------------------------------===//12 13#include "ReduceModuleData.h"14 15using namespace llvm;16 17void llvm::reduceModuleDataDeltaPass(Oracle &O, ReducerWorkItem &WorkItem) {18  Module &Program = WorkItem.getModule();19 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 once25  if (!Program.getModuleInlineAsm().empty() && !O.shouldKeep())26    Program.setModuleInlineAsm("");27}28