summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Comment parsing: actually check for a block command after "\param x"Dmitri Gribenko2013-01-261-6/+23
| | | | | | This fixes PR15068. llvm-svn: 173539
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-265-19/+60
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-258-3/+35
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* ARM says that the array cookie should always be eight bytes.John McCall2013-01-251-25/+21
| | | | | | | ARM is not thinking about over-aligned structures. Overrule ARM in both our generic-ARM and iOS ABI implementations. llvm-svn: 173531
* Move the decision about the kind of CGCXXABI to make insideJohn McCall2013-01-253-13/+25
| | | | | | the family-specific files. llvm-svn: 173530
* Improve coordination between the module manager and the global moduleDouglas Gregor2013-01-253-50/+71
| | | | | | | | | index, optimizing the operation that skips lookup in modules where we know the identifier will not be found. This makes the global module index optimization actually useful, providing an 8.5% speedup over modules without the global module index for -fsyntax-only. llvm-svn: 173529
* simplify code by removing excessive bracing.Fariborz Jahanian2013-01-251-20/+12
| | | | llvm-svn: 173521
* Attach enum's documentation to its typedef ifFariborz Jahanian2013-01-251-0/+10
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173516
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-2514-171/+293
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-2510-30/+63
| | | | llvm-svn: 173514
* Optimize ModuleManager::visit() by precomputing the visitation orderDouglas Gregor2013-01-251-65/+82
| | | | | | | | | | and limiting ourselves to two memory allocations. 10% speedup in -fsyntax-only time for modules. With this change, we can actually see some performance different from the global module index, but it's still about 1%. llvm-svn: 173512
* Silence unintended fallthrough diagnostic on a case label preceded with a ↵Alexander Kornienko2013-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | normal label. Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: case 1: ... goto label; ... } Reviewers: rsmith, doug.gregor Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D329 llvm-svn: 173486
* Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for ↵Alexander Kornienko2013-01-251-5/+10
| | | | | | multiple case labels. llvm-svn: 173458
* Fix some alignment and line break decisions.Daniel Jasper2013-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This combines two small changes: 1) Put a penalty on breaking after "<" 2) Only produce a hanging indent when parameters are separated by commas. Before: aaaaaaaaaaaaaaaaaaaaaaaa< aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa>(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); aaaaaa(new Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)); After: aaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa>( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); aaaaaa(new Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)); This changes one ObjC test, but AFAICT this is not according to any style guide (neither before nor after). We probably should be aligning on the ":" there according to: http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml?showone=Method_Invocations#Method_Invocations llvm-svn: 173457
* Lexer.cpp: Fix a warning with ptrdiff_t on i686. [-Wsign-compare]NAKAMURA Takumi2013-01-251-1/+1
| | | | llvm-svn: 173447
* Allow breaking after "::" if absolutely necessary.Daniel Jasper2013-01-251-4/+7
| | | | | | | | | | Otherwise, really long nested name specifiers can easily lead to a violation of the column limit. Not sure about the rules for indentation in those cases, so input is appreciated (see tests.). llvm-svn: 173438
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-8/+14
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* [Frontend] Remove another IsUserSpecified member variable that is now unused.Daniel Dunbar2013-01-253-18/+14
| | | | llvm-svn: 173412
* [Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.Daniel Dunbar2013-01-251-72/+63
| | | | llvm-svn: 173411
* [Frontend] The -iwithprefix option belongs in the After category, according toDaniel Dunbar2013-01-251-2/+2
| | | | | | | GCC docs. - Found by inspection. llvm-svn: 173410
* [Lex] Remove DirectoryLookup.UserSpecified, which is unused.Daniel Dunbar2013-01-252-5/+6
| | | | llvm-svn: 173409
* Serialization/GlobalModuleIndex.cpp: Fixup r173405, <cstdio>NAKAMURA Takumi2013-01-251-0/+1
| | | | llvm-svn: 173408
* Implement the reader of the global module index and wire it into theDouglas Gregor2013-01-254-28/+462
| | | | | | | | | | | | | | | | | | | | | | | AST reader. The global module index tracks all of the identifiers known to a set of module files. Lookup of those identifiers looks first in the global module index, which returns the set of module files in which that identifier can be found. The AST reader only needs to look into those module files and any module files not known to the global index (e.g., because they were (re)built after the global index), reducing the number of on-disk hash tables to visit. For an example source I'm looking at, we go from 237844 total identifier lookups into on-disk hash tables down to 126817. Unfortunately, this does not translate into a performance advantage. At best, it's a wash once the global module index has been built, but that's ignore the cost of building the global module index (which is itself fairly large). Profiles show that the global module index code is far less efficient than it should be; optimizing it might give enough of an advantage to justify its continued inclusion. llvm-svn: 173405
* Rename the -cc1 option "-generate-module-index" toDouglas Gregor2013-01-254-14/+28
| | | | | | | "-fmodules-global-index" and expand its behavior to include both the use and generation of the global module index. llvm-svn: 173404
* Track the number of lookups and hits into the on-disk hash tables forDouglas Gregor2013-01-251-9/+32
| | | | | | identifiers within the AST file reader. llvm-svn: 173403
* Clarify comment: "diagnose" is better than "warn" when emitting an error.Jordan Rose2013-01-251-1/+1
| | | | | | Thanks, Dmitri. llvm-svn: 173400
* Clean up: since we have FunctionDecl::IsInline, make it store the right valueRichard Smith2013-01-252-34/+15
| | | | | | | | | | | | for template instantiations, and use it to simplify the implementation of FunctionDecl::isInlined(). This incidentally changes the result of isInlined on a declared-but-not-defined non-inline member function from true to false. This is sort of a bug fix, but currently isInlined is only called on function definitions, so it has no visible effects. llvm-svn: 173397
* [analyzer] Add "-analyzer-config mode=[deep|shallow] ".Anna Zaks2013-01-241-2/+24
| | | | | | | | | | | | | The idea is to introduce a higher level "user mode" option for different use scenarios. For example, if one wants to run the analyzer for a small project each time the code is built, they would use the "shallow" mode. The user mode option will influence the default settings for the lower-level analyzer options. For now, this just influences the ipa modes, but we plan to find more optimal settings for them. llvm-svn: 173386
* [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".Anna Zaks2013-01-243-21/+27
| | | | | | | | | The idea is to eventually place all analyzer options under "analyzer-config". In addition, this lays the ground for introduction of a high-level analyzer mode option, which will influence the default setting for IPAMode. llvm-svn: 173385
* [analyzer] refactor: access IPAMode through the accessor.Anna Zaks2013-01-242-5/+8
| | | | llvm-svn: 173384
* removed duplicated comment.Fariborz Jahanian2013-01-241-1/+0
| | | | llvm-svn: 173378
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-245-29/+86
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* [mips] Do not emit i32 padding if target ABI is O32. This was causing backendAkira Hatanaka2013-01-241-1/+2
| | | | | | to pass floating point arguments to be passed in integer registers. llvm-svn: 173375
* Add a fixit for \U1234 -> \u1234.Jordan Rose2013-01-241-1/+9
| | | | llvm-svn: 173371
* As an extension, treat Unicode whitespace characters as whitespace.Jordan Rose2013-01-241-0/+23
| | | | llvm-svn: 173370
* Handle universal character names and Unicode characters outside of literals.Jordan Rose2013-01-242-17/+331
| | | | | | | | | | | | | | | | | | | | | | | | This is a missing piece for C99 conformance. This patch handles UCNs by adding a '\\' case to LexTokenInternal and LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN. If the UCN is not syntactically well-formed, we fall back to the old treatment: a backslash followed by an identifier beginning with 'u' (or 'U'). Because the spelling of an identifier with UCNs still has the UCN in it, we need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo. Of course, valid code that does *not* use UCNs will see only a very minimal performance hit (checks after each identifier for non-ASCII characters, checks when converting raw_identifiers to identifiers that they do not contain UCNs, and checks when getting the spelling of an identifier that it does not contain a UCN). This patch also adds basic support for actual UTF-8 in the source. This is treated almost exactly the same as UCNs except that we consider stray Unicode characters to be mistakes and offer a fixit to remove them. llvm-svn: 173369
* Unify diagnostics for \x, \u, and \U without any following hex digits.Jordan Rose2013-01-241-2/+2
| | | | llvm-svn: 173368
* [ms-inline asm] Add an error when trying to compile MS-style inline assemblyChad Rosier2013-01-241-2/+9
| | | | | | | for an unsupported architecture. rdar://13063988 llvm-svn: 173364
* [driver] Associate a JobAction with each result file. This enables the driverChad Rosier2013-01-244-34/+55
| | | | | | | to delete result files for only those commands that fail. Part of rdar://12984531 llvm-svn: 173361
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-245-207/+414
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* clang/GlobalModuleIndex: Don't open the same file twice. Use ↵NAKAMURA Takumi2013-01-241-3/+1
| | | | | | | raw_fd_ostream(fd, ...) instead. FIXME: PathV2::unique_file() is assumed to open the file with binary mode on win32. llvm-svn: 173330
* Start checking nonnull (as well as format and argument_with_type_tag) onNick Lewycky2013-01-241-0/+7
| | | | | | overloaded binary operators. llvm-svn: 173315
* Fix some wonky formatting, remove spurious emacs major mode marker. NoNick Lewycky2013-01-242-10/+8
| | | | | | functionality change! llvm-svn: 173314
* Micro cleanup: use an array of const char, rather than an array of char, as theRichard Smith2013-01-231-1/+1
| | | | | | | type of the string literal implicitly used for a raw user-defined literal call. No test; this has no semantic impact. llvm-svn: 173309
* Fix for case-sensitive file systems. UghDouglas Gregor2013-01-231-1/+1
| | | | llvm-svn: 173303
* Implement the writer side of the global module index. Douglas Gregor2013-01-236-4/+561
| | | | | | | | | | | | | | | | | | | | The global module index is a "global" index for all of the module files within a particular subdirectory in the module cache, which keeps track of all of the "interesting" identifiers and selectors known in each of the module files. One can perform a fast lookup in the index to determine which module files will have more information about entities with a particular name/selector. This information can help eliminate redundant lookups into module files (a serious performance problem) and help with creating auto-import/auto-include Fix-Its. The global module index is created or updated at the end of a translation unit that has triggered a (re)build of a module by scraping all of the .pcm files out of the module cache subdirectory, so it catches everything. As with module rebuilds, we use the file system's atomicity to synchronize. llvm-svn: 173301
* Add missing null check. Not sure why my tests passed before.Ted Kremenek2013-01-231-4/+6
| | | | llvm-svn: 173292
* Honor attribute 'analyzer_noreturn' on Objective-C methods.Ted Kremenek2013-01-231-0/+7
| | | | | | | | | This isn't likely a full solution, but it catches the common cases and can be refined over time. Fixes <rdar://problem/11634353>. llvm-svn: 173291
* Add extra indent for nested calls inside if's.Daniel Jasper2013-01-231-3/+7
| | | | | | | | | | | | Before: if (aaaaaaaaaa( aaaaaaaaaa)) {} After: if (aaaaaaaaaa( aaaaaaaaaa)) {} llvm-svn: 173290
* Implement -Wvla correctlyDmitri Gribenko2013-01-231-0/+5
| | | | | | | | | | | | | GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA, for example, if they are forbidden by coding guidelines). Currently Clang implements -Wvla as "warn on VLA when it is an extension". The attached patch makes our behavior match GCC. The existing vla extwarn is moved under -Wvla-extension and is still included into -Wgnu. This fixes PR5953. llvm-svn: 173286
OpenPOWER on IntegriCloud