23#define DEBUG_TYPE "annotation2metadata"
29 "annotation-remarks"))
32 auto *
Annotations = M.getGlobalVariable(
"llvm.global.annotations");
34 if (!
C ||
C->getNumOperands() != 1)
37 C = cast<Constant>(
C->getOperand(0));
41 for (
auto &
Op :
C->operands()) {
44 auto *OpC = dyn_cast<ConstantStruct>(&
Op);
45 if (!OpC || OpC->getNumOperands() != 4)
47 auto *StrC = dyn_cast<GlobalValue>(OpC->getOperand(1)->stripPointerCasts());
50 auto *StrData = dyn_cast<ConstantDataSequential>(StrC->getOperand(0));
53 auto *Fn = dyn_cast<Function>(OpC->getOperand(0)->stripPointerCasts());
59 I.addAnnotationMetadata(StrData->getAsCString());
Expand Atomic instructions
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.
A container for analyses that lazily runs them and caches their results.
Annotations lets you mark points and ranges inside source code, for tests:
This class represents an Operation in the Expression.
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.