summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Support C++11 attributes at the start of a parameter-declaration.Richard Smith2012-04-112-10/+20
| | | | llvm-svn: 154476
* [libclang] If displayDiagnostics is set (when calling clang_createIndex), ↵Argyrios Kyrtzidis2012-04-111-24/+44
| | | | | | | | | | | | | make sure to output the errors that occurred even if we did not get an AST (e.g. because the PCH failed to load). Also honor displayDiagnostics in clang_indexSourceFile(). rdar://11203489 llvm-svn: 154472
* [analyzer] Don't crash even when the system functions are redefined.Anna Zaks2012-04-103-7/+72
| | | | | | | | | | (Applied changes to CStringAPI, Malloc, and Taint.) This might almost never happen, but we should not crash even if it does. This fixes a crash on the internal analyzer buildbot, where postgresql's configure was redefining memmove (radar://11219852). llvm-svn: 154451
* AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix savingRichard Smith2012-04-103-23/+29
| | | | | | | of an uninitialized Stmt* in serialization of __atomic_init and add a test of atomics serialization. llvm-svn: 154448
* modern objective-c translation: writing containerFariborz Jahanian2012-04-101-11/+23
| | | | | | subscripting. // rdar://11203853 llvm-svn: 154441
* [analyzer] dynamic_cast: Better model cast from a reference.Anna Zaks2012-04-102-13/+16
| | | | | | | Generate a sink when the dynamic_cast from a reference fails to represent a thrown exception. llvm-svn: 154438
* [analyzer] Add support for C++ dynamic_cast.Anna Zaks2012-04-102-5/+129
| | | | | | Simulate the C++ dynamic_cast in the analyzer. llvm-svn: 154434
* When we determine that an initialization sequence failed due to anDouglas Gregor2012-04-101-3/+3
| | | | | | | | incomplete type, keep track of the actual type that was incomplete. Otherwise, we might fail to produce a diagnostic. Fixes PR12498. llvm-svn: 154432
* Improve the printing of __PRETTY_FUNCTION__ more provide moreDouglas Gregor2012-04-101-9/+69
| | | | | | information and more closely match GCC's, from Nikola Smiljanic! llvm-svn: 154430
* Add a query macro for C++11 N3276, decltype does not require completeDouglas Gregor2012-04-101-0/+1
| | | | | | return types, from Michel Morin! llvm-svn: 154428
* Improve diagnostics in C++11 when a non-type template argument for aDouglas Gregor2012-04-101-2/+27
| | | | | | non-type template parameter of pointer type is not a constant expression. llvm-svn: 154424
* Include the Objective-C parameter- and return-passing qualifiers whenDouglas Gregor2012-04-101-5/+15
| | | | | | | providing code completions for Objective-C method declarations. Fixes <rdar://problem/11164498>. llvm-svn: 154421
* For debug and coverage analysis if we're not optimizing go aheadEric Christopher2012-04-101-1/+1
| | | | | | | | | and emit a relatively empty block for a plain break statement. This enables us to track where we went through a switch. PR9796 & rdar://11215207 llvm-svn: 154420
* Don't include the ':' following code-completion suggestions forDouglas Gregor2012-04-101-3/+6
| | | | | | | 'public', 'private', or 'protected', unless code completion patterns are enabled. Fixes <rdar://problem/11189132>. llvm-svn: 154413
* objective-c: remove IsConstProperty as it does notFariborz Jahanian2012-04-101-17/+1
| | | | | | | seem to get called any more. Also add an assert in isModifiableLvalue. llvm-svn: 154410
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-103-98/+200
| | | | | | | | | | | | | | | | | | | code-completion related strings specific to a translation unit (ASTContext and related data) CodeCompletionAllocator does such limited caching, by caching the name assigned to a DeclContext*, but that is not the appropriate place since that object has a lifetime that can extend beyond that of an ASTContext. Introduce CodeCompletionTUInfo which will be always tied to a translation unit to do this kind of caching and move the caching of CodeCompletionAllocator into this object, and propagate it to all the places where it will be needed. The plan is to extend the caching where appropriate, using CodeCompletionTUInfo, to avoid re-calculating code-completion strings. Part of rdar://10796159. llvm-svn: 154408
* Rework implementation of null non-type template arguments based onDouglas Gregor2012-04-101-118/+154
| | | | | | | Richard's feedback, to properly catch non-constant expressions and type mismatches. Finishes <rdar://problem/11193097>. llvm-svn: 154407
* objective-c: add an assertion for propertyFariborz Jahanian2012-04-101-0/+5
| | | | | | expression enterring IsConstProperty function. llvm-svn: 154406
* Fix GCC's pedantic return-type warning -- this enum is fully covered.Chandler Carruth2012-04-101-0/+1
| | | | llvm-svn: 154399
* Don't link lib[std]c++ when -nostdlib is specified (Solaris driver).David Chisnall2012-04-101-2/+2
| | | | | | Patch by Dmitri Shubin! llvm-svn: 154392
* Pass -march, -mcpu, -mfpu to linuxtools assembler.Evgeniy Stepanov2012-04-101-0/+4
| | | | llvm-svn: 154389
* Express the number of ULPs in fpaccuracy metadata as a real rather than a Duncan Sands2012-04-103-10/+6
| | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. llvm-svn: 154388
* EmitStopPoint already checks if we have debug info.Eric Christopher2012-04-101-1/+1
| | | | llvm-svn: 154384
* Tidy.Eric Christopher2012-04-101-2/+2
| | | | llvm-svn: 154383
* Parsing of C++11 attributes:Richard Smith2012-04-103-33/+74
| | | | | | | | | | * Alternative tokens (such as 'compl') are treated as identifiers in attribute names. * An attribute-list can start with a comma. * An ellipsis may not be used with either of our currently-supported C++11 attributes. llvm-svn: 154381
* Disambiguation of '[[':Richard Smith2012-04-107-122/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * In C++11, '[[' is ill-formed unless it starts an attribute-specifier. Reject array sizes and array indexes which begin with a lambda-expression. Recover by parsing the lambda as a lambda. * In Objective-C++11, either '[' could be the start of a message-send. Fully disambiguate this case: it turns out that the grammars of message-sends, lambdas and attributes do not actually overlap. Accept any occurrence of '[[' where either '[' starts a message send, but reject a lambda in an array index just like in C++11 mode. Implement a couple of changes to the attribute wording which occurred after our attributes implementation landed: * In a function-declaration, the attributes go after the exception specification, not after the right paren. * A reference type can have attributes applied. * An 'identifier' in an attribute can also be a keyword. Support for alternative tokens (iso646 keywords) in attributes to follow. And some bug fixes: * Parse attributes after declarator-ids, even if they are not simple identifiers. * Do not accept attributes after a parenthesized declarator. * Accept attributes after an array size in a new-type-id. * Partially disamiguate 'delete' followed by a lambda. More work is required here for the case where the lambda-introducer is '[]'. llvm-svn: 154369
* objective-c modern translator: rewriting specificFariborz Jahanian2012-04-101-0/+22
| | | | | | | implicit casts which is needed to produce good c++ code. // rdar://11202764 llvm-svn: 154360
* Fix an annoying little bug I found while debugging another LTO issue. GoldRafael Espindola2012-04-091-6/+9
| | | | | | | | | requires the -plugin to come before any -plugin-opt options, we were passing them the other way around. With this one can run (for example): clang -o foo foo.c -O4 -Wl,-plugin-opt=generate-api-file llvm-svn: 154357
* My original patch missed the virtual-base case for destroyingJohn McCall2012-04-091-2/+3
| | | | | | | | | | | | base-class subojects. Incidentally, thinking about virtual bases makes it clear to me that we're not appropriately computing the access to the virtual base's member because we're not computing the best possible access to the virtual base at all; in fact, we're basically assuming it's public. I'll file a separate PR about that. llvm-svn: 154346
* Fix the access check performed as part of the determination of whetherJohn McCall2012-04-092-2/+46
| | | | | | | | to define a special member function as deleted so that it properly establishes an object context for the accesses to the base subobject members. llvm-svn: 154343
* objective-c: remove -fobjc-default-synthesize-properties from the driver.Fariborz Jahanian2012-04-091-2/+1
| | | | | | | cc1 option remains though to invoke default property synthesis. // rdar://11209719 llvm-svn: 154334
* objective-c: Remove -fno-objc-default-synthesize-propertiesFariborz Jahanian2012-04-091-3/+2
| | | | | | | as the driver option. // rdar://11209719 llvm-svn: 154331
* Fixes a fix to finding the current directory:Manuel Klimek2012-04-091-1/+4
| | | | | | | | We currently want to look whether PWD is available - if PWD is available it will get us the non-resolved current path, while fs::current_path will resolve symlinks. The long term fix is to not rely on that behavior any more. llvm-svn: 154330
* Revert r154321, pending more discussion.David Chisnall2012-04-093-22/+0
| | | | llvm-svn: 154327
* Fix bugs found by -Wconstant-conversion improvements currently under review.David Blaikie2012-04-094-25/+20
| | | | | | | | | | | | | | | | | | Specifically, using a an integer outside [0, 1] as a boolean constant seems to be an easy mistake to make with things like "x == a || b" where the author intended "x == a || x == b". The bug caused by calling SkipUntil with three token kinds was also identified by a VC diagnostic & reported by Francois Pichet as review feedback for my commit r154163. I've included test cases to verify the error recovery that was broken/poorly implemented due to this bug. The other fix (lib/Sema/SemaExpr.cpp) seems like that code was never actually reached in any of Clang's tests & is related to Objective C features I'm not familiar with, so I've not been able to construct a test case for it. Perhaps someone else can. llvm-svn: 154325
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-093-0/+22
| | | | | | for hooking in code flow visualisation applications. llvm-svn: 154321
* Factor out ARM floating ABI determination to new routine Anton Korobeynikov2012-04-091-35/+44
| | | | llvm-svn: 154318
* Make a modern Objective-C runtime the default target for *BSD. Don't yet ↵David Chisnall2012-04-091-0/+30
| | | | | | change this on GNU/Linux, where the GCC runtime still tends to be used. llvm-svn: 154315
* Wire up -fpie and -fPIE to LLVM's newly added TargetOptions. No testChandler Carruth2012-04-081-0/+1
| | | | | | | | | | | case as we don't currently have any way of dumping target options or otherwise observing this. Another small step toward fixing PR12380. With this we generate TLS accesses using the static model instead of the dynamic model, but we're still generating suboptimal code under the mistaken assumption that the TLS offset might be greater than 2^32, and therefor not viable as an immediate offset of a segment register. llvm-svn: 154298
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-084-19/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. llvm-svn: 154291
* Don't forget to evaluate the subexpression in a null pointer cast. If we'reRichard Smith2012-04-081-0/+2
| | | | | | converting from std::nullptr_t, the subexpression might have side-effects. llvm-svn: 154278
* ext_reserved_user_defined_literal must not default to Error in ↵Francois Pichet2012-04-071-1/+3
| | | | | | | | MicrosoftMode. Hence create ext_ms_reserved_user_defined_literal that doesn't default to Error; otherwise MSVC headers won't parse. Fixes PR12383. llvm-svn: 154273
* MIPS: Pass -mabi option to the assmbler when compile MIPS targets.Simon Atanasyan2012-04-071-10/+14
| | | | llvm-svn: 154270
* MIPS: Move code calculates CPU and ABI names to the separate function to ↵Simon Atanasyan2012-04-071-13/+21
| | | | | | reuse this function later. llvm-svn: 154269
* Fix several problems with protected access control:John McCall2012-04-074-52/+153
| | | | | | | | | | | | | | | | | | | | | - The [class.protected] restriction is non-trivial for any instance member, even if the access lacks an object (for example, if it's a pointer-to-member constant). In this case, it is equivalent to requiring the naming class to equal the context class. - The [class.protected] restriction applies to accesses to constructors and destructors. A protected constructor or destructor can only be used to create or destroy a base subobject, as a direct result. - Several places were dropping or misapplying object information. The standard could really be much clearer about what the object type is supposed to be in some of these accesses. Usually it's easy enough to find a reasonable answer, but still, the standard makes a very confident statement about accesses to instance members only being possible in either pointer-to-member literals or member access expressions, which just completely ignores concepts like constructor and destructor calls, using declarations, unevaluated field references, etc. llvm-svn: 154248
* [driver] In general, the driver claims redundant args and uses the last arg.Chad Rosier2012-04-071-0/+1
| | | | | | | | However, the '-x' option has special handling and wasn't following this paradigm. Fix it to do so by claiming the arg as we parse the '-x' option. rdar://11203340 llvm-svn: 154231
* Remove "parse error" in favor of more descriptive diagnostics.David Blaikie2012-04-062-9/+4
| | | | | | | | | | | In a few cases clang emitted a rather content-free diagnostic: 'parse error'. This change replaces two actual cases (template parameter parsing and K&R parameter declaration parsing) with more specific diagnostics and removes a third dead case of this in the BalancedDelimiterTracker (the ctor already checked the invariant necessary to ensure that the diag::parse_error was never actually used). llvm-svn: 154224
* Implement support for null non-type template arguments for non-typeDouglas Gregor2012-04-0611-60/+157
| | | | | | | template parameters of pointer, pointer-to-member, or nullptr_t type in C++11. Fixes PR9700 / <rdar://problem/11193097>. llvm-svn: 154219
* modern objective-c translation: support for Fariborz Jahanian2012-04-061-7/+190
| | | | | | dictionary literals. This concludes // rdar://10803676 llvm-svn: 154218
* Rework ExprEngine::evalLoad and clients (e.g. VisitBinaryOperator) so that ↵Ted Kremenek2012-04-065-51/+72
| | | | | | | | | | | | | | | | | | when we generate a new ExplodedNode we use the same Expr* as the one being currently visited. This is preparation for transitioning to having ProgramPoints refer to CFGStmts. This required a bit of trickery. We wish to keep the old Expr* bindings in the Environment intact, as plenty of logic relies on it and there is no reason to change it, but we sometimes want the Stmt* for the ProgramPoint to be different than the Expr* being used for bindings. This requires adding an extra argument for some functions (e.g., evalLocation). This looks a bit strange for some clients, but it will look a lot cleaner when were start using CFGStmt* in the appropriate places. As some fallout, the diagnostics arrows are a bit difference, since some of the node locations have changed. I have audited these, and they look reasonable. llvm-svn: 154214
OpenPOWER on IntegriCloud