mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
[msan] A no-op implementation of VarArg handling.
This stuff is used on platforms where MSan does not have a proper VarArg implementation (anything other than x86_64 at the moment). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,6 +74,7 @@
|
||||
#include "llvm/ADT/DepthFirstIterator.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/ADT/ValueMap.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
@@ -1963,9 +1964,29 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
||||
}
|
||||
};
|
||||
|
||||
VarArgHelper* CreateVarArgHelper(Function &Func, MemorySanitizer &Msan,
|
||||
/// \brief A no-op implementation of VarArgHelper.
|
||||
struct VarArgNoOpHelper : public VarArgHelper {
|
||||
VarArgNoOpHelper(Function &F, MemorySanitizer &MS,
|
||||
MemorySanitizerVisitor &MSV) {}
|
||||
|
||||
void visitCallSite(CallSite &CS, IRBuilder<> &IRB) {}
|
||||
|
||||
void visitVAStartInst(VAStartInst &I) {}
|
||||
|
||||
void visitVACopyInst(VACopyInst &I) {}
|
||||
|
||||
void finalizeInstrumentation() {}
|
||||
};
|
||||
|
||||
VarArgHelper *CreateVarArgHelper(Function &Func, MemorySanitizer &Msan,
|
||||
MemorySanitizerVisitor &Visitor) {
|
||||
return new VarArgAMD64Helper(Func, Msan, Visitor);
|
||||
// VarArg handling is only implemented on AMD64. False positives are possible
|
||||
// on other platforms.
|
||||
llvm::Triple TargetTriple(Func.getParent()->getTargetTriple());
|
||||
if (TargetTriple.getArch() == llvm::Triple::x86_64)
|
||||
return new VarArgAMD64Helper(Func, Msan, Visitor);
|
||||
else
|
||||
return new VarArgNoOpHelper(Func, Msan, Visitor);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user