Skip to content

Commit a2803c5

Browse files
authored
Merge amd-debug into amd-staging (llvm#3171)
2 parents 292c8a9 + e8b28ac commit a2803c5

File tree

12 files changed

+92
-788
lines changed

12 files changed

+92
-788
lines changed

clang/include/clang/Basic/DebugOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0, Compatible) ///< Omit unreferenced
5555

5656
/// Control DWARF extensions for heterogeneous debugging enablement and approach.
5757
ENUM_DEBUGOPT(HeterogeneousDwarfMode, HeterogeneousDwarfOpts, 2,
58-
HeterogeneousDwarfOpts::Disabled, Benign)
58+
HeterogeneousDwarfOpts::Disabled, Benign)
5959

6060
/// Control the Assignment Tracking debug info feature.
6161
ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2,

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5173,7 +5173,8 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
51735173
// Use VarDecl's Tag, Scope and Line number.
51745174
auto FieldAlign = getDeclAlignIfRequired(Field, CGM.getContext());
51755175
auto *D = DBuilder.createAutoVariable(
5176-
Scope, FieldName, Unit, Line, FieldTy, CGM.getCodeGenOpts().OptimizationLevel != 0,
5176+
Scope, FieldName, Unit, Line, FieldTy,
5177+
CGM.getCodeGenOpts().OptimizationLevel != 0,
51775178
Flags | llvm::DINode::FlagArtificial, MS, FieldAlign);
51785179

51795180
// Insert an llvm.dbg.declare into the current block.
@@ -5199,9 +5200,9 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
51995200
llvm::DILocalVariable *D = nullptr;
52005201
if (ArgNo) {
52015202
llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(VD);
5202-
D = DBuilder.createParameterVariable(Scope, Name, *ArgNo, Unit, Line, Ty,
5203-
CGM.getCodeGenOpts().OptimizationLevel != 0, Flags, MS,
5204-
Annotations);
5203+
D = DBuilder.createParameterVariable(
5204+
Scope, Name, *ArgNo, Unit, Line, Ty,
5205+
CGM.getCodeGenOpts().OptimizationLevel != 0, Flags, MS, Annotations);
52055206
} else {
52065207
// For normal local variable, we will try to find out whether 'VD' is the
52075208
// copy parameter of coroutine.
@@ -5242,9 +5243,9 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
52425243
D = RemapCoroArgToLocalVar();
52435244
// Or we will create a new DIVariable for this Decl if D dose not exists.
52445245
if (!D)
5245-
D = DBuilder.createAutoVariable(Scope, Name, Unit, Line, Ty,
5246-
CGM.getCodeGenOpts().OptimizationLevel != 0, Flags, MS,
5247-
Align);
5246+
D = DBuilder.createAutoVariable(
5247+
Scope, Name, Unit, Line, Ty,
5248+
CGM.getCodeGenOpts().OptimizationLevel != 0, Flags, MS, Align);
52485249
}
52495250
// Insert an llvm.dbg.declare into the current block.
52505251
DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(Expr),

llvm/include/llvm-c/DebugInfo.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,10 +964,9 @@ LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(
964964
* \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
965965
* \param MemorySpace DWARF memory space (optional, pass 0 for none).
966966
*/
967-
LLVM_C_ABI LLVMMetadataRef
968-
LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag,
969-
LLVMMetadataRef Type, unsigned AddressSpace,
970-
LLVMDWARFMemorySpace MemorySpace);
967+
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateReferenceType(
968+
LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type,
969+
unsigned AddressSpace, LLVMDWARFMemorySpace MemorySpace);
971970

