summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp26
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h19
-rw-r--r--clang/lib/CodeGen/CGException.cpp3
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp6
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
5 files changed, 22 insertions, 34 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 216a12b40d3..7d6eb83f12d 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -76,22 +76,20 @@ CGDebugInfo::~CGDebugInfo() {
}
ApplyDebugLocation::ApplyDebugLocation(CodeGenFunction &CGF,
- SourceLocation TemporaryLocation,
- bool ImplicitCode)
+ SourceLocation TemporaryLocation)
: CGF(&CGF) {
- init(TemporaryLocation, false /* DefaultToEmpty */, ImplicitCode);
+ init(TemporaryLocation);
}
ApplyDebugLocation::ApplyDebugLocation(CodeGenFunction &CGF,
bool DefaultToEmpty,
- SourceLocation TemporaryLocation,
- bool ImplicitCode)
+ SourceLocation TemporaryLocation)
: CGF(&CGF) {
- init(TemporaryLocation, DefaultToEmpty, ImplicitCode);
+ init(TemporaryLocation, DefaultToEmpty);
}
void ApplyDebugLocation::init(SourceLocation TemporaryLocation,
- bool DefaultToEmpty, bool ImplicitCode) {
+ bool DefaultToEmpty) {
auto *DI = CGF->getDebugInfo();
if (!DI) {
CGF = nullptr;
@@ -104,7 +102,7 @@ void ApplyDebugLocation::init(SourceLocation TemporaryLocation,
return;
if (TemporaryLocation.isValid()) {
- DI->EmitLocation(CGF->Builder, TemporaryLocation, ImplicitCode);
+ DI->EmitLocation(CGF->Builder, TemporaryLocation);
return;
}
@@ -3486,8 +3484,7 @@ void CGDebugInfo::EmitInlineFunctionEnd(CGBuilderTy &Builder) {
setInlinedAt(llvm::DebugLoc(CurInlinedAt).getInlinedAt());
}
-void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
- bool ImplicitCode) {
+void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc) {
// Update our current location
setLocation(Loc);
@@ -3495,9 +3492,8 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
return;
llvm::MDNode *Scope = LexicalBlockStack.back();
- Builder.SetCurrentDebugLocation(
- llvm::DebugLoc::get(getLineNumber(CurLoc), getColumnNumber(CurLoc), Scope,
- CurInlinedAt, ImplicitCode));
+ Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(
+ getLineNumber(CurLoc), getColumnNumber(CurLoc), Scope, CurInlinedAt));
}
void CGDebugInfo::CreateLexicalBlock(SourceLocation Loc) {
@@ -3544,7 +3540,7 @@ void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Builder,
assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
// Provide an entry in the line table for the end of the block.
- EmitLocation(Builder, Loc, true /* ImplicitCode */);
+ EmitLocation(Builder, Loc);
if (DebugKind <= codegenoptions::DebugLineTablesOnly)
return;
@@ -3560,7 +3556,7 @@ void CGDebugInfo::EmitFunctionEnd(CGBuilderTy &Builder, llvm::Function *Fn) {
// Pop all regions for this function.
while (LexicalBlockStack.size() != RCount) {
// Provide an entry in the line table for the end of the block.
- EmitLocation(Builder, CurLoc, true /* ImplicitCode */);
+ EmitLocation(Builder, CurLoc);
LexicalBlockStack.pop_back();
}
FnBeginRegionCount.pop_back();
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 6bffc7471d4..8641c2d8969 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -377,9 +377,7 @@ public:
/// Emit metadata to indicate a change in line/column information in
/// the source file. If the location is invalid, the previous
/// location will be reused.
- /// \param ImplicitCode True if the Loc must have coverage information
- void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
- bool ImplicitCode = false);
+ void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc);
/// Emit a call to llvm.dbg.function.start to indicate
/// start of a new function.
@@ -666,19 +664,16 @@ private:
/// location or preferred location of the specified Expr.
class ApplyDebugLocation {
private:
- void init(SourceLocation TemporaryLocation, bool DefaultToEmpty = false,
- bool ImplicitCode = false);
+ void init(SourceLocation TemporaryLocation, bool DefaultToEmpty = false);
ApplyDebugLocation(CodeGenFunction &CGF, bool DefaultToEmpty,
- SourceLocation TemporaryLocation,
- bool ImplicitCode = false);
+ SourceLocation TemporaryLocation);
llvm::DebugLoc OriginalLocation;
CodeGenFunction *CGF;
public:
/// Set the location to the (valid) TemporaryLocation.
- ApplyDebugLocation(CodeGenFunction &CGF, SourceLocation TemporaryLocation,
- bool ImplicitCode = false);
+ ApplyDebugLocation(CodeGenFunction &CGF, SourceLocation TemporaryLocation);
ApplyDebugLocation(CodeGenFunction &CGF, const Expr *E);
ApplyDebugLocation(CodeGenFunction &CGF, llvm::DebugLoc Loc);
ApplyDebugLocation(ApplyDebugLocation &&Other) : CGF(Other.CGF) {
@@ -701,15 +696,13 @@ public:
static ApplyDebugLocation CreateArtificial(CodeGenFunction &CGF) {
return ApplyDebugLocation(CGF, false, SourceLocation());
}
-
/// Apply TemporaryLocation if it is valid. Otherwise switch
/// to an artificial debug location that has a valid scope, but no
/// line information.
static ApplyDebugLocation
CreateDefaultArtificial(CodeGenFunction &CGF,
- SourceLocation TemporaryLocation,
- bool ImplicitCode = false) {
- return ApplyDebugLocation(CGF, false, TemporaryLocation, ImplicitCode);
+ SourceLocation TemporaryLocation) {
+ return ApplyDebugLocation(CGF, false, TemporaryLocation);
}
/// Set the IRBuilder to not attach debug locations. Note that
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 787d25a681a..4ee835259a5 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -767,8 +767,7 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
// Save the current IR generation state.
CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP();
- auto DL = ApplyDebugLocation::CreateDefaultArtificial(
- *this, CurEHLocation, true /* ImplicitCode */);
+ auto DL = ApplyDebugLocation::CreateDefaultArtificial(*this, CurEHLocation);
// Create and configure the landing pad.
llvm::BasicBlock *lpad = createBasicBlock("lpad");
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 8fa0badc6e2..77f978f687e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -317,7 +317,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
if (OnlySimpleReturnStmts)
DI->EmitLocation(Builder, LastStopPoint);
else
- DI->EmitLocation(Builder, EndLoc, true /* ImplicitCode */);
+ DI->EmitLocation(Builder, EndLoc);
}
// Pop any cleanups that might have been associated with the
@@ -333,7 +333,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// the ret after it's been at EndLoc.
if (CGDebugInfo *DI = getDebugInfo())
if (OnlySimpleReturnStmts)
- DI->EmitLocation(Builder, EndLoc, true /* ImplicitCode */);
+ DI->EmitLocation(Builder, EndLoc);
PopCleanupBlocks(PrologueCleanupDepth);
}
@@ -1179,7 +1179,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
}
// Emit a location at the end of the prologue.
if (CGDebugInfo *DI = getDebugInfo())
- DI->EmitLocation(Builder, StartLoc, true /* ImplicitCode */);
+ DI->EmitLocation(Builder, StartLoc);
// TODO: Do we need to handle this in two places like we do with
// target-features/target-cpu?
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 7a5e308187e..6ea2d75b318 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -786,7 +786,7 @@ public:
// If we should perform a cleanup, force them now. Note that
// this ends the cleanup scope before rescoping any labels.
if (PerformCleanup) {
- ApplyDebugLocation DL(CGF, Range.getEnd(), true /* ImplicitCode */);
+ ApplyDebugLocation DL(CGF, Range.getEnd());
ForceCleanup();
}
}
OpenPOWER on IntegriCloud