Skip to content

Commit a6b62eb

Browse files
committed
Various post-rebase fixes, adjusted comments, add trace in setDebugLoc
1 parent a4e871f commit a6b62eb

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

llvm/include/llvm/IR/DebugLoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace llvm {
8484
DILocAndCoverageTracking()
8585
: TrackingMDNodeRef(nullptr), DbgLocOrigin(true),
8686
Kind(DebugLocKind::Normal) {}
87-
// Valid or nullptr MDNode*, normal DebugLocKind
87+
// Valid or nullptr MDNode*, no annotative DebugLocKind.
8888
DILocAndCoverageTracking(const MDNode *Loc)
8989
: TrackingMDNodeRef(const_cast<MDNode *>(Loc)), DbgLocOrigin(!Loc),
9090
Kind(DebugLocKind::Normal) {}

llvm/include/llvm/IR/Instruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class Instruction : public User,
507507
LLVM_ABI bool extractProfTotalWeight(uint64_t &TotalVal) const;
508508

509509
/// Set the debug location information for this instruction.
510-
void setDebugLoc(DebugLoc Loc) { DbgLoc = std::move(Loc); }
510+
void setDebugLoc(DebugLoc Loc) { DbgLoc = std::move(Loc).getCopied(); }
511511

512512
/// Return the debug location for this node as a DebugLoc.
513513
const DebugLoc &getDebugLoc() const { return DbgLoc; }

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "llvm/CodeGen/TargetLowering.h"
3232
#include "llvm/CodeGen/TargetRegisterInfo.h"
3333
#include "llvm/CodeGen/TargetSubtargetInfo.h"
34-
#include "llvm/Config/config.h"
3534
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
3635
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
3736
#include "llvm/IR/Constants.h"

llvm/lib/CodeGen/BranchFolding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include "llvm/CodeGen/TargetPassConfig.h"
4343
#include "llvm/CodeGen/TargetRegisterInfo.h"
4444
#include "llvm/CodeGen/TargetSubtargetInfo.h"
45-
#include "llvm/Config/config.h"
45+
#include "llvm/Config/llvm-config.h"
4646
#include "llvm/IR/DebugInfoMetadata.h"
4747
#include "llvm/IR/DebugLoc.h"
4848
#include "llvm/IR/Function.h"

llvm/lib/IR/Instruction.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,9 +1361,6 @@ void Instruction::swapProfMetadata() {
13611361

13621362
void Instruction::copyMetadata(const Instruction &SrcInst,
13631363
ArrayRef<unsigned> WL) {
1364-
if (WL.empty() || is_contained(WL, LLVMContext::MD_dbg))
1365-
setDebugLoc(SrcInst.getDebugLoc());
1366-
13671364
if (!SrcInst.hasMetadata())
13681365
return;
13691366

@@ -1377,6 +1374,8 @@ void Instruction::copyMetadata(const Instruction &SrcInst,
13771374
if (WL.empty() || WLS.count(MD.first))
13781375
setMetadata(MD.first, MD.second);
13791376
}
1377+
if (WL.empty() || WLS.count(LLVMContext::MD_dbg))
1378+
setDebugLoc(SrcInst.getDebugLoc());
13801379
}
13811380

13821381
Instruction *Instruction::clone() const {

0 commit comments

Comments
 (0)