]> granicus.if.org Git - clang/log
clang
14 years agoIRgen/ABI: Add support for realigning structures which are passed by indirect
Daniel Dunbar [Thu, 16 Sep 2010 20:42:02 +0000 (20:42 +0000)]
IRgen/ABI: Add support for realigning structures which are passed by indirect
reference.

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

14 years agoIRgen/ABI/x86_32/Darwin: On Darwin, only structures with SSE vector types get passed
Daniel Dunbar [Thu, 16 Sep 2010 20:42:00 +0000 (20:42 +0000)]
IRgen/ABI/x86_32/Darwin: On Darwin, only structures with SSE vector types get passed
with a non-default-stack-ABI-alignment (of 16).
 - This fixes the ABI convenient, but breaks codegen since we now have
   underaligned arguments. Marginal improvement overall though, and will be
   fixed in next commit.

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

14 years agoIRgen/x86_32/Linux: Linux seems to align all stack objects to 4 bytes, unlike
Daniel Dunbar [Thu, 16 Sep 2010 20:41:56 +0000 (20:41 +0000)]
IRgen/x86_32/Linux: Linux seems to align all stack objects to 4 bytes, unlike
Darwin. Checked vs the handiest Linux llvm-gcc I had around, someone on Linux is
welcome to investigate more.

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

14 years agoadd a compatibility note about vector builtins
Chris Lattner [Thu, 16 Sep 2010 18:17:55 +0000 (18:17 +0000)]
add a compatibility note about vector builtins

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

14 years agoimprove the "enumeration value 'g' not handled in switch"
Chris Lattner [Thu, 16 Sep 2010 17:09:42 +0000 (17:09 +0000)]
improve the "enumeration value 'g' not handled in switch"
warning to handle multiple enumerators with one warning.

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

14 years agoSwap the priorities of constants and types, so that we prefer types.
Douglas Gregor [Thu, 16 Sep 2010 16:21:35 +0000 (16:21 +0000)]
Swap the priorities of constants and types, so that we prefer types.

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

14 years agoRemoves unused setter.
Fariborz Jahanian [Thu, 16 Sep 2010 16:14:34 +0000 (16:14 +0000)]
Removes unused setter.

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

14 years agoDon't add two code-completion results for the same selector; it
Douglas Gregor [Thu, 16 Sep 2010 16:06:31 +0000 (16:06 +0000)]
Don't add two code-completion results for the same selector; it
doesn't add any value. Instead, we'll just take the first method with
that selector that we find and create a completion for it.

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

14 years agoWhen collecting Objective-C methods for message send completions, be
Douglas Gregor [Thu, 16 Sep 2010 15:34:59 +0000 (15:34 +0000)]
When collecting Objective-C methods for message send completions, be
sure to visit the protocols of protocols.

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

14 years agoImplement code completion for Objective-C class message sends that are
Douglas Gregor [Thu, 16 Sep 2010 15:14:18 +0000 (15:14 +0000)]
Implement code completion for Objective-C class message sends that are
missing the opening bracket '[', e.g.,

  NSArray <CC>

at function scope. Previously, we would only give trivial completions
(const, volatile, etc.), because we're in a "declaration name"
scope. Now, we also provide completions for class methods of NSArray,
e.g.,

  alloc

Note that we already had support for this after the first argument,
e.g.,

  NSArray method:x <CC>

would get code completion for class methods of NSArray whose selector
starts with "method:". This was already present because we recover
as if NSArray method:x were a class message send missing the opening
bracket (which was committed in r114057).

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

14 years agoFix a silly typo and its pasteo. Thanks to Francois Pichet for noticing my mistake
Douglas Gregor [Thu, 16 Sep 2010 13:54:00 +0000 (13:54 +0000)]
Fix a silly typo and its pasteo. Thanks to Francois Pichet for noticing my mistake

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

14 years agoRight, there are *two* cases of pr-value class-type expressions that don't
John McCall [Thu, 16 Sep 2010 06:57:56 +0000 (06:57 +0000)]
Right, there are *two* cases of pr-value class-type expressions that don't
derive from temporaries of the same type.  Black-list member expressions
as well.

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

14 years agoOpportunistically use the C++ personality function in ObjC++
John McCall [Thu, 16 Sep 2010 06:16:50 +0000 (06:16 +0000)]
Opportunistically use the C++ personality function in ObjC++
translation units that don't catch ObjC types.  rdar://problem/8434851

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

