Commit Graph

18056 Commits

Author SHA1 Message Date
Ted Kremenek caf2c51fad Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker also handled undefined receivers in message expressions.
llvm-svn: 89524
2009-11-21 01:25:37 +00:00
Edward O'Callaghan 847f2a10ee Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
llvm-svn: 89520
2009-11-21 00:49:54 +00:00
Ted Kremenek f7adea43b4 More checker refactoring. Passing undefined values in a message expression is now handled by UndefinedArgChecker.
llvm-svn: 89519
2009-11-21 00:49:41 +00:00
John Thompson c1b70ab9b8 Revised Win32 include path to search highest version in registry, plus platform SDK path
llvm-svn: 89517
2009-11-21 00:15:52 +00:00
Daniel Dunbar c2588c3bd9 Convert test to FileCheck.
llvm-svn: 89514
2009-11-20 23:46:56 +00:00
Mike Stump 58ef18b38c Checkpoint current work. WIP.
llvm-svn: 89513
2009-11-20 23:44:51 +00:00
Douglas Gregor ade9bcd72e Cope with extraneous "template" keyword when providing an out-of-line
definition of a member template (or a member thereof). Fixes PR5566.

llvm-svn: 89512
2009-11-20 23:39:24 +00:00
Daniel Dunbar a764eef0e9 Driver: Add clang -cc1 dependency output options parsing.
llvm-svn: 89508
2009-11-20 23:28:07 +00:00
Daniel Dunbar a604639635 Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
llvm-svn: 89503
2009-11-20 22:47:55 +00:00
Daniel Dunbar 2eaef18e76 Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.
llvm-svn: 89502
2009-11-20 22:32:38 +00:00
Daniel Dunbar 32164f4bdb Driver: Use '-target-abi' 'FOO' instead of '-target-abi=FOO'.
llvm-svn: 89501
2009-11-20 22:32:30 +00:00
Daniel Dunbar b17d34906a Update for palign intrinsic fix.
llvm-svn: 89499
2009-11-20 22:21:59 +00:00
Daniel Dunbar 4274685b63 Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
llvm-svn: 89498
2009-11-20 22:21:52 +00:00
Daniel Dunbar 8bed86c43e Standardize Driver translation to call clang-cc using '-foo' form instead of '--foo'.
llvm-svn: 89497
2009-11-20 22:21:36 +00:00
Douglas Gregor 2094c5e80f A previous commit fixed PR5519; here's the test case.
llvm-svn: 89494
2009-11-20 22:05:53 +00:00
Douglas Gregor a25d65d1b6 Implement C++ [basic.lookup.classref]p3, which states how the type
name 'T' is looked up in the expression

  t.~T()

Previously, we weren't looking into the type of "t", and therefore
would fail when T actually referred to an injected-class-name. Fixes
PR5530.

llvm-svn: 89493
2009-11-20 22:03:38 +00:00
Douglas Gregor 09177b2b7f Update C++ status
llvm-svn: 89492
2009-11-20 22:00:06 +00:00
Douglas Gregor e4f764f013 When checking the base object of a member access expression (b.foo,
b->foo), don't look through pointers unless we have an -> operator.

llvm-svn: 89480
2009-11-20 19:58:21 +00:00
Douglas Gregor 51c538bee4 Teach FixOverloadedFunctionReference to build new expression ASTs rather
than tweaking existing ASTs, since we were (*gasp*) stomping on ASTs
within templates. I'm glad we found this little stick of TNT early...

llvm-svn: 89475
2009-11-20 19:42:02 +00:00
Mike Stump 4d119e49f9 Add testcases for recent checkins.
llvm-svn: 89469
2009-11-20 18:51:28 +00:00
Anders Carlsson 0a66c26191 Fix lifetime of conditional temporaries. Patch by Victor Zverovich!
llvm-svn: 89467
2009-11-20 17:27:56 +00:00
Daniel Dunbar 9c7efbb996 Fix some codegen tests to include positive checks.
llvm-svn: 89465
2009-11-20 17:23:39 +00:00
Daniel Dunbar 69fd86dd44 Add clang -cc1 parsing of CodeGenOptions.
llvm-svn: 89464
2009-11-20 17:23:30 +00:00
Daniel Dunbar 8cde1d978f clang-cc: Lift setForcedLangOptions out of options initialization.
llvm-svn: 89462
2009-11-20 16:55:31 +00:00
Ken Dyck 33211d9658 Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
UINT<n>_C(v) macros. 

llvm-svn: 89461
2009-11-20 16:49:10 +00:00
Ken Dyck 8dcc21420b Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
and UINT<n>_MAX defintions.

