summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* SourceManager: Vectorize ComputeLineNumbers for SSE2.Benjamin Kramer2012-04-061-2/+39
| | | | | | | | | | | | | | | | This method is very hot, it is called when emitting diagnostics, in -E mode and for many #pragma handlers. It scans through the whole source file to count newlines, records and caches them in a vector. The speedup from vectorization isn't very large, as we fall back to bytewise scanning when we hit a newline. There might be a way to avoid leaving the sse loop but everything I tried didn't work out because a call to push_back clobbers xmm registers. About 2% speedup on average on "clang -E > /dev/null" of all .cpp files in clang's lib/Sema. llvm-svn: 154204
* MIPS: Provide a correct path to the dynamic linker when build for MIPS ↵Simon Atanasyan2012-04-061-0/+3
| | | | | | 64-bit targets. llvm-svn: 154200
* Thread safety analysis: downgraded requirement that mutex expressions refer ↵DeLesley Hutchins2012-04-061-21/+17
| | | | | | to a lockable type from error to warning. llvm-svn: 154198
* modern objective-c translator: translate array literalFariborz Jahanian2012-04-061-15/+67
| | | | | | expressions. // rdar://10803676 llvm-svn: 154196
* MIPS: Pass -EB/-EL argument to the assembler according to selected endian ↵Simon Atanasyan2012-04-061-0/+6
| | | | | | when compile for MIPS targets. llvm-svn: 154195
* [analyzer] Check that the arguments to NSOrderedSet creation methods are ↵Jordy Rose2012-04-061-0/+12
| | | | | | | | valid ObjC objects. Patch by Sean McBride! llvm-svn: 154194
* Use atexit when __cxa_atexit isn't available instead of adding aJohn McCall2012-04-061-26/+98
| | | | | | | | | global destructor entry. For some reason this isn't enabled for apple-kexts; it'd be good to have documentation for that. Based on a patch by Nakamura Takumi! llvm-svn: 154191
* Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.John McCall2012-04-062-6/+6
| | | | llvm-svn: 154190
* Fix a Sema invariant bug that I recently introduced involvingJohn McCall2012-04-062-2/+11
| | | | | | | | | the template instantiation of statement-expressions. I think it was jyasskin who had a crashing testcase in this area; hopefully this fixes it and he can find his testcase and check it in. llvm-svn: 154189
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-064-1/+51
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Fix using Clang as a cross compiler installed on a host machine and notChandler Carruth2012-04-061-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inside of a sysroot targeting a system+sysroot which is "similar" or "compatible" with the host system. This shows up when trying to build system images on largely compatible hardware as-if fully cross compiled. The problem is that previously we *perfectly* mimiced GCC here, and it turns out GCC has a bug that no one has really stumbled across. GCC will try to look in thy system prefix ('/usr/local' f.ex.) into which it is instaled to find libraries installed along side GCC that should be preferred to the base system libraries ('/usr' f.ex.). This seems not unreasonable, but it has a very unfortunate consequence when combined with a '--sysroot' which does *not* contain the GCC installation we're using to complete the toolchain. That results in some of the host system's library directories being searched during the link. Now, it so happens that most folks doing stuff like this use '--with-sysroot' and '--disable-multilib' when configuring GCC. Even better, they're usually not cross-compiling to a target that is similar to the host. As a result, searching the host for libraries doesn't really matter -- most of the time weird directories get appended that don't exist (no arm triple lib directory, etc). Even if you're cross-compiling from 32-bit to 64-bit x86 or vice-versa, disabling multilib makes it less likely that you'll actually find viable libraries on the host. But that's just luck. We shouldn't rely on this, and this patch disables looking in the system prefix containing the GCC installation if that system prefix is *outside* of the sysroot. For empty sysroots, this has no effect. Similarly, when using the GCC *inside* of the sysroot, we still track wherever it is installed within the sysroot and look there for libraries. But now we can use a cross compiler GCC installation outside the system root, and only look for the crtbegin.o in the GCC installation, and look for all the other libraries inside the system root. This should fix PR12478, allowing Clang to be used when building a ChromiumOS image without polluting the image with libraries from the host system. llvm-svn: 154176
* zext ivar offsets if required (GNU runtimes).David Chisnall2012-04-061-1/+4
| | | | llvm-svn: 154175
* Fixed scoping error for late parsed attributes in nested classes.DeLesley Hutchins2012-04-062-1/+25
| | | | llvm-svn: 154173
* Restrict fixit for missing 'class' in template template parameters.David Blaikie2012-04-061-15/+29
| | | | | | | | | | | Based on Doug's feedback to r153887 this omits the FixIt if the following token isn't syntactically valid for the context. (not a comma, '...', identifier, '>', or '>>') There's a bunch of work to handle the '>>' case, but it makes for a much more pleasant diagnostic in this case. llvm-svn: 154163
* Point the caret at the error for the 'expected namespace name' diagnostic inRichard Smith2012-04-051-1/+1
| | | | | | a namespace alias declaration. llvm-svn: 154138
* Implement C90 pedantic warning for duplicate declaration specifiers which ↵Eli Friedman2012-04-051-0/+20
| | | | | | are duplicated via a typedef. Patch by Tim Northover. llvm-svn: 154136
* Properly implement the C rules for composite types for qualified pointers in ↵Eli Friedman2012-04-051-11/+27
| | | | | | conditionals. Patch by Tim Northover. llvm-svn: 154134
* objective-c: Don't warn when a category does not implement a methodFariborz Jahanian2012-04-052-12/+14
| | | | | | | declared in its adopted protocol when another category declares it because that category will implement it. // rdar://11186449 llvm-svn: 154132
* Only emit the getter and setter names if they're not the defaultEric Christopher2012-04-051-5/+13
| | | | | | | | synthesized ones. Reasonable debug info size reduction for objc. rdar://11179756 llvm-svn: 154129
* Make the variant of __builtin_shufflevector that takes the shuffle indexes ↵Eli Friedman2012-04-051-3/+3
| | | | | | as a vector actually usable. Patch by David Neto. PR12465. llvm-svn: 154128
* Require that all static analyzer issues have a category. As part of this ↵Ted Kremenek2012-04-0513-20/+39
| | | | | | | | | | change, consolidate some commonly used category strings into global references (more of this can be done, I just did a few). Fixes <rdar://problem/11191537>. llvm-svn: 154121
* Move some MIPS target macro definitions from class Mips32TargetInfoBaseSimon Atanasyan2012-04-051-4/+4
| | | | | | | to the base class MipsTargetInfoBase. These macros are applicable for both 32/64-bits targets. llvm-svn: 154116
* [Lex] Add support for 'user specified system frameworks' (see test case).Daniel Dunbar2012-04-051-7/+30
| | | | | | - Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks. llvm-svn: 154105
* [Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the ↵Daniel Dunbar2012-04-051-13/+11
| | | | | | | | FrameworkMap items. - No functionality change. llvm-svn: 154104
* Simplify.Daniel Dunbar2012-04-051-2/+1
| | | | llvm-svn: 154103
* Improve & simplify diagnostic for missing 'class' in template template ↵David Blaikie2012-04-051-5/+3
| | | | | | | | parameter. Change suggested by Sebastian Redl on review feedback from r153887. llvm-svn: 154102
* Handle symbolicating a reference in an initializer expression that we don't ↵Ted Kremenek2012-04-051-1/+6
| | | | | | understand. llvm-svn: 154084
* Teach ObjCContainersChecker that the array passed to CFArrayGetValueAtIndex ↵Ted Kremenek2012-04-051-3/+6
| | | | | | might not be a symbolic value. llvm-svn: 154083
* Do not crash in the callgraph construction when encountering deleted ↵Ted Kremenek2012-04-051-1/+2
| | | | | | function definitions. Fixes <rdar://problem/11178609>. llvm-svn: 154081
* [analyzer] Move stats calculation out of AnalysisConsumer destructor.Anna Zaks2012-04-051-7/+8
| | | | | | | The ASTConsumer does not get deleted with clang --analyze (for performance reasons), we still want the diagnostics to work. llvm-svn: 154078
* [analyzer] Change warding in a path diagnostic:Anna Zaks2012-04-051-1/+1
| | | | | | | "No method actually called because receiver is nil" -> "No method is called because receiver is nil" llvm-svn: 154077
* [analyzer] Remove redundant if statement (pointed out by Ted).Anna Zaks2012-04-051-4/+0
| | | | llvm-svn: 154075
* Improve diagnostics for invalid use of non-static members / this:Richard Smith2012-04-051-19/+27
| | | | | | | | | | | | * s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted the former by 28-2 in our diagnostics. * Fix the "use of member in static member function" diagnostic to correctly detect this situation inside a block or lambda. * Produce a more specific "invalid use of non-static member" diagnostic for the case where a nested class member refers to a member of a lexically-surrounding class. llvm-svn: 154073
* Fix assertions and wrong output from StmtPrinter's string literal printing.Richard Smith2012-04-051-5/+46
| | | | | | | | | | String literals (including unicode ones) can contain non-Unicode codepoints if they were written using \x or similar. Write those out using \x, but be careful that the following character can't be misinterpreted as part of the \x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before rendering them. llvm-svn: 154069
* Allow a conversion from the empty initializer list {} to anDouglas Gregor2012-04-041-0/+10
| | | | | | | std::initializer_list<T> so long as <T> is known. This conversion has identity rank. llvm-svn: 154065
* Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.Nico Weber2012-04-041-1/+5
| | | | | | Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html llvm-svn: 154064
* [driver] When using the -mfpmath= option, add an error message when trying to Chad Rosier2012-04-041-3/+9
| | | | | | | enable neonfp on a CPU that doesn't support NEON. rdar://11108618 llvm-svn: 154061
* Test commit to check commit access.Simon Atanasyan2012-04-041-1/+0
| | | | llvm-svn: 154056
* Implement C++11 [temp.arg.nontype]'s permission to use the address of an objectRichard Smith2012-04-041-34/+40
| | | | | | or function with internal linkage as a non-type template argument. llvm-svn: 154053
* Fix an oversight: don't run ARC optimization cleanup at -O0.Dan Gohman2012-04-041-1/+2
| | | | llvm-svn: 154052
OpenPOWER on IntegriCloud