14 years agoBasic: Add f{dim,ma,max,min}[lf]? builtins.
Daniel Dunbar [Thu, 16 Sep 2010 05:20:04 +0000 (05:20 +0000)]
Basic: Add f{dim,ma,max,min}[lf]? builtins.

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

14 years agoRefactored BugReporter to refer to EndNode as ErrorNode. We currently make the assump...
Tom Care [Thu, 16 Sep 2010 03:50:38 +0000 (03:50 +0000)]
Refactored BugReporter to refer to EndNode as ErrorNode. We currently make the assumption that EndNode == ErrorNode, but upcoming changes will break this.

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

14 years agoTidy up.
Zhongxing Xu [Thu, 16 Sep 2010 03:28:18 +0000 (03:28 +0000)]
Tidy up.

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

14 years agoFurther beautification: this pointer can now be typed.
John McCall [Thu, 16 Sep 2010 03:16:41 +0000 (03:16 +0000)]
Further beautification:  this pointer can now be typed.

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

14 years agoInitialize AggValueSlot's flags along all paths, plus minor beautification.
John McCall [Thu, 16 Sep 2010 03:13:23 +0000 (03:13 +0000)]
Initialize AggValueSlot's flags along all paths, plus minor beautification.
Prospective fix for broken commit in r114045.

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

14 years agoFix the clang build after Zhongxing Xu's commit.
John McCall [Thu, 16 Sep 2010 03:09:43 +0000 (03:09 +0000)]
Fix the clang build after Zhongxing Xu's commit.

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

14 years agoImplement automatic bracket insertion for Objective-C class message
Douglas Gregor [Thu, 16 Sep 2010 01:51:54 +0000 (01:51 +0000)]
Implement automatic bracket insertion for Objective-C class message
sends. These are far trickier than instance messages, because we
typically have something like

  NSArray alloc]

where it appears to be a declaration of a variable named "alloc" up
until we see the ']' (or a ':'), and at that point we can't backtrace.
So, we use a combination of syntactic and semantic disambiguation to
treat this as a message send only when the type is an Objective-C type
and it has the syntax of a class message send (which would otherwise
be ill-formed).

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

14 years agoIntroduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
Zhongxing Xu [Thu, 16 Sep 2010 01:25:47 +0000 (01:25 +0000)]
Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.

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

14 years agobuild: Add support for a CLANG_ORDER_FILE build variable to specify the path to
Daniel Dunbar [Thu, 16 Sep 2010 00:42:38 +0000 (00:42 +0000)]
build: Add support for a CLANG_ORDER_FILE build variable to specify the path to
the order file to use for the clang executable.

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

14 years agoDo not warn about empty bodies for 'if' statements if the body is expanded from a...
Ted Kremenek [Thu, 16 Sep 2010 00:37:05 +0000 (00:37 +0000)]
Do not warn about empty bodies for 'if' statements if the body is expanded from a macro.

Fixes <rdar://problem/8436021>.

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

14 years agoPatch to move RequiresGCollection bit to
Fariborz Jahanian [Thu, 16 Sep 2010 00:20:07 +0000 (00:20 +0000)]
Patch to move RequiresGCollection bit to
AggValueSlot slot.

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

14 years agoFor self-comparison warning, check the source location of both the LHS and RHS to...
Ted Kremenek [Thu, 16 Sep 2010 00:03:01 +0000 (00:03 +0000)]
For self-comparison warning, check the source location of both the LHS and RHS to see if they
are expanded from macros (and if so, omit the warning).  Previously we were just looking at the
location of the binary expression.

Fixes <rdar://problem/8435950>.

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

14 years agoHandle bracket insertion for Objective-C class messages in a very
Douglas Gregor [Wed, 15 Sep 2010 23:19:31 +0000 (23:19 +0000)]
Handle bracket insertion for Objective-C class messages in a very
narrow, almost useless case where we're inside a parenthesized
expression, e.g.,

  (NSArray alloc])

The solution to the general case still eludes me.

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

14 years agoTweak comment as suggested by Sebastian.
John McCall [Wed, 15 Sep 2010 20:59:13 +0000 (20:59 +0000)]
Tweak comment as suggested by Sebastian.

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

14 years agoWhile handling change of file, check if _current_ file is already seen or not. If...
Devang Patel [Wed, 15 Sep 2010 20:50:40 +0000 (20:50 +0000)]
While handling change of file, check if _current_ file is already seen or not. If current file is seen then it indicates that end of previous file's lexical scope.
This fixes radar 8396182.

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

