]> granicus.if.org Git - clang/log
clang
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

14 years agoTeach the EvaluatedExprVisitor and its client, which marks
Douglas Gregor [Sat, 11 Sep 2010 23:32:50 +0000 (23:32 +0000)]
Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.

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

14 years agoAugment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.
Chris Lattner [Sat, 11 Sep 2010 21:47:09 +0000 (21:47 +0000)]
Augment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.

Patch by John Regehr!

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

14 years agoUpdate website to reflect that tests are no longer failing on Windows.
Francois Pichet [Sat, 11 Sep 2010 21:16:11 +0000 (21:16 +0000)]
Update website to reflect that tests are no longer failing on Windows.

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

14 years agoAdd a completely unnecessary "template" keyword to appease GCC
Douglas Gregor [Sat, 11 Sep 2010 20:47:38 +0000 (20:47 +0000)]
Add a completely unnecessary "template" keyword to appease GCC

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

14 years agoFix last test still failing on Win32. 100% pass rate now!
Francois Pichet [Sat, 11 Sep 2010 20:43:12 +0000 (20:43 +0000)]
Fix last test still failing on Win32. 100% pass rate now!

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

14 years agoUpdate documentation to reflect the addition of support for in-class
Douglas Gregor [Sat, 11 Sep 2010 20:30:02 +0000 (20:30 +0000)]
Update documentation to reflect the addition of support for in-class
initialization of static const floating-point data membmers (John's
patch, in r113663).

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

14 years agoWhen parsing default function arguments, do not mark any declarations
Douglas Gregor [Sat, 11 Sep 2010 20:24:53 +0000 (20:24 +0000)]
When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

  1) We were marking some declarations "used" that shouldn't be,
  because we were marking them too eagerly.
  2) We were failing to mark some declarations as "used" when we
  should, if the first time it was instantiated happened to be an
  unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.

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

14 years agoDocument our extension to constant-fold __builtin_strlen and strlen
Douglas Gregor [Sat, 11 Sep 2010 18:08:34 +0000 (18:08 +0000)]
Document our extension to constant-fold __builtin_strlen and strlen

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

14 years agoThe two libclang crash-recovery tests that involve precompiled
Douglas Gregor [Sat, 11 Sep 2010 18:05:19 +0000 (18:05 +0000)]
The two libclang crash-recovery tests that involve precompiled
preambles end up leaving the precompiled preambles around. This is by
design, since we do minimal cleanup during crash recovery. However,
it's unfortunate for testing, so introduce a hook that allows these
two tests to put the precompiled preamble somewhere where we can
delete them after testing.

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

14 years agoIf we fail to create a temporary file for the precompiled preamble,
Douglas Gregor [Sat, 11 Sep 2010 17:56:52 +0000 (17:56 +0000)]
If we fail to create a temporary file for the precompiled preamble,
just abort creation of the precompiled preamble rather than doing
silly things. This is the second part of the fix for the weird
preamble-related failures on Windows. Big thanks to Francois Pichet
for the great detective work!

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

14 years agoadd latest gentoo gcc path
Nuno Lopes [Sat, 11 Sep 2010 17:51:45 +0000 (17:51 +0000)]
add latest gentoo gcc path

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

14 years agoTweak GetPreamblePCHPath() to more closely match the behavior of the
Douglas Gregor [Sat, 11 Sep 2010 17:51:16 +0000 (17:51 +0000)]
Tweak GetPreamblePCHPath() to more closely match the behavior of the
Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.

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

14 years agoDisable cxa_atexit by default on MingW.
Anton Korobeynikov [Sat, 11 Sep 2010 11:17:06 +0000 (11:17 +0000)]
Disable cxa_atexit by default on MingW.
Patch by Dimitry Andric!

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

14 years agoCMake: Fix mingw32 build.
Michael J. Spencer [Sat, 11 Sep 2010 02:13:48 +0000 (02:13 +0000)]
CMake: Fix mingw32 build.

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

14 years agoFixes an obscure bug in importd block variable layout
Fariborz Jahanian [Sat, 11 Sep 2010 01:27:29 +0000 (01:27 +0000)]
Fixes an obscure bug in importd block variable layout
information when imported variable is used
more than once. Originally though to be a bug in importing
block varibles. Fixes radar 8417746.

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

14 years agoTest destructors in delete expressions and of temporaries for throwing.
Sebastian Redl [Fri, 10 Sep 2010 23:27:10 +0000 (23:27 +0000)]
Test destructors in delete expressions and of temporaries for throwing.

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

14 years agoSupport in-class initialization of static const floating-point data members.
John McCall [Fri, 10 Sep 2010 23:21:22 +0000 (23:21 +0000)]
Support in-class initialization of static const floating-point data members.

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

14 years agoFix my silly sorting predicate. I hate integer-to-bool conversions
Douglas Gregor [Fri, 10 Sep 2010 23:05:54 +0000 (23:05 +0000)]
Fix my silly sorting predicate. I hate integer-to-bool conversions

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

14 years agoAddress Doug's comments.
Sebastian Redl [Fri, 10 Sep 2010 22:34:40 +0000 (22:34 +0000)]
Address Doug's comments.

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

14 years agoMake sure we're producing a newline in the preprocessed output before
Douglas Gregor [Fri, 10 Sep 2010 22:27:29 +0000 (22:27 +0000)]
Make sure we're producing a newline in the preprocessed output before
emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>.

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