aaron.ballman closed this revision.
aaron.ballman added a comment.
Committed in r294861.
https://reviews.llvm.org/D28166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaron.ballman updated this revision to Diff 83118.
aaron.ballman added a comment.
Added support for `AdjustedType` and `AdjustedTypeLoc`.
https://reviews.llvm.org/D28166
Files:
include/clang/AST/Type.h
include/clang/AST/TypeLoc.h
lib/Sema/SemaDecl.cpp
test/Sema/knr-def-call.c
test/Sem
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:11958-11962
+// The type location may be attributed; strip the attributes to get to
+// the function type location.
+while (auto ATL = TL.getAs()) {
+ TL = ATL.getModifiedLoc()
rnk added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:11958-11962
+// The type location may be attributed; strip the attributes to get to
+// the function type location.
+while (auto ATL = TL.getAs()) {
+ TL = ATL.getModifiedLoc();
+
aaron.ballman updated this revision to Diff 82985.
aaron.ballman marked 3 inline comments as done.
aaron.ballman added a comment.
Stripped out the codegen changes since @rnk 's commit fixed the issue.
https://reviews.llvm.org/D28166
Files:
include/clang/AST/Type.h
include/clang/AST/TypeLoc.
aaron.ballman marked an inline comment as done.
aaron.ballman added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.h:3570
for (auto *A : llvm::make_range(Arg, ArgRange.end()))
- ArgTypes.push_back(getVarArgType(A));
+ ArgTypes.push_back(getVarArgType(A, C
rnk added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.h:3570
for (auto *A : llvm::make_range(Arg, ArgRange.end()))
- ArgTypes.push_back(getVarArgType(A));
+ ArgTypes.push_back(getVarArgType(A, CallArgTypeInfo == nullptr));
rnk wrote:
rnk added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.h:3570
for (auto *A : llvm::make_range(Arg, ArgRange.end()))
- ArgTypes.push_back(getVarArgType(A));
+ ArgTypes.push_back(getVarArgType(A, CallArgTypeInfo == nullptr));
rnk wrote:
rnk added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.h:3570
for (auto *A : llvm::make_range(Arg, ArgRange.end()))
- ArgTypes.push_back(getVarArgType(A));
+ ArgTypes.push_back(getVarArgType(A, CallArgTypeInfo == nullptr));
I'm testin
aaron.ballman updated this revision to Diff 82930.
aaron.ballman added a comment.
I've updated this patch to correct the codegen changes. If you'd prefer, I can
review/commit in two separate phases, one for the codegen bug and one for the
attribute issue, as I think these changes might be reason
rsmith added a comment.
In https://reviews.llvm.org/D28166#634196, @aaron.ballman wrote:
> So I think the correct behavior is to only enable the vararg behavior when
> the function is variadic with an ellipsis rather than variadic due to a lack
> of prototype.
That sounds right. Note that fun
aaron.ballman added a reviewer: majnemer.
aaron.ballman added a comment.
> I *think* the problem is that we gin up the function type for a
> non-prototyped function based on the function call expression argument types,
> and the literal `0` is getting the type `signed long long`.
I think this i
aaron.ballman added a comment.
In https://reviews.llvm.org/D28166#633643, @rsmith wrote:
> In https://reviews.llvm.org/D28166#633621, @aaron.ballman wrote:
>
> > Do you think this patch should be gated on (or perhaps combined with) a fix
> > for the lowering bug, or do you think this patch is re
rsmith added a comment.
In https://reviews.llvm.org/D28166#633621, @aaron.ballman wrote:
> Do you think this patch should be gated on (or perhaps combined with) a fix
> for the lowering bug, or do you think this patch is reasonable on its own?
> Given that it turns working code into UB, I think
aaron.ballman added a comment.
In https://reviews.llvm.org/D28166#633595, @rsmith wrote:
> The test failure in test/CodeGen/microsoft-call-conv-x64.c definitely
> indicates a problem. The code has defined behavior, but the IR you say we now
> produce has undefined behavior due to a type mismatc
rsmith added a comment.
The test failure in test/CodeGen/microsoft-call-conv-x64.c definitely indicates
a problem. The code has defined behavior, but the IR you say we now produce has
undefined behavior due to a type mismatch between the call and the callee.
It looks to me like unprototyped `__
aaron.ballman updated this revision to Diff 82816.
aaron.ballman added a comment.
I've updated the patch to not hard code the type adjustments, but instead added
`Type::getAsAdjusted()` and `TypeLoc::getAsAdjusted()`.
This patch has one broken test case, but I do not think the test case was bein
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:7464-7470
+const Type *NonAttributedFTy = R.getTypePtr();
+while (const auto *AttrTy = NonAttributedFTy->getAs()) {
+ NonAttributedFTy = AttrTy->getModifiedType().getTypePtr();
+}
bool Ha
rsmith added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:7464-7470
+const Type *NonAttributedFTy = R.getTypePtr();
+while (const auto *AttrTy = NonAttributedFTy->getAs()) {
+ NonAttributedFTy = AttrTy->getModifiedType().getTypePtr();
+}
bool HasProtot
aaron.ballman created this revision.
aaron.ballman added a reviewer: rsmith.
aaron.ballman added a subscriber: cfe-commits.
When determining whether a function was written with a prototype, we would look
at the type to see if it was something other than a FunctionType while the
canonical type wa
20 matches
Mail list logo