14 years agoMacro definitions in AST files have their own IDs.
Sebastian Redl [Wed, 15 Sep 2010 19:54:06 +0000 (19:54 +0000)]
Macro definitions in AST files have their own IDs.

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

14 years agoInitialize TypeOrExpr to NULL to silence a false-positive uninitialized warning
Nick Lewycky [Wed, 15 Sep 2010 18:35:19 +0000 (18:35 +0000)]
Initialize TypeOrExpr to NULL to silence a false-positive uninitialized warning
from certain GCC's. Patch by Neil Vachharajani!

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

14 years agoTest commit
Marcin Swiderski [Wed, 15 Sep 2010 18:34:15 +0000 (18:34 +0000)]
Test commit

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

14 years agoRevert "Clean up in buildbot directories."
Jakob Stoklund Olesen [Wed, 15 Sep 2010 18:08:14 +0000 (18:08 +0000)]
Revert "Clean up in buildbot directories."

This reverts commit 113814.

This patch was never intended to stay in the repository. If you are reading this
from the future, we apologize for the noise.

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

14 years agoImprove code completion for Objective-C message sends when the opening
Douglas Gregor [Wed, 15 Sep 2010 16:23:04 +0000 (16:23 +0000)]
Improve code completion for Objective-C message sends when the opening
'[' is missing. Prior commits improving recovery also improved code
completion beyond the first selector, e.g., at or after the "to" in

  calculator add:x to:y

but not after "calculator". We now provide the same completions for

  calculator <CC>

that we would for

  [calculator <CC>

if "calculator" is an expression whose type is something that can
receive Objective-C messages.

This code completion works for instance and super message sends, but not
class message sends.

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

14 years agoMake the new -fobjc-nonfragile-abi2 the default
Fariborz Jahanian [Wed, 15 Sep 2010 16:00:51 +0000 (16:00 +0000)]
Make the new -fobjc-nonfragile-abi2 the default
abi for clang's objective-c compilations.
(radar 8353555).

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

14 years agoExtend bracket insertion to message sends to "super", e.g.,
Douglas Gregor [Wed, 15 Sep 2010 15:09:43 +0000 (15:09 +0000)]
Extend bracket insertion to message sends to "super", e.g.,

  super method:arg]

will now recover nicely and insert the '[' before 'super'.

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

14 years agoExtend bracket insertion to handle nullary selectors, e.g.
Douglas Gregor [Wed, 15 Sep 2010 14:54:45 +0000 (14:54 +0000)]
Extend bracket insertion to handle nullary selectors, e.g.

  a getFoo]

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

14 years agoImplement bracket insertion for Objective-C instance message sends as
Douglas Gregor [Wed, 15 Sep 2010 14:51:05 +0000 (14:51 +0000)]
Implement bracket insertion for Objective-C instance message sends as
part of parser recovery. For example, given:

  a method1:arg];

