summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* unwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS ↵Benjamin Kramer2013-01-091-0/+9
| | | | | | | | is specified. For GCC compatibility. llvm-svn: 171991
* Do not model loads from complex types, since we don't accurately model the ↵Ted Kremenek2013-01-091-0/+5
| | | | | | | | imaginary and real parts yet. Fixes false positive reported in <rdar://problem/12964481>. llvm-svn: 171987
* Suppress GCC -Wreturn warning.David Blaikie2013-01-091-0/+1
| | | | | | Modified from a patch by David Greene. llvm-svn: 171982
* Handle static functions being redeclared in function scope.Rafael Espindola2013-01-091-0/+4
| | | | | | Fixes pr14861. llvm-svn: 171978
* Enables layouting unwrapped lines around preprocessor directives.Manuel Klimek2013-01-093-41/+69
| | | | | | | | | | | | | | | | | | | | | | | Previously, we'd always start at indent level 0 after a preprocessor directive, now we layout the following snippet (column limit 69) as follows: functionCallTo(someOtherFunction( withSomeParameters, whichInSequence, areLongerThanALine(andAnotherCall, B withMoreParamters, whichStronglyInfluenceTheLayout), andMoreParameters), trailing); Note that the different jumping indent is a different issue that will be addressed separately. This is the first step towards handling #ifdef->#else->#endif chains correctly. llvm-svn: 171974
* Only align after assignments on the top level.Daniel Jasper2013-01-091-1/+3
| | | | | | | | | | | | | This fixes llvm.org/PR14870 and we no longer mess up: template <typename T1, typename T2 = char, typename T3 = char, typename T4 = char> void f(); It removes the nice aligment for assignments inside other expressions, but I am not sure those are actually practically relevant. If so, we can fix those later. llvm-svn: 171966
* Don't simply give up when exceeding 80cols, choose an "ok" option.Daniel Jasper2013-01-091-3/+11
| | | | | | | | | | | | | | | This addresses llvm.org/PR14847. We can now format something like: int aaaaaaaaaaaaaaaaaaaaaaaaaaa = // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; clang-format unavoidably exceeds the column limit, but does not just flush everything into a single line. Moreover, it tries to minimize the number of characters beyond the column limit. llvm-svn: 171964
* Correctly format wrapped function call parameters in templated functions.Daniel Jasper2013-01-091-1/+1
| | | | | | | | | | | | | | | | This fixes llvm.org/PR14846. Before: template <typename T> void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( int aaaaaaaaaaaaaaaaa); After: template <typename T> void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( int aaaaaaaaaaaaaaaaa); llvm-svn: 171963
* Allow comments in the middle of statements to be on their own line.Daniel Jasper2013-01-091-1/+3
| | | | | | | | | | | | This fixes llvm.org/PR14860. Before, we messed up the format of: if (DeclaratorInfo.isFunctionDeclarator() && //getDeclSpecContextFromDeclaratorContext(Context) == DSC_top_level && Tok.is(tok::semi) && NextToken().is(tok::l_brace)) { } llvm-svn: 171961
* Fix ObjC block declarations.Daniel Jasper2013-01-091-3/+4
| | | | | | Before: int ( ^ Block1) (int, int) = ^ (int i, int j) After: int (^Block1) (int, int) = ^(int i, int j) llvm-svn: 171959
* Improve formatting of conditional operators.Daniel Jasper2013-01-091-28/+36
| | | | | | | | | | | | This addresses llvm.org/PR14864. We used to completely mess this up and now format as: Diag(NewFD->getLocation(), getLangOpts().MicrosoftExt ? diag::ext_function_specialization_in_class : diag::err_function_specialization_in_class) << NewFD->getDeclName(); llvm-svn: 171957
* [ubsan] Make static check data non-const so it can be used for deduplication.Will Dietz2013-01-091-1/+1
| | | | llvm-svn: 171947
* Make sure clang puts tokens from different files on separate lines in "-E ↵Eli Friedman2013-01-091-1/+4
| | | | | | | | -P" mode. <rdar://problem/12774044> llvm-svn: 171944
* Make __has_include a bit more resilient in the presence of macros. ↵Eli Friedman2013-01-091-2/+8
| | | | | | <rdar://problem/12748859>. llvm-svn: 171939
* When name lookup for a redeclaration finds declarations that are knownDouglas Gregor2013-01-091-0/+41
| | | | | | | | | | (because they are part of some module) but have not been made visible (because they are in a submodule that wasn't imported), filter out those declarations unless both the old declaration and the new declaration have external linkage. When one or both has internal linkage, there should be no conflict unless both are imported. llvm-svn: 171925
* put back diagnostics when flexible members are capturedFariborz Jahanian2013-01-091-1/+4
| | | | | | in lambdas. llvm-svn: 171921
* Fix typo (again).Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171917
* Remove lambda from my last patch.Fariborz Jahanian2013-01-081-4/+1
| | | | llvm-svn: 171915
* Fixes typo in comment.Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171913
* objectiveC blocks: It is impractical to capture Fariborz Jahanian2013-01-081-1/+16
| | | | | | | | struct variables with flexiable array members in blocks (and lambdas). Issue error instead of crashing in IRGen. // rdar://12655829 llvm-svn: 171912
* PR14855: don't silently swallow a nested-name-specifier after a type name.Richard Smith2013-01-081-1/+5
| | | | llvm-svn: 171908
* Clear LV cache when dropping availability attributes.Rafael Espindola2013-01-081-0/+6
| | | | llvm-svn: 171906
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-082-12/+8
| | | | llvm-svn: 171902
* Don't crash when trying to apply the availability attribute to a block.Rafael Espindola2013-01-081-1/+6
| | | | llvm-svn: 171899
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-081-2/+2
| | | | llvm-svn: 171895
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-083-7/+7
| | | | llvm-svn: 171894
* Don't break after unary operators.Daniel Jasper2013-01-081-2/+1
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa, * aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaa, *aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 171890
* Move loop variable update.Rafael Espindola2013-01-081-2/+1
| | | | | | Thanks to Dmitri Gribenko for the suggestion. llvm-svn: 171889
* Mark all subsequent decls used.Rafael Espindola2013-01-082-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | In the source static void f(); static void f(); template<typename T> static void g() { f(); } static void f() { } void h() { g<int>(); } the call to f refers to the second decl, but it is only marked used at the end of the translation unit during instantiation, after the third f decl has been linked in. With this patch we mark all subsequent decls used, so that it is easy to check if a symbol is used or not. llvm-svn: 171888
* Formatter: Format @ literals better. Array and dictionary literals need more ↵Nico Weber2013-01-081-1/+4
| | | | | | work. llvm-svn: 171887
* [analyzer] Only include uniqueling location as issue_hash when availableAnna Zaks2013-01-081-11/+18
| | | | | | | This makes us more optimistic when matching reports in a changing code base. Addresses Jordan's feedback for r171825. llvm-svn: 171884
* Use Decl::getAvailability() rather than checking for the "unavailable"Douglas Gregor2013-01-081-1/+2
| | | | | | | attribute when determining whether we need to see an implementation of a property. Fixes <rdar://problem/12958191>. llvm-svn: 171877
* Don't put spaces around ##.Daniel Jasper2013-01-081-2/+4
| | | | | | | | | | | | | | | | | In Clang/LLVM this seems to be the more common formatting for ##s. There might still be case that we miss, but we'll fix those as we go along. Before: #define A(X) void function ## X(); After: #define A(X) void function##X(); llvm-svn: 171862
* Clear the LV cache when setting the instantiated from link.Rafael Espindola2013-01-081-0/+1
| | | | | | Fixes pr14835. llvm-svn: 171857
* Change the data structure used in clang-format.Daniel Jasper2013-01-083-298/+315
| | | | | | | | | | | | This is a first step towards supporting more complex structures such as #ifs inside unwrapped lines. This patch mostly converts the array-based UnwrappedLine into a linked-list-based UnwrappedLine. Future changes will allow multiple children for each Token turning the UnwrappedLine into a tree. No functional changes intended. llvm-svn: 171856
* Clear the LV cache when merging the availability attribute.Rafael Espindola2013-01-081-2/+6
| | | | | | | The availability implies default visibility, so it can change the computed visibility. llvm-svn: 171840
* Don't warn about undefined varargs argument behavior in unreachable code.Ted Kremenek2013-01-081-5/+5
| | | | | | Fixes <rdar://problem/12322000>. llvm-svn: 171831
* [arcmt] Follow-up for r171484; make sure when adding brackets enclosing case ↵Argyrios Kyrtzidis2013-01-081-58/+136
| | | | | | | | | statements, that the case does not "contain" a declaration that is referenced "outside" of it, otherwise we will emit un-compilable code. llvm-svn: 171828
* Move ref qualifiers from Type bitfields into FunctionProtoType, stealing twoRichard Smith2013-01-081-2/+5
| | | | | | | bits from the number of parameters. This brings the bitfields down from 33 bits to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems. llvm-svn: 171827
* [analyzer] Include the bug uniqueing location in the issue_hash.Anna Zaks2013-01-085-34/+63
| | | | | | | | | | | | | | | The issue here is that if we have 2 leaks reported at the same line for which we cannot print the corresponding region info, they will get treated as the same by issue_hash+description. We need to AUGMENT the issue_hash with the allocation info to differentiate the two issues. Add the "hash" (offset from the beginning of a function) representing allocation site to solve the issue. We might want to generalize solution in the future when we decide to track more than just the 2 locations from the diagnostics. llvm-svn: 171825
* [analyzer] Plist: change the type of issue_hash from int to string.Anna Zaks2013-01-081-2/+2
| | | | | | This gives more flexibility to what could be stored as issue_hash. llvm-svn: 171824
* PR14838: When a member reference is bound to a temporary, don't forget toRichard Smith2013-01-081-2/+2
| | | | | | | perform the semantic checks associated with the destruction of that temporary. It'll be destroyed at the end of the constructor. llvm-svn: 171818
* Back out my no-op change from r171783.Douglas Gregor2013-01-081-8/+2
| | | | llvm-svn: 171817
* Extract the instance-method case for debug info out into a separate function.David Blaikie2013-01-072-10/+12
| | | | | | | | | | This is in preparation for using this to construct the function type for pointers to member functions to include the implicit/artificial 'this' parameter in that case as well. (feedback from GDB indicates that this might be all that's necessary to get it to behave well with Clang's pointer-to-member function debug output) llvm-svn: 171809
* [ubsan] Use correct type for compound assignment ops.Will Dietz2013-01-071-2/+2
| | | | llvm-svn: 171801
* Simplify computing debug info type for static member functions.David Blaikie2013-01-071-26/+27
| | | | | | No (intended) functional change. llvm-svn: 171800
* Minor refactoring of my last patchFariborz Jahanian2013-01-071-13/+12
| | | | | | related to // rdar://12958878 llvm-svn: 171792
* Use the C++11 POD definition in C++11 mode to determine whether oneDouglas Gregor2013-01-071-2/+8
| | | | | | can create a VLA of class type. Fixes <rdar://problem/12151822>. llvm-svn: 171783
* Use getter. Fixes the build from a bad merge.Rafael Espindola2013-01-071-1/+1
| | | | llvm-svn: 171782
* Add support for attribute((mode(unwind_word))).Rafael Espindola2013-01-071-0/+4
| | | | | | Patch by Nick Lewycky. Fixes pr8703. llvm-svn: 171781
OpenPOWER on IntegriCloud