summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Give ModuleFiles an index, so that we can use indexed vectors ratherDouglas Gregor2013-01-211-20/+30
| | | | | | | than DenseMaps and SmallPtrSets for module-visitation data. ~2.6% speedup for modules. llvm-svn: 173081
* Eliminate Sema::CompareProperties(), which was walking over a pile ofDouglas Gregor2013-01-212-62/+68
| | | | | | | | | lexical declarations looking for properties when we could more efficiently check for property mismatches at property declaration time. Good for ~1% of -fsyntax-only time when most of the properties we're checking against come from an AST file. llvm-svn: 173079
* Formatter: Set MatchingParen for [], to match <>, (), {}. No functionality ↵Nico Weber2013-01-211-0/+2
| | | | | | change. llvm-svn: 173078
* Formatter: Rename LSquare to Left to make parseSquare() more consistent with ↵Nico Weber2013-01-211-8/+6
| | | | | | the other paren parsing methods. llvm-svn: 173077
* Fixes various problems around enum parsing.Manuel Klimek2013-01-211-31/+42
| | | | | | | | | | | | | | | | Very similar to what we do for record definitions: - tighten down what is an enum definition, so that we don't mistake a function for an enum - allow common idioms around declarations (we'll want to handle that more centrally in the future) We now correctly format: enum X f() { a(); return 42; } llvm-svn: 173075
* Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, whichDouglas Gregor2013-01-212-46/+28
| | | | | | | | | | did a redundant traversal of the lexical declarations in the superclass. Instead, when we declare a new property, look into the superclass to see whether we're redeclaring the property. Goot for 1% of -fsyntax-only time on Cocoa.h and a little less than 3% on my modules test case. llvm-svn: 173073
* [ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a ↵Argyrios Kyrtzidis2013-01-211-0/+2
| | | | | | | | | | crash if Precompilepreamble is set to true because there is no FileManager at that point. Patch by Hurcan Solter! llvm-svn: 173071
* Replace some unnecessary O(N^2) lookups for properties withDouglas Gregor2013-01-211-40/+53
| | | | | | | DeclContext lookups. The performance win is negligible in my tests, but it's the Right Thing To Do (TM). llvm-svn: 173068
* [analyzer] Show notes inside implicit calls at the last explicit call site.Jordan Rose2013-01-211-3/+6
| | | | | | | | | | | | | | | | | | | Before: struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'. NonTrivial m; }; Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'. After: struct Wrapper { NonTrivial m; }; Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'. ^-- 2. Calling default constructor for 'NonTrivial'. llvm-svn: 173067
OpenPOWER on IntegriCloud