summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Redo how PCH handles its implicit include. Instead of treating this specially inDaniel Dunbar2009-11-112-4/+24
| | | | | | | | | | | | | | | the front-end (as far as the preprocessor goes), follow the usual logic of inserting the (original include path) name into the predefines buffer. This pushes the responsibility for handling this to PCH instead of the front-end. In PCH this requires being a little more clever when we diff the predefines buffers. Neither of these solutions are particularly great, I think what we eventually should do is something like gcc where we insert a special marker to indicate the PCH file, but then run the preprocessor as usual. This would be clearer and would allow us to drop the overly clever predefines handling. llvm-svn: 86806
* More StringRef simplification to PCHValidator::ReadPredefinesBuffer.Daniel Dunbar2009-11-111-27/+22
| | | | llvm-svn: 86805
* Rewrite splitLines using StringRef; this is much simpler, and also now avoidsDaniel Dunbar2009-11-111-26/+26
| | | | | | | | | | | | | tons of std::string trashing. I plan to move this and other fun string munging utilities to a StringRefExtras.h at some point if no one beats me to it. On a synthetic benchmark on x86_64, llvm-gcc actually generates code thats 10% faster using the StringRef version. gcc miscompiles the synthetic benchmark, which I'm crossing my fingers and hoping won't happen here. clang compiles the sythetic benchmark correctly (wootness), but the StringRef version is slower. Silly clang. llvm-svn: 86799
* Refactor DereferenceChecker to use only the new Checker API instead ofTed Kremenek2009-11-116-200/+204
| | | | | | | | | | the old builder API. This percolated a bunch of changes up to the Checker class (where CheckLocation has been renamed VisitLocation) and GRExprEngine. ProgramPoint now has the notion of a "LocationCheck" point (with PreLoad and PreStore respectively), and a bunch of the old ProgramPoints that are no longer used have been removed. llvm-svn: 86798
* Preserve source locations when building offsetof expressions featuringJohn McCall2009-11-111-1/+1
| | | | | | anonymous members. Partial fix for PR 5390. llvm-svn: 86796
* More VTT work. We now track offsets and use the ctor vtable builderMike Stump2009-11-112-11/+27
| | | | | | interface. WIP. llvm-svn: 86793
* Fixup spacing.Mike Stump2009-11-111-2/+1
| | | | llvm-svn: 86792
* Apparently the following idiom is specifically encouraged:John McCall2009-11-111-1/+12
| | | | | | | if (self = [super init]) Recognize it and only warn if -Wparentheses is explicitly enabled. llvm-svn: 86790
* Avoid generating additional destructor(s) for initialized constructedFariborz Jahanian2009-11-111-0/+3
| | | | | | objects. llvm-svn: 86778
* Introduce a new representation for template templateDouglas Gregor2009-11-1115-229/+392
| | | | | | | | | | | | | | | | | | | | | | | | | parameters. Rather than storing them as either declarations (for the non-dependent case) or expressions (for the dependent case), we now (always) store them as TemplateNames. The primary change here is to add a new kind of TemplateArgument, which stores a TemplateName. However, making that change ripples to every switch on a TemplateArgument's kind, also affecting TemplateArgumentLocInfo/TemplateArgumentLoc, default template arguments for template template parameters, type-checking of template template arguments, etc. This change is light on testing. It should fix several pre-existing problems with template template parameters, such as: - the inability to use dependent template names as template template arguments - template template parameter default arguments cannot be instantiation However, there are enough pieces missing that more implementation is required before we can adequately test template template parameters. llvm-svn: 86777
* StringRefify some PCH interfaces.Daniel Dunbar2009-11-112-31/+24
| | | | llvm-svn: 86775
* Replace startsWith functions with StringRef.Daniel Dunbar2009-11-111-25/+4
| | | | llvm-svn: 86774
* Stub out most of the VTT building code. WIP.Mike Stump2009-11-111-2/+83
| | | | llvm-svn: 86772
* Create a new Scope when parsing a declaration with a C++ scope specifier.John McCall2009-11-111-3/+0
| | | | llvm-svn: 86764
* Add Diagnostic::Report method for reporting diagnostics without a location.Daniel Dunbar2009-11-102-7/+5
| | | | llvm-svn: 86760
* PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.Daniel Dunbar2009-11-101-3/+3
| | | | llvm-svn: 86757
* Diagnose illegally typed operator new/new[].Fariborz Jahanian2009-11-101-2/+21
| | | | llvm-svn: 86755
* Attach location info with llvm.dbg.declare.Devang Patel2009-11-101-1/+4
| | | | llvm-svn: 86750
* Add FIXIT hint for -Wsemicolon-before-method-bodyTed Kremenek2009-11-101-2/+4
| | | | llvm-svn: 86746
* Revert r86741; it doesn't handle virtual bases correctly.Eli Friedman2009-11-101-11/+9
| | | | llvm-svn: 86745
* Minor optimization to skip null check in generated code where it isn'tEli Friedman2009-11-101-9/+11
| | | | | | necessary. llvm-svn: 86741
* Fix for PR5454: make sure to use the right block as the predecessor in theEli Friedman2009-11-101-0/+1
| | | | | | generated PHI node for the null check of a new operator. llvm-svn: 86738
* Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses ↵Ted Kremenek2009-11-101-1/+1
| | | | | | <rdar://problem/7381735>. llvm-svn: 86731
* Silence warning.Benjamin Kramer2009-11-101-1/+1
| | | | llvm-svn: 86719
* Improve parsing of template arguments to lay the foundation forDouglas Gregor2009-11-1011-93/+157
| | | | | | | | | | | | | | | | | | | | | | handling template template parameters properly. This refactoring: - Parses template template arguments as id-expressions, representing the result of the parse as a template name (Action::TemplateTy) rather than as an expression (lame!). - Represents all parsed template arguments via a new parser-specific type, ParsedTemplateArgument, which stores the kind of template argument (type, non-type, template) along with all of the source information about the template argument. This replaces an ad hoc set of 3 vectors (one for a void*, which was either a type or an expression; one for a bit telling whether the first was a type or an expression; and one for a single source location pointing at the template argument). - Moves TemplateIdAnnotation into the new Parse/Template.h. It never belonged in the Basic library anyway. llvm-svn: 86708
* Changed a variable name to match what it representsFariborz Jahanian2009-11-101-3/+3
| | | | | | (Ted's feedback). llvm-svn: 86702
* This patch implements Code gen. for destruction ofFariborz Jahanian2009-11-102-8/+68
| | | | | | global array of objects. llvm-svn: 86701
* Only generate a VTT for classes that need a VTT.Mike Stump2009-11-101-0/+4
| | | | llvm-svn: 86699
* Localize -disable-llvm-optzns handling to BackendConsumer::CreatePasses.Daniel Dunbar2009-11-101-8/+15
| | | | | | | | | | | - This is conceptually better since the only thing we want this option to do is preserve the internal module as constructed by IRgen, before running any passes. - This also fixes bugs in -disable-llvm-optzns handling with regards to debug info. llvm-svn: 86691
* Fix a similar problem with qualified lookup through using directives,John McCall2009-11-101-1/+1
| | | | | | | although in this case we probably just run a risk of duplicating work; I can't think of how this could cause a bug. llvm-svn: 86680
* Make a somewhat more convincing test case for unqualified lookup throughJohn McCall2009-11-101-1/+2
| | | | | | | | | using directives, and fix a bug thereby exposed: since we're playing tricks with pointers, we need to make certain we're always using the same pointers for things. Also tweak an existing error message. llvm-svn: 86679
* Ignore parentheses when check the type of the expr.Zhongxing Xu2009-11-101-1/+1
| | | | llvm-svn: 86677
* SizeofPointerChecker: Many false positives have the form 'sizeof *p'. Zhongxing Xu2009-11-101-1/+9
| | | | | | | | This is reasonable because people know what they are doing when they intentionally dereference the pointer. So now we only emit warning when a pointer variable is use literally. llvm-svn: 86673
* Add vtable caching to prevent multiple vtables for the same class fromMike Stump2009-11-105-24/+41
| | | | | | | | being generated. Add the most derived vtable pointer to the VTT. llvm-svn: 86671
* Fix unqualified lookup through using directives.John McCall2009-11-101-83/+168
| | | | | | This is a pretty minimal test case; I'll make a better one later. llvm-svn: 86669
* When trying to assign a regular string literal to an Objective-C 'id' type ↵Anders Carlsson2009-11-101-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example: @class NSString; @interface Test + (void)test:(NSString *)string; @end void g(NSString *a); void f() { NSString *a = "Foo"; g("Foo"); [Test test:"Foo"]; } will produce t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *' NSString *a = "Foo"; ^~~~~ @ t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *' g("Foo"); ^~~~~ @ t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *' [Test test:"Foo"]; ^~~~~ @ 3 diagnostics generated. llvm-svn: 86665
* Now we can safely use the argument expression's source range.Zhongxing Xu2009-11-101-1/+1
| | | | llvm-svn: 86663
* SizeofPointerChecker: If an explicit type specifier is used, do not issue ↵Zhongxing Xu2009-11-101-0/+5
| | | | | | warnings. llvm-svn: 86662
* Use PP.getLocForEndOfToken as suggested by John.Anders Carlsson2009-11-101-2/+2
| | | | llvm-svn: 86661
* Use the source range of the whole sizeof expression, otherwise it crashes whenZhongxing Xu2009-11-101-1/+1
| | | | | | the argument is not an expression. llvm-svn: 86660
* If a function with a default argument is redefined and the new function also ↵Anders Carlsson2009-11-101-1/+10
| | | | | | has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444. llvm-svn: 86659
* Refine PointerSubChecker: compare the base region instead of the original Zhongxing Xu2009-11-102-3/+27
| | | | | | region, so that arithmetic within a memory chunk is allowed. llvm-svn: 86652
* Be sure to clear out VCall when we clear out VCalls.Mike Stump2009-11-102-0/+42
| | | | | | Start implementing VTTs. WIP. llvm-svn: 86650
* Rename: StripCasts describes what it does better. Zhongxing Xu2009-11-107-9/+9
| | | | | | getBaseRegion will be used in another method. llvm-svn: 86649
* Finish off mangling for the VTT.Mike Stump2009-11-101-0/+8
| | | | llvm-svn: 86647
* Add mangling for the construction vtable.Mike Stump2009-11-102-0/+25
| | | | llvm-svn: 86643
* Fix clang's use of DenseMap iterators after r86636 fixed their constness.Jeffrey Yasskin2009-11-106-6/+6
| | | | | | Patch by Victor Zverovich! llvm-svn: 86638
* Switch to getFileOrSTDIN().Daniel Dunbar2009-11-101-4/+1
| | | | llvm-svn: 86632
* Move all of the type-printing logic to its own C++ source fileDouglas Gregor2009-11-104-665/+723
| | | | llvm-svn: 86629
* Privatize InitHeaderSearch, this functionality is only exposed viaDaniel Dunbar2009-11-091-2/+61
| | | | | | ApplyHeaderSearchOptions now. llvm-svn: 86617
OpenPOWER on IntegriCloud