Skip to content

Commit c72fc17

Browse files
committed
Address review comments
1 parent 521fe91 commit c72fc17

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,8 +3510,8 @@ The debugging information would look as if it were produced for the following co
35103510
"__llvm_verbose_trap: Argument must not be null!"();
35113511
}
35123512
3513-
However, the LLVM IR would not actually contain a call to the artificial
3514-
function — it only exists in the debug metadata.
3513+
However, the generated code would not actually contain a call to the artificial
3514+
function — it only exists in the debugging information.
35153515
35163516
Query for this feature with ``__has_builtin(__builtin_verbose_trap)``. Note that
35173517
users need to enable debug information to enable this feature. A call to this

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3593,6 +3593,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
35933593
TrapLocation, *E->getArg(0)->tryEvaluateString(getContext()));
35943594
}
35953595
ApplyDebugLocation ApplyTrapDI(*this, TrapLocation);
3596+
// Currently no attempt is made to prevent traps from being merged.
35963597
EmitTrapCall(Intrinsic::trap);
35973598
return RValue::get(nullptr);
35983599
}

clang/lib/CodeGen/CGDebugInfo.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ class CGDebugInfo {
348348
const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI,
349349
llvm::ArrayRef<llvm::Metadata *> PreviousFieldsDI, const RecordDecl *RD);
350350

351-
// A cache that maps artificial inlined function names used for
352-
// __builtin_verbose_trap to subprograms.
351+
/// A cache that maps artificial inlined function names used for
352+
/// __builtin_verbose_trap to subprograms.
353353
llvm::StringMap<llvm::DISubprogram *> InlinedTrapFuncMap;
354354

355355
// A function that returns the subprogram corresponding to the artificial
@@ -613,15 +613,15 @@ class CGDebugInfo {
613613
return CoroutineParameterMappings;
614614
}
615615

616-
// Create a debug location from `TrapLocation` that adds an artificial inline
617-
// frame where the frame name is
618-
//
619-
// * `<Prefix>: <FailureMsg>` if `<FailureMsg>` is not empty.
620-
// * `<Prefix>` if `<FailureMsg>` is empty.
621-
//
622-
// Currently `<Prefix>` is always "__llvm_verbose_trap".
623-
//
624-
// This is used to store failure reasons for traps.
616+
/// Create a debug location from `TrapLocation` that adds an artificial inline
617+
/// frame where the frame name is
618+
///
619+
/// * `<Prefix>: <FailureMsg>` if `<FailureMsg>` is not empty.
620+
/// * `<Prefix>` if `<FailureMsg>` is empty.
621+
///
622+
/// Currently `<Prefix>` is always "__llvm_verbose_trap".
623+
///
624+
/// This is used to store failure reasons for traps.
625625
llvm::DILocation *CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
626626
StringRef FailureMsg);
627627

0 commit comments

Comments
 (0)