Commit Graph

9621 Commits

Author SHA1 Message Date
Chris Lattner 1598a3a1a9 add assertion
llvm-svn: 64652
2009-02-16 19:27:54 +00:00
Chris Lattner 99a83317b7 code cleanup
llvm-svn: 64651
2009-02-16 19:25:52 +00:00
Chris Lattner aab70d2963 wrap long lines.
llvm-svn: 64650
2009-02-16 19:24:31 +00:00
Daniel Dunbar d73ea816af assert/ErrorUnsupported in unimplemented stub functions instead of
miscompiling.

llvm-svn: 64647
2009-02-16 18:48:45 +00:00
Ted Kremenek 6ae3eaf5a8 Add pretty-printing (for GraphViz) support for RangeConstraintManager.
llvm-svn: 64646
2009-02-16 18:42:56 +00:00
Chris Lattner 43df556ab5 Add support for deprecating ObjC properties. Unlike GCC, we warn that the
property is deprecated, not the getter/setter if the attribute is on
the property.

llvm-svn: 64644
2009-02-16 18:35:08 +00:00
Chris Lattner 41fd42e782 propagate attributes onto property decls.
llvm-svn: 64643
2009-02-16 18:32:47 +00:00
Fariborz Jahanian eb209e7dbd define __OBJC2__ for objc's nonfragile abi.
llvm-svn: 64642
2009-02-16 18:28:48 +00:00
Douglas Gregor bcbf86399f When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.

llvm-svn: 64641
2009-02-16 18:20:44 +00:00
Daniel Dunbar a1c37501ed ccc: @<filename> arguments are only treated specially if <filename>
exists, otherwise gcc just treats as an input.
 - PR3591

