| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
The declaration of a flexible array member was correctly diagnosed as an
extension in C89 mode but not in C++.
llvm-svn: 193918
|
|
|
|
| |
llvm-svn: 193799
|
|
|
|
|
|
|
|
|
|
|
| |
The AST was constructed so that this builtin returned the default BoolTy and
since I'd opted for custom SemaChecking, I should have set it properly at that
point.
This caused an assertion failure when the types didn't match up with what we
generated. This makes it return an IntTy, which is as good as anything.
llvm-svn: 193606
|
|
|
|
|
|
| |
Registered targets don't matter for Sema tests, this passes fine.
llvm-svn: 193485
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.
Patch by Anders Rönnholm!
llvm-svn: 193418
|
|
|
|
|
|
|
|
|
|
|
|
| |
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.
I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.
llvm-svn: 193295
|
|
|
|
|
|
|
|
|
| |
it. Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.
Differential Revision: http://llvm-reviews.chandlerc.com/D2003
llvm-svn: 193290
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes pr17624.
A FIXME from Richard Smith:
It seems to me that the root cause is that a per-Decl 'used' flag doesn't
really make much sense in the way we use it now. I think we should either track
whether that particular declaration is used (with isUsed scanning the entire
redecl chain), or we should only have one flag for the entire redeclaration
chain (perhaps by always looking at the flag on either the most recent decl or
the canonical decl). Modeling it as "is this declaration or any previous
declaration used" is weird, and requires contortions like the loop at the end
of Sema::MarkFunctionReferenced.
llvm-svn: 193202
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes pr17639.
Before this patch clang would consider
void foo(void) __attribute((alias("__foo")));
a declaration. It now correctly handles it as a definition.
Initial patch by Alp Toker. I added support for variables.
llvm-svn: 193200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a fixed version of r193161. In order to handle
void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));
it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.
This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.
This patch also handles cyclic aliases.
llvm-svn: 193188
|
|
|
|
|
|
|
|
|
|
| |
This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.
llvm-svn: 193174
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
undefined names. For example, with this patch we now reject"
This reverts commit r193161.
It broke
void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));
Looks like we have to fix pr17639 first :-(
llvm-svn: 193162
|
|
|
|
|
|
|
|
|
|
|
|
| |
names. For example, with this patch we now reject
void f1(void) __attribute__((alias("g1")));
This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.
llvm-svn: 193161
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:
for ( ; ({ if (first) { first = 0; continue; } 0; }); )
Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.
Differential Revision: http://llvm-reviews.chandlerc.com/D1762
llvm-svn: 193073
|
|
|
|
|
|
| |
The convention is LF unless specifically testing line endings.
llvm-svn: 193056
|
|
|
|
| |
llvm-svn: 192869
|
|
|
|
|
|
| |
__builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me.
llvm-svn: 192729
|
|
|
|
|
|
|
| |
They weren't added with the rest of the microsoft record layout patch due me not
doing svn add.
llvm-svn: 192612
|
|
|
|
| |
llvm-svn: 192494
|
|
|
|
| |
llvm-svn: 192338
|
|
|
|
|
|
|
|
|
|
|
|
| |
underlying integer type. This is a precondition for calling getIntegerRank().
Fixes an assertion failure in a test case involving vectors.
Fixes <rdar://problem/15091442>
Please somebody check this.
llvm-svn: 192334
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up from r192240.
This makes it an error to use callee-cleanup conventions on variadic
functions, except for __fastcall and __stdcall, which we ignore with
a warning for GCC and MSVC compatibility.
Differential Revision: http://llvm-reviews.chandlerc.com/D1870
llvm-svn: 192308
|
|
|
|
|
|
|
|
|
|
| |
MSVC allows this and silently falls back to __cdecl for variadic functions.
This patch turns Clang's error into a warning in MS mode and adds a test
to make sure we generate correct code.
Differential Revision: http://llvm-reviews.chandlerc.com/D1861
llvm-svn: 192240
|
|
|
|
| |
llvm-svn: 192144
|
|
|
|
|
|
|
|
|
|
| |
Fixes <rdar://problem/10679282>.
I'm not completely satisfied with this patch. Sprinkling "diagnostic ignored"
_Pragmas throughout this file is gross, but I couldn't suppress
it for the entire file.
llvm-svn: 192143
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.
See also ...
Bug:
http://llvm.org/bugs/show_bug.cgi?id=16644 and
cfe-dev discussion:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html
llvm-svn: 191890
|
|
|
|
|
|
|
|
|
|
| |
This attribute allows users to use a modified C or C++ function as an ARM
exception-handling function and, with care, to successfully return control to
user-space after the issue has been dealt with.
rdar://problem/14207019
llvm-svn: 191769
|
|
|
|
| |
llvm-svn: 191376
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.
Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.
llvm-svn: 191064
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the following, more specific warning flags:
gnu-anonymous-struct
gnu-compound-literal-initializer
gnu-empty-struct
gnu-flexible-array-initializer
gnu-flexible-array-union-member
gnu-folding-constant
redeclared-class-member
gnu-redeclared-enum
gnu-union-cast
gnu-variable-sized-type-not-at-end
Patch by Peter Lewis.
llvm-svn: 190972
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for PR16752. Second commit.
PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.
Fixes:
1st Commit (Done): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth
2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.
Also test/Sema/attr-mode.c was fixed. 'XC' mode test was disabled for PPC64 machines.
llvm-svn: 190926
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.
C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.
llvm-svn: 190915
|
|
|
|
| |
llvm-svn: 190824
|
|
|
|
|
|
| |
test cases for the semantics checks.
llvm-svn: 190802
|
|
|
|
|
|
| |
Patch by Artyom Skrobov.
llvm-svn: 190801
|
|
|
|
|
|
| |
helper function.
llvm-svn: 190710
|
|
|
|
|
|
| |
messages in the parser.
llvm-svn: 190706
|
|
|
|
|
|
| |
Found by inspection.
llvm-svn: 190701
|
|
|
|
|
|
| |
argument. Instead, it takes an expression that is fully resolved.
llvm-svn: 190476
|
|
|
|
|
|
|
| |
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.
llvm-svn: 190439
|
|
|
|
|
|
| |
This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required.
llvm-svn: 190368
|
|
|
|
|
|
| |
PR17105.
llvm-svn: 190312
|
|
|
|
|
|
| |
functionality was never completely implemented, and this is an improvement over silently eating the attribute.
llvm-svn: 190303
|
|
|
|
|
|
| |
argument list.
llvm-svn: 189711
|
|
|
|
|
|
| |
Based on a patch by Benno Rice!
llvm-svn: 189644
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.
Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.
Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.
Excellent test cases provided by Alexander Zinenko!
Reviewers: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D1231
llvm-svn: 189412
|
|
|
|
| |
llvm-svn: 188996
|
|
|
|
|
|
|
| |
This tests warning flags, so no need to test for specific alignment which is
platform-dependent.
llvm-svn: 188993
|
|
|
|
| |
llvm-svn: 188992
|
|
|
|
|
|
|
|
|
| |
Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).
llvm-svn: 188968
|