summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Patch for PR 7409 - only error on definition of invalid typedefs. Suppress ↵Richard Trieu2011-05-071-3/+7
| | | | | | errors for additional uses of this invalid typedef. llvm-svn: 131043
* Implement a minor optimization by not introducing declarations intoDouglas Gregor2011-05-061-4/+4
| | | | | | DeclContext's lookup table when they aren't in any identifier namespace. llvm-svn: 131037
* When checking for a prior declaration of the name of a namespace, skipDouglas Gregor2011-05-061-4/+15
| | | | | | | | any names that aren't in the appropriate identifier namespaces. Fixes an embarrassing bug where we give a redefinition error due to an Objective-C category (<rdar://problem/9388207>). llvm-svn: 131036
* In ms_struct structs, Establish a new alignment for a Fariborz Jahanian2011-05-061-3/+7
| | | | | | non-bitfield following a bitfield if size of their types differ. llvm-svn: 131032
* Establish a new alignment for an ms_struct bitfield followingFariborz Jahanian2011-05-062-1/+16
| | | | | | a non-bitfield if size of their types differ. llvm-svn: 131023
* Keep track of the file ID corresponding to the original file used toDouglas Gregor2011-05-062-6/+18
| | | | | | | | | | | build a precompiled header. Use this information to eliminate the call to SourceManager::getLocation() while loading a precompiled preamble, since SourceManager::getLocation() itself causes unwanted deserialization. Fixed <rdar://problem/9399352>. llvm-svn: 131021
* Fix false positive warning about uninitialized variable.Cameron Esfahani2011-05-061-1/+1
| | | | llvm-svn: 131019
* Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.Alexis Hunt2011-05-064-29/+28
| | | | llvm-svn: 131018
* Add support for Microsoft __if_exists and __if_not_exists construct inside ↵Francois Pichet2011-05-062-0/+85
| | | | | | | | | | | | function definition. Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols. More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx Support at class and namespace scopes will be added later. llvm-svn: 131014
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-0617-38/+44
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Don't emit nsw flags for vector operations; there's basically no benefit, ↵Eli Friedman2011-05-061-7/+4
| | | | | | and a lot of downside (like PR9850, which is about clang's xmmintrin.h making an unexpected transformation on an expression involving _mm_add_epi32). llvm-svn: 131000
* Add an implementation of thunks for varargs methods. The implementation is ↵Eli Friedman2011-05-063-46/+153
| | | | | | a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 . llvm-svn: 130993
* Introduce a new libclang parsing flag,Douglas Gregor2011-05-065-9/+25
| | | | | | | | | | | | | CXTranslationUnit_NestedMacroInstantiations, which indicates whether we want to see "nested" macro instantiations (e.g., those that occur inside other macro instantiations) within the detailed preprocessing record. Many clients (e.g., those that only care about visible tokens) don't care about this information, and in code that uses preprocessor metaprogramming, this information can have a very high cost. Addresses <rdar://problem/9389320>. llvm-svn: 130990
* Reset the emitted initializers.Axel Naumann2011-05-061-0/+2
| | | | | | This enables incremental codegen, where the initializer array can be removed from the module, such that only new initializers will be emitted and run. llvm-svn: 130986
* Move logic for passing down -mrelax-all / -relax-all into a commonJoerg Sonnenberger2011-05-061-14/+37
| | | | | | | | function. Extend the logic to check if the input was compiled. Use -relax-all as default only if -O0 is used for compilation. Fixes bug 9290. llvm-svn: 130983
* Warn when trying to call a pure virtual member function in a class from the ↵Anders Carlsson2011-05-061-0/+13
| | | | | | class constructor/destructor. Fixes PR7966. llvm-svn: 130982
* Rename ContainsCompileAction to ContainsCompileOrAssembleAction toJoerg Sonnenberger2011-05-061-5/+5
| | | | | | properly reflect its behavior. llvm-svn: 130981
* Do defaulted constructors properly.Alexis Hunt2011-05-064-13/+72
| | | | | | | | Explictly defaultedness is correctly reflected on the AST, but there are no changes to how that affects the definition of functions or much else really. llvm-svn: 130974
* Revert r130912 in order to approach defaulted functions from the otherAlexis Hunt2011-05-067-39/+11
| | | | | | | direction and not introduce things in the wrong place three different times. llvm-svn: 130968
* Slight tweak to alias template error handling: don't guess that a ↵Richard Smith2011-05-051-1/+2
| | | | | | template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic. llvm-svn: 130961
* type of last arg of objc_assign_ivar is ptrdiff_t. Fariborz Jahanian2011-05-051-1/+5
| | | | | | // rdar://9362887 llvm-svn: 130956
* Implement support for C++0x alias templates.Richard Smith2011-05-0524-114/+478
| | | | llvm-svn: 130953
* __alignof attribute on the field must considerFariborz Jahanian2011-05-051-0/+4
| | | | | | packed attribute on the field. //rdar://9217290 llvm-svn: 130948
* PR9849: Fix _mm_setr_pi32 and friends to actually work correctly. They ↵Eli Friedman2011-05-051-4/+4
| | | | | | broke with the MMX rewrite a while back. llvm-svn: 130945
* When instantiating a block expression, the instantiatedFariborz Jahanian2011-05-051-2/+5
| | | | | | | blockScopeInfo's CapturesCXXThis field need get set as well. // rdar://9362021. John M. please review. llvm-svn: 130930
* Do not drop uint128 on the floor.Devang Patel2011-05-051-0/+2
| | | | llvm-svn: 130929
* Scoped enumerations should not be treated as integer types (in the CDouglas Gregor2011-05-051-3/+3
| | | | | | | | sense). Fixes <rdar://problem/9366066> by eliminating an inconsistency between C++ overloading (which handled scoped enumerations correctly) and C binary operator type-checking (which didn't). llvm-svn: 130924
* When providing code completions for an Objective-C property access,Douglas Gregor2011-05-051-13/+61
| | | | | | | also include methods with zero-argument selectors. Implements <rdar://problem/9048332>. llvm-svn: 130922
* Introduce a Diagnostic::Report function that accepts and emits a ↵Argyrios Kyrtzidis2011-05-051-0/+41
| | | | | | StoredDiagnostic. llvm-svn: 130919
* Add Checker callback for running a checker at the end of processing an ↵Ted Kremenek2011-05-052-0/+17
| | | | | | entire TranslationUnit. Patch by Lei Zhang. llvm-svn: 130913
* Implement some framework for defaulted constructors.Alexis Hunt2011-05-057-11/+39
| | | | | | There's some unused stuff for now. llvm-svn: 130912
* Frontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.Daniel Dunbar2011-05-051-2/+2
| | | | llvm-svn: 130909
* Look through block pointers and ObjC object pointersMatt Beaumont-Gay2011-05-051-4/+3
| | | | llvm-svn: 130906
* With invalid overloaded operators, we can get into funny cases whereDouglas Gregor2011-05-051-0/+9
| | | | | | | | | | the overloading of member and non-member functions results in arity mismatches that don't fit well into our overload-printing scheme. This only happens for invalid code (which breaks the arity invariants for these cases), so just suppress the diagnostic rather than inventing anything new. Fixes <rdar://problem/9222009>. llvm-svn: 130902
* Preserve the full name of the file, so that '-c -o foo.pic.o' producesNick Lewycky2011-05-054-15/+11
| | | | | | foo.pic.gcno instead of foo.gcno. llvm-svn: 130899
* Change cycle detection to be based off of a warning flag.Alexis Hunt2011-05-053-9/+6
| | | | llvm-svn: 130898
* When adding KVC code completions, keep track of all of the selectorsDouglas Gregor2011-05-041-23/+30
| | | | | | | that we've previously seen, both in declared methods and from previous KVC completions, to eliminate duplicates. Fixes <rdar://problem/9162207>. llvm-svn: 130890
* there i fixed itAlexis Hunt2011-05-043-50/+120
| | | | | | | | | Increase robustness of the delegating constructor cycle detection mechanism. No more infinite loops on invalid or logic errors leading to false results. Ensure that this is maintained correctly accross serialization. llvm-svn: 130887
* ASTUnit::LoadFromASTFile(): recover the resources from an ASTReader if it ↵Ted Kremenek2011-05-041-0/+10
| | | | | | crashes during PCH validation. llvm-svn: 130886
* Clean up Sema::BuildCXXNestedNameSpecifier()'s creation of TypeLocDouglas Gregor2011-05-041-7/+15
| | | | | | | | information. Rather than looking at the declaration kind to figure out what TypeLoc to build, look at the type; it makes so much more sense. Fixes <rdar://problem/9086649>. llvm-svn: 130882
* Implement Sema::isExprCallable.Matt Beaumont-Gay2011-05-042-107/+139
| | | | | | | | We can use this to produce nice diagnostics (and try to fixit-and-recover) in various cases where we might see "MyFunction" instead of "MyFunction()". The changes in SemaExpr are an example of how to use isExprCallable. llvm-svn: 130878
* When converting an integral template argument value to a non-typeDouglas Gregor2011-05-041-15/+22
| | | | | | | template parameter of type 'bool', force the value to be zero or one. Fixes <rdar://problem/9169404>. llvm-svn: 130873
* Pack ivar offsets together.Bill Wendling2011-05-041-1/+1
| | | | | | | | | | Ivar offsets for synthesized ivars are wrong, which could end up with a large number of dirty pages because of ivar fixups at runtime. When we pack all of the synthesized ivars into the same section, it limits the number of dirty pages created. Place them in the "__DATA,__objc_ivar" section. <rdar://problem/9374905> llvm-svn: 130870
* Record where the GCOV data files should be placed.Nick Lewycky2011-05-044-0/+37
| | | | llvm-svn: 130866
* Simplification noticed by Chris.Bill Wendling2011-05-041-3/+2
| | | | llvm-svn: 130864
* More ms_struct bitfield stuff:Fariborz Jahanian2011-05-042-1/+33
| | | | | | | | Adjacent bit fields are packed into the same 1-, 2-, or 4-byte allocation unit if the integral types are the same size. // rdar://8823265. llvm-svn: 130851
* From Vassil Vassilev:Axel Naumann2011-05-041-0/+2
| | | | | | Like in r126648, provide (empty) default implementation for pure virtual getMemoryBufferSizes(). Not all use cases have meaningful implementations. llvm-svn: 130838
* Add C++ include paths for libstdc++ with Ubuntu 11.04 and Debian's ↵Axel Naumann2011-05-041-0/+10
| | | | | | | | libstdc++6-4.5, as collected from http://packages.ubuntu.com/search?mode=exactfilename&suite=natty&section=all&arch=any&searchon=contents&keywords=c%2B%2Blocale.h and http://packages.debian.org/wheezy/armel/libstdc++6-4.5-dev/filelist Fixes compilation with clang++ on Ubuntu 11.04. llvm-svn: 130837
* Implement a better version of delegating constructor cycle detection.Alexis Hunt2011-05-043-20/+65
| | | | | | | | | | | | | This is more efficient as it's all done at once at the end of the TU. This could still get expensive, so a flag is provided to disable it. As an added bonus, the diagnostics will now print out a cycle. The PCH test is XFAILed because we currently can't deal with a note emitted in the header and I, being tired, see no other way to verify the serialization of delegating constructors. We should probably address this problem /somehow/ but no good solution comes to mind. llvm-svn: 130836
* No, fix this use after free properly.Nick Lewycky2011-05-041-3/+2
| | | | llvm-svn: 130833
OpenPOWER on IntegriCloud