summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f945d09)
raw | patch | inline | side by side (parent: f945d09)
author | Adrian Prantl <aprantl@apple.com> | |
Thu, 2 May 2013 17:27:49 +0000 (17:27 +0000) | ||
committer | Adrian Prantl <aprantl@apple.com> | |
Thu, 2 May 2013 17:27:49 +0000 (17:27 +0000) |
to emitted instructions. Use this if you want an instruction to be
counted towards the prologue or if there is no useful source location.
rdar://problem/13442648
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180929 91177308-0d34-0410-b5e6-96231b3b80d8
counted towards the prologue or if there is no useful source location.
rdar://problem/13442648
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180929 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/IRBuilder.h | patch | blob | history |
index 189ba3d305c41fdbda2977098c99c8c2a593c830..f11d3b4e0b270269b85d6b6c30527d3aa392aeb7 100644 (file)
class IRBuilderBase {
DebugLoc CurDbgLocation;
protected:
+ /// Save the current debug location here while we are suppressing
+ /// line table entries.
+ llvm::DebugLoc SavedDbgLocation;
+
BasicBlock *BB;
BasicBlock::iterator InsertPt;
LLVMContext &Context;
CurDbgLocation = L;
}
+ /// \brief Temporarily suppress DebugLocations from being attached
+ /// to emitted instructions, until the next call to
+ /// SetCurrentDebugLocation() or EnableDebugLocations(). Use this
+ /// if you want an instruction to be counted towards the prologue or
+ /// if there is no useful source location.
+ void DisableDebugLocations() {
+ llvm::DebugLoc Empty;
+ SavedDbgLocation = getCurrentDebugLocation();
+ SetCurrentDebugLocation(Empty);
+ }
+
+ /// \brief Restore the previously saved DebugLocation.
+ void EnableDebugLocations() {
+ assert(CurDbgLocation.isUnknown());
+ SetCurrentDebugLocation(SavedDbgLocation);
+ }
+
/// \brief Get location information used by debugging information.
DebugLoc getCurrentDebugLocation() const { return CurDbgLocation; }