llvm-svn: 89460
2009-11-20 16:44:38 +00:00
Ken Dyck 764a5f3881 Avoid unwanted macro expansion in macros that paste together int<n>_t and
uint<n>_t definitions.

llvm-svn: 89459
2009-11-20 16:37:35 +00:00
David Chisnall bc8bdea183 Fixed crash when using undefined protocols (GNU runtime).
llvm-svn: 89457
2009-11-20 14:50:59 +00:00
Benjamin Kramer df5280df05 Add a workaround to silence a bogus g++-4.4 -pedantic warning.
driver.cpp:211: warning: ISO C++ forbids zero-size array 'argv'

llvm-svn: 89455
2009-11-20 11:49:06 +00:00
Benjamin Kramer 7d875c7e7e Fix typo GCC 4.3 warned about.
llvm-svn: 89453
2009-11-20 10:03:00 +00:00
Zhongxing Xu adfd1a2e8b no need to cast.
llvm-svn: 89451
2009-11-20 06:14:56 +00:00
Eli Friedman 564048e692 Fix a couple minor memory leaks.
llvm-svn: 89450
2009-11-20 05:53:06 +00:00
Ted Kremenek a4f7c180ae Add simple static analyzer checker to check for sending 'release', 'retain', etc. directly to a class. Fixes <rdar://problem/7252064>.
llvm-svn: 89449
2009-11-20 05:27:05 +00:00
Ted Kremenek c1f161c012 Unused ivar checker: ivars referenced by lexically nested functions should not be flagged as unused. Fixes <rdar://problem/7254495>.
llvm-svn: 89448
2009-11-20 04:31:57 +00:00
Zhongxing Xu 1aec3c0427 No need to pass the state argument explicitly.
llvm-svn: 89447
2009-11-20 04:09:56 +00:00
Zhongxing Xu ab0ae2139a Revert r89437 and add a comment.
llvm-svn: 89446
2009-11-20 03:50:46 +00:00
Mike Stump d8d26d06a5 Implement throw d, where d is a class type that requires copy
construction.  WIP.

llvm-svn: 89442
2009-11-20 02:31:07 +00:00
Douglas Gregor 3153da7154 Don't build an explicit conversion to a reference type
llvm-svn: 89441
2009-11-20 02:31:03 +00:00
Mike Stump 4d7a07bdaf Handle throw d, where d is a class type but only has a trivial copy
constructor.  WIP.

llvm-svn: 89438
2009-11-20 01:57:39 +00:00
Zhongxing Xu 6d9a942174 It's unnecessary to check for unknown at this point.
llvm-svn: 89437
2009-11-20 01:56:48 +00:00
Daniel Dunbar f7535121a2 Driver: Add parsing for TargetOptions to CompilerInvocation::CreateFromArgs.
llvm-svn: 89435
2009-11-20 01:46:44 +00:00
Daniel Dunbar c5d28f2ea9 Ignore -Wstrict-overflow={3,4,5} for now.
llvm-svn: 89433
2009-11-20 01:31:27 +00:00
Ted Kremenek a96d02c76b Really fix test case.
llvm-svn: 89430
2009-11-20 01:20:12 +00:00
Ted Kremenek 4b412f51df Fix test case.
llvm-svn: 89429
2009-11-20 01:19:22 +00:00
Douglas Gregor ee9067c51f When we have a non-dependent expression such as
A::f

that occurs within a non-static member function with a type-dependent
"this", don't consider this to be a case for introduction of an
implicit "(*this)." to refer to a specific member function unless we
know (at template definition time) that A is a base class of *this.

There is some disagreement here between GCC, EDG, and Clang about the
handling of this case. I believe that Clang now has the correct,
literal interpretation of the standard, but have asked for
clarification (c++std-core-15483).

llvm-svn: 89425
2009-11-20 00:59:20 +00:00
Mike Stump d1782cc478 Add suport for throw;. WIP.
llvm-svn: 89424
2009-11-20 00:56:31 +00:00
Mike Stump 18fc44dfd3 Fix rtti generation for throws. WIP.
llvm-svn: 89420
2009-11-20 00:43:57 +00:00
Mike Stump 101f052faf Simplify rtti building code a little. Prep for reuse for throw rtti
generation.

llvm-svn: 89416
2009-11-20 00:31:50 +00:00
Ted Kremenek dd2b2b23c8 Fix null dereference in NSAutoreleasePoolChecker when analyzing messages sent to blocks.
llvm-svn: 89413
2009-11-20 00:12:36 +00:00
Mike Stump a7a1b7e780 Fixup key function calculations.
llvm-svn: 89412
2009-11-20 00:02:19 +00:00
Douglas Gregor deebf6efab Deduce a ConstantArrayType from a value-dependent initializer list
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!

