Граф коммитов

10405 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 9af6668984 Driver: Add default for ArgList::hasFlag and simplify implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:08:57 +00:00
Douglas Gregor 5c27f2bfd2 Allow us to ask for the access specifier of a translation unit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 20:58:25 +00:00
Fariborz Jahanian cf71dd4242 Propagte -fvisibility to objc2's class symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 20:26:30 +00:00
Eli Friedman 85a5319ea4 Diagnose uses of function specifiers on declarations which don't declare
functions.  Fixes PR3941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 19:37:57 +00:00
Daniel Dunbar 5c1aaafbd6 Driver: Explicitly warn that -pg isn't supported (even though we
aren't failing the compilation).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 19:18:24 +00:00
Daniel Dunbar 1e23f5f963 Driver: Add 'q' flag for options which shouldn't be reported as unused.
- <rdar://problem/6756295> warning about '-dynamic' argument unused
   during compilation seems incorrect


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 19:04:18 +00:00
Ted Kremenek 235c5ed8be CFG: when there is not continue or break target, mark the CFG as bad.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:53:24 +00:00
Anders Carlsson 8ac67a7725 Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:53:02 +00:00
Fariborz Jahanian ef79bc9b07 Fixes method name lookup when method appears in
the base implementations (and not in
current implementation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:28:06 +00:00
Anders Carlsson ef88e58360 Fix broken test case. I have no idea why this ever worked.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:21:53 +00:00
Daniel Dunbar 4ae24e7f11 Driver: Fix a parsing bug where some options were matched
incorrectly. I'm blanking on the smartest way to write this search,
but we should just do the right thing when we move to TableGen.
 - <rdar://problem/6761194> [driver] -Wextra-tokens isn't parsed
   correctly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:21:47 +00:00
Chris Lattner 3eb2fc820e add a warning for this crazy case, as suggested by Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 18:18:09 +00:00
Douglas Gregor c2ee10d79f Move the internal DeclContext data structures into a separate header.
Simplify the addition of a case statement to a switch.

Fix -print-stats for attribute-qualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 17:20:56 +00:00
Daniel Dunbar 82fc0cb788 Use %s in test, not hard coded name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 17:09:43 +00:00
Chris Lattner 10d2427386 Fariborz points out that weak is now defined to the attribute even
in C mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 16:50:40 +00:00
Douglas Gregor 1a31ad8171 XFAIL a failing test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 16:32:03 +00:00
Steve Naroff ebaa768521 Tweak Sema::ActOnInstanceMessage() to look for a class method when dealing with qualified id's. This change is motivated by our desire to not support the "Class<foo>" idiom. Note that the change makes perfect sense (since all ObjC classes are also id/instances).
This allow us to document a simple migration path...change "Class <foo>" to "id <foo>".

This effects: 
- <rdar://problem/6761939> TASK: File source change radars for "qualified Class" errors
- <rdar://problem/6761864> Protocol qualified Class is unsupported


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 15:07:57 +00:00
Ted Kremenek c1279db9c3 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 14:26:58 +00:00
Steve Naroff 939ab4741c Fix typo in newly added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 14:22:40 +00:00
Steve Naroff d9fd7647e2 Change the type of ObjC @ string constants (from NSConstantString->NSString).
This fixes <rdar://problem/6757102> clang type for @"xxx" is "NSConstantString *" (GCC type is "NSString *").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 14:18:33 +00:00
Daniel Dunbar 7e075cb62c Handle use side of __objc_exception__ attribute; when using an
exception with this attribute we don't need to emit a weak definition
for the exception type information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 06:43:45 +00:00
Chris Lattner 7f48c6e0f0 *everyone* knows that __weak is not defined on linux :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 06:05:28 +00:00
Chris Lattner 0b51415dcf implement rdar://6762183. I'm not sure if it is more insane that
GCC ignores macro definitions after \n's or that real code depends
on this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 06:02:44 +00:00
Daniel Dunbar 6ab187a49a Various fixes to symbols used for Obj-C x86_64 metadata.
- Changed method names to match gcc (categories names still aren't
   mangled in).

 - Expose correct name for class and metadata symbols (although
   -fvisibility=hidden isn't yet correct).

 - Remove several things from llvm.used that didn't need to be there
   (I suspect this can still be trimmed).

 - Don't use asm-prefix extension for _objc_empty_{cache,vtable} (not
   needed).

 - Hide EH type class info with -fvisibility=hidden

 - Change setGlobal[Option]Visibility to not change the visibility of
   functions with internal linkage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:48:37 +00:00
Ted Kremenek e82e13ad4e Add test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:33:18 +00:00
Ted Kremenek f96f16d9f5 Remove hack from LiveVariables analysis where variables whose address are taken
are considered 'live'. This hack isn't needed anymore because we have a
separation in the path-sensitive analyzer between variable names and bindings;
the analyzer can continue to reason about the storage of a variable after its
name is no longer directly referenced.  Now the live variables analysis literally means "is this name live".

Along this line, update the dead stores checker to explicitly look for variables
whose values have escaped.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:25:24 +00:00
Chris Lattner 2ec926cce3 define __va_copy unconditionally, but va_copy only in c99 or non-ansi mode.
Fixes rdar://6759546, some code that actually used __va_copy because they
thought it was "more portable".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:12:42 +00:00
Ted Kremenek a5770b9c0d Remove GetLeakNode. This isn't the right approach.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:07:44 +00:00
Ted Kremenek 0fa96548f2 Remove period.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:54:31 +00:00
Ted Kremenek 0b3c9a9fe4 Eagerly compute the leak location when a leak occurs at the end of a path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:54:20 +00:00
Ted Kremenek 581329c09f Removed some commented code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:53:35 +00:00
Chris Lattner 3a5cbd37c9 The __weak and __strong defines are common to all darwin targets
and are even set in C mode.  As such, move them to Targets.cpp.

__OBJC_GC__ is also darwin specific, but seems reasonable to always
define it when in objc-gc mode.

This fixes rdar://6761450


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:48:21 +00:00
Ted Kremenek 90658ec725 Remove hack support for @try...@finally in source-level CFGs. The current hack
had too many false positives in the analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:26:02 +00:00
Daniel Dunbar 16fd3a9f51 Driver: More verbosity reduction.
- Ignore some more -W options and -[fm] options which we can somewhat
   safely ignore.

 - Recognize that -W is an alias for -Wextra

W: -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wfour-char-constants -Winit-self -Wmissing-format-attribute -Wno-#warnings -Wno-comment -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wstrict-prototypes -Wunused-parameter

f: -fconstant-cfstrings -fdollars-in-identifiers -finline -finline-functions -fno-inline -fno-keep-inline-functions -fno-strict-aliasing -fobjc-atdefs -fobjc-call-cxx-cdtors -fobjc-new-property -fstack-protector

m: -mconstant-cfstrings -mfix-and-continue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 02:59:27 +00:00
Daniel Dunbar 590230da13 Fix test (triple wasn't passed correctly, the driver doesn't accept
-mtriple).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 02:31:44 +00:00
Ted Kremenek bfd7c9e3fd PathDiagnostic generation: experiment with avoiding generation of control-flow
pieces between block entrance and block end unless necessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 01:34:17 +00:00
Daniel Dunbar 0002d23aaf Implement __sync_{add,sub,and,or,xor}_and_fetch and
__sync_bool_compare_and_swap.
 - <rdar://problem/6762223> [sema/irgen] support
   __sync_bool_compare_and_swap and __sync_add_and_fetch


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 00:55:51 +00:00
Daniel Dunbar b1c71dfe3f Remove a FIXME, the driver handles -O4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 00:38:22 +00:00
Anders Carlsson f8544a4667 Use the new getFunctionInfo that takes a BlockPointerType parameter, and get rid of getBlockFunctionType from CGBlocks.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 00:20:24 +00:00
Ted Kremenek 933c42217f retain/release checker: When hunting for the leak location, don't walk the
ExplodedGraph backwards. That may inadvertently result in reverse control-flow
edges in the PathDiagostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 00:12:43 +00:00
Ted Kremenek e97386fdd4 Don't overguard to adding a control-flow piece when "alwaysAdd" is true.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 00:11:40 +00:00
Fariborz Jahanian e2573e529d Warn instead of error on duplicate protocol definitions.
Be kind to so many projects which are doing this (and be
like gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 23:43:32 +00:00
Ted Kremenek 14856d7b7a Rewrite control-flow diagnostic generation "extensive" algorithm using "edge
contexts".  This allows us to use a stack of contexts to keep track of what control-flow pieces to include when exiting blocks like 'if', 'for', etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 23:06:54 +00:00
Ted Kremenek fea5f5a1e8 PathDiagnosticLocation now also wraps Decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 22:33:35 +00:00
Steve Naroff fc479d793b Make casting 'super' a deprecated warning (instead of a hard error).
This will simplify clang adoption, and is probably better "etiquette" (since gcc has always accepted this idiom without warning). Once we are over the adoption hurdle, we can turn this into an error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 22:07:54 +00:00
Anders Carlsson ae8ecdd6db Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 21:55:22 +00:00
Douglas Gregor a86b832906 Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 18:45:53 +00:00
Fariborz Jahanian 77c9fd2eee Fixed visibility issues related to objc2's synthesized
ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 18:30:00 +00:00
Anders Carlsson 5529b24500 Add a getFunctionInfo that takes a BlockPointerType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 18:05:26 +00:00
Anders Carlsson 6c247e38e5 Simplify C++ member function calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 17:45:20 +00:00