mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Transform: add SymbolRewriter pass
This introduces the symbol rewriter. This is an IR->IR transformation that is implemented as a CodeGenPrepare pass. This allows for the transparent adjustment of the symbols during compilation. It provides a clean, simple, elegant solution for symbol inter-positioning. This technique is often used, such as in the various sanitizers and performance analysis. The control of this is via a custom YAML syntax map file that indicates source to destination mapping, so as to avoid having the compiler to know the exact details of the source to destination transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
#include "llvm/Transforms/Utils/SymbolRewriter.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
@@ -445,6 +446,7 @@ void TargetPassConfig::addPassesToHandleExceptions() {
|
||||
void TargetPassConfig::addCodeGenPrepare() {
|
||||
if (getOptLevel() != CodeGenOpt::None && !DisableCGP)
|
||||
addPass(createCodeGenPreparePass(TM));
|
||||
addPass(llvm::createRewriteSymbolsPass());
|
||||
}
|
||||
|
||||
/// Add common passes that perform LLVM IR to IR transforms in preparation for
|
||||
|
Reference in New Issue
Block a user