we detect after parsing the expression "a" that we have the start of a
message send expression. We pretend we've seen a '[' prior to the a,
then parse the remainder as a message send. We'll then give a
diagnostic+fix-it such as:

fixit-objc-message.m:17:3: error: missing '[' at start of message
      send expression
  a method1:arg];
  ^
  [

The algorithm here is very simple, and always assumes that the open
bracket goes at the beginning of the message send. It also only works
for non-super instance message sends at this time.

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

14 years agoTweak regex not to accidentally match a trailing \r.
Benjamin Kramer [Wed, 15 Sep 2010 12:31:46 +0000 (12:31 +0000)]
Tweak regex not to accidentally match a trailing \r.

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

14 years agoFix pointer-signext.c test case: it was relying on value names, which don't appear...
Cameron Esfahani [Wed, 15 Sep 2010 10:52:02 +0000 (10:52 +0000)]
Fix pointer-signext.c test case: it was relying on value names, which don't appear in the non-assert build.  Switch to using check-next as well.

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

14 years agoTest hardening.
John McCall [Wed, 15 Sep 2010 10:38:11 +0000 (10:38 +0000)]
Test hardening.

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

14 years agoone piece of code is responsible for the lifetime of every aggregate
John McCall [Wed, 15 Sep 2010 10:14:12 +0000 (10:14 +0000)]
one piece of code is responsible for the lifetime of every aggregate
slot.  The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision.  The main obstacle here is that
IR-generation must be much more careful about making sure that exactly

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

14 years agoRelax assertion in CFG builder when processing ForStmts. This fixes an assertion...
Ted Kremenek [Wed, 15 Sep 2010 07:01:20 +0000 (07:01 +0000)]
Relax assertion in CFG builder when processing ForStmts.  This fixes an assertion failure
on code containing GNU statement expressions reported in PR 8141.

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

14 years agobuild: Start sketching code to allow grafting libc++ build into LLVM/Clang build if
Daniel Dunbar [Wed, 15 Sep 2010 03:53:45 +0000 (03:53 +0000)]
build: Start sketching code to allow grafting libc++ build into LLVM/Clang build if
libc++ is checked out into llvm/projects.
 - WIP, not on by default yet.

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

14 years agoDisallow the use of UnknownVal as the index for ElementRegions. UnknownVals can...
Ted Kremenek [Wed, 15 Sep 2010 03:13:30 +0000 (03:13 +0000)]
Disallow the use of UnknownVal as the index for ElementRegions.  UnknownVals can be used as
the index when the value evaluation isn't powerful enough.  By creating ElementRegions with
UnknownVals as the index, this gives the false impression that they are the same element, when
they really aren't.  This becomes really problematic when deriving symbols from these regions
(e.g., those representing the initial value of the index), since two different indices will
get the same symbol for their binding.

This fixes an issue with the idempotent operations checker that would cause two indices that
are clearly not the same to make it appear as if they always had the same value.

Fixes <rdar://problem/8431728>.

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

14 years agoFix classification of statement expressions.
Douglas Gregor [Wed, 15 Sep 2010 01:37:48 +0000 (01:37 +0000)]
Fix classification of statement expressions.

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

14 years agoFix Windows64 target info so pointer arithmetic is done correctly, and no sign extens...
Cameron Esfahani [Wed, 15 Sep 2010 00:28:12 +0000 (00:28 +0000)]
Fix Windows64 target info so pointer arithmetic is done correctly, and no sign extension code is emitted: PtrDiffType needs to be a signed long long.  Add a corresponding test case.

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

14 years agoMicrosoft's flexible array rules relaxation:
Francois Pichet [Wed, 15 Sep 2010 00:14:08 +0000 (00:14 +0000)]
Microsoft's flexible array rules relaxation:
   - in union
   - as the only element of a struct/class.

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

14 years agoIntroduce a new code-completion context for a parenthesized
Douglas Gregor [Tue, 14 Sep 2010 23:59:36 +0000 (23:59 +0000)]
Introduce a new code-completion context for a parenthesized
expression, e.g., after the '(' that could also be a type cast. Here,
we provide types as code-completion results in C/Objective-C (C++
already had them), although we wouldn't in a normal expression context.

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

14 years agoAdd CFG::BuildOptions class to pass in CFG builder options under on parameter. Patch...
Ted Kremenek [Tue, 14 Sep 2010 23:41:16 +0000 (23:41 +0000)]
Add CFG::BuildOptions class to pass in CFG builder options under on parameter.  Patch by Marcin Świderski!

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

14 years agoFix destructor and assignment operator lookup in the has_nothrow traits.
Sebastian Redl [Tue, 14 Sep 2010 23:40:14 +0000 (23:40 +0000)]
Fix destructor and assignment operator lookup in the has_nothrow traits.

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

14 years agoAdjust assertion in RegionStoreManager::RetrieveArray() to also take into account...
Ted Kremenek [Tue, 14 Sep 2010 23:29:38 +0000 (23:29 +0000)]
Adjust assertion in RegionStoreManager::RetrieveArray() to also take into account typedefs.

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

14 years agoDriver: Add a -stdlib= argument which can be used to select the C++ standard
Daniel Dunbar [Tue, 14 Sep 2010 23:12:40 +0000 (23:12 +0000)]
Driver: Add a -stdlib= argument which can be used to select the C++ standard
library to use.
 - This is currently useful for testing libc++; you can now use 'clang++
   -stdlib=libc++ t.cpp' to compile using it if installed.

 - In the future could also be used to select other standard library choices if
   alternatives become available (for example, to use an alternate C library).

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

14 years agoDriver: Factor out some code for handling the C++ standard library.
Daniel Dunbar [Tue, 14 Sep 2010 23:12:35 +0000 (23:12 +0000)]
Driver: Factor out some code for handling the C++ standard library.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 14 Sep 2010 23:12:31 +0000 (23:12 +0000)]
Simplify.

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

