Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ba3d52c

Browse filesBrowse files
committed
[Clang] Add noalias to this pointer in C++ constructors
1 parent 8c74dc1 commit ba3d52c
Copy full SHA for ba3d52c

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎clang/lib/CodeGen/CodeGenFunction.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CodeGenFunction.cpp
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,8 +1567,10 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
15671567
PGO.assignRegionCounters(GD, CurFn);
15681568
if (isa<CXXDestructorDecl>(FD))
15691569
EmitDestructorBody(Args);
1570-
else if (isa<CXXConstructorDecl>(FD))
1570+
else if (isa<CXXConstructorDecl>(FD)) {
1571+
Fn->addParamAttr(0, llvm::Attribute::NoAlias);
15711572
EmitConstructorBody(Args);
1573+
}
15721574
else if (getLangOpts().CUDA &&
15731575
!getLangOpts().CUDAIsDevice &&
15741576
FD->hasAttr<CUDAGlobalAttr>())

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.