Commit Graph

21953 Commits

Author SHA1 Message Date
Chris Lattner 198cb4df6e Instead of counting totally diagnostics, split the count into a count
of errors and warnings.  This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.

llvm-svn: 100675
2010-04-07 18:47:42 +00:00
Chris Lattner a503f7c9d2 convert to -verify mode.
llvm-svn: 100674
2010-04-07 18:43:41 +00:00
Douglas Gregor 3b4abb6792 Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
  analysis on the resulting type.
  - Downgrade the errors concerning friend type declarations that do
  not refer to classes to ExtWarns in C++98/03. C++0x allows
  practically any type to be befriended, and ignores the friend
  declaration if the type is not a class.

llvm-svn: 100635
2010-04-07 17:57:12 +00:00
Douglas Gregor afb9bc10fa Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
semantic analysis) and Sema::ActOnFriendTypeDecl (the action
callback). This is a prerequisite for improving template instantiation
of friend type declarations.

llvm-svn: 100633
2010-04-07 16:53:43 +00:00
John McCall 8586bfd85d @llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
to the intrinsic, even when math-errno is off.

Fixes rdar://problem/7828230 by falling back on the library function.

llvm-svn: 100613
2010-04-07 08:20:20 +00:00
Chris Lattner fdb76ccfb4 a ridiculous amount of propagation through the backend later,
have the code generate slap a srcloc metadata on inline asm nodes.
This allows us to diagnose invalid inline asms with such nice 
diagnostics as:

<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
asm.c:2:12: note: generated from here
  __asm__ ("abc incl    %0" : "+r" (X));
           ^
2 diagnostics generated.

llvm-svn: 100608
2010-04-07 05:46:54 +00:00
Zhongxing Xu 7614b5b475 Fix comment.
llvm-svn: 100604
2010-04-07 04:40:26 +00:00
Ted Kremenek 232d44ed48 Update checker build.
llvm-svn: 100603
2010-04-07 04:09:49 +00:00
Jeffrey Yasskin 3b54129419 Deprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().
llvm-svn: 100600
2010-04-07 01:55:59 +00:00
John McCall 1bff99322a Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
Fixes a spurious warning in LLVM.

llvm-svn: 100595
2010-04-07 01:14:35 +00:00
Ted Kremenek 6e95bfc6a5 Fix crash in StoreManager::CastRegion() when the base region is a type with 0 size.
llvm-svn: 100594
2010-04-07 00:46:49 +00:00
John McCall 8e36d53e34 Check access for the implicit calls to destructors that occur when we
have a temporary object in C++.

Also fix a tag mismatch that Doug noticed.

llvm-svn: 100593
2010-04-07 00:41:46 +00:00
Ted Kremenek 6ca136a77f Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.
llvm-svn: 100589
2010-04-07 00:27:13 +00:00
Fariborz Jahanian ea7a133775 Improve on diagnostics when an objc class is used as
a stand-alone type declaration.

llvm-svn: 100588
2010-04-07 00:22:00 +00:00
Douglas Gregor 636a61e0d2 Implement code completion for Objective-C method declarations and
definitions, e.g., after 

  -

or

  - (id)

we'll find all of the "likely" instance methods that one would want to
declare or define at this point. In the latter case, we only produce
results whose return types match "id".

llvm-svn: 100587
2010-04-07 00:21:17 +00:00
Fariborz Jahanian 8409416db7 Minor clean up.
llvm-svn: 100583
2010-04-06 23:43:59 +00:00
Fariborz Jahanian b2c1aac544 default access for synthesize ivar is @protect.
Fixes radar 7823675.

llvm-svn: 100582
2010-04-06 23:36:17 +00:00
Fariborz Jahanian 6a0a2e0ccc Patch to not build ivar ASTs when they are ilegally
declared in categories.

llvm-svn: 100577
2010-04-06 22:43:48 +00:00
John McCall 2351cb9139 Devote a special diagnostic to the typo
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.

llvm-svn: 100574
2010-04-06 22:24:14 +00:00
Ted Kremenek f969841a1a Teach MemRegion::getBaseRegion() about ObjCIvarRegions. We want to treat
them the same way as fields.  This fixes a regression in RegionStore::RemoveDeadbindings()
that emerged from going to the cluster-based analysis.

