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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

14 years agoEli helped me understand how evaluation contexts work.
Sebastian Redl [Fri, 10 Sep 2010 21:57:27 +0000 (21:57 +0000)]
Eli helped me understand how evaluation contexts work.

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

14 years agoDriver: Set TOOL_NO_EXPORTS when building a "production" compiler, we don't
Daniel Dunbar [Fri, 10 Sep 2010 21:42:03 +0000 (21:42 +0000)]
Driver: Set TOOL_NO_EXPORTS when building a "production" compiler, we don't
currently expect that to be useful for plugins, and this is important for
startup performance:
--
ddunbar@lordcrumb:tmp$ touch empty.c
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name   avg     min     med     max      SD    total
user  0.0054  0.0052  0.0054  0.0055  0.0000  0.5350
 sys  0.0084  0.0090  0.0078  0.0087  0.0008  0.8390
wall  0.0149  0.0149  0.0149  0.0149  0.0003  1.4943
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name   avg     min     med     max      SD    total
user  0.0036  0.0036  0.0036  0.0038  0.0000  0.3646
 sys  0.0072  0.0071  0.0068  0.0070  0.0006  0.7158
wall  0.0123  0.0123  0.0122  0.0136  0.0003  1.2262
--

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

14 years agoFollow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.
Sebastian Redl [Fri, 10 Sep 2010 21:15:56 +0000 (21:15 +0000)]
Follow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.

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

14 years agoCMake: Update to use standard CMake dependency tracking facilities instead
Michael J. Spencer [Fri, 10 Sep 2010 21:13:16 +0000 (21:13 +0000)]
CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

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

14 years agoTest CXXNoexceptExpr codegen and serialization.
Sebastian Redl [Fri, 10 Sep 2010 21:04:03 +0000 (21:04 +0000)]
Test CXXNoexceptExpr codegen and serialization.

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

14 years agoImplement CXXNoexceptExpr codegen.
Sebastian Redl [Fri, 10 Sep 2010 21:04:00 +0000 (21:04 +0000)]
Implement CXXNoexceptExpr codegen.

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

14 years agoAdd another small test case.
Sebastian Redl [Fri, 10 Sep 2010 21:03:58 +0000 (21:03 +0000)]
Add another small test case.

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

14 years agoSerialization support for CXXNoexceptExpr.
Sebastian Redl [Fri, 10 Sep 2010 20:55:54 +0000 (20:55 +0000)]
Serialization support for CXXNoexceptExpr.

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

14 years agoMake 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr...
Ted Kremenek [Fri, 10 Sep 2010 20:55:52 +0000 (20:55 +0000)]
Make 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr, and friend ASTStmtReader so that it is the only class that can use them.

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

14 years agoTests for noexcept in templates.
Sebastian Redl [Fri, 10 Sep 2010 20:55:50 +0000 (20:55 +0000)]
Tests for noexcept in templates.

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

14 years agoFirst version of a testcase, plus fixes.
Sebastian Redl [Fri, 10 Sep 2010 20:55:47 +0000 (20:55 +0000)]
First version of a testcase, plus fixes.

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

14 years agoDefine and implement CXXNoexceptExpr. Create it in Sema.
Sebastian Redl [Fri, 10 Sep 2010 20:55:43 +0000 (20:55 +0000)]
Define and implement CXXNoexceptExpr. Create it in Sema.

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

14 years agoParse the noexcept operator and stub out sema.
Sebastian Redl [Fri, 10 Sep 2010 20:55:37 +0000 (20:55 +0000)]
Parse the noexcept operator and stub out sema.

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

14 years agoImplement Expr::CanThrow, a function that applies the noexcept operator rules to...
Sebastian Redl [Fri, 10 Sep 2010 20:55:33 +0000 (20:55 +0000)]
Implement Expr::CanThrow, a function that applies the noexcept operator rules to expressions.

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

14 years agoMake CallExpr::getCalleeDecl look through pointer derefs.
Sebastian Redl [Fri, 10 Sep 2010 20:55:30 +0000 (20:55 +0000)]
Make CallExpr::getCalleeDecl look through pointer derefs.

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

14 years agoFix a comment.
Sebastian Redl [Fri, 10 Sep 2010 20:55:27 +0000 (20:55 +0000)]
Fix a comment.

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

14 years agoPolish diagnostics for null dereferences via ObjC ivar accesses. Finishes up <rdar...
Ted Kremenek [Fri, 10 Sep 2010 20:20:49 +0000 (20:20 +0000)]
Polish diagnostics for null dereferences via ObjC ivar accesses.  Finishes up <rdar://problem/6352035>.

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

14 years agoIRGen fix for using property-dot syntax to pass
Fariborz Jahanian [Fri, 10 Sep 2010 18:56:35 +0000 (18:56 +0000)]
IRGen fix for using property-dot syntax to pass
reference object to a c++ member function.
fixes radar 8409336.

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

14 years agoRe-devirtualize this. A new virtual method snuck in.
Chandler Carruth [Fri, 10 Sep 2010 08:13:48 +0000 (08:13 +0000)]
Re-devirtualize this. A new virtual method snuck in.

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

14 years agoSupport strlen() and __builtin_strlen() as constant expressions with
Douglas Gregor [Fri, 10 Sep 2010 06:27:15 +0000 (06:27 +0000)]
Support strlen() and __builtin_strlen() as constant expressions with
the call argument is a string literal. Fixes
<rdar://problem/8413477>.

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

14 years agoAdd checker implementation for my previous commit!
Ted Kremenek [Fri, 10 Sep 2010 03:45:29 +0000 (03:45 +0000)]
Add checker implementation for my previous commit!

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

14 years agoImplement: <rdar://problem/6351970> rule request: warn if @synchronized mutex can...
Ted Kremenek [Fri, 10 Sep 2010 03:05:40 +0000 (03:05 +0000)]
Implement: <rdar://problem/6351970> rule request: warn if @synchronized mutex can be nil

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

14 years agoAdd ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for...
Ted Kremenek [Fri, 10 Sep 2010 03:05:33 +0000 (03:05 +0000)]
Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).

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

14 years agoUpdate checker build.
Ted Kremenek [Fri, 10 Sep 2010 01:20:17 +0000 (01:20 +0000)]
Update checker build.

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

14 years agoAdded AnalyzerStatsChecker, a path sensitive check that reports visitation statistics...
Tom Care [Fri, 10 Sep 2010 00:44:44 +0000 (00:44 +0000)]
Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.

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

14 years agoAdd libclang support for label statements, gotos, and taking the
Douglas Gregor [Fri, 10 Sep 2010 00:22:18 +0000 (00:22 +0000)]
Add libclang support for label statements, gotos, and taking the
address of a label (GNU extension).

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

14 years agoAdd libclang visitation for C99 designated initializers.
Douglas Gregor [Thu, 9 Sep 2010 23:28:23 +0000 (23:28 +0000)]
Add libclang visitation for C99 designated initializers.

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

14 years agoAdd libclang visitation for __builtin_offsetof's components (fields
Douglas Gregor [Thu, 9 Sep 2010 23:10:46 +0000 (23:10 +0000)]
Add libclang visitation for __builtin_offsetof's components (fields
and array references).

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