Steve Naroff
65a0089eb7
Fix <rdar://problem/6764172> [sema] crash on invalid.
...
llvm-svn: 68568
2009-04-07 22:56:58 +00:00
Daniel Dunbar
ea10ab668f
Visibility attributes should only be set on definition.
...
llvm-svn: 68561
2009-04-07 22:36:33 +00:00
Daniel Dunbar
c44b4ccca8
Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
...
multiple instances of an option.
Also, removed direct -ansi support from clang-cc.
llvm-svn: 68558
2009-04-07 22:13:21 +00:00
Anders Carlsson
5f50c651e9
Shuffle some call code around. No functionality change.
...
llvm-svn: 68557
2009-04-07 22:10:22 +00:00
Daniel Dunbar
3a148f2625
Driver: Forward remaining -f options to clang manually.
...
- Groups are really just intended to hold inherent structure of the
options, not be abused for individual tool argument translation.
llvm-svn: 68554
2009-04-07 21:51:40 +00:00
Daniel Dunbar
9dc82a2632
Driver: Only forward last instance of -mmacosx-version-min= and
...
-isysroot to clang.
- Don't forward arbitrary -i* options to clang, just the ones we know
about.
llvm-svn: 68553
2009-04-07 21:42:00 +00:00
Fariborz Jahanian
9ecb84bb21
Now that we have __weak defined as attribute in all modes,
...
we must not issue gc-specific errors in non-gc mode.
llvm-svn: 68551
2009-04-07 21:25:06 +00:00
Daniel Dunbar
d18049ab1d
Driver: Manually translate a number of -f with no- variants options to
...
clang.
- We will eventually want some more driver infrastructre for this
probably.
- For now, the clang-cc interface stays relatively the same, but we
don't accept multiple instances anymore, or the [no-] variants
directly.
llvm-svn: 68550
2009-04-07 21:16:11 +00:00
Daniel Dunbar
30bf11e181
Driver: Add default for ArgList::hasFlag and simplify implementation.
...
llvm-svn: 68549
2009-04-07 21:08:57 +00:00
Douglas Gregor
ceec5cbaed
Allow us to ask for the access specifier of a translation unit
...
llvm-svn: 68548
2009-04-07 20:58:25 +00:00
Fariborz Jahanian
57eb2e021e
Propagte -fvisibility to objc2's class symbols.
...
llvm-svn: 68543
2009-04-07 20:26:30 +00:00
Eli Friedman
574c745370
Diagnose uses of function specifiers on declarations which don't declare
...
functions. Fixes PR3941.
llvm-svn: 68541
2009-04-07 19:37:57 +00:00
Daniel Dunbar
513d500fda
Driver: Explicitly warn that -pg isn't supported (even though we
...
aren't failing the compilation).
llvm-svn: 68540
2009-04-07 19:18:24 +00:00
Daniel Dunbar
a3cfbe33da
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
llvm-svn: 68535
2009-04-07 19:04:18 +00:00
Ted Kremenek
882cf06652
CFG: when there is not continue or break target, mark the CFG as bad.
...
llvm-svn: 68533
2009-04-07 18:53:24 +00:00
Anders Carlsson
d8db853243
Remove some dead code.
...
llvm-svn: 68532
2009-04-07 18:53:02 +00:00
Fariborz Jahanian
69ba935743
Fixes method name lookup when method appears in
...
the base implementations (and not in
current implementation).
llvm-svn: 68527
2009-04-07 18:28:06 +00:00
Daniel Dunbar
b2a7c062aa
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
llvm-svn: 68525
2009-04-07 18:21:47 +00:00
Douglas Gregor
b1fe2c9001
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.
llvm-svn: 68522
2009-04-07 17:20:56 +00:00
Chris Lattner
2a5c0a3688
Fariborz points out that weak is now defined to the attribute even
...
in C mode.
llvm-svn: 68520
2009-04-07 16:50:40 +00:00
Steve Naroff
ebc790d4d8
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
llvm-svn: 68517
2009-04-07 15:07:57 +00:00
Steve Naroff
54e5945297
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 *").
llvm-svn: 68514
2009-04-07 14:18:33 +00:00
Daniel Dunbar
d7beeea228
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.
llvm-svn: 68513
2009-04-07 06:43:45 +00:00
Daniel Dunbar
15894b791b
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.
llvm-svn: 68510
2009-04-07 05:48:37 +00:00
Ted Kremenek
4d947facad
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.
llvm-svn: 68504
2009-04-07 05:25:24 +00:00
Chris Lattner
33d840cc8f
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".
llvm-svn: 68503
2009-04-07 05:12:42 +00:00
Ted Kremenek
aed74642cb
Remove GetLeakNode. This isn't the right approach.
...
llvm-svn: 68502
2009-04-07 05:07:44 +00:00
Ted Kremenek
8928d74e19
Remove period.
...
llvm-svn: 68497
2009-04-07 04:54:31 +00:00
Ted Kremenek
e2f5a9f8e3
Eagerly compute the leak location when a leak occurs at the end of a path.
...
llvm-svn: 68496
2009-04-07 04:54:20 +00:00
Ted Kremenek
3cb8a84924
Removed some commented code.
...
llvm-svn: 68495
2009-04-07 04:53:35 +00:00
Chris Lattner
c2d140156c
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
llvm-svn: 68494
2009-04-07 04:48:21 +00:00
Ted Kremenek
89be6526c3
Remove hack support for @try...@finally in source-level CFGs. The current hack
...
had too many false positives in the analyzer.
llvm-svn: 68492
2009-04-07 04:26:02 +00:00
Daniel Dunbar
c790b09b81
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
llvm-svn: 68487
2009-04-07 02:59:27 +00:00
Ted Kremenek
86d52c4c02
PathDiagnostic generation: experiment with avoiding generation of control-flow
...
pieces between block entrance and block end unless necessary.
llvm-svn: 68483
2009-04-07 01:34:17 +00:00
Daniel Dunbar
4fab57ddea
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
llvm-svn: 68482
2009-04-07 00:55:51 +00:00
Anders Carlsson
350da60733
Use the new getFunctionInfo that takes a BlockPointerType parameter, and get rid of getBlockFunctionType from CGBlocks.cpp
...
llvm-svn: 68478
2009-04-07 00:20:24 +00:00
Ted Kremenek
6fd0921bdb
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.
llvm-svn: 68477
2009-04-07 00:12:43 +00:00
Ted Kremenek
d7c1aaa6c5
Don't overguard to adding a control-flow piece when "alwaysAdd" is true.
...
llvm-svn: 68476
2009-04-07 00:11:40 +00:00
Fariborz Jahanian
54d569c51d
Warn instead of error on duplicate protocol definitions.
...
Be kind to so many projects which are doing this (and be
like gcc).
llvm-svn: 68474
2009-04-06 23:43:32 +00:00
Ted Kremenek
c4c9ed0f9b
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.
llvm-svn: 68473
2009-04-06 23:06:54 +00:00
Ted Kremenek
92820d2d3d
PathDiagnosticLocation now also wraps Decls.
...
llvm-svn: 68470
2009-04-06 22:33:35 +00:00
Steve Naroff
837dc03222
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.
llvm-svn: 68468
2009-04-06 22:07:54 +00:00
Anders Carlsson
57640939c2
Fix typo.
...
llvm-svn: 68466
2009-04-06 21:55:22 +00:00
Douglas Gregor
7a5bc76b81
Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!
...
llvm-svn: 68454
2009-04-06 18:45:53 +00:00
Fariborz Jahanian
bc3c77b881
Fixed visibility issues related to objc2's synthesized
...
ivars.
llvm-svn: 68453
2009-04-06 18:30:00 +00:00
Anders Carlsson
6f811f149b
Add a getFunctionInfo that takes a BlockPointerType.
...
llvm-svn: 68452
2009-04-06 18:05:26 +00:00
Anders Carlsson
2266e244b5
Simplify C++ member function calls.
...
llvm-svn: 68451
2009-04-06 17:45:20 +00:00
Anders Carlsson
65cb90efc1
Define __OPTIMIZE__ and __OPTIMIZE_SIZE__ if the -O[12] and -Os flags are passed to the compiler.
...
llvm-svn: 68450
2009-04-06 17:37:10 +00:00
Chris Lattner
a8d2dbd181
Daniel convinced me that accepting "const va_list" arguments to va_arg is
...
a really really bad idea. Now that we emit an error about the unpromoted
type, users should be able to understand what is going on.
llvm-svn: 68447
2009-04-06 17:07:34 +00:00
Fariborz Jahanian
15e3a5c4b8
writable property in a category of class's superclass
...
makes the property writable in the current class.
llvm-svn: 68446
2009-04-06 16:59:10 +00:00
Chris Lattner
dcceee734c
Fix a couple of cases where Constant* pointers can dangle in
...
ObjCNonFragileABITypesHelper by converting them to dynamic
getters. This fixes a crash on rdar://6757213. The others
should be converted over as well.
llvm-svn: 68445
2009-04-06 16:53:45 +00:00
Chris Lattner
56382aa890
in va_arg diagnostics, print out the unpromoted type. This makes the
...
diagnostic use the va_list typedef more often, see the difference in the
changed testcase.
llvm-svn: 68441
2009-04-05 15:49:53 +00:00
Ted Kremenek
d3ebd551b9
Fix output of ranges in analyzer plist files.
...
llvm-svn: 68437
2009-04-05 02:08:28 +00:00
Chris Lattner
3f5cd77db2
Add a warning for questionable va_args usage.
...
llvm-svn: 68435
2009-04-05 00:59:53 +00:00
Chris Lattner
9e658eccab
GCC compatibility: gcc allows applying va_args to const
...
va_lists for some reason. This fixes rdar://6726818
llvm-svn: 68434
2009-04-05 00:52:59 +00:00
Chris Lattner
ecdaf40c9e
fix rdar://6757323, where an escaped newline in a // comment
...
was causing the char after the newline to get eaten.
llvm-svn: 68430
2009-04-05 00:26:41 +00:00
Anders Carlsson
468fa6366b
Add some basic support for generating C++ member functions.
...
llvm-svn: 68425
2009-04-04 20:47:02 +00:00
Anton Korobeynikov
1dfc5f51c8
Extend possible handled regparm(N) value
...
llvm-svn: 68424
2009-04-04 10:27:50 +00:00
Daniel Dunbar
a9bbcfa130
Driver: Handle -dumpversion, this is used by some configuration
...
scripts.
llvm-svn: 68418
2009-04-04 05:17:38 +00:00
Daniel Dunbar
f89733cfb8
Driver: Handle properly calling dsymutil when source input is
...
preceeded by a linker input flag.
- <rdar://problem/6757236> clang should make a dSYM when going
straight from source to binary
- This still matches gcc, but the right way to solve this would be to
detect the situation we care about (we are compiling from source
and linking in one step), instead of looking at the suffix of the
input file. The Tool doesn't quite have enough information to do
this yet, however.
- Also, find the suffix correctly.
llvm-svn: 68417
2009-04-04 00:55:30 +00:00
Daniel Dunbar
90dd6f45cc
Driver: Automatically suppress warnings for duplicate versions of
...
flags which were used for something.
llvm-svn: 68416
2009-04-04 00:52:26 +00:00
Anton Korobeynikov
c847824e8e
Basic support for regparm codegen
...
llvm-svn: 68414
2009-04-04 00:49:24 +00:00
Anton Korobeynikov
6953ef2de3
Provide sema proper values of maximal number of arguments passed in registers.
...
llvm-svn: 68413
2009-04-03 23:38:25 +00:00
Anders Carlsson
e5fd6f2227
Add support for calling C++ member functions.
...
llvm-svn: 68412
2009-04-03 22:50:24 +00:00
Anders Carlsson
b15b55c2d0
Add a getFunctionInfo that takes a CXXMethodDecl.
...
llvm-svn: 68411
2009-04-03 22:48:58 +00:00
Daniel Dunbar
f69985511d
Driver: Add -Qunused-arguments option to suppress driver "unused
...
arguments" warning.
llvm-svn: 68410
2009-04-03 22:09:23 +00:00
Fariborz Jahanian
2705859981
Real corener case of a method declared in a protocol
...
used in a class which declares a property of the same
name. This should not result in an unimplemented
method warning.
llvm-svn: 68409
2009-04-03 21:51:32 +00:00
Chris Lattner
01b8ef2ac4
improve the string literal comparison warning to not call @encode's "string literals".
...
llvm-svn: 68407
2009-04-03 21:11:28 +00:00
Ted Kremenek
f9201d9799
Sentence-case bug type.
...
llvm-svn: 68406
2009-04-03 21:10:31 +00:00
Daniel Dunbar
c2a7189048
Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
...
need to do anything special to support this.
llvm-svn: 68403
2009-04-03 20:51:31 +00:00
Ted Kremenek
751e7e3833
retain/release checker: don't track NSPanel until we have better reasoning about
...
the subtle ownership issues of such objects.
llvm-svn: 68397
2009-04-03 19:02:51 +00:00
Chris Lattner
3a4e43107b
add fixit advice to an archiac ObjC issue.
...
llvm-svn: 68395
2009-04-03 18:38:42 +00:00
Steve Naroff
55a719835d
Add a comment/FIXME so Eli can sleep better:-))
...
llvm-svn: 68379
2009-04-03 09:44:50 +00:00
Zhongxing Xu
ec7e7dfe0a
This is the first step to gradually remove the use of loc::SymbolVal. Now
...
when creating symbolic values, we distinguish between location and non-location
values. For location values, we create a symbolic region instead of a
loc::SymbolVal.
llvm-svn: 68373
2009-04-03 07:33:13 +00:00
Anders Carlsson
16b1461c21
Ignore plus operands when looking up the operand number from a named operand. This matches llvm-gcc and fixes PR3908.
...
llvm-svn: 68371
2009-04-03 05:57:08 +00:00
Fariborz Jahanian
befc9dfbff
Implement -fvisibility.
...
llvm-svn: 68369
2009-04-03 03:28:57 +00:00
Daniel Dunbar
6a8803a34f
Driver: Add missed translation for darwin::Preprocess (gcc), -d*
...
wasn't being forwarded.
llvm-svn: 68365
2009-04-03 01:27:06 +00:00
Daniel Dunbar
fd6cfcffa2
Add target hook for setting symbol prefix and section of unicode
...
string literals.
llvm-svn: 68363
2009-04-03 00:57:44 +00:00
Douglas Gregor
0f4cc3f728
Fix a little typo that was killing de-serialization
...
llvm-svn: 68354
2009-04-03 00:25:09 +00:00
Douglas Gregor
17bbaed164
Resynchronize Decl/VarDecl serialization code with the structures
...
llvm-svn: 68346
2009-04-02 23:40:00 +00:00
Ted Kremenek
6e4c284abe
Sentence-type bug type and category.
...
llvm-svn: 68345
2009-04-02 22:50:16 +00:00
Ed Schouten
e33194b9d5
Add some whitespace to test my commit privileges.
...
Approved by: ddunbar
llvm-svn: 68343
2009-04-02 19:13:12 +00:00
Douglas Gregor
9c0d38a7a0
Add a new command-line option "-fixit-at=file:line:column" that only
...
applies fix-its to error messages that occur at that specific location
in the program.
llvm-svn: 68342
2009-04-02 19:05:20 +00:00
Fariborz Jahanian
38a5c9650e
Fix up lookup rules for properties declared in
...
objc's continuation class.
llvm-svn: 68339
2009-04-02 18:44:20 +00:00
Steve Naroff
d5ca2d0165
Fix http://llvm.org/bugs/show_bug.cgi?id=3907 .
...
llvm-svn: 68338
2009-04-02 18:37:59 +00:00
Daniel Dunbar
b48a4aaec9
Driver: Tweak search paths for FreeBSD.
...
- Patch by Pawel Worach!
llvm-svn: 68332
2009-04-02 18:30:04 +00:00
Mike Stump
d3e3885f2d
Remove -ftrapu.
...
llvm-svn: 68330
2009-04-02 18:15:54 +00:00
Sanjiv Gupta
639f2d92f8
Don't use static globals for params as it confuses the optimzer that their values are never being used in the function.
...
llvm-svn: 68328
2009-04-02 17:51:27 +00:00
Douglas Gregor
a42bd8433d
Provide FIX-IT notes to describe what fix-it is doing behind the
...
scenes, using the underlying diagnostic client to format the
messages.
llvm-svn: 68324
2009-04-02 17:13:00 +00:00
Douglas Gregor
068913eb7a
Some cleanups to the fix-it rewriter. Thanks, Chris
...
llvm-svn: 68322
2009-04-02 16:34:42 +00:00
Anders Carlsson
4eca109941
Implement mangling of declarations inside functions.
...
llvm-svn: 68321
2009-04-02 16:24:45 +00:00
Anders Carlsson
f2125a02db
Mangle VarDecls correctly.
...
llvm-svn: 68320
2009-04-02 16:05:20 +00:00
Anders Carlsson
810679c37a
Move the function decl mangling code out into its own function. No functionality change.
...
llvm-svn: 68319
2009-04-02 15:51:53 +00:00
Douglas Gregor
d8e97def58
When calling a function without a prototype for which we have a
...
definition, warn if there are too many/too few function call
arguments.
llvm-svn: 68318
2009-04-02 15:37:10 +00:00
Daniel Dunbar
b0006ae76d
Wire --version to normal -v version text.
...
llvm-svn: 68316
2009-04-02 15:05:41 +00:00
Chris Lattner
098d94a57d
add TemplateName.cpp/h to the xcode project, minor tidying.
...
llvm-svn: 68301
2009-04-02 06:07:12 +00:00
Anders Carlsson
cbaeb9e633
Emit code for linkage specifications.
...
llvm-svn: 68300
2009-04-02 05:55:18 +00:00
Ted Kremenek
a64bbc68fc
Also "flatten" PathLocations fed to the HTMLDiagnosticClient. We need a better
...
long-term strategy, but this should work for now.
llvm-svn: 68297
2009-04-02 05:17:38 +00:00
Ted Kremenek
12f510aa8f
Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
...
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.
llvm-svn: 68292
2009-04-02 05:13:24 +00:00
Chris Lattner
49836b448e
fix a FIXME, providing accurate source range info for DeclStmt's. The end
...
of the range is now the ';' location. For something like this:
$ cat t2.c
#define bool int
void f(int x, int y) {
bool b = !x && y;
}
We used to produce:
$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;
void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
(DeclStmt 0x2201ef0 <line:2:14> <----
0x2201a20 "int b =
(BinaryOperator 0x2201ed0 <line:4:10, col:16> 'int' '&&'
(UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
(DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
(DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")
Now we produce:
$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;
void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
(DeclStmt 0x2201ef0 <line:2:14, line:4:17> <------
0x2201a20 "int b =
(BinaryOperator 0x2201ed0 <col:10, col:16> 'int' '&&'
(UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
(DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
(DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")
llvm-svn: 68288
2009-04-02 04:16:50 +00:00