Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for builtin_verbose_trap #79230

Merged
merged 19 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/include/clang/CodeGen/ModuleBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"

namespace llvm {
class Constant;
Expand All @@ -28,7 +29,7 @@ namespace llvm {
}

// Prefix of the name of the artificial inline frame.
#define CLANG_TRAP_PREFIX "__clang_trap_msg"
inline constexpr llvm::StringRef CLANG_TRAP_PREFIX = "__clang_trap_msg";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name should be changed to use the usual variable/constant naming convention (ClangTrapPrefix, I think, in this case).


namespace clang {
class CodeGenOptions;
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3515,8 +3515,7 @@ llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor(
llvm::DebugLoc TrapLocation, StringRef Category, StringRef FailureMsg) {
// Create a debug location from `TrapLocation` that adds an artificial inline
// frame.
const char *Prefix = CLANG_TRAP_PREFIX;
SmallString<64> FuncName(Prefix);
SmallString<64> FuncName(CLANG_TRAP_PREFIX);

FuncName += "$";
FuncName += Category;
Expand Down