Commit Graph

25675 Commits

Author SHA1 Message Date
Daniel Dunbar cfe3a2f6e8 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.

llvm-svn: 113924
2010-09-15 03:53:45 +00:00
Ted Kremenek c4deb92316 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>.

llvm-svn: 113920
2010-09-15 03:13:30 +00:00
Douglas Gregor e572b068ab Fix classification of statement expressions.
llvm-svn: 113917
2010-09-15 01:37:48 +00:00
Cameron Esfahani eb85650e67 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.
llvm-svn: 113910
2010-09-15 00:28:12 +00:00
Francois Pichet f657b639fd Microsoft's flexible array rules relaxation:
- in union
   - as the only element of a struct/class.

llvm-svn: 113909
2010-09-15 00:14:08 +00:00
Douglas Gregor 5e35d59188 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.

llvm-svn: 113904
2010-09-14 23:59:36 +00:00
Ted Kremenek e97b1ebef1 Add CFG::BuildOptions class to pass in CFG builder options under on parameter. Patch by Marcin Świderski!
llvm-svn: 113898
2010-09-14 23:41:16 +00:00
Sebastian Redl 058fc820d7 Fix destructor and assignment operator lookup in the has_nothrow traits.
llvm-svn: 113897
2010-09-14 23:40:14 +00:00
Ted Kremenek 72c9b0d582 Adjust assertion in RegionStoreManager::RetrieveArray() to also take into account typedefs.
llvm-svn: 113893
2010-09-14 23:29:38 +00:00
Daniel Dunbar 092b6fb187 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).

llvm-svn: 113891
2010-09-14 23:12:40 +00:00
Daniel Dunbar bf11f79053 Driver: Factor out some code for handling the C++ standard library.
llvm-svn: 113890
2010-09-14 23:12:35 +00:00
Daniel Dunbar 30a12b8d88 Simplify.
llvm-svn: 113889
2010-09-14 23:12:31 +00:00
Ted Kremenek c95589d2e6 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>.

llvm-svn: 113888
2010-09-14 23:08:34 +00:00
Fariborz Jahanian 805b74ea30 RHS of property expression assignment requires
copy initialization before passing it to 
a setter. Fixes radar 8427922.

llvm-svn: 113885
2010-09-14 23:02:38 +00:00
Douglas Gregor 6ed2feebfc 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>.

llvm-svn: 113883
2010-09-14 22:55:20 +00:00
Douglas Gregor 4e4425030a 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.

llvm-svn: 113864
2010-09-14 21:51:42 +00:00
John McCall d441b1e637 Tweak this assert.
llvm-svn: 113863
2010-09-14 21:45:42 +00:00
Tom Care c88ed9561e Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that we aborted analysis may not necessarily be due to a loop.
llvm-svn: 113862
2010-09-14 21:35:27 +00:00
John McCall d3be2c83d5 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).

llvm-svn: 113861
2010-09-14 21:34:24 +00:00
John McCall 824c2f537c Implement the EH cleanup to call 'operator delete' if a new-expression throws
(but not if destructors associated with the full-expression throw).

llvm-svn: 113836
2010-09-14 07:57:04 +00:00
Michael J. Spencer 433e9c7f2a PrintFunctionNames: Fix Windows (MSV{S,C} and mingw) build.
llvm-svn: 113835
2010-09-14 06:39:35 +00:00
Ted Kremenek 8abff774aa Fix CFGBuilder crash reported in PR 8141.
llvm-svn: 113826
2010-09-14 01:13:32 +00:00
Argyrios Kyrtzidis 9efa1ce145 Fix VLA miscompilation.
llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes.
Fixes r8403108.

llvm-svn: 113822
2010-09-14 00:42:34 +00:00
Douglas Gregor 2967e28ee7 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.

llvm-svn: 113821
2010-09-14 00:20:32 +00:00
Michael J. Spencer 09476212de Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

llvm-svn: 113817
2010-09-13 23:54:41 +00:00
Jakob Stoklund Olesen 54481e5948 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.