llvm-svn: 89407
2009-11-19 23:25:22 +00:00
John McCall 8cd7813ca3 Draw a brighter line between "unresolved" expressions, where we have done the
appropriate lookup and simply can't resolve the referrent yet, and
"dependent scope" expressions, where we can't do the lookup yet because the
entity we need to look into is a dependent type.

llvm-svn: 89402
2009-11-19 22:55:06 +00:00
Fariborz Jahanian e774fa6412 Don't issue spurious diagnostic with Obj-C fast enumeration.
(radar 7409165).

llvm-svn: 89400
2009-11-19 22:12:37 +00:00
Daniel Dunbar 84e8a249fa Fix some default in the option classes, and some CompilerInvocation argification
errors.

llvm-svn: 89388
2009-11-19 20:54:59 +00:00
Daniel Dunbar 69d98a6818 Add missing dependency on TableGen.
llvm-svn: 89387
2009-11-19 20:54:45 +00:00
Mike Stump cd2b821241 Fixup address point computations. WIP.
llvm-svn: 89386
2009-11-19 20:52:19 +00:00
Ted Kremenek 439a6d146c Fix crash when using --analyzer-store=region when handling initializers with nested arrays/structs whose values are not explicitly specified. Fixes <rdar://problem/7403269>.
llvm-svn: 89384
2009-11-19 20:20:24 +00:00
Ted Kremenek 0c54d2da14 Remove printf statement.
llvm-svn: 89383
2009-11-19 20:01:53 +00:00
Ted Kremenek 0c78ae18ab Fix 80 col. violation.
llvm-svn: 89382
2009-11-19 19:59:42 +00:00
Ted Kremenek 4b35a2ed08 Only fetch the ASTContext object within the assertion.
llvm-svn: 89375
2009-11-19 19:04:08 +00:00
Daniel Dunbar 5d26212f6b Silence -Asserts warning.
llvm-svn: 89373
2009-11-19 18:53:25 +00:00
Daniel Dunbar 8c9efca5bd Driver: Move INPUT and UNKNOWN sentinel options into the OptParser.td file.
llvm-svn: 89371
2009-11-19 18:47:17 +00:00
Fariborz Jahanian 1eab66c7cc Patch to implement new-operators with default args.
Fixes pr5547.

llvm-svn: 89370
2009-11-19 18:39:40 +00:00
Daniel Dunbar 0f32a4bc86 Driver: Add Sentinel flag to option kinds.
llvm-svn: 89367
2009-11-19 18:09:06 +00:00
Douglas Gregor ad2956c25d Cope with an amusingly little anomaly with dependent types and
incomplete array initialization, where we have the following in a
template:

  int a[] = { 1, 2, something-value-dependent };
  // ...
  sizeof(a);

The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).

llvm-svn: 89366
2009-11-19 18:03:26 +00:00
John Thompson e467e19766 Added preliminary support step for PS3
llvm-svn: 89362
2009-11-19 17:18:50 +00:00
Douglas Gregor 45959e5556 Try yet again to de-bork CMake Windows build w.r.t. clang++
llvm-svn: 89361
2009-11-19 16:42:34 +00:00
Ken Dyck aff01ceb95 Define WCHAR_MIN and WCHAR_MAX in terms of __WCHAR_WIDTH__ for consistency with
other limit macros.

llvm-svn: 89355
2009-11-19 15:53:08 +00:00
Ken Dyck 0138b9e1db Define __WCHAR_WIDTH__ for use in stdint.h.
llvm-svn: 89353
2009-11-19 15:47:58 +00:00
Ken Dyck f0b343f5b7 Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
widths. This corrects the values of these definitions for MSP430 and PIC16.

llvm-svn: 89350
2009-11-19 14:35:19 +00:00
Ken Dyck a1f677c3d1 Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
stdint.h.

llvm-svn: 89348
2009-11-19 14:16:57 +00:00
Ken Dyck 279ed5189c Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
arbitrary widths.

llvm-svn: 89347
2009-11-19 14:03:24 +00:00
Ken Dyck 575128656e Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.
llvm-svn: 89346
2009-11-19 13:42:09 +00:00
Ken Dyck 9b25f781c5 Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.

llvm-svn: 89345
2009-11-19 13:18:59 +00:00
Ken Dyck f982fc0b23 Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
replaced with __PTRDIFF_WIDTH__.

