24#define DEBUG_TYPE "annotation2metadata"
30 "annotation-remarks"))
33 auto *
Annotations = M.getGlobalVariable(
"llvm.global.annotations");
35 if (!
C ||
C->getNumOperands() != 1)
38 C = cast<Constant>(
C->getOperand(0));
42 for (
auto &Op :
C->operands()) {
45 auto *OpC = dyn_cast<ConstantStruct>(&Op);
46 if (!OpC || OpC->getNumOperands() != 4)
48 auto *StrC = dyn_cast<GlobalValue>(OpC->getOperand(1)->stripPointerCasts());
51 auto *StrData = dyn_cast<ConstantDataSequential>(StrC->getOperand(0));
54 auto *Fn = dyn_cast<Function>(OpC->getOperand(0)->stripPointerCasts());
60 I.addAnnotationMetadata(StrData->getAsCString());
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
print must be executed print the must be executed context for all instructions
A container for analyses that lazily runs them and caches their results.
Annotations lets you mark points and ranges inside source code, for tests:
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.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.