summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-12-29 23:49:00 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-12-29 23:49:00 +0000
commit608a24501c73ee2384464fa1c1703e28116d05f3 (patch)
treed99f56fc9d07ecdd2e2af2044f4ea3c8a566e04c /clang/lib/CodeGen/CGDebugInfo.h
parentb7373cd6398eee6a35d20a623bb6fb06f5414dc0 (diff)
downloadbcm5719-llvm-608a24501c73ee2384464fa1c1703e28116d05f3.tar.gz
bcm5719-llvm-608a24501c73ee2384464fa1c1703e28116d05f3.zip
Revert "DebugInfo: Generalize debug info location handling"
Asserting when building compiler-rt when using a GCC host compiler. Reverting while I investigate. This reverts commit r224941. llvm-svn: 224970
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 274cbc4f365..9649e296160 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -448,16 +448,27 @@ private:
}
};
-class ApplyDebugLocation {
+/// SaveAndRestoreLocation - An RAII object saves the current location
+/// and automatically restores it to the original value.
+class SaveAndRestoreLocation {
protected:
- llvm::DebugLoc OriginalLocation;
- CodeGenFunction &CGF;
+ SourceLocation SavedLoc;
+ CGDebugInfo *DI;
+ CGBuilderTy &Builder;
+public:
+ SaveAndRestoreLocation(CodeGenFunction &CGF, CGBuilderTy &B);
+ /// Autorestore everything back to normal.
+ ~SaveAndRestoreLocation();
+};
+/// NoLocation - An RAII object that temporarily disables debug
+/// locations. This is useful for emitting instructions that should be
+/// counted towards the function prologue.
+class NoLocation : public SaveAndRestoreLocation {
public:
- ApplyDebugLocation(CodeGenFunction &CGF,
- SourceLocation TemporaryLocation = SourceLocation(),
- bool ForceColumnInfo = false);
- ~ApplyDebugLocation();
+ NoLocation(CodeGenFunction &CGF, CGBuilderTy &B);
+ /// Autorestore everything back to normal.
+ ~NoLocation();
};
/// ArtificialLocation - An RAII object that temporarily switches to
@@ -471,9 +482,16 @@ public:
/// This is necessary because passing an empty SourceLocation to
/// CGDebugInfo::setLocation() will result in the last valid location
/// being reused.
-class ArtificialLocation : public ApplyDebugLocation {
+class ArtificialLocation : public SaveAndRestoreLocation {
public:
- ArtificialLocation(CodeGenFunction &CGF);
+ ArtificialLocation(CodeGenFunction &CGF, CGBuilderTy &B);
+
+ /// Set the current location to line 0, but within the current scope
+ /// (= the top of the LexicalBlockStack).
+ void Emit();
+
+ /// Autorestore everything back to normal.
+ ~ArtificialLocation();
};
OpenPOWER on IntegriCloud