summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve the internal representation and semantic analysis of friendDouglas Gregor2009-10-134-34/+117
| | | | | | | | | | | | | | | function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. llvm-svn: 83970
* Refine handling for return value conversions with respect to virtualMike Stump2009-10-131-12/+22
| | | | | | offsets for covariant thunks. llvm-svn: 83965
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-1313-57/+33
| | | | llvm-svn: 83964
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-132-3/+33
| | | | | | | | | | which is a common idiom to improve PIC'ness of code using the addr of label extension. This implementation is a gross hack, but the only other alternative would be to teach evalutate about this horrid combination. While GCC allows things like "&&foo - &&bar + 1", people don't use this in practice. This implements PR5131. llvm-svn: 83957
* reimplement codegen for indirect goto with the following advantages:Chris Lattner2009-10-133-44/+91
| | | | | | | | | | | | | 1. CGF now has fewer bytes of state (one pointer instead of a vector). 2. The generated code is determinstic, instead of getting labels in 'map order' based on pointer addresses. 3. Clang now emits one 'indirect goto switch' for each function, instead of one for each indirect goto. This fixes an M*N = N^2 IR size issue when there are lots of address-taken labels and lots of indirect gotos. 4. This also makes the default cause do something useful, reducing the size of the jump table needed (by one). llvm-svn: 83952
* number address-taken labels from 1. This allows 0 to be used as a sentinelChris Lattner2009-10-131-1/+1
| | | | | | | for a null pointer. In other words, "&&foo != NULL" will always work out to true. llvm-svn: 83948
* Use the new Type::getInt8PtrTy method. This should probably be used in a lotChris Lattner2009-10-131-1/+1
| | | | | | more places in clang codegen now. llvm-svn: 83947
* make the diagnostic in the 'unused result' warning more preciseChris Lattner2009-10-132-13/+33
| | | | | | about the reason, rdar://7186119. llvm-svn: 83940
* fix PR4938 by recognizing % as a modifier on outputs,Chris Lattner2009-10-131-0/+3
| | | | | | previously we only recognized it on inputs. llvm-svn: 83939
* Now we can call into another function with the CallInliner transfer function.Zhongxing Xu2009-10-131-1/+35
| | | | llvm-svn: 83936
* Add an initial implementation of EnterStackFrame() to the StoreManager.Zhongxing Xu2009-10-131-0/+22
| | | | llvm-svn: 83934
* Enable "debug info attached to an instruction" mode.Devang Patel2009-10-121-0/+2
| | | | llvm-svn: 83928
* When declaring a class template whose name is qualified, make sureDouglas Gregor2009-10-122-2/+9
| | | | | | | | that the scope in which it is being declared is complete. Also, when instantiating a member class template's ClassTemplateDecl, be sure to delay type creation so that the resulting type is dependent. Ick. llvm-svn: 83923
* There is no need to attach debug location info with alloca instruction.Devang Patel2009-10-121-5/+1
| | | | llvm-svn: 83913
* Encode long double.Devang Patel2009-10-121-0/+1
| | | | llvm-svn: 83912
* Permit explicit specialization of member functions of class templatesDouglas Gregor2009-10-122-4/+14
| | | | | | | | that are declarations (rather than definitions). Also, be sure to set the access specifiers properly when instantiating the declarations of member function templates. llvm-svn: 83911
* More appropriate API usage.John McCall2009-10-121-3/+1
| | | | llvm-svn: 83910
* Implement -Wparentheses: warn about using assignments in contexts that requireJohn McCall2009-10-123-48/+77
| | | | | | | | | conditions. Add a fixit to insert the parentheses. Also fix a very minor possible memory leak in 'for' conditions. Fixes PR 4876 and rdar://problem/7289172 llvm-svn: 83907
* Store the key function of a record decl inside CGRecordLayout.Anders Carlsson2009-10-122-3/+41
| | | | llvm-svn: 83900
* Use a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, ↵Ted Kremenek2009-10-121-63/+72
| | | | | | | | | | | | successor and predecessor vectors, etc. Speedup: when doing 'clang-cc -analyze -dump-cfg' (without actual printing, just CFG building) on the amalgamated SQLite source (all of SQLite in one source file), runtime reduced by 9%. This fixes: <rdar://problem/7250745> llvm-svn: 83899
* Fixup windows include paths. Patch by John Thompson.Mike Stump2009-10-122-102/+119
| | | | llvm-svn: 83898
* Diagnose the declaration of explicit specializations after an implicitDouglas Gregor2009-10-126-39/+132
| | | | | | | instantiation has already been required. To do so, keep track of the point of instantiation for anything that can be instantiated. llvm-svn: 83890
* Handle built-in unary operators when reporting ambiguities.Fariborz Jahanian2009-10-122-13/+18
| | | | | | wip - To prune excessive reporting. llvm-svn: 83889
* Even more devirtualization cleverness.Anders Carlsson2009-10-121-1/+5
| | | | llvm-svn: 83886
* More devirtualization improvements.Anders Carlsson2009-10-121-0/+4
| | | | llvm-svn: 83883
* Devirtualize calls on temporaries. A().f() for example.Anders Carlsson2009-10-121-0/+6
| | | | llvm-svn: 83882
* Factor out devirtualization checking into a separate function and make it ↵Anders Carlsson2009-10-121-1/+15
| | | | | | handle references correctly. llvm-svn: 83880
* Use CanQualType (instead of QualType) to store collection of visibleFariborz Jahanian2009-10-121-7/+9
| | | | | | canonical conversion types. llvm-svn: 83869
* If built-in operators could not be selected because of ambiguity inFariborz Jahanian2009-10-121-2/+31
| | | | | | | | | | | | | | | | | | user-defined type conversions, issue list of ambiguites in addition to the diagnostic. So, clang now issues the following: b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1' int i = c1->*pmf; ~~^ b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *' b.cpp:5:5: note: candidate function operator E*(); ^ b.cpp:11:5: note: candidate function operator E*(); ^ llvm-svn: 83862
* Typo in AddGnuCPlusPlusIncludePaths.Edward O'Callaghan2009-10-121-1/+1
| | | | llvm-svn: 83847
* If the base type of a member call is a record type we don't need to emit a ↵Anders Carlsson2009-10-111-5/+6
| | | | | | virtual call. llvm-svn: 83816
* Remove dead variable.Benjamin Kramer2009-10-111-1/+1
| | | | llvm-svn: 83808
* Add CGVtable.cpp to CMakeLists.Benjamin Kramer2009-10-111-0/+1
| | | | llvm-svn: 83800
* Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson2009-10-117-554/+608
| | | | llvm-svn: 83798
* Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of ↵Anders Carlsson2009-10-114-17/+17
| | | | | | QualTypes. llvm-svn: 83793
* Types appearing more than once in a spec shouldn't matter.Sebastian Redl2009-10-111-5/+10
| | | | llvm-svn: 83766
* Test exception spec compatibility on return type and parameters.Sebastian Redl2009-10-116-226/+316
| | | | | | | Along the way, use RequireCompleteType when testing exception spec types. Separate all the ugly spec stuff into its own file. llvm-svn: 83764
* Introduces a new BindingVal which combines direct andZhongxing Xu2009-10-111-190/+165
| | | | | | | | default binding for regions. This allows us to simply a lot of code. A further simplification could be done is that many methods of regionstore can only work on Store instead of GRState. llvm-svn: 83762
* Move our (non-existing) RTTI emission code into CGRtti.cpp. No functionality ↵Anders Carlsson2009-10-103-32/+49
| | | | | | change. llvm-svn: 83732
* Generate weak read barriers when reading a weak __blockFariborz Jahanian2009-10-101-1/+5
| | | | | | variable inside the block. llvm-svn: 83729
* Implement the core checking for compatible exception specifications in ↵Sebastian Redl2009-10-104-4/+55
| | | | | | | | | assignment and initialization. The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet. This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment. llvm-svn: 83710
* Qualified lookup through using declarations. Diagnose a new type of ambiguity.John McCall2009-10-105-50/+295
| | | | | | | Split the various ambiguous result enumerators into their own enum. Tests for most of C++ [namespace.qual]. llvm-svn: 83700
* Check that the return type is complete when calling a member function.Anders Carlsson2009-10-101-0/+5
| | | | llvm-svn: 83694
* Add CheckCallReturnType and start using it for regular call expressions. ↵Anders Carlsson2009-10-094-11/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This will improve error messages. For struct B; B f(); void g() { f(); } We now get t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B' f(); ^~~ t.cpp:3:3: note: 'f' declared here B f(); ^ t.cpp:1:8: note: forward declaration of 'struct B' struct B; ^ llvm-svn: 83692
* Dead Code EliminationDouglas Gregor2009-10-092-23/+0
| | | | llvm-svn: 83686
* Add some FIXMEsDouglas Gregor2009-10-091-0/+2
| | | | llvm-svn: 83685
* Minor tweaks for code-completion:Douglas Gregor2009-10-092-4/+15
| | | | | | | | | | | - Filter out unnamed declarations - Filter out declarations whose names are reserved for the implementation (e.g., __bar, _Foo) - Place OVERLOAD: or COMPLETION: at the beginning of each code-completion result, so we can easily separate them from other compilation results. llvm-svn: 83680
* Revert 83567.Devang Patel2009-10-091-6/+3
| | | | llvm-svn: 83676
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-0915-909/+525
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* When declaring a friend class template, we may end up finding anDouglas Gregor2009-10-091-0/+16
| | | | | | | | injected-class-name (e.g., when we're referring to other specializations of the current class template). Make sure that we see the template rather than the injected-class-name. Fixes PR4768. llvm-svn: 83672
OpenPOWER on IntegriCloud