summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* With lax vector conversions (the default) make sure we convert between twoEric Christopher2010-08-261-2/+7
| | | | | | | | | vectors that are the same size. Fix up testcases accordingly and add a new one to make sure we still error if lax vector conversions are disabled. Fixes rdar://8328190 llvm-svn: 112122
* Revert "Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-263-9/+6
| | | | | | | into the clients", because the C standard library sucks. Where's my stable sort, huh? llvm-svn: 112121
* Pull DelayedDiagnostic and AccessedEntity out into their own header.John McCall2010-08-253-7/+11
| | | | | | | | This works courtesy of the new SmallVector<..., 0> specialization that doesn't require a complete type. Note that you'll need to pull at least SmallVector.h from LLVM to compile successfully. llvm-svn: 112114
* Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!Argyrios Kyrtzidis2010-08-251-4/+0
| | | | llvm-svn: 112112
* Finally pass "two floats in a 64-bit unit" as a <2 x float> instead ofChris Lattner2010-08-251-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as a double in the x86-64 ABI. This allows us to generate much better code for certain things, e.g.: _Complex float f32(_Complex float A, _Complex float B) { return A+B; } Used to compile into (look at the integer silliness!): _f32: ## @f32 ## BB#0: ## %entry movd %xmm1, %rax movd %eax, %xmm1 movd %xmm0, %rcx movd %ecx, %xmm0 addss %xmm1, %xmm0 movd %xmm0, %edx shrq $32, %rax movd %eax, %xmm0 shrq $32, %rcx movd %ecx, %xmm1 addss %xmm0, %xmm1 movd %xmm1, %eax shlq $32, %rax addq %rdx, %rax movd %rax, %xmm0 ret Now we get: _f32: ## @f32 movdqa %xmm0, %xmm2 addss %xmm1, %xmm2 pshufd $16, %xmm2, %xmm2 pshufd $1, %xmm1, %xmm1 pshufd $1, %xmm0, %xmm0 addss %xmm1, %xmm0 pshufd $16, %xmm0, %xmm1 movdqa %xmm2, %xmm0 unpcklps %xmm1, %xmm0 ret and compile stuff like: extern float _Complex ccoshf( float _Complex ) ; float _Complex ccosf ( float _Complex z ) { float _Complex iz; (__real__ iz) = -(__imag__ z); (__imag__ iz) = (__real__ z); return ccoshf(iz); } into: _ccosf: ## @ccosf ## BB#0: ## %entry pshufd $1, %xmm0, %xmm1 xorps LCPI4_0(%rip), %xmm1 unpcklps %xmm0, %xmm1 movaps %xmm1, %xmm0 jmp _ccoshf ## TAILCALL instead of: _ccosf: ## @ccosf ## BB#0: ## %entry movd %xmm0, %rax movq %rax, %rcx shlq $32, %rcx shrq $32, %rax xorl $-2147483648, %eax ## imm = 0xFFFFFFFF80000000 addq %rcx, %rax movd %rax, %xmm0 jmp _ccoshf ## TAILCALL There is still "stuff to be done" here for the struct case, but this resolves rdar://6379669 - [x86-64 ABI] Pass and return _Complex float / double efficiently llvm-svn: 112111
* Fix miscompilation. The custom new[]/delete[] methods were not getting ↵Argyrios Kyrtzidis2010-08-251-5/+8
| | | | | | called for arrays with more than 1 dimension. llvm-svn: 112107
* Add missing null checks in PseudoConstantAnalysisTom Care2010-08-251-1/+4
| | | | llvm-svn: 112100
* Improved the handling of blocks and block variables in PseudoConstantAnalysisTom Care2010-08-251-30/+47
| | | | | | | | | | - Removed the assumption that __block vars are all non-constant - Simplified some repetitive code in RunAnalysis - Added block walking support - Code/comments cleanup - Separated out test for block pseudoconstants llvm-svn: 112098
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-253-6/+9
| | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. llvm-svn: 112095
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-2528-25/+28
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* When combining the code-completion results from Sema long with theDouglas Gregor2010-08-253-66/+64
| | | | | | | | code-completion results cached by ASTUnit, sort the resulting result set. This makes testing far, far easier, so this commit also includes tests for the previous few fixes. llvm-svn: 112070
* Fix horrible white space errors.Michael J. Spencer2010-08-251-69/+69
| | | | llvm-svn: 112067
* Initialize the translation-unit scope before lexing the firstDouglas Gregor2010-08-252-5/+5
| | | | | | | token. The first token might be something that ends up triggering code completion, which in turn requires a valid Scope. Test case forthcoming. llvm-svn: 112066
* Add a missing caseDouglas Gregor2010-08-251-0/+1
| | | | llvm-svn: 112065
* Fix an off-by-one error when computing the precompiled preamble forDouglas Gregor2010-08-251-1/+2
| | | | | | | code completion. We were allowing the preamble to include the line that we're code-completing on. Again, testcase is forthcoming. llvm-svn: 112064
* Make the cursor kind of macro-name-only completions produced byDouglas Gregor2010-08-251-1/+4
| | | | | | | ASTUnit match those produced directly by code completion. Test case is forthcoming. llvm-svn: 112063
* Add a code-completion context for "natural language" completions, soDouglas Gregor2010-08-251-2/+1
| | | | | | that ASTUnit knows not to try to provide completions there. llvm-svn: 112057
* Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor2010-08-254-6/+40
| | | | | | | expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. llvm-svn: 112054
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-2561-1322/+1314
| | | | | | to the new constants. llvm-svn: 112047
* Recursive functions should be marked when used from another function. Fixes ↵Argyrios Kyrtzidis2010-08-251-1/+4
| | | | | | http://llvm.org/PR7923. llvm-svn: 112045
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-2518-93/+83
| | | | llvm-svn: 112044
* Make sure volatile variables are emitted even if static. Fixes rdar://8315219Argyrios Kyrtzidis2010-08-251-0/+4
| | | | llvm-svn: 112043
* Rename *PendingImplicitInstantiations to *PendingInstantiations. NoChandler Carruth2010-08-255-45/+41
| | | | | | functionality changed. llvm-svn: 112040
* Split FunctionScopeInfo and BlockScopeInfo into their own header.John McCall2010-08-259-50/+71
| | | | llvm-svn: 112038
* Support explicit instantiation of function templates and members of classChandler Carruth2010-08-252-12/+26
| | | | | | | | | | | | | templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. llvm-svn: 112037
* Remove Sema.h's dependency on DeclCXX.h.John McCall2010-08-2510-2/+20
| | | | llvm-svn: 112032
* Remove the DenseSet dependency from Sema.h.John McCall2010-08-254-0/+5
| | | | llvm-svn: 112030
* Teach Sema to live without CodeCompleteConsumer.h.John McCall2010-08-253-71/+71
| | | | llvm-svn: 112028
* Remove AnalysisBasedWarnings.h's dependency on Type.hJohn McCall2010-08-253-14/+28
| | | | llvm-svn: 112027
* Move more stuff out of Sema.h.John McCall2010-08-2510-33/+64
| | | | llvm-svn: 112026
* IRgen: Fix a horrible bug in pointer to bool conversion, which we were treatingDaniel Dunbar2010-08-251-2/+7
| | | | | | as a truncation not a comparison to null. llvm-svn: 112021
* Expression statements undergo lvalue-to-rvalue conversion in C,John McCall2010-08-251-2/+10
| | | | | | | | but not in C++, so don't emit aggregate loads of volatile references in null context in C++. Happens to have been caught by an assertion. We do not get the scalar case right. Volatiles are really broken. llvm-svn: 112019
* Reformatting.John McCall2010-08-251-3/+3
| | | | llvm-svn: 112018
* When performing completions involving Objective-C method declarationsDouglas Gregor2010-08-251-17/+32
| | | | | | | (e.g., for message sends or method declaration/definition completions), adjust methods that come from a base class. llvm-svn: 112013
* Plug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.Argyrios Kyrtzidis2010-08-251-1/+3
| | | | llvm-svn: 112006
* Use a smart pointer instead of delete.Argyrios Kyrtzidis2010-08-251-6/+5
| | | | llvm-svn: 112005
* No need to default synthesize property if implementation Fariborz Jahanian2010-08-251-0/+6
| | | | | | | has its own getter and setter methods declared. Fixed 8349319 (nonfragile-abi2). llvm-svn: 112003
* Fix 'for' loop variables' scope.Devang Patel2010-08-251-6/+6
| | | | llvm-svn: 112002
* Give a slight preference to functions returning "void" when we'reDouglas Gregor2010-08-241-4/+13
| | | | | | | performing code completion at the statement level (rather than in an arbitrary expression). llvm-svn: 112001
* Preserve invalidity of typeof operands in C++.John McCall2010-08-241-1/+2
| | | | llvm-svn: 111999
* Catch the case of trying to turn '&(X::a)' into a member pointer as well.John McCall2010-08-241-10/+20
| | | | llvm-svn: 111997
* When trying to resolve the address of an overloaded expression,John McCall2010-08-242-17/+41
| | | | | | | | only form pointers-to-member if the expression has the appropriate form. This avoids assertions later on on invalid code, but also allows us to properly resolve mixed-staticity overloads. llvm-svn: 111987
* AST writer support for having specializations of templates from earlier in ↵Sebastian Redl2010-08-242-3/+30
| | | | | | the chain. This ought to finish C++ chained PCH support. llvm-svn: 111986
* AST reader support for having specializations of templates from earlier in ↵Sebastian Redl2010-08-242-0/+21
| | | | | | the chain. llvm-svn: 111985
* Frontend: Add basic -H support.Daniel Dunbar2010-08-243-9/+45
| | | | | | | - I didn't implement the GCC "multiple include guard" detection parts, because it doesn't seem useful or obvious. llvm-svn: 111983
* Add some missing X86-specific asm constraint letters, and fixDale Johannesen2010-08-241-4/+18
| | | | | | | some bugs in setting allowsRegister on the ones there. 8348447. llvm-svn: 111980
* correct the -isystem option to not add the -isysroot path. Only the weirdChris Lattner2010-08-242-7/+8
| | | | | | -iwithsysroot flag should do that. This fixes rdar://8345942 llvm-svn: 111979
* Fix printf format string checking for '%lc' (which expects a wint_t or ↵Ted Kremenek2010-08-243-0/+32
| | | | | | compatible argument). Fixes PR 7981. llvm-svn: 111978
* It is not error in c++ to take address ofFariborz Jahanian2010-08-241-1/+4
| | | | | | register variable (c++03 7.1.1P3). radar 8108252. llvm-svn: 111977
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-245-7/+69
| | | | | | arguments. llvm-svn: 111976
OpenPOWER on IntegriCloud