summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Factor the trait for lookup into the on-based hash table ofDouglas Gregor2013-01-232-46/+52
| | | | | | | | | identifiers into two parts: the part that involves dealing with the key (which can be re-used) and the ASTReader-specific part that creates the IdentifierInfos. While I'm at it, StringRef'ify this code, which was using pair<const char*, unsigned>. No functionality change. llvm-svn: 173283
* [PCH] Temporarily disable the "ambiguous macro" warning that is currently ↵Argyrios Kyrtzidis2013-01-231-0/+4
| | | | | | | | | | | | bogus with a PCH that redefined a macro without undef'ing it first. Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits. rdar://13016031 llvm-svn: 173281
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-235-136/+146
| | | | llvm-svn: 173277
* Add constness for NestedNameSpecifier::Create parameterDmitri Gribenko2013-01-231-2/+3
| | | | llvm-svn: 173274
* Don't try to align builder-type continuations on assignments.Daniel Jasper2013-01-231-4/+12
| | | | | | | | | | | | | Before: int aaaa = aaaaa().aaaaa() // force break .aaaaa(); After: int aaaa = aaaaa().aaaaa() // force break .aaaaa(); The other indent is just wrong and confusing. llvm-svn: 173273
* Constify some getters in RedeclarableTemplateDeclDmitri Gribenko2013-01-231-6/+6
| | | | llvm-svn: 173272
* Don't try to do a hanging ident after assignments.Daniel Jasper2013-01-231-5/+2
| | | | | | | | | | | | | | | | | | | | | | | Before: bool aaaa = aaaaaaaaaaa( aaaaaaaaaaaaaaaaa); After: bool aaaa = aaaaaaaaaaa( aaaaaaaaaaaaaaaaa); The other indentation was a nice attempt but doesn't work in many cases. Not sure what the right long term solution is as the "After: " is still not nice. We either need to figure out what to do in the cases where it "doesn't work" or come up with a third solution, e.g. falling back to: bool aaaa = aaaaaaaaaaa( aaaaaaaaaaaaaaaaa); which should always work and nicely highlight the structure. llvm-svn: 173268
* Fix handling of macro definitions.Manuel Klimek2013-01-231-1/+2
| | | | | | | Now correctly formats: #define A (1) llvm-svn: 173264
* Fixes layouting regression and invalid-read.Manuel Klimek2013-01-232-2/+7
| | | | | | | | | | Layouting would prevent breaking before + in a[b + c] = d; Regression detected by code review. Also fixes an invalid-read found by the valgrind bot. llvm-svn: 173262
* Fix the formatting of pointer/reference types in range-based for loops.Daniel Jasper2013-01-231-1/+2
| | | | | | Before: for (int & a : Values) {} After: for (int &a : Values) {} llvm-svn: 173259
* Removing the penalty for breaking after "=".Daniel Jasper2013-01-231-5/+0
| | | | | | | | | | | | | | | | Having seen more cases, this actually was not a good thing to do in the first place. We can still improve on what we do now, but breaking after the "=" is good in many cases. Before: aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa)); After: aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa)); llvm-svn: 173257
* Fix another regression for pointer types.Daniel Jasper2013-01-231-11/+19
| | | | | | | | | | Before: if (int * a = &b) ... After: if (int *a = &b) ... Also changed all the existing tests to test the expressions in question both in a declaration and in an expression context. llvm-svn: 173256
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-2310-31/+89
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Fix regression in formatting pointer types.Daniel Jasper2013-01-231-1/+3
| | | | | | | | | We will need a more principled solution, but we should not leave this unfixed until we come up with one. Before: void f() { int * a; } After: void f() { int *a; } llvm-svn: 173252
* Fixes incorrect handling of the declaration context stack.Manuel Klimek2013-01-231-2/+2
| | | | llvm-svn: 173250
* Fix segfaults in the formatter.Manuel Klimek2013-01-231-2/+2
| | | | | Also: expletive deleted. llvm-svn: 173247
* Add option to allow putting all parameters onto the next line.Daniel Jasper2013-01-231-18/+17
| | | | | | | | | | | | | | | | | This only affects styles where BinPackParameters is false. With AllowAllParametersOnNextLine: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaa); Without it: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaa); llvm-svn: 173246
* Allow us to better guess the context of an unwrapped line.Manuel Klimek2013-01-233-19/+53
| | | | | | | | | | | This gives us the ability to guess better defaults for whether a * between identifiers is a pointer dereference or binary operator. Now correctly formats: void f(a *b); void f() { f(a * b); } llvm-svn: 173243
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-232-7/+12
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173229
* Make __attribute__((nonnull)) use the general expression evaluator to search forNick Lewycky2013-01-231-2/+14
| | | | | | | nulls instead of limiting itself to the language-defined "null pointer constant". llvm-svn: 173227
* [Driver] Don't remove non-regular files that were outputs.Daniel Dunbar2013-01-231-3/+3
| | | | llvm-svn: 173215
* Documentation cleanup: fixing documentation for FrontendAction.James Dennett2013-01-231-3/+3
| | | | | | | | | | | | | | * Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile; * Add some basic \file documentation for FrontendAction.h; * More use of "\brief" instead of repeating the name of the entity being documented; * Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were polluting the documentation for BeginSourceFile; * Drop incorrect "\see" markup that broke Doxygen's formatting; * Other minor documentation fixes. llvm-svn: 173213
* Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2013-01-232-4/+11
| | | | | | when adding a single attribute to the function. llvm-svn: 173211
* Fix compilation on Linux, which defines PATH_MAX in a weird place,Douglas Gregor2013-01-222-0/+10
| | | | | | from Saleem Abdulrasool! llvm-svn: 173208
* PowerPC: fix __builtin_eh_return_data_regno returnAdhemerval Zanella2013-01-221-0/+5
| | | | llvm-svn: 173188
* [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-styleChad Rosier2013-01-223-21/+0
| | | | | | inline assembly can be enable with -fasm-blocks or -fms-extensions alone. llvm-svn: 173186
* Small code change to improve performanceFariborz Jahanian2013-01-221-2/+6
| | | | | | in my last patch, suggested by Argyrios. llvm-svn: 173182
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-222-42/+35
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* [ms-inline asm] Remove a warning about ms-style inline assembly not beingChad Rosier2013-01-221-3/+0
| | | | | | supported. llvm-svn: 173177
* Make getDefinitiveDeclContext() actually return a DeclContext, as oneDouglas Gregor2013-01-223-9/+10
| | | | | | | would expect, and clean up the return/break inconsistencies. Thanks, Sebastian! llvm-svn: 173171
* Fix a bug in VarDecl::getSourceRange() for static member arrays with an elementNico Weber2013-01-221-1/+3
| | | | | | | | type with an implicit initializer expression. Patch from Will Wilson <will@indefiant.com>! llvm-svn: 173170
* Implements more principled comment parsing.Manuel Klimek2013-01-223-40/+67
| | | | | | | | | | | | | | | | | | Changing nextToken() in the UnwrappedLineParser to get the next non-comment token. This allows us to correctly layout a whole class of snippets, like: if /* */(/* */ a /* */) /* */ f() /* */; /* */ else /* */ g(); Fixes a bug in the formatter where we would assume there is a previous non-comment token. Also adds the indent level of an unwrapped line to the debug output in the parser. llvm-svn: 173168
* Let the formatter be more restrictive for breaking around . and ->Daniel Jasper2013-01-221-1/+11
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa) .aaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa(); llvm-svn: 173160
* Fix "*" formatting when creating arrays of pointers.Daniel Jasper2013-01-221-0/+10
| | | | | | Before: A = new int * [10](); After: A = new int *[10](); llvm-svn: 173150
* Switch to APFloat constructor taking fltSemantics.Tim Northover2013-01-225-10/+47
| | | | | | | | This change also makes the serialisation store the required semantics, fixing an issue where PPC128 was always assumed when re-reading a 128-bit value. llvm-svn: 173139
* [ASan] Link with the dynamic runtime on OS XAlexander Potapenko2013-01-221-4/+2
| | | | | | This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it. llvm-svn: 173135
* Use the correct field to copy/dispose a __block variable.John McCall2013-01-221-14/+41
| | | | | | | | | | | | | | | We were previously hard-coding a particular field index. This was fine before (because we were obviously guaranteed the presence of a copy/dispose member) except for (1) alignment padding and (2) future extensions adding extra members to the header, such as the extended-layout pointer. Note that we only introduce the extended-layout pointer in the presence of structs. (We also seem to be introducing it even in the presence of an all-non-object layout, but that's a different potential issue.) llvm-svn: 173122
* Remove "incorrect" aligning of trailing comments.Daniel Jasper2013-01-211-4/+11
| | | | | | | | | | | | | | | We used to align trailing comments belong to different things. Before: void f() { // some function.. } int a; // some variable.. After: void f() { // some function.. } int a; // some variable.. llvm-svn: 173100
* Have AttributeSet::getRetAttributes() return an AttributeSet instead of ↵Bill Wendling2013-01-211-3/+4
| | | | | | | | | Attribute. This further restricts the use of the Attribute class to the Attribute family of classes. llvm-svn: 173099
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-212-17/+39
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling2013-01-211-6/+6
| | | | | | | | | Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. llvm-svn: 173095
OpenPOWER on IntegriCloud