llvm-svn: 89344
2009-11-19 12:37:14 +00:00
Ken Dyck 8af6035ac9 Construct the macro body of PTRDIFF_MAX and PTRDIFF_MIN from __PTRDIFF_WIDTH__.
llvm-svn: 89343
2009-11-19 12:33:01 +00:00
Ken Dyck 056efe0fc7 Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.
llvm-svn: 89342
2009-11-19 12:21:52 +00:00
Ken Dyck cc11129fda Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
__INTPTR_WIDTH__ instead.

llvm-svn: 89340
2009-11-19 12:15:31 +00:00
Douglas Gregor c3851cd0d8 Try to fix CMake clang++ creation on Windows
llvm-svn: 89336
2009-11-19 07:59:29 +00:00
Douglas Gregor 156d50c529 Add missing testcase for Objective-C p@property getter/setter completions
llvm-svn: 89335
2009-11-19 07:58:03 +00:00
Douglas Gregor c8537c5156 Objective-C code completion within properties after "setter = " or
"getter = ", to provide suitable method names.

llvm-svn: 89334
2009-11-19 07:41:15 +00:00
Daniel Dunbar 51cd8f085f Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.
llvm-svn: 89333
2009-11-19 07:37:51 +00:00
Daniel Dunbar f57e69c78a Add missing dependency for CMake.
llvm-svn: 89332
2009-11-19 07:37:40 +00:00
Daniel Dunbar 5eb47e0ab4 Add missing init.
llvm-svn: 89331
2009-11-19 07:37:33 +00:00
Daniel Dunbar be6ef3874f Sketch .td file and build system goop for OptTable based clang-cc options.
llvm-svn: 89330
2009-11-19 07:19:04 +00:00
Daniel Dunbar 52ed5feee5 Factor out OptTable::ParseArgs, for parsing an entire argument vector.
llvm-svn: 89327
2009-11-19 06:35:06 +00:00
Douglas Gregor 564d41fbe4 CMake goop to create clang++ symlink
llvm-svn: 89320
2009-11-19 05:46:45 +00:00
Daniel Dunbar da9e8e225d clang-cc: Remove some more llvm:🆑:init arguments, by only setting values when
the argument is given.

Also, tweak Opt.Sysroot defaulting.

llvm-svn: 89318
2009-11-19 05:32:21 +00:00
Daniel Dunbar d80277895d Change -code-completion-debug-printer to -no-code-completion-debug-printer.
Also, tweak a few help strings and update CompilerInvocation serialization for prev change.

llvm-svn: 89317
2009-11-19 05:32:09 +00:00
Daniel Dunbar 484afa2d3b Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm:🆑:init(true) arguments.
llvm-svn: 89315
2009-11-19 04:55:23 +00:00
Daniel Dunbar 71f5f9ff7f clang-cc: Remove superfluous llvm:🆑:init(false) arguments.
llvm-svn: 89314
2009-11-19 04:55:06 +00:00
Daniel Dunbar da13faf982 Driver: ArgList doesn't depend on Options.h anymore.
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar b323fd72ab Driver: Take option ID for {Input,Unknown}Option, to drop dependency on actual options.
llvm-svn: 89312
2009-11-19 04:25:06 +00:00
Daniel Dunbar 8c00957008 Driver: Introduce OptSpecifier class for protecting access to an option id.
llvm-svn: 89310
2009-11-19 04:14:53 +00:00
Mike Stump aa51ad6815 Refine vtable, rtti and rtti name instantiation so that they follow
the key function.  All the code is wired up, but won't work yet, as I
had to turn off key function calculation as it doesn't work yet.

Also, we refine visibility of the vtable, rtti and rtti name to match
the class, as well as as arrange for all the symbols to be internal
for anonymous namespace entities.

llvm-svn: 89309
2009-11-19 04:04:36 +00:00
Daniel Dunbar fffd18167d Driver: Switch to using explicit {getLast,has}ArgNoClaim functions instead of taking a Claim argument.
- Most driver code always claims, and bool arguments don't play nice with the overloads.

llvm-svn: 89308
2009-11-19 04:00:53 +00:00
Mike Stump beab381d2d This doesn't work yet.
llvm-svn: 89307
2009-11-19 03:53:54 +00:00
Daniel Dunbar b3b47b8dde Driver: Resolve inconsistency in matching options against options which are
aliases -- just treat this case as an (unchecked) client error.

llvm-svn: 89306
2009-11-19 03:26:50 +00:00
Daniel Dunbar 0bfb21e4b0 Use Option::matches instead of direct ID comparison.
llvm-svn: 89305
2009-11-19 03:26:40 +00:00
Daniel Dunbar efba4ef9ae Remove extra ';', found by clang++.
llvm-svn: 89304
2009-11-19 03:26:32 +00:00