]> granicus.if.org Git - clang/log
clang
14 years agoCode completion results that refer to macros now get the cursor kind
Douglas Gregor [Mon, 5 Apr 2010 16:10:30 +0000 (16:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlways assume block-level expressions in the caller are alive when analyzing
Zhongxing Xu [Mon, 5 Apr 2010 13:16:29 +0000 (13:16 +0000)]
Always assume block-level expressions in the caller are alive when analyzing
the callee.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100429 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSince now we process regions in clusters when removing dead bindings, this
Zhongxing Xu [Mon, 5 Apr 2010 13:00:12 +0000 (13:00 +0000)]
Since now we process regions in clusters when removing dead bindings, this
code can be removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100428 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply patch for adding support for address spaces and added a isVolatile field...
Mon P Wang [Sun, 4 Apr 2010 03:10:52 +0000 (03:10 +0000)]
Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100305 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't produce a vtable for a class if we have an explicit template instantiation...
Rafael Espindola [Sat, 3 Apr 2010 04:26:42 +0000 (04:26 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100266 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd option and macro definition for AES instructions. Now produces real
Eric Christopher [Fri, 2 Apr 2010 23:50:19 +0000 (23:50 +0000)]
Add option and macro definition for AES instructions.  Now produces real
assembly for testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100253 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove diagnosing when a method type does not start with '-'|'+'
Fariborz Jahanian [Fri, 2 Apr 2010 23:15:40 +0000 (23:15 +0000)]
Improve diagnosing when a method type does not start with '-'|'+'
when parsing. Fixes radar 7822196.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100248 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:40 +0000 (22:29 +0000)]
IRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100237 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid unneeded calls to opt/llvm-dis.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:38 +0000 (22:29 +0000)]
Avoid unneeded calls to opt/llvm-dis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100236 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMerge several tests into switch.c.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:35 +0000 (22:29 +0000)]
Merge several tests into switch.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100235 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen/Obj-C: Eliminate FindIvarInterface, now that ivar's are in the right DeclContex...
Daniel Dunbar [Fri, 2 Apr 2010 21:14:02 +0000 (21:14 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100228 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAST: Add ObjCIvarDecl::getContainingInterface().
Daniel Dunbar [Fri, 2 Apr 2010 21:13:59 +0000 (21:13 +0000)]
AST: Add ObjCIvarDecl::getContainingInterface().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100227 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodiagnose declaring class extension after its implementation
Fariborz Jahanian [Fri, 2 Apr 2010 20:53:05 +0000 (20:53 +0000)]
diagnose declaring class extension after its implementation
(radar 7822210).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100226 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNewDebugLoc got renamed to DebugLoc.
Chris Lattner [Fri, 2 Apr 2010 20:21:43 +0000 (20:21 +0000)]
NewDebugLoc got renamed to DebugLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100219 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants...
Daniel Dunbar [Fri, 2 Apr 2010 20:10:03 +0000 (20:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100213 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose invalid code with -fobjc-nonfragile-abi2 when
Fariborz Jahanian [Fri, 2 Apr 2010 20:09:24 +0000 (20:09 +0000)]
Diagnose invalid code with -fobjc-nonfragile-abi2 when
property is being accessed without the dot-syntax notation.
(radar 7822344).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100212 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSema/Obj-C: Narrow type, and simplify.
Daniel Dunbar [Fri, 2 Apr 2010 19:44:54 +0000 (19:44 +0000)]
Sema/Obj-C: Narrow type, and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100210 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWe seem to get an inconsistent alignment value in the generated
Douglas Gregor [Fri, 2 Apr 2010 19:02:06 +0000 (19:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100205 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r100193 since it causes failures in objc in clang
Mon P Wang [Fri, 2 Apr 2010 18:43:42 +0000 (18:43 +0000)]
Revert r100193 since it causes failures in objc in clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100200 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.
Daniel Dunbar [Fri, 2 Apr 2010 18:29:09 +0000 (18:29 +0000)]
Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100197 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework our handling of copy construction of temporaries, which was a
Douglas Gregor [Fri, 2 Apr 2010 18:24:57 +0000 (18:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100196 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply patch for adding support for address spaces and added a isVolatile field...
Mon P Wang [Fri, 2 Apr 2010 18:04:30 +0000 (18:04 +0000)]
Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100193 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCG/NeXT: Assert some invariants on an ivar's containing decl context that I am about...
Daniel Dunbar [Fri, 2 Apr 2010 15:43:29 +0000 (15:43 +0000)]
CG/NeXT: Assert some invariants on an ivar's containing decl context that I am about to refactor based on, following some testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100188 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a constructor is a dependent context, just set the base and member initializers...
Anders Carlsson [Fri, 2 Apr 2010 06:26:44 +0000 (06:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100180 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose multiple base and member initializers in class templates.
Anders Carlsson [Fri, 2 Apr 2010 05:42:15 +0000 (05:42 +0000)]
Diagnose multiple base and member initializers in class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100179 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore cleanup.
Anders Carlsson [Fri, 2 Apr 2010 03:43:34 +0000 (03:43 +0000)]
More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100175 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConstify.
Anders Carlsson [Fri, 2 Apr 2010 03:38:04 +0000 (03:38 +0000)]
Constify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100174 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor cleanup.
Anders Carlsson [Fri, 2 Apr 2010 03:37:03 +0000 (03:37 +0000)]
Minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100173 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoResolve a layering violation by making AddTaggedVal public for
Chandler Carruth [Fri, 2 Apr 2010 01:39:03 +0000 (01:39 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100169 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCheck in a motivating test for the revised access semantics.
John McCall [Fri, 2 Apr 2010 00:11:49 +0000 (00:11 +0000)]
Check in a motivating test for the revised access semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100159 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrect the calculation of access to more closely model the wording in
John McCall [Fri, 2 Apr 2010 00:03:43 +0000 (00:03 +0000)]
Correct the calculation of access to more closely model the wording in
the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100155 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate analyzer build.
Ted Kremenek [Thu, 1 Apr 2010 23:25:38 +0000 (23:25 +0000)]
Update analyzer build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100153 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor cleanup with the ternary operator
Douglas Gregor [Thu, 1 Apr 2010 22:47:07 +0000 (22:47 +0000)]
Minor cleanup with the ternary operator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100144 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRelax the typesafty rules of block pointers types which
Fariborz Jahanian [Thu, 1 Apr 2010 19:50:22 +0000 (19:50 +0000)]
Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100129 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOverhaul checking of non-type template arguments that should refer to
Douglas Gregor [Thu, 1 Apr 2010 18:32:35 +0000 (18:32 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100125 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Daniel Dunbar [Thu, 1 Apr 2010 18:21:41 +0000 (18:21 +0000)]
Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100119 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix -Asserts warning, and protect against missing case.
Daniel Dunbar [Thu, 1 Apr 2010 16:50:48 +0000 (16:50 +0000)]
Fix -Asserts warning, and protect against missing case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100115 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInclude *.inc in install target
Kovarththanan Rajaratnam [Thu, 1 Apr 2010 14:24:41 +0000 (14:24 +0000)]
Include *.inc in install target

Fixes PR6755.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100105 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse the element type to compute the array size when the base region is a VarRegion.
Zhongxing Xu [Thu, 1 Apr 2010 08:20:27 +0000 (08:20 +0000)]
Use the element type to compute the array size when the base region is a VarRegion.
Patch by Jordy Rose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100099 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInitial support for visiting CXXMemberCallExpr.
Zhongxing Xu [Thu, 1 Apr 2010 07:58:50 +0000 (07:58 +0000)]
Initial support for visiting CXXMemberCallExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100098 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadjust to IRBuilder change and use faster DebugLoc apis.
Chris Lattner [Thu, 1 Apr 2010 06:31:43 +0000 (06:31 +0000)]
adjust to IRBuilder change and use faster DebugLoc apis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100093 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove C++ constructor handling.
Zhongxing Xu [Thu, 1 Apr 2010 03:47:27 +0000 (03:47 +0000)]
Improve C++ constructor handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100080 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo.
Eric Christopher [Thu, 1 Apr 2010 03:07:20 +0000 (03:07 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100079 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFirst start at wmmintrin.h file with Intel AES-NI instructions.
Eric Christopher [Thu, 1 Apr 2010 03:03:35 +0000 (03:03 +0000)]
First start at wmmintrin.h file with Intel AES-NI instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100077 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug (PR 6699) in RegionStore::RemoveDeadBindings() where
Ted Kremenek [Thu, 1 Apr 2010 00:15:55 +0000 (00:15 +0000)]
Fix a bug (PR 6699) in RegionStore::RemoveDeadBindings() where
array values with a non-zero offset would get prematurely pruned from the store.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100067 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove diagnostics when an elaborated-type-specifer containing a
Douglas Gregor [Wed, 31 Mar 2010 23:17:41 +0000 (23:17 +0000)]
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>'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100060 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the representation of dependent elaborated-type-specifiers
Douglas Gregor [Wed, 31 Mar 2010 22:19:08 +0000 (22:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100054 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIssue better syntax error when objc's messaging
Fariborz Jahanian [Wed, 31 Mar 2010 20:22:35 +0000 (20:22 +0000)]
Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100040 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtend DependentNameType with a keyword enum that specifies whether
Douglas Gregor [Wed, 31 Mar 2010 20:19:30 +0000 (20:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100039 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor reverse data flow analyses, enqueue the blocks in reverse order.
Ted Kremenek [Wed, 31 Mar 2010 18:45:04 +0000 (18:45 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100030 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRe-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries when
Chandler Carruth [Wed, 31 Mar 2010 18:34:58 +0000 (18:34 +0000)]
Re-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries when
instantiating a template, which ensures the destructor is called. This fixes
PR6671.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100029 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPatch implements gcc's -Wno-protocol option to suppress warning
Fariborz Jahanian [Wed, 31 Mar 2010 18:23:33 +0000 (18:23 +0000)]
Patch implements gcc's -Wno-protocol option to suppress warning
on unimplemented methods in protocols adopted by a class.
(radar 7056600).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100028 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the AST statistics tracking I added yesterday; it didn't pan out.
Douglas Gregor [Wed, 31 Mar 2010 18:21:31 +0000 (18:21 +0000)]
Remove the AST statistics tracking I added yesterday; it didn't pan out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100027 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak DataFlowSolver's worklist data structure to have an ordered worklist
Ted Kremenek [Wed, 31 Mar 2010 18:16:59 +0000 (18:16 +0000)]
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%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100026 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReinstate my CodeModificationHint -> FixItHint renaming patch, without
Douglas Gregor [Wed, 31 Mar 2010 17:46:05 +0000 (17:46 +0000)]
Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename TypenameType to DependentNameType in anticipation of some
Douglas Gregor [Wed, 31 Mar 2010 17:34:00 +0000 (17:34 +0000)]
Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r100008, which inexplicably breaks the clang-i686-darwin10 builder
Douglas Gregor [Wed, 31 Mar 2010 17:25:35 +0000 (17:25 +0000)]
Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename CodeModificationHint to FixItHint, since we've been using the
Douglas Gregor [Wed, 31 Mar 2010 15:31:50 +0000 (15:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor include pruning.
Benjamin Kramer [Wed, 31 Mar 2010 15:04:05 +0000 (15:04 +0000)]
Minor include pruning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDefine "exploded graph" by reference to a paper.
Jeffrey Yasskin [Wed, 31 Mar 2010 05:26:20 +0000 (05:26 +0000)]
Define "exploded graph" by reference to a paper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99990 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse the new optimized debug info metadata accessors. In
Chris Lattner [Wed, 31 Mar 2010 03:36:01 +0000 (03:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99983 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport __attribute__((unused)) on types. This suddenly started firing
John McCall [Wed, 31 Mar 2010 02:47:45 +0000 (02:47 +0000)]
Support __attribute__((unused)) on types.  This suddenly started firing
a lot for me on selfhosts, I dunno why.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99981 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6327: restore invariants when there's a parse error in an initializer.
John McCall [Wed, 31 Mar 2010 02:13:20 +0000 (02:13 +0000)]
Fix PR6327:  restore invariants when there's a parse error in an initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99980 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRegularize support for naming conversion functions in using decls.
John McCall [Wed, 31 Mar 2010 01:36:47 +0000 (01:36 +0000)]
Regularize support for naming conversion functions in using decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99979 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGe...
Daniel Dunbar [Wed, 31 Mar 2010 01:09:11 +0000 (01:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99978 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCGRecordLayoutBuilder: Switch unions to use same mechanism for tracking field and...
Daniel Dunbar [Wed, 31 Mar 2010 00:55:13 +0000 (00:55 +0000)]
CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking field and bit-field info as structs.
 - Anders, please check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99977 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a few asserts to be on the safe side.
Argyrios Kyrtzidis [Wed, 31 Mar 2010 00:38:09 +0000 (00:38 +0000)]
Add a few asserts to be on the safe side.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99973 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't skip past the '}' if an expression has error and is not followed by ';'.
Argyrios Kyrtzidis [Wed, 31 Mar 2010 00:37:59 +0000 (00:37 +0000)]
Don't skip past the '}' if an expression has error and is not followed by ';'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99972 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDrastically simplify the computation of linkage for typeinfo by using
Douglas Gregor [Wed, 31 Mar 2010 00:15:35 +0000 (00:15 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99968 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRGen: Hide CGRecordLayoutBuilder class, because I can.
Daniel Dunbar [Wed, 31 Mar 2010 00:11:27 +0000 (00:11 +0000)]
IRGen: Hide CGRecordLayoutBuilder class, because I can.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove silly temporary comment.
John McCall [Tue, 30 Mar 2010 23:58:36 +0000 (23:58 +0000)]
Remove silly temporary comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99964 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce a new kind of derived-to-base cast which bypasses the need for
John McCall [Tue, 30 Mar 2010 23:58:03 +0000 (23:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99963 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSlightly relax test case. An upcoming LLVM commit will change the xor instruction.
Jakob Stoklund Olesen [Tue, 30 Mar 2010 23:57:49 +0000 (23:57 +0000)]
Slightly relax test case. An upcoming LLVM commit will change the xor instruction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99962 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix test in -Asserts build.
Daniel Dunbar [Tue, 30 Mar 2010 23:50:00 +0000 (23:50 +0000)]
Fix test in -Asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99960 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRecognize __attribute__((NSObject)) directly applied
Fariborz Jahanian [Tue, 30 Mar 2010 22:40:11 +0000 (22:40 +0000)]
Recognize __attribute__((NSObject)) directly applied
on retain properties. (radar 7809468).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99951 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert Mon Ping's 99930 due to broken llvm-gcc buildbots.
Bob Wilson [Tue, 30 Mar 2010 22:28:46 +0000 (22:28 +0000)]
Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99949 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFormatting tweaks.
Daniel Dunbar [Tue, 30 Mar 2010 22:26:15 +0000 (22:26 +0000)]
Formatting tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99947 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRGen: Narrow getCGRecordLayout type.
Daniel Dunbar [Tue, 30 Mar 2010 22:26:12 +0000 (22:26 +0000)]
IRGen: Narrow getCGRecordLayout type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99946 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen: Move CGRecordLayout to its own happy little file.
Daniel Dunbar [Tue, 30 Mar 2010 22:26:10 +0000 (22:26 +0000)]
IRgen: Move CGRecordLayout to its own happy little file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor formatting/FIXME cleanups.
Daniel Dunbar [Tue, 30 Mar 2010 22:26:07 +0000 (22:26 +0000)]
Minor formatting/FIXME cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99944 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix an oversight with access control for address-of-function.
John McCall [Tue, 30 Mar 2010 22:20:00 +0000 (22:20 +0000)]
Fix an oversight with access control for address-of-function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99942 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemember the regparm attribute in FunctionType::ExtInfo.
Rafael Espindola [Tue, 30 Mar 2010 22:15:11 +0000 (22:15 +0000)]
Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen "delayed parsing" C++ default arguments, if there is an error, there may be...
Argyrios Kyrtzidis [Tue, 30 Mar 2010 22:14:32 +0000 (22:14 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99939 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a test for C++ [stmt.select]p3, which specifies that redeclaring a
Douglas Gregor [Tue, 30 Mar 2010 22:07:46 +0000 (22:07 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99937 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPropagate the "found declaration" (i.e. the using declaration instead of
John McCall [Tue, 30 Mar 2010 21:47:33 +0000 (21:47 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99936 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix this test on windows. When running on windows we print
Rafael Espindola [Tue, 30 Mar 2010 21:19:02 +0000 (21:19 +0000)]
Fix this test on windows. When running on windows we print
double 0.000000e+000
instead of
double 0.000000e+00

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99932 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded support for address spaces and added a isVolatile field to memcpy, memmove...
Mon P Wang [Tue, 30 Mar 2010 21:02:45 +0000 (21:02 +0000)]
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99930 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove diagnostics when printing a template instantiation backtrace
Douglas Gregor [Tue, 30 Mar 2010 20:35:20 +0000 (20:35 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99923 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRegionStore: specially handle loads from integer global variables declared 'const'.
Ted Kremenek [Tue, 30 Mar 2010 20:31:04 +0000 (20:31 +0000)]
RegionStore: specially handle loads from integer global variables declared 'const'.
Fixes a false positive reported in PR 6288.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99922 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse 'const Optional<SVal>&' to avoid an extra copy.
Ted Kremenek [Tue, 30 Mar 2010 20:30:52 +0000 (20:30 +0000)]
Use 'const Optional<SVal>&' to avoid an extra copy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99921 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothe big refactoring bits of PR3782.
Rafael Espindola [Tue, 30 Mar 2010 20:24:48 +0000 (20:24 +0000)]
the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce new AST statistics that keep track of the number of isa (or
Douglas Gregor [Tue, 30 Mar 2010 18:56:13 +0000 (18:56 +0000)]
Introduce new AST statistics that keep track of the number of isa (or
dyn_cast) invocations for C++ and Objective-C types, declarations,
expressions, and statements. The statistics will be printed when
-print-stats is provided to Clang -cc1, with results such as:

277073 clang - Number of checks for C++ declaration nodes
 13311 clang - Number of checks for C++ expression nodes
    18 clang - Number of checks for C++ statement nodes
174182 clang - Number of checks for C++ type nodes
 92300 clang - Number of checks for Objective-C declaration nodes
  9800 clang - Number of checks for Objective-C expression nodes
     7 clang - Number of checks for Objective-C statement nodes
 65733 clang - Number of checks for Objective-C type nodes

The statistics are only gathered when NDEBUG is not defined, since
they introduce potentially-expensive operations into very low-level
routines (isa).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99912 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the analyzer to recognize (but ignore) assignments to isa. Fixes PR 6302.
Ted Kremenek [Tue, 30 Mar 2010 18:24:54 +0000 (18:24 +0000)]
Change the analyzer to recognize (but ignore) assignments to isa.  Fixes PR 6302.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99904 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd Support for 'warn_unused_result" attribute on
Fariborz Jahanian [Tue, 30 Mar 2010 18:22:15 +0000 (18:22 +0000)]
Add Support for 'warn_unused_result" attribute on
objective-c methods. (radar 7418262).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99903 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't produce a vtable if we are just instantiating a method and the
Rafael Espindola [Tue, 30 Mar 2010 18:07:27 +0000 (18:07 +0000)]
Don't produce a vtable if we are just instantiating a method and the
class has no key function.

Fix PR6738.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99900 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix FileEntry declaration.
Daniel Dunbar [Tue, 30 Mar 2010 17:57:47 +0000 (17:57 +0000)]
Fix FileEntry declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99896 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach Clang's -cc1 option -print-stats to print LLVM statistics.
Douglas Gregor [Tue, 30 Mar 2010 17:33:59 +0000 (17:33 +0000)]
Teach Clang's -cc1 option -print-stats to print LLVM statistics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99894 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug where we would incorrectly report an error about initializing two fields...
Anders Carlsson [Tue, 30 Mar 2010 16:19:37 +0000 (16:19 +0000)]
Fix a bug where we would incorrectly report an error about initializing two fields in an anonymous struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99891 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReduce nesting.
Anders Carlsson [Tue, 30 Mar 2010 15:39:27 +0000 (15:39 +0000)]
Reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99889 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReplace some constant-sized SmallVectors.
Benjamin Kramer [Tue, 30 Mar 2010 11:36:44 +0000 (11:36 +0000)]
Replace some constant-sized SmallVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99884 91177308-0d34-0410-b5e6-96231b3b80d8