14 years agoDon't divide-by-zero in RegionStoreManager::getSizeInElements() when getting the...
Ted Kremenek [Tue, 14 Sep 2010 23:08:34 +0000 (23:08 +0000)]
Don't divide-by-zero in RegionStoreManager::getSizeInElements() when getting the size of a VLA.  We don't track VLA extents yet,
but we should at least not crash.  Fixes <rdar://problem/8424269>.

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

14 years agoRHS of property expression assignment requires
Fariborz Jahanian [Tue, 14 Sep 2010 23:02:38 +0000 (23:02 +0000)]
RHS of property expression assignment requires
copy initialization before passing it to
a setter. Fixes radar 8427922.

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

14 years agoWhen marking the declarations in a default argument expression as
Douglas Gregor [Tue, 14 Sep 2010 22:55:20 +0000 (22:55 +0000)]
When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.

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

14 years agoEliminate the default case in the expression-classification code, so
Douglas Gregor [Tue, 14 Sep 2010 21:51:42 +0000 (21:51 +0000)]
Eliminate the default case in the expression-classification code, so
that we're sure to keep it updated when new expression kinds
emerge. Also fixes a few little bugs in the classification of
expressions.

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

14 years agoTweak this assert.
John McCall [Tue, 14 Sep 2010 21:45:42 +0000 (21:45 +0000)]
Tweak this assert.

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

14 years agoRename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that...
Tom Care [Tue, 14 Sep 2010 21:35:27 +0000 (21:35 +0000)]
Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that we aborted analysis may not necessarily be due to a loop.

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

14 years agoThe paired 'operator delete' for a placement 'operator new' is always a
John McCall [Tue, 14 Sep 2010 21:34:24 +0000 (21:34 +0000)]
The paired 'operator delete' for a placement 'operator new' is always a
placement 'operator delete', even if there are no placement args (i.e.
overload resolution selected an operator new with default arguments).

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

14 years agoImplement the EH cleanup to call 'operator delete' if a new-expression throws
John McCall [Tue, 14 Sep 2010 07:57:04 +0000 (07:57 +0000)]
Implement the EH cleanup to call 'operator delete' if a new-expression throws
(but not if destructors associated with the full-expression throw).

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

14 years agoPrintFunctionNames: Fix Windows (MSV{S,C} and mingw) build.
Michael J. Spencer [Tue, 14 Sep 2010 06:39:35 +0000 (06:39 +0000)]
PrintFunctionNames: Fix Windows (MSV{S,C} and mingw) build.

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

14 years agoFix CFGBuilder crash reported in PR 8141.
Ted Kremenek [Tue, 14 Sep 2010 01:13:32 +0000 (01:13 +0000)]
Fix CFGBuilder crash reported in PR 8141.

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

14 years agoFix VLA miscompilation.
Argyrios Kyrtzidis [Tue, 14 Sep 2010 00:42:34 +0000 (00:42 +0000)]
Fix VLA miscompilation.

llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes.
Fixes r8403108.

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

14 years agoI will not mix declaration and statements in C90.
Douglas Gregor [Tue, 14 Sep 2010 00:20:32 +0000 (00:20 +0000)]
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.

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

14 years agoRevert "CMake: Update to use standard CMake dependency tracking facilities instead"
Michael J. Spencer [Mon, 13 Sep 2010 23:54:41 +0000 (23:54 +0000)]
Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

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

14 years agoClean up in buildbot directories.
Jakob Stoklund Olesen [Mon, 13 Sep 2010 23:26:28 +0000 (23:26 +0000)]
Clean up in buildbot directories.

This test created a statements.ll file until about a month ago. Some buildbots
still have this file in their source dir. This is the easiest way to remove the
file on all bots. Then I'll revert.

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

14 years agoAdd __char16_t and __char32_t as aliases for the C++0x char16_t and
Douglas Gregor [Mon, 13 Sep 2010 23:21:44 +0000 (23:21 +0000)]
Add __char16_t and __char32_t as aliases for the C++0x char16_t and
char32_t, respectively, but which can also be used in C++98/03
mode. Fixes <rdar://problem/8418510>.

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

