1//===- DXILFinalizeLinkage.cpp - Finalize linkage of functions ------------===// 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 7//===----------------------------------------------------------------------===// 16#define DEBUG_TYPE "dxil-finalize-linkage" 23// Collect non-entry and non-exported functions to set to internal linkage. 27if (EF.hasFnAttribute(
"hlsl.shader") || EF.hasFnAttribute(
"hlsl.export"))
35if (
F->isDefTriviallyDead())
36 M.getFunctionList().erase(
F);
56"DXIL Finalize Linkage",
false,
false)
static bool finalizeLinkage(Module &M)
Module.h This file contains the declarations for the Module class.
This file contains the declarations for metadata subclasses.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
A container for analyses that lazily runs them and caches their results.
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
@ InternalLinkage
Rename collisions when linking (static functions).
@ ExternalLinkage
Externally visible function.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createDXILFinalizeLinkageLegacyPass()
Pass to finalize linkage of functions.