llvm-svn: 113814
2010-09-13 23:26:28 +00:00
Douglas Gregor 83d61f914a 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>.

llvm-svn: 113813
2010-09-13 23:21:44 +00:00
Douglas Gregor 16a2bdd6b0 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.

llvm-svn: 113805
2010-09-13 22:52:57 +00:00
Ted Kremenek 19d4d2f0ef Add reverse iterator for initializers in constructor. Patch by Marcin Świderski!
llvm-svn: 113800
2010-09-13 22:26:02 +00:00
Ted Kremenek 8c1e37bfbe Add 'insert()' to BumpVector. Patch by Marcin Świderski!
llvm-svn: 113799
2010-09-13 22:25:59 +00:00
Ted Kremenek 35965b972e 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!

llvm-svn: 113798
2010-09-13 22:25:54 +00:00
Sebastian Redl 5c649bc7bb Don't crash when using type traits on a class with a constructor template.
llvm-svn: 113796
2010-09-13 22:18:28 +00:00
Sebastian Redl c15c326b51 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.
llvm-svn: 113794
2010-09-13 22:02:47 +00:00
Eric Christopher 26c045d9ff Try to get this to stop leaving a temporary file on linux.
llvm-svn: 113793
2010-09-13 21:51:42 +00:00
Sebastian Redl 951006f510 Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not finding implicitly declared copy constructors, part of PR8107.
llvm-svn: 113784
2010-09-13 21:10:20 +00:00
Sebastian Redl 8eb06f17c4 Eagerly evaluate type traits in Sema instead of lazily in AST. They actually need Sema access to be correct, fixes coming up.
llvm-svn: 113782
2010-09-13 20:56:31 +00:00
Devang Patel 068b5b3d61 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.

llvm-svn: 113780
2010-09-13 20:46:23 +00:00
Argyrios Kyrtzidis 14ec9f674a 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 '[]'.

llvm-svn: 113778
2010-09-13 20:15:54 +00:00
Argyrios Kyrtzidis 9b0d1cf47c Remove the trivial setters from CXXDeleteExpr.
llvm-svn: 113777
2010-09-13 20:15:40 +00:00
Argyrios Kyrtzidis cebc0f006f Add a compatibility note about clang not implicitly converting between objc_object* and id (and SEL, Class).
llvm-svn: 113761
2010-09-13 17:48:07 +00:00
Argyrios Kyrtzidis 2716b9ae54 Update 'docs/PCHInternals.html' about how subexpressions are stored.
llvm-svn: 113760
2010-09-13 17:48:02 +00:00
Douglas Gregor e47191cfe1 Fix a typo noted by Gabor
llvm-svn: 113754
2010-09-13 16:44:26 +00:00
Fariborz Jahanian 0aa35b9cf5 Block description for trivial block literals have
their 'isa' field scanned regardless.

llvm-svn: 113749
2010-09-13 16:09:44 +00:00
Argyrios Kyrtzidis f24d569f9e 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

llvm-svn: 113744
2010-09-13 11:45:48 +00:00
Argyrios Kyrtzidis 0e8b3ce247 Avoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.
llvm-svn: 113743
2010-09-13 11:45:41 +00:00
Argyrios Kyrtzidis b4c659b662 Avoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.
llvm-svn: 113742
2010-09-13 11:45:32 +00:00
Argyrios Kyrtzidis caf8248fc5 Avoid setters in ASTDeclReader::VisitCXXRecordDecl.
llvm-svn: 113741
2010-09-13 11:45:25 +00:00
Abramo Bagnara 3aabb4b452 Congruent diagnostic for void* arithmetic.
llvm-svn: 113740
2010-09-13 06:50:07 +00:00
Abramo Bagnara 6a0c4097f1 Parentheses around address non-type template argument is demoted to an extension warning.
llvm-svn: 113739
2010-09-13 06:06:58 +00:00
Douglas Gregor bdd7b2358b 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.

llvm-svn: 113725
2010-09-12 08:16:09 +00:00