summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* restructure code a bit: there are two potential issuesChris Lattner2010-02-121-11/+15
| | | | | | | | | | | | worth asserting about in this code: 1) if the source range is bogus (begin loc after end loc), and 2) if the client is trying to highlight a range that is purely whitespace. It is possible to just silently ignore #2, but it seems like it is always a bug, so lets keep asserting on this condition, but with a better assert message. llvm-svn: 95998
* Fix a refacto that broke the clang-on-clang build.Anders Carlsson2010-02-121-7/+1
| | | | llvm-svn: 95994
* Fixes a rewriter bug rewriting function decl.Fariborz Jahanian2010-02-121-2/+14
| | | | | | | with block-pointer-type as one or more of its arguments. Fixes radar 7638400. llvm-svn: 95992
* Improve representation of tag declarations first declared or definedDouglas Gregor2010-02-123-3/+6
| | | | | | within the declarator of another declaration, from Enea Zaffanella! llvm-svn: 95991
* Start stubbing out more of the covariant thunk support.Anders Carlsson2010-02-121-10/+20
| | | | llvm-svn: 95990
* Simplify incomplete-array merging code in the AST importer, thanks toDouglas Gregor2010-02-121-24/+14
| | | | | | Daniel's suggestion. llvm-svn: 95987
* Fix a latent bug found by Ahmed Charles, where we were callingDouglas Gregor2010-02-121-1/+1
| | | | | | ASTContext::getFunctionType with the wrong set of arguments. llvm-svn: 95986
* Keep track of whether a final overrider needs a return type adjustment.Anders Carlsson2010-02-121-5/+26
| | | | llvm-svn: 95985
* Move overrider out into a separate struct.Anders Carlsson2010-02-121-13/+25
| | | | llvm-svn: 95984
* Fix PR6282: the include guard optimization cannot happen if theChris Lattner2010-02-121-7/+10
| | | | | | | | guard macro is already defined for the first occurrence of the header. If it is, the body will be skipped and not be properly analyzed for the include guard optimization. llvm-svn: 95972
* Keep track of the address points for all primary bases, and add the ability ↵Anders Carlsson2010-02-121-11/+48
| | | | | | to dump multiple address points for a single offset. llvm-svn: 95970
* Work around an annoying, non-standard optimization in the glibcDouglas Gregor2010-02-123-6/+67
| | | | | | | | | | | | | | | | | | | | | | headers, where malloc (and many other libc functions) are declared with empty throw specifications, e.g., extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__ ((__malloc__)) ; The C++ standard doesn't seem to allow this, and redeclaring malloc as the standard permits (as follows) resulted in Clang (rightfully!) complaining about mis-matched exception specifications. void *malloc(size_t size); We work around this by silently propagating an empty throw specification "throw()" from a function with C linkage declared in a system header to a redeclaration that has no throw specifier. Ick. llvm-svn: 95969
* Fix a bug causing an assertion when a covariant return type differed fromJohn McCall2010-02-121-9/+12
| | | | | | an overriden type only by reduced qualification. llvm-svn: 95968
* In C++, allow builtins to be referred to via qualified name lookup, e.g.,Douglas Gregor2010-02-122-30/+48
| | | | | | | | ::__builtin_va_copy Fixes one of the Firefox issues in PR5511. llvm-svn: 95966
* More work on vtable layout. We can now layout vtables with primary bases.Anders Carlsson2010-02-121-52/+138
| | | | llvm-svn: 95965
* Waste two bits in every clang::Type so that the type class can be readJohn McCall2010-02-121-1/+1
| | | | | | in a single byte-load rather than some crazy bitmunging operation. llvm-svn: 95964
* When dumping vtables, dump whether a virtual member function is pure or not.Anders Carlsson2010-02-121-1/+9
| | | | llvm-svn: 95963
* More work on the final overriders.Anders Carlsson2010-02-121-10/+130
| | | | llvm-svn: 95954
* Do not ignore anonymous records.Devang Patel2010-02-121-2/+2
| | | | llvm-svn: 95953
* Cache new compile unit.Devang Patel2010-02-121-1/+8
| | | | llvm-svn: 95952
* Handle AST merges of incomplete class types. Douglas Gregor2010-02-121-40/+50
| | | | llvm-svn: 95941
* Implementing unused function warning.Tanya Lattner2010-02-126-0/+53
| | | | llvm-svn: 95940
* Warn about using the new force_align_arg_pointer attribute on a functionCharles Davis2010-02-111-4/+6
| | | | | | | pointer. If you don't like the new warning, you can turn it off with -Wno-force-align-arg-pointer. llvm-svn: 95939
* Fixes a rewriting bug where order of constructor expression arguments did ↵Fariborz Jahanian2010-02-111-15/+28
| | | | | | | | | | not match order of constructor arguments (all block API specific). This was exposed only in a large block literal expression in a large file where PtrSet container size execceded its limit and required reallocation. Fixes radar 7638294 llvm-svn: 95936
* When we have a dependent direct initializer but not a dependentDouglas Gregor2010-02-112-18/+27
| | | | | | | | variable type, we can (and should) still check for completeness of the variable's type. Do so, to work around an assertion that shows up in Boost's shared_ptr. llvm-svn: 95934
* Fix leak in CXXNewExpr where the SubExprs array would get allocated directly ↵Ted Kremenek2010-02-112-6/+17
| | | | | | using 'new[]' instead of the allocator associated with ASTContext. llvm-svn: 95933
* Fix re-allocation in AttrWithString::ReplaceString() to use the allocator ↵Ted Kremenek2010-02-111-1/+1
| | | | | | assosciated with ASTContext. llvm-svn: 95931
* Allocate the SubExprs array in ObjCMessageExpr using the allocator ↵Ted Kremenek2010-02-114-30/+45
| | | | | | associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>). llvm-svn: 95930
* Stub out the final overriders class.Anders Carlsson2010-02-111-1/+128
| | | | llvm-svn: 95922
* Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate ↵Anders Carlsson2010-02-111-6/+6
| | | | | | this). llvm-svn: 95911
* Move two functions to the top. No functionality change.Anders Carlsson2010-02-111-77/+77
| | | | llvm-svn: 95908
* Uncomment lines I never meant to have left commented in a commit.Ted Kremenek2010-02-111-3/+3
| | | | llvm-svn: 95906
* When AST merging for record declarations fails, warn about theDouglas Gregor2010-02-112-44/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | incompatibility and show where the structural differences are. For example: struct1.c:36:8: warning: type 'struct S7' has incompatible definitions in different translation units struct S7 { int i : 8; unsigned j : 8; } x7; ^ struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here struct S7 { int i : 8; unsigned j : 8; } x7; ^ struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here struct S7 { int i : 8; unsigned j : 16; } x7; ^ There are a few changes to make this work: - ASTImporter now has only a single Diagnostic object, not multiple diagnostic objects. Otherwise, having a warning/error printed via one Diagnostic and its note printed on the other Diagnostic could cause the note to be suppressed. - Implemented import functionality for IntegerLiteral (along with general support for statements and expressions) llvm-svn: 95900
* More vtable layout dumper improvements. Handle destructors, dump the ↵Anders Carlsson2010-02-115-22/+69
| | | | | | complete function type of the member functions (using PredefinedExpr::ComputeName. llvm-svn: 95887
* Driver: Fix clang -ccc-no-clang -x c++-header foo.h on Darwin.Daniel Dunbar2010-02-111-1/+2
| | | | llvm-svn: 95876
* Keep track of, and dump, vtable address points.Anders Carlsson2010-02-111-2/+33
| | | | llvm-svn: 95874
* Suppress warnings if their instantiation location is in a system header, notJohn McCall2010-02-111-1/+1
| | | | | | | | | | | | | their spelling location. This prevents warnings from being swallowed just because the caret is on the first parenthesis in, say, NULL. This is an experiment; the risk is that there might be a substantial number of system headers which #define symbols to expressions which inherently cause warnings. My theory is that that's rare enough that it can be worked around case-by-case, and that producing useful warnings around NULL is worth it. But I'm willing to accept that I might be empirically wrong. llvm-svn: 95870
* Patch by Cristian Draghici:Ted Kremenek2010-02-111-2/+34
| | | | | | | | | | | | Enhance the printf format string checking when using the format specifier flags ' ', '0', '+' with the 'p' or 's' conversions (since they are nonsensical and undefined). This is similar to GCC's checking. Also warning when a precision is used with the 'p' conversin specifier, since it has no meaning. llvm-svn: 95869
* Check in the beginnings of my new vtable layout builder idea.Anders Carlsson2010-02-112-9/+210
| | | | | | | | Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code. I've also added a very simple new vtable layout test case. llvm-svn: 95865
* Use the allocator associated with ASTContext to allocate the argsTed Kremenek2010-02-113-3/+19
| | | | | | | | array associated with NonNullAttr. This fixes yet another leak when ASTContext uses a BumpPtrAllocator. Fixes: <rdar://problem/7637150> llvm-svn: 95863
* Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) byTed Kremenek2010-02-112-5/+34
| | | | | | | | | storing the set of StoredDeclsMaps in an internal vector of void*. This isn't an ideal solution, but for the time being this fixes a major memory leak with these DenseMaps not being freed. Fixes: <rdar://problem/7634755> llvm-svn: 95861
* Remove use of 'std::string' from Attr objects, using instead a byteTed Kremenek2010-02-116-31/+56
| | | | | | | | | array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
* Driver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.Daniel Dunbar2010-02-112-3/+23
| | | | llvm-svn: 95849
* Driver: Fix infinite loop and wrong message on invalid -ccc-clang-arch argument.Daniel Dunbar2010-02-111-4/+2
| | | | llvm-svn: 95848
* Clean up ownership of 'AttributeList' objects in Parser. ApparentlyTed Kremenek2010-02-115-46/+83
| | | | | | | | | | | | | | | | | | | | | we would just leak them all over the place, with no clear ownership of these objects at all. AttributeList objects would get leaked on both error and non-error paths. Note: I introduced the usage of llvm::OwningPtr<AttributeList> to manage these objects, which is particularly useful for methods with multiple return sites. In at least one method I used them even when they weren't strictly necessary because it clarified the ownership semantics and made the code easier to read. Should the excessive 'take()' and 'reset()' calls become a performance issue we can always re-evaluate. Note+1: I believe I have not introduced any double-frees, but it would be nice for someone to review this. This fixes <rdar://problem/7635046>. llvm-svn: 95847
* Strip attributes and 'inline' off the "previous declaration" of aJohn McCall2010-02-111-15/+27
| | | | | | | template explicit specialization. Complete an apparently stalled refactor towards using CheckSpecializationInstantiationRedecl(). llvm-svn: 95845
* Remove another redundant ASTContext parameterDouglas Gregor2010-02-113-4/+5
| | | | llvm-svn: 95843
* Eliminate a bunch of unnecessary ASTContexts from members functions ofDouglas Gregor2010-02-1112-58/+48
| | | | | | Decl subclasses. No functionality change. llvm-svn: 95841
* Diagnose when user provided getter is being used as lvalueFariborz Jahanian2010-02-112-5/+16
| | | | | | using property dot-syntax. Fixes radar 7628953. llvm-svn: 95838
* Eliminate the ASTContext parameter from RecordDecl::getDefinition()Douglas Gregor2010-02-1115-28/+27
| | | | | | | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No functionality change. llvm-svn: 95836
OpenPOWER on IntegriCloud