summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Parser: Add support for #pragma align, which is just another spelling of #pragmaDaniel Dunbar2010-07-316-17/+55
| | | | | | options align. llvm-svn: 109952
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-3110-24/+640
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Implement dependency analysis for the precompiled preamble. If any ofDouglas Gregor2010-07-314-32/+125
| | | | | | | the files in the precompiled preamble have changed since it was build, force the preamble to be rebuilt. llvm-svn: 109937
* Update checker build.Ted Kremenek2010-07-301-1/+1
| | | | llvm-svn: 109907
* Test case for PR7763.Tom Care2010-07-301-0/+14
| | | | llvm-svn: 109895
* Uncomment unfinished work bailout in IdempotentOperationsChecker.Tom Care2010-07-301-2/+2
| | | | llvm-svn: 109893
* Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING ↵Douglas Gregor2010-07-302-16/+64
| | | | | | environment variable is set. llvm-svn: 109890
* Correctly deal with using names for both functions and structs in chained PCH.Sebastian Redl2010-07-307-14/+41
| | | | llvm-svn: 109871
* Add specialisation iterators for {Class,Function}TemplateDeclPeter Collingbourne2010-07-301-0/+74
| | | | | | | | | This patch introduces the ClassTemplateDecl::spec_{begin,end}() and FunctionTemplateDecl::{,partial_}spec_{begin,end}() member functions as a public interface for iterating over the declarations' specialisation sets. llvm-svn: 109870
* Refactor find*Specialization functions using SpecEntryTraitsPeter Collingbourne2010-07-302-16/+22
| | | | | | | | | This patch reimplements the find*Specialization family of member functions of {Class,Function}TemplateDecl in terms of a common implementation that uses SpecEntryTraits to obtain the most recent declaration. llvm-svn: 109869
* Introduce RedeclarableTemplateDecl::SpecEntryTraitsPeter Collingbourne2010-07-301-0/+18
| | | | | | | SpecEntryTraits describes how to obtain the most recent declaration of a specialisation from an entry in a specialisation FoldingSet. llvm-svn: 109868
* Safely get a data pointer for vectors that might be empty.Sebastian Redl2010-07-301-6/+15
| | | | llvm-svn: 109867
* Tighten the rules when deciding if an ivar must beFariborz Jahanian2010-07-302-3/+20
| | | | | | | auto-synthesized (nonfragile-abi2 specific). Fixes radar 8251648. llvm-svn: 109866
* Fixed typedef inside extern "C".Abramo Bagnara2010-07-306-36/+40
| | | | llvm-svn: 109865
* tests: Use env instead of assuming bash.Daniel Dunbar2010-07-301-1/+1
| | | | llvm-svn: 109864
* Update checker build.Ted Kremenek2010-07-301-1/+1
| | | | llvm-svn: 109862
* When we are deserializing the lexical decls of a DeclContext from PCH, ↵Argyrios Kyrtzidis2010-07-301-0/+3
| | | | | | | | | | | notify the PCHReader to hold off passing Decls to the consumer until the DeclContext is fully prepared. Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would form a cycle and we would enter infinite loop territory. llvm-svn: 109857
* Refactor the way PCHReader tracks whether we are in recursive loading.Argyrios Kyrtzidis2010-07-304-42/+55
| | | | | | | | | | -Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing) -Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing to ExternalASTSource. These are preparation for the next commit. llvm-svn: 109856
* Improve error recovery when presented with an ill-formed template-idJohn McCall2010-07-303-6/+14
| | | | | | | | (e.g. due to a broken template argument) following template parameters. Fixes rdar://problem/8254267 llvm-svn: 109853
* If a TST_typename has a null type, mark the declarator invalid. PreventsJohn McCall2010-07-301-2/+4
| | | | | | some downstream crashes, among them rdar://problem/8229840. llvm-svn: 109850
* Emit global destructors even if the destroyed object has no initializers or hasJohn McCall2010-07-302-9/+20
| | | | | | | | an initializer requiring temporary object disposal. Fixes rdar:://problem/8246444. llvm-svn: 109849
* fix PR5179 and correctly fix PR5831 to not miscompile.Chris Lattner2010-07-306-48/+132
| | | | | | | | | | | | | | | | | | | | The X86-64 ABI code didn't handle the case when a struct would get classified and turn up as "NoClass INTEGER" for example. This is perfectly possible when the first slot is all padding (e.g. due to empty base classes). In this situation, the first 8-byte doesn't take a register at all, only the second 8-byte does. This fixes this by enhancing the x86-64 abi stuff to allow and handle this case, reverts the broken fix for PR5831, and enhances the target independent stuff to be able to handle an argument value in registers being accessed at an offset from the memory value. This is the last x86-64 calling convention related miscompile that I'm aware of. llvm-svn: 109848
* There is no reason for this test to invoke 'llc'.Daniel Dunbar2010-07-301-1/+1
| | | | llvm-svn: 109847
* Add test case for crash reported in <rdar://problem/8236270> (which has ↵Ted Kremenek2010-07-301-0/+11
| | | | | | since been fixed in trunk). llvm-svn: 109834
* Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.Ted Kremenek2010-07-302-3/+21
| | | | llvm-svn: 109833
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-3017-77/+153
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Add clang_isPODType() for querying if the CXType is POD. Implements ↵Ted Kremenek2010-07-306-11/+33
| | | | | | <rdar://problem/8250669>. llvm-svn: 109822
* Revert "Re-apply fixed version of 108749, correctly conditionalizing the newDaniel Dunbar2010-07-293-20/+10
| | | | | | | sections on", this change uncovered a possible linker bug which resulted in the wrong messages getting dispatched. Backing this out while we investigate... llvm-svn: 109817
* CMake: Clang test targets depend on the {FileCheck,not,count} tools.Daniel Dunbar2010-07-291-3/+3
| | | | llvm-svn: 109816
* Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.Nate Begeman2010-07-293-1/+7
| | | | llvm-svn: 109814
* Teach isIncompleteType() to look through sugar when it is dealing withDouglas Gregor2010-07-291-2/+3
| | | | | | Objective-C object and interface types. This is part of PR7741. llvm-svn: 109808
* move the last hunk of getCoerceResult into the placeChris Lattner2010-07-292-34/+29
| | | | | | that needs it and remove getCoerceResult. llvm-svn: 109807
* now that direct and coerce are merged, getCoerceResult gets simpler.Chris Lattner2010-07-291-5/+0
| | | | llvm-svn: 109805
* now that GetSSETypeAtOffset handles passing SSE class values asChris Lattner2010-07-291-14/+0
| | | | | | float, the special case hack in getCoerceResult can go away. llvm-svn: 109804
* Change the name to something less terrible; suggestion by Doug. No ↵Argyrios Kyrtzidis2010-07-294-4/+4
| | | | | | functionality change. llvm-svn: 109797
* Weak references and variables that are not definitions are not required for ↵Argyrios Kyrtzidis2010-07-292-0/+14
| | | | | | early codegen/deserialization. llvm-svn: 109796
* Implement the clang-side of detection for when to pass asChris Lattner2010-07-291-3/+39
| | | | | | | | <2 x float> instead of double. This works but can't be turned on until I teach codegen to pass <2 x float> as one XMM register instead of two. llvm-svn: 109790
* Look at me, I can count!Chris Lattner2010-07-291-1/+1
| | | | llvm-svn: 109786
* Implement PCH support for offsetof(base-specifier).Argyrios Kyrtzidis2010-07-294-5/+13
| | | | llvm-svn: 109785
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-298-215/+192
| | | | | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
* fix rdar://8251384, another case where we could access beyond theChris Lattner2010-07-292-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | end of a struct. This improves the case when the struct being passed contains 3 floats, either due to a struct or array of 3 things. Before we'd generate this IR for the testcase: define float @bar(double %X.coerce0, double %X.coerce1) nounwind { entry: %X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2] %0 = bitcast %struct.foof* %X to %1* ; <%1*> [#uses=2] %1 = getelementptr %1* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %X.coerce0, double* %1 %2 = getelementptr %1* %0, i32 0, i32 1 ; <double*> [#uses=1] store double %X.coerce1, double* %2 %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1] %tmp1 = load float* %tmp ; <float> [#uses=1] ret float %tmp1 } which compiled (with optimization) to: _bar: ## @bar ## BB#0: ## %entry movd %xmm1, %rax movd %eax, %xmm0 ret Now we produce: define float @bar(double %X.coerce0, float %X.coerce1) nounwind { entry: %X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2] %0 = bitcast %struct.foof* %X to %0* ; <%0*> [#uses=2] %1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %X.coerce0, double* %1 %2 = getelementptr %0* %0, i32 0, i32 1 ; <float*> [#uses=1] store float %X.coerce1, float* %2 %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1] %tmp1 = load float* %tmp ; <float> [#uses=1] ret float %tmp1 } and: _bar: ## @bar ## BB#0: ## %entry movaps %xmm1, %xmm0 ret llvm-svn: 109776
* Add codegen support for ARM qadd & qsub intrinsicsNate Begeman2010-07-291-0/+2
| | | | llvm-svn: 109771
* start setting up infrastructure for passing multi-floatsChris Lattner2010-07-291-15/+33
| | | | | | | as <2 x float> instead of as double. The backend isn't ready yet, but infrastructure in the frontend can come up. llvm-svn: 109768
* Prepare for upcoming ownership change.Benjamin Kramer2010-07-291-8/+7
| | | | llvm-svn: 109766
* rename Get8ByteTypeAtOffset -> GetINTEGERTypeAtOffset toChris Lattner2010-07-291-17/+18
| | | | | | | make it clear that this function should only return a type that the codegen will classify the same as an INTEGER type. llvm-svn: 109763
* handle a case where we could access off the end of a functionChris Lattner2010-07-292-9/+12
| | | | | | that Eli pointed out, rdar://8249586 llvm-svn: 109762
* in release mode, irbuilder doesn't add names to instructions,Chris Lattner2010-07-291-2/+2
| | | | | | this will hopefully fix the osuosl clang-i686-darwin10 builder. llvm-svn: 109760
* fix PR7742 / rdar://8250764, a miscompilation of structChris Lattner2010-07-292-2/+19
| | | | | | | | | | | return where the struct has a base but no fields. This was because the x86-64 abi logic was checking the wrong predicate in one place. This was introduced in r91874, which was a fix for PR5831, which lacked a CHECK line, so I verified and added it. llvm-svn: 109759
* Tigthen the condition for issung ivar shadowingFariborz Jahanian2010-07-292-1/+23
| | | | | | | variables to those in file scope (nonfragile-abi2). Fixes radar 8248681. llvm-svn: 109758
* When dynamic_cast'ing from a type to itself, fill in the cast kindDouglas Gregor2010-07-291-0/+1
| | | | | | with CK_NoOp. Fixes PR7727. llvm-svn: 109757
OpenPOWER on IntegriCloud