14 years agoIntroduce a new kind of cursor into libclang, which covers a reference
Douglas Gregor [Mon, 13 Sep 2010 22:52:57 +0000 (22:52 +0000)]
Introduce a new kind of cursor into libclang, which covers a reference
to an "overloaded" set of declarations. This cursor kind works for
unresolved references to functions/templates (e.g., a call within a
template), using declarations, and Objective-C class and protocol
forward declarations.

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

14 years agoAdd reverse iterator for initializers in constructor. Patch by Marcin Świderski!
Ted Kremenek [Mon, 13 Sep 2010 22:26:02 +0000 (22:26 +0000)]
Add reverse iterator for initializers in constructor.  Patch by Marcin Świderski!

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

14 years agoAdd 'insert()' to BumpVector. Patch by Marcin Świderski!
Ted Kremenek [Mon, 13 Sep 2010 22:25:59 +0000 (22:25 +0000)]
Add 'insert()' to BumpVector.  Patch by Marcin Świderski!

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

14 years agoRemove from the CFG the half-implemented support for scoping information. We decided...
Ted Kremenek [Mon, 13 Sep 2010 22:25:54 +0000 (22:25 +0000)]
Remove from the CFG the half-implemented support for scoping information.  We decided that scope information doesn't belong in the CFG at all, since it is a lexical construct.

Patch by Marcin Świderski!

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

14 years agoDon't crash when using type traits on a class with a constructor template.
Sebastian Redl [Mon, 13 Sep 2010 22:18:28 +0000 (22:18 +0000)]
Don't crash when using type traits on a class with a constructor template.

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

14 years agoRemove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due...
Sebastian Redl [Mon, 13 Sep 2010 22:02:47 +0000 (22:02 +0000)]
Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed.

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

14 years agoTry to get this to stop leaving a temporary file on linux.
Eric Christopher [Mon, 13 Sep 2010 21:51:42 +0000 (21:51 +0000)]
Try to get this to stop leaving a temporary file on linux.

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

14 years agoHave __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not...
Sebastian Redl [Mon, 13 Sep 2010 21:10:20 +0000 (21:10 +0000)]
Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not finding implicitly declared copy constructors, part of PR8107.

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

14 years agoEagerly evaluate type traits in Sema instead of lazily in AST. They actually need...
Sebastian Redl [Mon, 13 Sep 2010 20:56:31 +0000 (20:56 +0000)]
Eagerly evaluate type traits in Sema instead of lazily in AST. They actually need Sema access to be correct, fixes coming up.

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

14 years agoRecognize .ll as input files.
Devang Patel [Mon, 13 Sep 2010 20:46:23 +0000 (20:46 +0000)]
Recognize .ll as input files.
Handle %test_debuginfo on a RUN command line.

This set up now allows one to write small test cases to check debug info.
e.g.

; RUN: %clang -O0 -g %s -c -o %t.o
; RUN: %clang %t.o -o %t.out
; RUN: %test_debuginfo %s %t.out

define i32 @f1(i32 %i) nounwind ssp {
; DEBUGGER: break f1
; DEBUGGER: r
; DEBUGGER: p i
; CHECK: $1 = 42
entry:
  %i.addr = alloca i32, align 4
...
...
}

It is also possible now to write test cases in c/c++.
The plan is to store these debug info testcases in a separate place.

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

14 years agoWhen applying 'delete' on a pointer-to-array type match GCC and EDG behavior and...
Argyrios Kyrtzidis [Mon, 13 Sep 2010 20:15:54 +0000 (20:15 +0000)]
When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

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

14 years agoRemove the trivial setters from CXXDeleteExpr.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 20:15:40 +0000 (20:15 +0000)]
Remove the trivial setters from CXXDeleteExpr.

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

14 years agoAdd a compatibility note about clang not implicitly converting between objc_object...
Argyrios Kyrtzidis [Mon, 13 Sep 2010 17:48:07 +0000 (17:48 +0000)]
Add a compatibility note about clang not implicitly converting between objc_object* and id (and SEL, Class).

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

14 years agoUpdate 'docs/PCHInternals.html' about how subexpressions are stored.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 17:48:02 +0000 (17:48 +0000)]
Update 'docs/PCHInternals.html' about how subexpressions are stored.

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

14 years agoFix a typo noted by Gabor
Douglas Gregor [Mon, 13 Sep 2010 16:44:26 +0000 (16:44 +0000)]
Fix a typo noted by Gabor

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

