summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-05-02 17:27:49 +0000
committerAdrian Prantl <aprantl@apple.com>2013-05-02 17:27:49 +0000
commit9ee5840de4e739bd1f03b54254aac92a4c8ea26a (patch)
treec564d909be4c3520687f006ed02e3b82c3e81016 /llvm
parent05e2c79f87e08ce00388e3e90c57cf6759a452a2 (diff)
downloadbcm5719-llvm-9ee5840de4e739bd1f03b54254aac92a4c8ea26a.tar.gz
bcm5719-llvm-9ee5840de4e739bd1f03b54254aac92a4c8ea26a.zip
Provide an API to temporarily suppress DebugLocations from being attached
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 llvm-svn: 180929
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/IRBuilder.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 189ba3d305c..f11d3b4e0b2 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -49,6 +49,10 @@ protected:
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;
@@ -113,6 +117,23 @@ public:
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; }
OpenPOWER on IntegriCloud