summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Format strings: a character literal should be printed with %c, not %d.Jordan Rose2012-12-051-10/+18
| | | | | | | | | | | | | | | | | | The type of a character literal is 'int' in C, but if the user writes a character /as/ a literal, we should assume they meant it to be a character and not a numeric value, and thus offer %c as a correction rather than %d. There's a special case for multi-character literals (like 'MooV'), which have implementation-defined value and usually cannot be printed with %c. These still use %d as the suggestion. In C++, the type of a character literal is 'char', and so this problem doesn't exist. <rdar://problem/12282316> llvm-svn: 169398
* Format strings: the correct conversion for 'char' is %c, not %d or %hhd.Jordan Rose2012-12-051-1/+1
| | | | | | | We tried to account for 'uint8_t' by saying that /typedefs/ of 'char' should be corrected as %hhd rather than %c, but the condition was wrong. llvm-svn: 169397
* Remove bad and useless enum to bool conversion.Daniel Jasper2012-12-051-5/+2
| | | | llvm-svn: 169390
* Clang-format: parse for and while loopsAlexander Kornienko2012-12-052-0/+21
| | | | | | | | | | | | | | Summary: Adds support for formatting for and while loops. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D174 llvm-svn: 169387
* Indentation fixes for clang-format.Daniel Jasper2012-12-052-30/+51
| | | | | | | | | | - Fix behavior of memoization together with optimization - Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did not count towards the inner level) - Recognize more tokens as assignments Review: http://llvm-reviews.chandlerc.com/D172 llvm-svn: 169384
* Follow-up to r169286, addresses comments in ↵Alexander Kornienko2012-12-053-6/+8
| | | | | | http://llvm-reviews.chandlerc.com/D164#comment-4 : comments and a method rename llvm-svn: 169382
* Reuse an existing diagnostic for tsan/msan needing -pie error.Evgeniy Stepanov2012-12-051-4/+13
| | | | | | | Add a diagnosting for -fsanitize=memory conflicting with other sanitizers. Extend tests. llvm-svn: 169380
* In C++, if we hit an error in the class-head, don't try to parse the class body.Richard Smith2012-12-051-1/+3
| | | | | | | Our error recovery path may have made the class anonymous, and that has a pretty disastrous impact on any attempt to parse a class body containing constructors. llvm-svn: 169374
* PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to beRichard Smith2012-12-051-2/+10
| | | | | | | the LHS of a token paste. Use "expanded from here" instead when we're not sure it's actually a macro. llvm-svn: 169373
* Minor reorganization. No functionality change.Richard Smith2012-12-051-30/+30
| | | | llvm-svn: 169367
* Add missing virtual destructors reported by -Wnon-virtual-dtor.Daniel Jasper2012-12-051-0/+2
| | | | llvm-svn: 169365
* Small tweaks to automatic formatting.Daniel Jasper2012-12-051-2/+13
| | | | | | | Recognize '!=' as a binary operator and assume that there are no type definitions on the RHS of an assignment. llvm-svn: 169363
* Simplify slightly by seperating out the responsibility for emission of a caretRichard Smith2012-12-051-34/+42
| | | | | | | | diagnostic from the emission of macro backtraces. Incidentally, we now get the displayed source location for a diagnostic and the location for the caret from the same place, rather than computing them separately. No functionality change. llvm-svn: 169357
* Driver.cpp: Restore clang/Config/config.h to be included at last not to ↵NAKAMURA Takumi2012-12-051-1/+4
| | | | | | | | prevent llvm-config.h. Or "llvm/Support/system_error.h" could not be compiled on mingw. llvm-svn: 169354
* Simplify diagnostic emission. No functionality change intended.Richard Smith2012-12-051-20/+19
| | | | llvm-svn: 169351
* Thread-safety analysis: check locks on method calls, operator=, andDeLesley Hutchins2012-12-051-0/+44
| | | | | | copy constructors. llvm-svn: 169350
* [analyzer] Implement an opt-in variant of direct ivar assignment.Anna Zaks2012-12-052-9/+57
| | | | | | | This will only check the direct ivar assignments in the annotated methods. llvm-svn: 169349
* Thread Safety Analysis: refactor to make more methods accept const pointers,DeLesley Hutchins2012-12-051-86/+94
| | | | | | adjust checkAccess. No change in functionality. llvm-svn: 169348
* Testing C++ declarations embedded inFariborz Jahanian2012-12-051-0/+25
| | | | | | | | <declaration> tag of Comment XML and added support for friend declaration printing. This is wip. // rdar://12378714 llvm-svn: 169346
* Thread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.DeLesley Hutchins2012-12-051-0/+4
| | | | | | | | | | | | As the analysis improves, it will continue to add new warnings that are potentially disruptive to existing users. From now on, such warnings will first be introduced under the "beta" flag. Such warnings are not turned on by default; their purpose is to allow users to test their code against future planned changes, before those changes are actually made. After a suitable migration period, beta warnings will be folded into the standard -Wthread-safety. llvm-svn: 169338
* Add -whole-archive around the ASan runtime archive in the link command.Chandler Carruth2012-12-041-2/+8
| | | | | | | | | | | This ensures that even though it comes first, we pick up its .o files. Note that if we can use this (or something similar / equivalent) on other platforms, we could potentially remove ReplaceOperatorsNewAndDelete from the ASan runtimes. We should probably do something similar for TSan and MSan as well. llvm-svn: 169328
* Alphabetize source files, just like they have been before.Ted Kremenek2012-12-041-1/+1
| | | | llvm-svn: 169318
* Use the 'count' attribute to calculate the upper bound of an array.Bill Wendling2012-12-041-26/+9
| | | | | | | | | The count attribute is more accurate with regards to the size of an array. It also obviates the upper bound attribute in the subrange. We can also better handle an unbound array by setting the count to -1 instead of the lower bound to 1 and upper bound to 0. llvm-svn: 169311
* Currently, with -fsanitize=address, the driver appends libclang_rt.asan.a toMatt Beaumont-Gay2012-12-041-2/+6
| | | | | | | | | | | | | | | | the link command. This all works fine when the driver is also responsible for adding -lstdc++ to the link command. But, if -lstdc++ (or libstdc++.a, etc) is passed explicitly to the driver, the ASan runtime will appear in the link command after the standard library, leading to multiple-definition errors for the global 'operator new' and 'operator delete'. Fix this in a painfully simple way, by inserting libclang_rt.asan.a at the start of the link command instead of the end. If we need to do something more clever, we can walk the link command looking for something that resembles libstdc++ and insert libclang_rt.asan.a as late as possible, but the simple solution works for now. llvm-svn: 169310
* Testing C declarations embedded inFariborz Jahanian2012-12-041-0/+1
| | | | | | | | <declaration> tag of Comment XML and fixed a missing block literal printout as result of the testing. // rdar://12378714 llvm-svn: 169307
* Add missing destructors found with -Wnon-virtual-dtor.Daniel Jasper2012-12-042-0/+5
| | | | llvm-svn: 169303
* Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClientEli Bendersky2012-12-042-8/+8
| | | | | | in the triple. llvm-svn: 169292
* Error recovery part 2Alexander Kornienko2012-12-043-32/+52
| | | | | | | | | | | | | | Summary: Adds recovery for structural errors in clang-format. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, silvas Differential Revision: http://llvm-reviews.chandlerc.com/D164 llvm-svn: 169286
* objective-c blocks: Consider padding due to alignmentFariborz Jahanian2012-12-044-6/+36
| | | | | | | after the fixed size block header when generating captured block variable info. // rdar://12773256 llvm-svn: 169285
* Clang-format error recovery part 1Alexander Kornienko2012-12-041-2/+10
| | | | | | | | | | Reviewers: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D163 llvm-svn: 169278
* Make parenthesis counting and aligning a bit saner.Daniel Jasper2012-12-041-40/+53
| | | | | Review: http://llvm-reviews.chandlerc.com/D162 llvm-svn: 169274
* Enum formatting implementationAlexander Kornienko2012-12-041-27/+53
| | | | | | | | | | | | Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D161 llvm-svn: 169272
* ToolChains.cpp: Fixup r169260, clang/Config/config.h needs to be listed ↵NAKAMURA Takumi2012-12-041-4/+5
| | | | | | *last*, or llvm/Config/llvm-config.h could not be read in header files. llvm-svn: 169268
* Fixes crash in isDerivedFrom for recursive templates.Manuel Klimek2012-12-041-1/+6
| | | | llvm-svn: 169262
* Small fixes to unary operator recognition and handling of includeDaniel Jasper2012-12-041-6/+20
| | | | | | directives. llvm-svn: 169261
* Autotools has the same include guard for both Clang and LLVM's config.h.Chandler Carruth2012-12-041-1/+4
| | | | | | | | | | | | Shuffling order causes the wrong one to win. CMake didn't exhibit this problem because Clang's has *no* guards. I'll fix this properly tomorrow when Eric and I can check both build systems and get them to DTRT, but for now unbreak some bots by hoisting this header. llvm-svn: 169260
* Replace workarounds with correct fixes.Daniel Jasper2012-12-041-16/+16
| | | | | | | | Also fix header guard. http://llvm-reviews.chandlerc.com/D159 llvm-svn: 169254
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-04316-1030/+977
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* clang/Lex: [CMake] Update CMakefiles since r169229.NAKAMURA Takumi2012-12-041-0/+1
| | | | llvm-svn: 169233
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-047-115/+138
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* In the PreprocessingRecord, to identify the different conditional directive ↵Argyrios Kyrtzidis2012-12-041-16/+19
| | | | | | | | regions use the SourceLocation at the start of the respective region, instead of a unique integer. llvm-svn: 169228
* Introduce CompilationDatabase::getAllCompileCommands() that returns allArgyrios Kyrtzidis2012-12-042-9/+30
| | | | | | compile commands of the database and expose it via the libclang API. llvm-svn: 169226
* Add a 'count' field to the DWARF subrange.Bill Wendling2012-12-041-5/+18
| | | | | | | | | The count field is necessary because there isn't a difference between the 'lo' and 'hi' attributes for a one-element array and a zero-element array. When the count is '0', we know that this is a zero-element array. When it's >=1, then it's a normal constant sized array. When it's -1, then the array is unbounded. llvm-svn: 169219
* Testing objective-C declarations embedded inFariborz Jahanian2012-12-041-1/+11
| | | | | | | | <declaration> tag of Comment XML and fixed a missing declaration of ivars private to @implementation as result of the testing. // rdar://12378714 llvm-svn: 169193
* Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly ↵Michael Ilseman2012-12-041-0/+10
| | | | | | modes. Test cases included. llvm-svn: 169191
* remove trailing whitespaceMichael Ilseman2012-12-041-32/+32
| | | | llvm-svn: 169187
* Fix test failure when building Clang with g++4.7 -- don't use a Twine temporaryRichard Smith2012-12-031-5/+5
| | | | | | after its lifetime has ended! llvm-svn: 169170
* Fixes a compile warning and crash in the tests.Manuel Klimek2012-12-031-12/+13
| | | | | | | | The necessity of this fix points to a problem with the design of the addToken during the optimiation phase, which we need to address in a much more principled way. llvm-svn: 169151
* Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this ↵Alexey Samsonov2012-12-034-6/+32
| | | | | | flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object. llvm-svn: 169144
* libclangFormat is not libclangTooling, but it depends on it.Benjamin Kramer2012-12-032-2/+3
| | | | llvm-svn: 169139
OpenPOWER on IntegriCloud