#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
+#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
llvm::DIScope DS(RegionStack.back());
llvm::DILocation DO(NULL);
- llvm::DILocation DL =
- DebugFactory.CreateLocation(Line, Column, DS, DO);
- Builder.SetDebugLocation(Call, DL.getNode());
+ llvm::DILocation DL = DebugFactory.CreateLocation(Line, Column, DS, DO);
+
+ // TODO: Remove #include of LLVMContext from this.
+ llvm::LLVMContext &Context = Call->getContext();
+ unsigned DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+ Context.getMetadata().addMD(DbgMDKind, DL.getNode(), Call);
}
/// EmitDeclare - Emit local variable declaration debug info.
llvm::DILocation DO(NULL);
llvm::DILocation DL =
DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
- Builder.SetDebugLocation(Call, DL.getNode());
+
+ // TODO: Remove #include of LLVMContext from this.
+ llvm::LLVMContext &Context = Call->getContext();
+ unsigned DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+ Context.getMetadata().addMD(DbgMDKind, DL.getNode(), Call);
+
}
void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *Decl,
#include "llvm/CallingConv.h"
#include "llvm/Module.h"
#include "llvm/Intrinsics.h"
+#include "llvm/LLVMContext.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/ErrorHandling.h"
using namespace clang;
CI->replaceAllUsesWith(NewCall);
// Copy any custom metadata attached with CI.
- llvm::MetadataContext &TheMetadata = CI->getContext().getMetadata();
- TheMetadata.copyMD(CI, NewCall);
-
+ CI->getContext().getMetadata().copyMD(CI, NewCall);
CI->eraseFromParent();
}
}