LLVM: lib/Target/DirectX/DXILFinalizeLinkage.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
15
16#define DEBUG_TYPE "dxil-finalize-linkage"
17
18using namespace llvm;
19
22
23
24 for (Function &EF : M.functions()) {
25 if (EF.isIntrinsic())
26 continue;
27 if (EF.hasFnAttribute("hlsl.shader") || EF.hasFnAttribute("hlsl.export"))
28 continue;
30 }
31
35 if (F->isDefTriviallyDead())
36 M.getFunctionList().erase(F);
37 }
38
39 return false;
40}
41
47}
48
51}
52
54
56 "DXIL Finalize Linkage", false, false)
59
62}
static bool finalizeLinkage(Module &M)
Module.h This file contains the declarations for the Module class.
#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.