forked from OSchip/llvm-project
Fix modules build by moving implementation into .cpp file
This commit is contained in:
parent
c7b71acef2
commit
24bc072edb
|
@ -23,7 +23,6 @@
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
#include "llvm/IR/DebugInfo.h"
|
#include "llvm/IR/DebugInfo.h"
|
||||||
#include "llvm/IR/DebugInfoMetadata.h"
|
#include "llvm/IR/DebugInfoMetadata.h"
|
||||||
#include "llvm/IR/Intrinsics.h"
|
|
||||||
#include "llvm/IR/TrackingMDRef.h"
|
#include "llvm/IR/TrackingMDRef.h"
|
||||||
#include "llvm/Support/Casting.h"
|
#include "llvm/Support/Casting.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -99,23 +98,13 @@ namespace llvm {
|
||||||
Instruction *
|
Instruction *
|
||||||
insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
|
insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
|
||||||
DIExpression *Expr, const DILocation *DL,
|
DIExpression *Expr, const DILocation *DL,
|
||||||
BasicBlock *InsertBB, Instruction *InsertBefore) {
|
BasicBlock *InsertBB, Instruction *InsertBefore);
|
||||||
if (!ValueFn)
|
|
||||||
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
|
|
||||||
return insertDbgIntrinsic(ValueFn, Val, VarInfo, Expr, DL, InsertBB,
|
|
||||||
InsertBefore);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Internal helper for insertDbgAddrIntrinsic.
|
/// Internal helper for insertDbgAddrIntrinsic.
|
||||||
Instruction *
|
Instruction *
|
||||||
insertDbgAddrIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
|
insertDbgAddrIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
|
||||||
DIExpression *Expr, const DILocation *DL,
|
DIExpression *Expr, const DILocation *DL,
|
||||||
BasicBlock *InsertBB, Instruction *InsertBefore) {
|
BasicBlock *InsertBB, Instruction *InsertBefore);
|
||||||
if (!AddrFn)
|
|
||||||
AddrFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_addr);
|
|
||||||
return insertDbgIntrinsic(AddrFn, Val, VarInfo, Expr, DL, InsertBB,
|
|
||||||
InsertBefore);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Construct a builder for a module.
|
/// Construct a builder for a module.
|
||||||
|
|
|
@ -1013,6 +1013,24 @@ static Function *getDeclareIntrin(Module &M) {
|
||||||
: Intrinsic::dbg_declare);
|
: Intrinsic::dbg_declare);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Instruction *DIBuilder::insertDbgValueIntrinsic(
|
||||||
|
llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr,
|
||||||
|
const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore) {
|
||||||
|
if (!ValueFn)
|
||||||
|
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
|
||||||
|
return insertDbgIntrinsic(ValueFn, Val, VarInfo, Expr, DL, InsertBB,
|
||||||
|
InsertBefore);
|
||||||
|
}
|
||||||
|
|
||||||
|
Instruction *DIBuilder::insertDbgAddrIntrinsic(
|
||||||
|
llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr,
|
||||||
|
const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore) {
|
||||||
|
if (!AddrFn)
|
||||||
|
AddrFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_addr);
|
||||||
|
return insertDbgIntrinsic(AddrFn, Val, VarInfo, Expr, DL, InsertBB,
|
||||||
|
InsertBefore);
|
||||||
|
}
|
||||||
|
|
||||||
Instruction *DIBuilder::insertDeclare(Value *Storage, DILocalVariable *VarInfo,
|
Instruction *DIBuilder::insertDeclare(Value *Storage, DILocalVariable *VarInfo,
|
||||||
DIExpression *Expr, const DILocation *DL,
|
DIExpression *Expr, const DILocation *DL,
|
||||||
BasicBlock *InsertBB,
|
BasicBlock *InsertBB,
|
||||||
|
|
Loading…
Reference in New Issue