14 years agoBlock description for trivial block literals have
Fariborz Jahanian [Mon, 13 Sep 2010 16:09:44 +0000 (16:09 +0000)]
Block description for trivial block literals have
their 'isa' field scanned regardless.

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

14 years agoFix C++ PCH issue.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 11:45:48 +0000 (11:45 +0000)]
Fix C++ PCH issue.

The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing.
Write and read it from PCH.
Fixes http://llvm.org/PR8134

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

14 years agoAvoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 11:45:41 +0000 (11:45 +0000)]
Avoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.

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

14 years agoAvoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 11:45:32 +0000 (11:45 +0000)]
Avoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.

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

14 years agoAvoid setters in ASTDeclReader::VisitCXXRecordDecl.
Argyrios Kyrtzidis [Mon, 13 Sep 2010 11:45:25 +0000 (11:45 +0000)]
Avoid setters in ASTDeclReader::VisitCXXRecordDecl.

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

14 years agoCongruent diagnostic for void* arithmetic.
Abramo Bagnara [Mon, 13 Sep 2010 06:50:07 +0000 (06:50 +0000)]
Congruent diagnostic for void* arithmetic.

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

14 years agoParentheses around address non-type template argument is demoted to an extension...
Abramo Bagnara [Mon, 13 Sep 2010 06:06:58 +0000 (06:06 +0000)]
Parentheses around address non-type template argument is demoted to an extension warning.

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

14 years agoDon't assert when attempting to take the address of an overloaded
Douglas Gregor [Sun, 12 Sep 2010 08:16:09 +0000 (08:16 +0000)]
Don't assert when attempting to take the address of an overloaded
function fails due to ambiguities in partial ordering of function
templates. Fixes PR8033.

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

14 years agoWhen performing overload resolution, only compare the final conversion
Douglas Gregor [Sun, 12 Sep 2010 08:07:23 +0000 (08:07 +0000)]
When performing overload resolution, only compare the final conversion
sequences for two conversion functions when in fact we are in the text
of initialization by a user-defined conversion sequences. Fixes PR8034.

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

14 years agoDiagnose the instantiation of variables (including static data
Douglas Gregor [Sun, 12 Sep 2010 07:37:24 +0000 (07:37 +0000)]
Diagnose the instantiation of variables (including static data
members) with function type. Fixes PR8047.

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

14 years agoDon't complain about useless user-defined conversion functions when
Douglas Gregor [Sun, 12 Sep 2010 07:22:28 +0000 (07:22 +0000)]
Don't complain about useless user-defined conversion functions when
they were instantiated from a template. In template metaprogramming,
stuff happens. Fixes PR8065.

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

14 years agoWhen diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the
Douglas Gregor [Sun, 12 Sep 2010 05:24:55 +0000 (05:24 +0000)]
When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the
error to a warning if we're in a case that would be allowed in
C++0x. This "fixes" PR8084 by making Clang accept more code than GCC
and (non-strict) EDG do.

Also, add the missing test case for the C++0x semantics, which should
have been in r113717.

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

14 years agoImplement C++0x semantics for [temp.expl.spec]p2, which loosens the
Douglas Gregor [Sun, 12 Sep 2010 05:08:28 +0000 (05:08 +0000)]
Implement C++0x semantics for [temp.expl.spec]p2, which loosens the
restrictions on out-of-line specializations to allow them anywhere in
an enclosing context. Motivated by PR8084.

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

14 years agoAdd basic support for Microsoft enum forward declaration.
Francois Pichet [Sun, 12 Sep 2010 05:06:55 +0000 (05:06 +0000)]
Add basic support for Microsoft enum forward declaration.
Assigning an underlying integral type to an enum forward declaration will come in a next patch.

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

14 years agoImplement the "note" in C++ [over.built]p1, which is actually meant to
Douglas Gregor [Sun, 12 Sep 2010 04:28:07 +0000 (04:28 +0000)]
Implement the "note" in C++ [over.built]p1, which is actually meant to
be a semantic requirement that a built-in overloaded operator is not
added to the overload set of there is already a user-defined
overloaded operator with the same parameter types. Fixes PR8087.

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

14 years agoDon't perform integral promotions from an incompletion enumeration
Douglas Gregor [Sun, 12 Sep 2010 03:38:25 +0000 (03:38 +0000)]
Don't perform integral promotions from an incompletion enumeration
type. Fixes PR8089 in a slightly different way than had been suggested.

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