Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 2 deletions clang/lib/CodeGen/CGBlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ CGBlockInfo::CGBlockInfo(const BlockDecl *block, StringRef name)

// Skip asm prefix, if any. 'name' is usually taken directly from
// the mangled name of the enclosing function.
if (!name.empty() && name[0] == '\01')
name = name.substr(1);
name.consume_front("\01");
}

// Anchor the vtable to this translation unit.
Expand Down
6 changes: 2 additions & 4 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4500,8 +4500,7 @@ void CGDebugInfo::emitFunctionStart(GlobalDecl GD, SourceLocation Loc,

Flags |= llvm::DINode::FlagPrototyped;
}
if (Name.starts_with("\01"))
Name = Name.substr(1);
Name.consume_front("\01");

assert((!D || !isa<VarDecl>(D) ||
GD.getDynamicInitKind() != DynamicInitKind::NoStub) &&
Expand Down Expand Up @@ -4590,8 +4589,7 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,
} else {
llvm_unreachable("not a function or ObjC method");
}
if (!Name.empty() && Name[0] == '\01')
Name = Name.substr(1);
Name.consume_front("\01");

if (D->isImplicit()) {
Flags |= llvm::DINode::FlagArtificial;
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3388,8 +3388,7 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) {
auto SL = E->getFunctionName();
assert(SL != nullptr && "No StringLiteral name in PredefinedExpr");
StringRef FnName = CurFn->getName();
if (FnName.starts_with("\01"))
FnName = FnName.substr(1);
FnName.consume_front("\01");
StringRef NameItems[] = {
PredefinedExpr::getIdentKindName(E->getIdentKind()), FnName};
std::string GVName = llvm::join(NameItems, NameItems + 2, ".");
Expand Down
6 changes: 1 addition & 5 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4061,11 +4061,7 @@ namespace {
return false;
std::string BuiltinNameStr = BI.getName(BuiltinID);
StringRef BuiltinName = BuiltinNameStr;
if (BuiltinName.starts_with("__builtin_") &&
Name == BuiltinName.slice(strlen("__builtin_"), StringRef::npos)) {
return true;
}
return false;
return BuiltinName.consume_front("__builtin_") && Name == BuiltinName;
}

bool VisitStmt(const Stmt *S) {
Expand Down