llvm-svn: 64640
2009-02-16 18:18:43 +00:00
Douglas Gregor 75a45ba2a4 Adopt a more principled approach to invalid declarations:
- If a declaration is an invalid redeclaration of an existing name,
    complain about the invalid redeclaration then avoid adding it to
    the AST (we can still parse the definition or initializer, if any).
  - If the declaration is invalid but there is no prior declaration
    with that name, introduce the invalid declaration into the AST
    (for later error recovery).
  - If the declaration is an invalid redeclaration of a builtin that
    starts with __builtin_, we produce an error and drop the
    redeclaration. If it is an invalid redeclaration of a library
    builtin (e.g., malloc, printf), warn (don't error!) and drop the
    redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.

llvm-svn: 64639
2009-02-16 17:45:42 +00:00
Ted Kremenek de39198f95 RangeConstraintManager is not on by default.
llvm-svn: 64638
2009-02-16 17:26:11 +00:00
Chris Lattner 50afe31b43 add support for deprecated objc ivars.
llvm-svn: 64637
2009-02-16 17:19:12 +00:00
Chris Lattner 96895e8dcd specify a triple to use, otherwise we get errors on this test for
hosts with a different size_t type.

llvm-svn: 64636
2009-02-16 17:11:14 +00:00
Chris Lattner f06a702e46 update expected-warning line.
llvm-svn: 64635
2009-02-16 17:08:46 +00:00
Chris Lattner ee4b5235e3 Add support for deprecated members of RecordDecls (e.g. struct fields).
llvm-svn: 64634
2009-02-16 17:07:21 +00:00
Argyrios Kyrtzidis 73b85e30ed castToDeclContext/castFromDeclContext are only required to be included in the class of decls that directly derive from DeclContext.
Their subclasses don't need them.

llvm-svn: 64632
2009-02-16 14:31:00 +00:00
Argyrios Kyrtzidis 9b7bd9bfc6 castToDeclContext/castFromDeclContext are not meant to be used directly; they are used indirectly by cast/dyn_cast.
All Decl <-> DeclContext casting should be done through cast/dyn_cast.

llvm-svn: 64631
2009-02-16 14:29:59 +00:00
Argyrios Kyrtzidis afe24c8818 DeclContext had its "casting machinery" inside the class definition so that if a new declaration context Decl appeared, the necessary changes
would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class.

llvm-svn: 64630
2009-02-16 14:29:28 +00:00
Argyrios Kyrtzidis ac152f1a1a Make DeclContexts maintenance a bit easier.
-In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses,
 it should be marked with DECL_CONTEXT_BASE.

-Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions.

llvm-svn: 64629
2009-02-16 14:28:33 +00:00
Ben Laurie 7b1c6c09f7 Untabify.
llvm-svn: 64628
2009-02-16 09:18:41 +00:00
Ted Kremenek fa95ce412c Do not register 'RangeConstraintManager' as the default ConstraintManager.
llvm-svn: 64627
2009-02-16 04:54:20 +00:00
Nate Begeman a6b47a4142 Don't allow taking the address of an element in an ext_vector
llvm-svn: 64614
2009-02-15 22:45:20 +00:00
Chris Lattner 4576b2eebd lots of trailing whitespace
llvm-svn: 64613
2009-02-15 22:44:22 +00:00
Chris Lattner 4bf74fdd90 Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method.  This ensures that they
are treated consistently.  This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.

llvm-svn: 64612
2009-02-15 22:43:40 +00:00
Chris Lattner 8510b902fb implement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error recovery.
llvm-svn: 64609
2009-02-15 22:24:30 +00:00
Chris Lattner 0629c8f4e4 don't pass a random english string in as a string argument to Diag.
llvm-svn: 64608
2009-02-15 22:21:03 +00:00
Chris Lattner 20cf43010a fix a fixme in -emit-html output: highlight the entire range of a macro
instantiation, which highlights the arguments of a function like macro
as well as its identifier.

llvm-svn: 64607
2009-02-15 21:32:34 +00:00
Chris Lattner f52c0b261c add a new SourceManager::getInstantiationRange helper method.
llvm-svn: 64606
2009-02-15 21:26:50 +00:00
Chris Lattner 641f1eab77 fix build on systems where uint64_t != unsigned long long
llvm-svn: 64605
2009-02-15 21:20:13 +00:00
Chris Lattner 5a2e9cb42d fix PR3579: __LINE__ expands to the presumed location of the
*end* of a macro instantiation, not the start of it.  This is
really all about bug-for-bug compatibility with GCC, but not
doing this breaks the FreeBSD kernel.

llvm-svn: 64604
2009-02-15 21:06:39 +00:00
Chris Lattner 2edf0fcb75 fix PR3579: __LINE__ expands to the presumed location of the
*end* of a macro instantiation, not the start of it.  This is
really all about bug-for-bug compatibility with GCC, but not
doing this breaks the FreeBSD kernel.

llvm-svn: 64603
2009-02-15 21:06:15 +00:00
Chris Lattner 9dc9c206d3 track "just a little more" location information for macro instantiations.
Now instead of just tracking the expansion history, also track the full
range of the macro that got replaced.  For object-like macros, this doesn't
change anything.  For _Pragma and function-like macros, this means we track
the locations of the ')'.

This is required for PR3579 because apparently GCC uses the line of the ')'
of a function-like macro as the location to expand __LINE__ to.

llvm-svn: 64601
2009-02-15 20:52:18 +00:00
Daniel Dunbar f898638eee PR3589: Don't simplify libcalls with -ffreestanding.
llvm-svn: 64599
2009-02-15 20:00:15 +00:00
Ted Kremenek d9849254ab Remove accidental duplication of content in .h file.
llvm-svn: 64596
2009-02-15 18:24:51 +00:00
Daniel Dunbar bb025312f3 Fix pasto noticed by Anders Johnsen.
llvm-svn: 64595
2009-02-15 18:23:07 +00:00
Chris Lattner 37959570af implement support for attribute(unavailable) on objc methods.
This implements gcc/testsuite/objc.dg/method-attribute-1.m

llvm-svn: 64581
2009-02-15 07:50:52 +00:00
Daniel Dunbar 8de90f0a92 Obj-C non-fragile ABI: Fix types of a few globals; these were not
creating valid LLVM structures (although they work fined).

llvm-svn: 64580
2009-02-15 07:36:20 +00:00
Daniel Dunbar 87f7ba3541 ccc: Pass -P to clang.
llvm-svn: 64578
2009-02-15 05:59:37 +00:00
Chris Lattner 4c6ea8612a allow implementations of deprecated functions to use deprecated symbols.
llvm-svn: 64572
2009-02-15 01:38:09 +00:00
Mike Stump 0e7d7b68c8 Use getNameAsCString instead of getNameAsString and reflow the type.
Thanks Anders.

llvm-svn: 64571
2009-02-14 22:49:33 +00:00
Mike Stump 2d5a2878d4 Generate the helper function for blocks. Now basic codegen is
starting to work for blocks.

llvm-svn: 64570
2009-02-14 22:16:35 +00:00
Fariborz Jahanian 35afdfc36e Fixed a bad ir-gen bug which caused a dejagnu test to fail.
Now we are pretty close to be in sync with objc's classic 
abi when it comes to passing dejagnu objc executable tests.

llvm-svn: 64569
2009-02-14 21:25:36 +00:00
Douglas Gregor 2563d0fa08 Add a test case for -ffreestanding that redefines malloc.
Warn that complex numbers are an extension in a freestanding C99
implementation.

llvm-svn: 64568
2009-02-14 21:06:05 +00:00
Douglas Gregor 69c7951c8e Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586
llvm-svn: 64566
2009-02-14 20:49:29 +00:00
Mike Stump 6bae7a1b2a Add expected note. Surely people test before the check in stuff.
llvm-svn: 64565
2009-02-14 20:35:19 +00:00
Cedric Venet 08438133da Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

llvm-svn: 64564
2009-02-14 20:20:19 +00:00
Fariborz Jahanian 99bed6fd21 Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).

llvm-svn: 64563
2009-02-14 20:13:28 +00:00
Anders Carlsson b6ba4682b5 Add support for deprecated Obj-C methods. The semantics mostly match what gcc has.
llvm-svn: 64562
2009-02-14 19:08:58 +00:00
Douglas Gregor e711f7052e Add hook to add attributes to function declarations that we know
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
2009-02-14 18:57:46 +00:00