llvm-svn: 100570
2010-04-06 22:06:03 +00:00
John McCall a8ae222d0e Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup.  My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.

llvm-svn: 100562
2010-04-06 21:38:20 +00:00
Douglas Gregor c01890e1cc When code completion produces an overload set as its results (e.g.,
while we're completing in the middle of a function call), also produce
"ordinary" name results that show what can be typed at that point.

llvm-svn: 100558
2010-04-06 20:19:47 +00:00
Douglas Gregor 2cb6c30673 Do not produce semicolons at the end of code-completion results
llvm-svn: 100557
2010-04-06 20:11:37 +00:00
Douglas Gregor 285560929f Only prove macros as code-completion results when we're in a case
statement or for ordinary names. This means that we won't show macros
when completing, e.g., member expressions such as "p->".

llvm-svn: 100555
2010-04-06 20:02:15 +00:00
Ted Kremenek 7deb7050d5 Fix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
llvm-svn: 100551
2010-04-06 19:41:24 +00:00
Douglas Gregor 9d2ddb2e5d When sending a message to "id", apply some heuristics to try to narrow
down the set of code-completion results based on Objective-C
conventions. 

llvm-svn: 100548
2010-04-06 19:22:33 +00:00
Chris Lattner e6485c5873 add a testcase that the integrated assembler rejects, this verifies
that the integrated assembler is working.

llvm-svn: 100545
2010-04-06 18:46:25 +00:00
Chris Lattner 5ec32e7fd8 teach clang to install the inline asm diagnostic handler,
allowing backend errors to be mapped through clang's 
diagnostics subsystem, including the backend location info.

We now get:

$ clang asm.c -c -o t.o -integrated-as
<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
1 diagnostic generated.

With colors, and correct "# diagnostics generated".

llvm-svn: 100543
2010-04-06 18:38:50 +00:00
Chris Lattner 6d67213ebb reduce indentation, tidy.
llvm-svn: 100537
2010-04-06 17:52:14 +00:00
Blaine Garst 55050630a9 improved wording around ABI
llvm-svn: 100536
2010-04-06 17:46:43 +00:00
Douglas Gregor d720daf8bc Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.

llvm-svn: 100535
2010-04-06 17:30:22 +00:00
Chris Lattner c0e8a59ac9 fit in 80 cols
llvm-svn: 100534
2010-04-06 17:29:22 +00:00
Fariborz Jahanian 440a6832c5 Put type restriction on convesion to nonconforming 'id' back in
block pointer type comparison.

llvm-svn: 100533
2010-04-06 17:23:39 +00:00
Daniel Dunbar 3d45e17d15 Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
deciding when we need to emit an extra "command failed" diagnostic.
 - This also fixes the case where we were emitting that extra diagnostics, even
   when using clang w/ the integrated assembler, which has good diagnostics.

llvm-svn: 100529
2010-04-06 17:07:49 +00:00
Douglas Gregor 6285f754fa Implement support for code completion of an Objective-C message send to
"id" or an expression of type "id". In these cases, we produce a list
of all of the (class or instance) methods, respectively, that we know about.

Note that this implementation does not yet work well with precompiled
headers; that's coming soon.

llvm-svn: 100528
2010-04-06 16:40:00 +00:00
Douglas Gregor e7938a04c8 Add test for code completion of Objective-C message sends to classes.
llvm-svn: 100527
2010-04-06 15:27:03 +00:00
Douglas Gregor be9ea80abf Perform code-completion within ParseCastExpression, which handles,
e.g., the right-hand side of binary expressions.

llvm-svn: 100526
2010-04-06 15:09:27 +00:00
Douglas Gregor 6314641822 clang-wpa fixes for Diagnostic
llvm-svn: 100518
2010-04-06 04:03:12 +00:00
Zhongxing Xu 0f290ec0f0 Fix PR 6725. It looks like the copy constructor gets elided during inlining.
This bug only shows up with GCC 4.4.1 Release-Asserts build.

llvm-svn: 100516
2010-04-06 03:01:56 +00:00
Douglas Gregor ff8f4f6262 Unbreak build
llvm-svn: 100514
2010-04-06 01:25:58 +00:00
Daniel Dunbar 196ea449ed IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
llvm-svn: 100513
2010-04-06 01:07:44 +00:00
Daniel Dunbar d45491077a Simplify.
llvm-svn: 100512
2010-04-06 01:07:41 +00:00
Daniel Dunbar 60d81e8611 Simplify.
llvm-svn: 100511
2010-04-06 01:07:39 +00:00
Douglas Gregor 7f95d26e53 Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.

llvm-svn: 100498
2010-04-05 23:52:57 +00:00
Ted Kremenek 273c4f53ec Use cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.
llvm-svn: 100496
2010-04-05 23:45:09 +00:00
Chris Lattner 61955ab200 inline in MC assembly parsers. clang -integrated-as now
works with inline asm!

llvm-svn: 100493
2010-04-05 23:33:20 +00:00
Chris Lattner 58c79341ab Match MemoryBuffer API changes.
llvm-svn: 100484
2010-04-05 22:42:27 +00:00
Ted Kremenek b535782fc4 Fix possible null dereference by bailing out of CheckObjCPropertyAttributes() early if the Decl* is null.
llvm-svn: 100483
2010-04-05 22:39:42 +00:00
Douglas Gregor 01fa5c3734 Grrrr
llvm-svn: 100476
2010-04-05 21:47:48 +00:00
Douglas Gregor 0228a9c76b Try to de-bork build of WPA
llvm-svn: 100475
2010-04-05 21:47:24 +00:00
Daniel Dunbar dc406b8e92 IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.
- Unfortunately, this requires some horrible code in CGObjCMac which always
   allocats a CGBitFieldInfo because we don't currently build a proper layout
   for Objective-C classes. It needs to be cleaned up, but I don't want the
   bit-field cleanups to be blocked on that.

llvm-svn: 100474
2010-04-05 21:36:35 +00:00
Douglas Gregor cf04b02d1d Extend the type printing policy to allow one to turn off the printing
of file locations for anonymous tag types (e.g., "enum <anonymous at
t.h:15:6>"), which can get rather long.

llvm-svn: 100470
2010-04-05 21:25:31 +00:00
Jeffrey Yasskin 6e085c1efe Print the errors when a clang test fails instead of just listing the
failing test files.

llvm-svn: 100469
2010-04-05 21:20:38 +00:00
Douglas Gregor d03e823fb4 Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.

llvm-svn: 100464
2010-04-05 21:10:19 +00:00
Devang Patel a2c048eaf8 Emit debug info for objc getters and setters.
llvm-svn: 100462
2010-04-05 21:09:15 +00:00
Chris Lattner da081a8e1f fix PR6780, properly handling the IR {|} escapes in inline asm strings.
llvm-svn: 100449
2010-04-05 18:44:00 +00:00
Douglas Gregor a0bc68b647 Make the ASTUnit constructor private; all ASTUnit clients should be using the static factory functions
llvm-svn: 100444
2010-04-05 18:20:14 +00:00
Chris Lattner 005fc1bbcf fix PR6782, an accept invalid. We weren't emitting the diagnostic
returned by SetTypeSpecType.

llvm-svn: 100443
2010-04-05 18:18:31 +00:00
Douglas Gregor a2433154c8 Minor ASTUnit cleanups:
- Rename "Diagnostics" and related to "StoredDiagnostics", to better
  capture what we're actually storing.
  - Move SourceManager and FileManager to the heap.

llvm-svn: 100441
2010-04-05 18:10:21 +00:00
Daniel Dunbar cd3d5e76ce IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
llvm-svn: 100433
2010-04-05 16:20:44 +00:00
Daniel Dunbar b76c4cd5ec Add a FIXME and reduce nesting.
llvm-svn: 100432
2010-04-05 16:20:33 +00:00
Douglas Gregor f3df985ba7 Code completion results that refer to macros now get the cursor kind
of macro definitions when passed to CIndex. Add test for code
completion of macros via CIndex.

llvm-svn: 100431
2010-04-05 16:10:30 +00:00
Zhongxing Xu faa4905e0c Always assume block-level expressions in the caller are alive when analyzing
the callee.

llvm-svn: 100429
2010-04-05 13:16:29 +00:00
Zhongxing Xu 973b5f55f8 Since now we process regions in clusters when removing dead bindings, this
code can be removed.

llvm-svn: 100428
2010-04-05 13:00:12 +00:00
Mon P Wang cc2ab0cdc9 Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.
llvm-svn: 100305
2010-04-04 03:10:52 +00:00
Rafael Espindola 8e7ca8e0b1 Don't produce a vtable for a class if we have an explicit template instantiation declaration and no key function. We will produce the vtable at the explicit template instantiation.
Fixes PR6748

llvm-svn: 100266
2010-04-03 04:26:42 +00:00
Eric Christopher e1ddaf911b Add option and macro definition for AES instructions. Now produces real
assembly for testcases.

llvm-svn: 100253
2010-04-02 23:50:19 +00:00
Fariborz Jahanian d077f719be Improve diagnosing when a method type does not start with '-'|'+'
when parsing. Fixes radar 7822196.

llvm-svn: 100248
2010-04-02 23:15:40 +00:00
Daniel Dunbar 7e5aba433d IRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.
llvm-svn: 100237
2010-04-02 22:29:40 +00:00
Daniel Dunbar 8f0be43669 Avoid unneeded calls to opt/llvm-dis.
llvm-svn: 100236
2010-04-02 22:29:38 +00:00
Daniel Dunbar 87c1991bb4 Merge several tests into switch.c.
llvm-svn: 100235
2010-04-02 22:29:35 +00:00
Daniel Dunbar 8c7f981833 IRgen/Obj-C: Eliminate FindIvarInterface, now that ivar's are in the right DeclContexts (-2 FIXMEs). We still have an annoying linear scan + hidden dependency on how Obj-C layout is done.
- This is also an algorithmic improvement in IRgen for Obj-C, although it probably doesn't matter in practice.

llvm-svn: 100228
2010-04-02 21:14:02 +00:00
Daniel Dunbar 89947ea894 AST: Add ObjCIvarDecl::getContainingInterface().
llvm-svn: 100227
2010-04-02 21:13:59 +00:00
Fariborz Jahanian e16cdb407a diagnose declaring class extension after its implementation
(radar 7822210).

llvm-svn: 100226
2010-04-02 20:53:05 +00:00
Chris Lattner 18a584b56c NewDebugLoc got renamed to DebugLoc.
llvm-svn: 100219
2010-04-02 20:21:43 +00:00
Daniel Dunbar fe3ead7c48 Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants on the provided DeclContext.
- Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is.

llvm-svn: 100213
2010-04-02 20:10:03 +00:00
Fariborz Jahanian a9f8675e02 Diagnose invalid code with -fobjc-nonfragile-abi2 when
property is being accessed without the dot-syntax notation.
(radar 7822344).

llvm-svn: 100212
2010-04-02 20:09:24 +00:00
Daniel Dunbar ab5d7aef72 Sema/Obj-C: Narrow type, and simplify.
llvm-svn: 100210
2010-04-02 19:44:54 +00:00
Douglas Gregor ce6c2748f7 We seem to get an inconsistent alignment value in the generated
assembly for the global "d7". We were previously testing for alignment
3, which seems to happen for some builders and not for others. I've
eliminated the alignment check and added a FIXME to unbreak the
buildbots.

llvm-svn: 100205
2010-04-02 19:02:06 +00:00
Mon P Wang f7f3bff646 Revert r100193 since it causes failures in objc in clang
llvm-svn: 100200
2010-04-02 18:43:42 +00:00
Daniel Dunbar 229385cd68 Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.
llvm-svn: 100197
2010-04-02 18:29:09 +00:00
Douglas Gregor 45cf7e3d2a Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.

llvm-svn: 100196
2010-04-02 18:24:57 +00:00
Mon P Wang 4b82a88764 Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.
llvm-svn: 100193
2010-04-02 18:04:30 +00:00
Daniel Dunbar 031d4d40d0 CG/NeXT: Assert some invariants on an ivar's containing decl context that I am about to refactor based on, following some testing.
llvm-svn: 100188
2010-04-02 15:43:29 +00:00
Anders Carlsson db0a965eca If a constructor is a dependent context, just set the base and member initializers as they are written. Fixes a bug where we wouldn't show initialization order warnings when instantiating.
llvm-svn: 100180
2010-04-02 06:26:44 +00:00
Anders Carlsson 7b3f2788a1 Diagnose multiple base and member initializers in class templates.
llvm-svn: 100179
2010-04-02 05:42:15 +00:00
Anders Carlsson 4c8cb01b5a More cleanup.
llvm-svn: 100175
2010-04-02 03:43:34 +00:00
Anders Carlsson 96b8fc664a Constify.
llvm-svn: 100174
2010-04-02 03:38:04 +00:00
Anders Carlsson e857b29e0c Minor cleanup.
llvm-svn: 100173
2010-04-02 03:37:03 +00:00
Chandler Carruth 4a70ae54b4 Resolve a layering violation by making AddTaggedVal public for
PartialDiagnostic objects, and hoisting the stream operator for QualType into
Type.h with the operator for the normal DiagnosticBuilder. Also remove the no
longer needed friend declaration for the DeclarationName stream operator.

llvm-svn: 100169
2010-04-02 01:39:03 +00:00
John McCall cdf40bed1b Check in a motivating test for the revised access semantics.
llvm-svn: 100159
2010-04-02 00:11:49 +00:00
John McCall d79b4d8173 Correct the calculation of access to more closely model the wording in
the standard.

llvm-svn: 100155
2010-04-02 00:03:43 +00:00
Ted Kremenek cbcb692133 Update analyzer build.
llvm-svn: 100153
2010-04-01 23:25:38 +00:00
Douglas Gregor 697a39110f Minor cleanup with the ternary operator
llvm-svn: 100144
2010-04-01 22:47:07 +00:00
Fariborz Jahanian d603b54c55 Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.

llvm-svn: 100129
2010-04-01 19:50:22 +00:00
Douglas Gregor b242683d99 Overhaul checking of non-type template arguments that should refer to
an object or function. Our previous checking was too lax, and ended up
allowing missing or extraneous address-of operators, among other
evils. The new checking provides better diagnostics and adheres more
closely to the standard.

Fixes PR6563 and PR6749.

llvm-svn: 100125
2010-04-01 18:32:35 +00:00
Daniel Dunbar e43887bd2b Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Daniel Dunbar f4b37e1926 Fix -Asserts warning, and protect against missing case.
llvm-svn: 100115
2010-04-01 16:50:48 +00:00
Kovarththanan Rajaratnam 8841e86d11 Include *.inc in install target
Fixes PR6755.

llvm-svn: 100105
2010-04-01 14:24:41 +00:00
Zhongxing Xu 640aad7667 Use the element type to compute the array size when the base region is a VarRegion.
Patch by Jordy Rose.

llvm-svn: 100099
2010-04-01 08:20:27 +00:00
Zhongxing Xu 920070cfe7 Initial support for visiting CXXMemberCallExpr.
llvm-svn: 100098
2010-04-01 07:58:50 +00:00
Chris Lattner e675d0f924 adjust to IRBuilder change and use faster DebugLoc apis.
llvm-svn: 100093
2010-04-01 06:31:43 +00:00
Zhongxing Xu 8cea7f6f70 Improve C++ constructor handling.
llvm-svn: 100080
2010-04-01 03:47:27 +00:00
Eric Christopher 2fbd4050e9 Fix typo.
llvm-svn: 100079
2010-04-01 03:07:20 +00:00
Eric Christopher 5464e5ae00 First start at wmmintrin.h file with Intel AES-NI instructions.
llvm-svn: 100077
2010-04-01 03:03:35 +00:00
Ted Kremenek c3e1f2f9ba Fix a bug (PR 6699) in RegionStore::RemoveDeadBindings() where
array values with a non-zero offset would get prematurely pruned from the store.

llvm-svn: 100067
2010-04-01 00:15:55 +00:00
Douglas Gregor f5af3584ca Improve diagnostics when an elaborated-type-specifer containing a
nested-name-specifier (e.g., "class T::foo") fails to find a tag
member in the scope nominated by the
nested-name-specifier. Previously, we gave a bland

  error: 'Nested' does not name a tag member in the specified scope

which didn't actually say where we were looking, which was rather
horrible when the nested-name-specifier was instantiated. Now, we give
something a bit better:

  error: no class named 'Nested' in 'NoDepBase<T>'

llvm-svn: 100060
2010-03-31 23:17:41 +00:00
Douglas Gregor e677dafce1 Change the representation of dependent elaborated-type-specifiers
(such as "class T::foo") from an ElaboratedType of a TypenameType to a
DependentNameType, which more accurately models the underlying
concept.

Improve template instantiation for DependentNameType nodes that
represent nested-name-specifiers, by performing tag name lookup and
checking the resulting tag appropriately. Fixes PR5681.

There is still much testing and cleanup to do in this area.

llvm-svn: 100054
2010-03-31 22:19:08 +00:00
Fariborz Jahanian 083712fbb7 Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268).

llvm-svn: 100040
2010-03-31 20:22:35 +00:00
Douglas Gregor 0208535fda Extend DependentNameType with a keyword enum that specifies whether
this was parsed as a typename-specifier, elaborated-type-specifier
(including the kind), or just a dependent qualified type name.

llvm-svn: 100039
2010-03-31 20:19:30 +00:00
Ted Kremenek b43e06fa56 For reverse data flow analyses, enqueue the blocks in reverse order.
This more likely matches with the ideal order the blocks should be visited.
This shaves another 1% off the -fsyntax-only time for compare.c (403.gcc).

llvm-svn: 100030
2010-03-31 18:45:04 +00:00
Chandler Carruth b32b344c8f Re-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries when
instantiating a template, which ensures the destructor is called. This fixes
PR6671.

llvm-svn: 100029
2010-03-31 18:34:58 +00:00
Fariborz Jahanian c1fb862fda Patch implements gcc's -Wno-protocol option to suppress warning
on unimplemented methods in protocols adopted by a class.
(radar 7056600).

llvm-svn: 100028
2010-03-31 18:23:33 +00:00
Douglas Gregor d7d70e4788 Remove the AST statistics tracking I added yesterday; it didn't pan out.
llvm-svn: 100027
2010-03-31 18:21:31 +00:00
Ted Kremenek 8a47a38b3f Tweak DataFlowSolver's worklist data structure to have an ordered worklist
and a DenseSet for caching instead of using a single SmallPtrSet.
This makes the behavior of the DataFlowSolver more deterministic, and
reduces the -fsyntax-only time on compare.c (403.gcc) by 1%.

llvm-svn: 100026
2010-03-31 18:16:59 +00:00
Douglas Gregor a771f46c82 Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".

llvm-svn: 100022
2010-03-31 17:46:05 +00:00
Douglas Gregor c1d2d8a014 Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.

llvm-svn: 100019
2010-03-31 17:34:00 +00:00
Douglas Gregor 30e631862f Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
llvm-svn: 100018
2010-03-31 17:25:35 +00:00
Douglas Gregor 3baad0d4f7 Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.

llvm-svn: 100008
2010-03-31 15:31:50 +00:00
Benjamin Kramer 9e2e1c9024 Minor include pruning.
llvm-svn: 100007
2010-03-31 15:04:05 +00:00
Jeffrey Yasskin cd028b14ea Define "exploded graph" by reference to a paper.
llvm-svn: 99990
2010-03-31 05:26:20 +00:00
Chris Lattner be49c03ff4 use the new optimized debug info metadata accessors. In
addition to the inherent win, this eliminates the pointless
cost of going through the name -> mdkind stringmap that we
were paying.

llvm-svn: 99983
2010-03-31 03:36:01 +00:00
John McCall cef1582923 Support __attribute__((unused)) on types. This suddenly started firing
a lot for me on selfhosts, I dunno why.

llvm-svn: 99981
2010-03-31 02:47:45 +00:00
John McCall eae5acbbd0 Fix PR6327: restore invariants when there's a parse error in an initializer.
llvm-svn: 99980
2010-03-31 02:13:20 +00:00
John McCall da4458e98f Regularize support for naming conversion functions in using decls.
llvm-svn: 99979
2010-03-31 01:36:47 +00:00
Daniel Dunbar 034299ef25 IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGenTypes, to per-record CGRecordLayout structures.
- I did a cursory check that this was perf neutral, FWIW.

llvm-svn: 99978
2010-03-31 01:09:11 +00:00
Daniel Dunbar e75a64f2d3 CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking field and bit-field info as structs.
- Anders, please check.

llvm-svn: 99977
2010-03-31 00:55:13 +00:00
Argyrios Kyrtzidis 0204197d53 Add a few asserts to be on the safe side.
llvm-svn: 99973
2010-03-31 00:38:09 +00:00
Argyrios Kyrtzidis 90ab3b7779 Don't skip past the '}' if an expression has error and is not followed by ';'.
llvm-svn: 99972
2010-03-31 00:37:59 +00:00
Douglas Gregor d7f18dd750 Drastically simplify the computation of linkage for typeinfo by using
the existing (and already well-tested) linkage computation for types,
with minor tweaks for dynamic classes and (pointers to) incomplete
types. Fixes PR6597.