972971
/**
973972
* Create C++11 nullptr type.

llvm/include/llvm/Transforms/Utils/Local.h

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class BasicBlock;
3636
class BranchInst;
3737
class CallBase;
3838
class CallInst;
39-
class DbgVariableIntrinsic;
4039
class DIBuilder;
4140
class DomTreeUpdater;
4241
class Function;
@@ -275,44 +274,31 @@ LLVM_ABI CallInst *changeToCall(InvokeInst *II, DomTreeUpdater *DTU = nullptr);
275274
LLVM_ABI void InsertDebugValueAtStoreLoc(DbgVariableRecord *DVR, StoreInst *SI,
276275
DIBuilder &Builder);
277276

278-
/// Creates and inserts an llvm.dbg.value intrinsic before a store
279-
/// that has an associated llvm.dbg.value intrinsic.
280-
LLVM_ABI void InsertDebugValueAtStoreLoc(DbgVariableIntrinsic *DII,
281-
StoreInst *SI, DIBuilder &Builder);
282-
283-
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
284-
/// that has an associated llvm.dbg.declare intrinsic.
285-
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
286-
StoreInst *SI,
287-
DIBuilder &Builder);
277+
/// Inserts a dbg.value record before a store to an alloca'd value
278+
/// that has an associated dbg.declare record.
288279
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR,
289280
StoreInst *SI,
290281
DIBuilder &Builder);
291282

292-
/// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
293-
/// that has an associated llvm.dbg.declare intrinsic.
294-
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
295-
LoadInst *LI, DIBuilder &Builder);
283+
/// Inserts a dbg.value record before a load of an alloca'd value
284+
/// that has an associated dbg.declare record.
296285
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR,
297286
LoadInst *LI, DIBuilder &Builder);
298287

299-
/// Inserts a llvm.dbg.value intrinsic after a phi that has an associated
300-
/// llvm.dbg.declare intrinsic.
301-
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
302-
PHINode *LI, DIBuilder &Builder);
288+
/// Inserts a dbg.value record after a phi that has an associated
289+
/// llvm.dbg.declare record.
303290
LLVM_ABI void ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR,
304291
PHINode *LI, DIBuilder &Builder);
305292

306-
/// Lowers llvm.dbg.declare intrinsics into appropriate set of
307-
/// llvm.dbg.value intrinsics.
293+
/// Lowers dbg.declare records into appropriate set of dbg.value records.
308294
LLVM_ABI bool LowerDbgDeclare(Function &F);
309295

310296
/// Propagate dbg.value intrinsics through the newly inserted PHIs.
311297
LLVM_ABI void
312298
insertDebugValuesForPHIs(BasicBlock *BB,
313299
SmallVectorImpl<PHINode *> &InsertedPHIs);
314300

315-
/// Replaces llvm.dbg.declare instruction when the address it
301+
/// Replaces dbg.declare record when the address it
316302
/// describes is replaced with a new value. If Deref is true, an
317303
/// additional DW_OP_deref is prepended to the expression. If Offset
318304
/// is non-zero, a constant displacement is added to the expression
@@ -321,10 +307,10 @@ LLVM_ABI bool replaceDbgDeclare(Value *Address, Value *NewAddress,
321307
DIBuilder &Builder, uint8_t DIExprFlags,
322308
int Offset);
323309

324-
/// Replaces multiple llvm.dbg.value instructions when the alloca it describes
310+
/// Replaces multiple dbg.value records when the alloca it describes
325311
/// is replaced with a new value. If Offset is non-zero, a constant displacement
326312
/// is added to the expression (after the mandatory Deref). Offset can be
327-
/// negative. New llvm.dbg.value instructions are inserted at the locations of
313+
/// negative. New dbg.value records are inserted at the locations of
328314
/// the instructions they replace.
329315
LLVM_ABI void replaceDbgValueForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
330316
DIBuilder &Builder, int Offset = 0);

llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
namespace llvm {
2525
class DominatorTree;
26-
class DbgVariableIntrinsic;
2726
class IntrinsicInst;
2827
class PostDominatorTree;
2928
class AllocaInst;
@@ -53,8 +52,6 @@ struct AllocaInfo {
5352
AllocaInst *AI;
5453
SmallVector<IntrinsicInst *, 2> LifetimeStart;
5554
SmallVector<IntrinsicInst *, 2> LifetimeEnd;
56-
SmallVector<DbgVariableIntrinsic *, 2> DbgVariableIntrinsics;
57-
// Non-intrinsic records of variable locations.
5855
SmallVector<DbgVariableRecord *, 2> DbgVariableRecords;
5956
};
6057

0 commit comments

Comments
 (0)