| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
are apparently used by Solaris libc despite the fact that clang claims
to be compatible with gcc 4.2, which doesn't support them.
llvm-svn: 80610
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
name, e.g.,
x->Base::f()
retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.
When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?
llvm-svn: 80167
|
|
|
|
|
|
| |
type convesions of class objects [class.conv]. WIP.
llvm-svn: 80127
|
|
|
|
|
|
|
|
|
|
| |
Objective-C code.
This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.
Approved by snaroff.
llvm-svn: 79248
|
|
|
|
|
|
| |
CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.
llvm-svn: 79157
|
|
|
|
| |
llvm-svn: 78780
|
|
|
|
| |
llvm-svn: 78415
|
|
|
|
|
|
| |
string.
llvm-svn: 78276
|
|
|
|
| |
llvm-svn: 78102
|
|
|
|
| |
llvm-svn: 77652
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510
|
|
|
|
|
|
|
|
|
| |
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.
llvm-svn: 76193
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.
The motivation behind this change is twofold:
1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.
2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.
Along with this patch:
a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.
llvm-svn: 76098
|
|
|
|
|
|
|
|
|
| |
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.
This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.
llvm-svn: 74501
|
|
|
|
|
|
| |
Fixes PR4470.
llvm-svn: 74413
|
|
|
|
| |
llvm-svn: 74369
|
|
|
|
| |
llvm-svn: 73702
|
|
|
|
| |
llvm-svn: 72726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
argument. This avoids the argument from being silenced when the argument is
the NULL macro, which is defined in a system header. This also makes the output
a bit nicer, e.g.:
t.c:8:3: warning: null passed to a callee which requires a non-null argument
func1(NULL, cp2, i1);
^ ~~~~
vs something like:
t.c:8:10: warning: argument is null where non-null is required
func1(NULL, cp2, i1);
^
llvm-svn: 72393
|
|
|
|
| |
llvm-svn: 72219
|
|
|
|
| |
llvm-svn: 72158
|
|
|
|
| |
llvm-svn: 72139
|
|
|
|
|
|
| |
checking when block is envoked. In progress.
llvm-svn: 72039
|
|
|
|
|
|
|
|
|
| |
NumArgs && "Arg access out of range!").
For format string checking, only check the type of the format
specifier for non-vararg functions.
llvm-svn: 71672
|
|
|
|
|
|
| |
rdar://6880573
llvm-svn: 71636
|
|
|
|
|
|
|
|
|
| |
of the underlying _N builtin, not the the type of the pointee of the
actual type. This ensures that atomics involving pointers end up
using the correct integer type when they are resolved, avoiding
aborts in codegen.
llvm-svn: 71218
|
|
|
|
|
|
|
|
|
| |
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)
llvm-svn: 71212
|
|
|
|
| |
llvm-svn: 70664
|
|
|
|
|
|
|
|
|
|
|
| |
reason for adding these is to error out in CodeGen when trying to generate
them instead of silently emitting a call to a non-existent function.
(Note that it is not valid to lower these to setjmp/longjmp; in addition
to that lowering being different from the intent, setjmp and longjmp
require a larger buffer.)
llvm-svn: 70658
|
|
|
|
|
|
| |
This enables one specific class of non-literal format warnings.
llvm-svn: 70368
|
|
|
|
| |
llvm-svn: 70367
|
|
|
|
| |
llvm-svn: 70361
|
|
|
|
|
|
|
| |
expressions that can be of static duration to be returned.
Radar 6786551
llvm-svn: 69331
|
|
|
|
|
|
| |
Teach Sema::SemaBuiltinVAStart() about blocks.
llvm-svn: 69201
|
|
|
|
| |
llvm-svn: 68982
|
|
|
|
|
|
|
|
|
|
| |
- Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants.
Remove warning from CheckObjCString.
As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling).
llvm-svn: 68245
|
|
|
|
|
|
|
|
| |
allow non-literal format strings that are variables that (a) permanently bind to
a string constant and (b) whose string constants are resolvable within the same
translation unit.
llvm-svn: 67404
|
|
|
|
|
|
|
|
|
|
| |
(printf, X, Y)))'
set HasVAListArg to true when 'Y' is 0 (i.e., ignore the data arguments).
This fixes <rdar://problem/6623513>.
llvm-svn: 65642
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.
Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.
As part of this, some types have been renamed:
TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType
There shouldn't be any functionality change...
llvm-svn: 65591
|
|
|
|
|
|
| |
- <rdar://problem/6094103> sema fails to promote type arguments to __builtin_isgreater (and friends)
llvm-svn: 65059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we used to not account for escapes in strings with
string concat. Before:
t.m:5:20: warning: field width should have type 'int', but argument has type 'unsigned int'
printf("\n\n" "\n\n%*d", (unsigned) 1, 1);
^ ~~~~~~~~~~~~
after:
t.m:5:23: warning: field width should have type 'int', but argument has type 'unsigned int'
printf("\n\n" "\n\n%*d", (unsigned) 1, 1);
^ ~~~~~~~~~~~~
llvm-svn: 64941
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
escapes in the string for subtoken positioning. This gives
us working examples like:
t.m:5:16: warning: field width should have type 'int', but argument has type 'unsigned int'
printf("\n\n%*d", (unsigned) 1, 1);
^ ~~~~~~~~~~~~
where before the caret pointed two spaces to the left.
llvm-svn: 64940
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now emit:
t.m:6:15: warning: field width should have type 'int', but argument has type 'unsigned int'
printf(STR, (unsigned) 1, 1);
^ ~~~~~~~~~~~~
t.m:3:18: note: instantiated from:
#define STR "abc%*ddef"
^
which has the correct location in the string literal in the note line.
llvm-svn: 64936
|
|
|
|
|
|
| |
it needs cleaning.
llvm-svn: 64932
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and escaped newlines don't throw off the offset computation.
On this testcase:
printf("abc\
def"
"%*d", (unsigned) 1, 1);
Before:
t.m:5:5: warning: field width should have type 'int', but argument has type 'unsigned int'
def"
^
after:
t.m:6:12: warning: field width should have type 'int', but argument has type 'unsigned int'
"%*d", (unsigned) 1, 1);
^ ~~~~~~~~~~~~
llvm-svn: 64930
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First step, handle diagnostics in StringLiteral's that are due to token pasting.
For example, we now handle:
id str2 = @"foo"
"bar"
@"baz"
" b\0larg"; // expected-warning {{literal contains NUL character}}
Correctly:
test/SemaObjC/exprs.m:17:15: warning: CFString literal contains NUL character
" b\0larg"; // expected-warning {{literal contains NUL character}}
~~~^~~~~~~
There are several other related issues still to be done.
llvm-svn: 64924
|
|
|
|
| |
llvm-svn: 64894
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.
Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.
Be a bit more careful about when we consider a function a "builtin" in
C++.
llvm-svn: 64561
|
|
|
|
|
|
|
|
| |
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.
llvm-svn: 64526
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:
- fprintf and vfprintf: the builtins mechanism cannot (yet)
express FILE* arguments, so these can't be encoded.
- NSLog: the builtins mechanism cannot (yet) express NSString*
arguments, so this (and NSLogv) can't be encoded.
- asprintf and vasprintf: these aren't part of the C99 standard
library, so we really shouldn't be defining them as builtins in
the general case (and we don't seem to have the machinery to make
them builtins only on certain targets and depending on whether
extensions are enabled).
llvm-svn: 64512
|