llvm-svn: 99968
2010-03-31 00:15:35 +00:00
Daniel Dunbar 23ee4b7710 IRGen: Hide CGRecordLayoutBuilder class, because I can.
llvm-svn: 99967
2010-03-31 00:11:27 +00:00
John McCall 539f22474b Remove silly temporary comment.
llvm-svn: 99964
2010-03-30 23:58:36 +00:00
John McCall d9c7c6568e Introduce a new kind of derived-to-base cast which bypasses the need for
null checks, and make sure we elide null checks when accessing base class
members.

llvm-svn: 99963
2010-03-30 23:58:03 +00:00
Jakob Stoklund Olesen 4d2972d793 Slightly relax test case. An upcoming LLVM commit will change the xor instruction.
llvm-svn: 99962
2010-03-30 23:57:49 +00:00
Daniel Dunbar c4d551b6ff Fix test in -Asserts build.
llvm-svn: 99960
2010-03-30 23:50:00 +00:00
Fariborz Jahanian df58603c26 Recognize __attribute__((NSObject)) directly applied
on retain properties. (radar 7809468).

llvm-svn: 99951
2010-03-30 22:40:11 +00:00
Bob Wilson adb58e32cc Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.
llvm-svn: 99949
2010-03-30 22:28:46 +00:00
Daniel Dunbar 76dc2e677c Formatting tweaks.
llvm-svn: 99947
2010-03-30 22:26:15 +00:00
Daniel Dunbar 6915cbe7a2 IRGen: Narrow getCGRecordLayout type.
llvm-svn: 99946
2010-03-30 22:26:12 +00:00
Daniel Dunbar 072d0bb247 IRgen: Move CGRecordLayout to its own happy little file.
llvm-svn: 99945
2010-03-30 22:26:10 +00:00
Daniel Dunbar f4ffa0dabf Minor formatting/FIXME cleanups.
llvm-svn: 99944
2010-03-30 22:26:07 +00:00
John McCall b493d53424 Fix an oversight with access control for address-of-function.
llvm-svn: 99942
2010-03-30 22:20:00 +00:00
Rafael Espindola 49b85ab6e6 Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.

llvm-svn: 99940
2010-03-30 22:15:11 +00:00
Argyrios Kyrtzidis 998d51b98f When "delayed parsing" C++ default arguments, if there is an error, there may be tokens left in the token stream
that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because
the CachedTokens that holds them will be deleted while the lexer is still using them.

Make sure that the tokens of default args are removed from the token stream.
Fixes PR6647.

llvm-svn: 99939
2010-03-30 22:14:32 +00:00
Douglas Gregor 504662f28f Add a test for C++ [stmt.select]p3, which specifies that redeclaring a
name in the outermost block of a if/else that declares the same name
is ill-formed. Turns out that Clang and MSVC were right about PR6739;
GCC is too lax.

llvm-svn: 99937
2010-03-30 22:07:46 +00:00
John McCall 16df1e59f2 Propagate the "found declaration" (i.e. the using declaration instead of
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation.  This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.

This allows us to complete an access-controlled selfhost, if there are no
recent regressions.

llvm-svn: 99936
2010-03-30 21:47:33 +00:00
Rafael Espindola 5c61cbeb58 Fix this test on windows. When running on windows we print
double 0.000000e+000
instead of
double 0.000000e+00

llvm-svn: 99932
2010-03-30 21:19:02 +00:00
Mon P Wang 231e99743a Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset
llvm-svn: 99930
2010-03-30 21:02:45 +00:00
Douglas Gregor 607f14168a Improve diagnostics when printing a template instantiation backtrace
involving substitution of deduced template arguments into a class
template partial specialization or function template, or when
substituting explicitly-specific template arguments into a function
template. We now print the actual deduced argument bindings so the
user can see what got deduced.

llvm-svn: 99923
2010-03-30 20:35:20 +00:00
Ted Kremenek 2d107f9d1d RegionStore: specially handle loads from integer global variables declared 'const'.
Fixes a false positive reported in PR 6288.

llvm-svn: 99922
2010-03-30 20:31:04 +00:00