- Jul 03, 2013
-
-
Daniel Jasper authored
This fixes llvm.org/PR16514. llvm-svn: 185531
-
Daniel Jasper authored
In general, clang-format breaks after an operator if the LHS spans multiple lines. Otherwise, this can lead to confusing effects and effectively hide the operator precendence, e.g. in if (aaaaaaaaaaaaaa == bbbbbbbbbbbbbb && c) { ... This patch removes this rule for comparisons, if the LHS is not a binary expression itself as many users were wondering why clang-format inserts an unnecessary linebreak. Before: if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) > 5) { ... After: if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) > 5) { ... In the long run, we might: - Want to do this for other binary expressions as well. - Do this only if the RHS is short or even only if it is a literal. llvm-svn: 185530
-
Pavel Labath authored
Summary: The analyzer incorrectly handled noreturn destructors which were hidden inside function calls. This happened because NoReturnFunctionChecker only listened for PostStmt events, which are not executed for destructor calls. I've changed it to listen to PostCall events, which should catch both cases. Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1056 llvm-svn: 185522
-
Serge Pavlov authored
llvm-svn: 185493
-
Kaelyn Uhrain authored
The removal is tried by retrying the failed lookup of a correction candidate with either the MemberContext or SS (CXXScopeSpecifier) or both set to NULL if they weren't already. If the candidate identifier is then looked up successfully, make a note in the candidate that the SourceRange should include any existing nested name specifier even if the candidate isn't adding a different one (i.e. the candidate has a NULL NestedNameSpecifier). Also tweak the diagnostic messages to differentiate between a suggestion that just replaces the identifer but leaves the existing nested name specifier intact and one that replaces the entire qualified identifier, in cases where the suggested replacement is unqualified. llvm-svn: 185487
-
Kaelyn Uhrain authored
CorrectTypo will now see and consider those corrections that are effectively shadowed by other declarations in a closer context when resolved via an unqualified lookup. This involves adding any parent namespaces to the set of namespaces as fully-qualified name specifiers, and also adding potential corrections that passed name lookup but were rejected by the given CorrectionCandidateCallback into the set of failed corrections that should be tried with the set of namespace specifiers. llvm-svn: 185486
-
Manman Ren authored
Darwin systems currently do not support dwarf version 3 or above. When we are ready, we can bump the default to gdwarf-4 for Darwin. For other systems, the default is dwarf version 3, if everything goes smoothly, we can bump the version to 4. rdar://13591116 llvm-svn: 185483
-
- Jul 02, 2013
-
-
Richard Trieu authored
the test environment. llvm-svn: 185470
-
James Dennett authored
C++1y init-capture support, and to improve some Doxygen markup. llvm-svn: 185469
-
Manman Ren authored
No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185463
-
Reid Kleckner authored
Unlike Itanium, there is no code to indicate the beginning of a parameter pack. I tested this with MSVC 2013, which is the only version that implements variadic templates so far. This is needed to compile APInt.cpp for the MS C++ ABI. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D1077 llvm-svn: 185454
-
Richard Smith authored
llvm-svn: 185453
-
Eli Friedman authored
Make sure we properly treat names defined inside a block as local names. There are basically three fixes here. One, correctly treat blocks as a context where we need to use local-name mangling using the new isLocalContainerContext helper. Two, make CXXNameMangler::manglePrefix handle local names in a consistent way. Three, extend CXXNameMangler::mangleLocalName so it can mangle a block correctly. llvm-svn: 185450
-
Serge Pavlov authored
llvm-svn: 185446
-
Jordan Rose authored
While we don't model pointers-to-members besides "null" and "non-null", we were using Loc symbols for valid pointers and NonLoc integers for the null case. This hit the assert committed in r185401. Fixed by using a true (Loc) null for null member pointers. llvm-svn: 185444
-
Andy Gibbs authored
llvm-svn: 185439
-
Timur Iskhodzhanov authored
llvm-svn: 185438
-
Daniel Jasper authored
Before, the computed byte range would include the trailing newline. clang-format on the other hand counts whitespace as belonging to the following token, so that git-clang-format inadvertendly reformats the first unmodified line as well. It is not entirely clear whether clang-format's behavior itself should be modified, but for now this seems to be a safe change. llvm-svn: 185423
-
Daniel Jasper authored
Before (exceeding the column limit): LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; After: LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; llvm-svn: 185418
-
Pavel Labath authored
Summary: Static analyzer used to abort when encountering AttributedStmts, because it asserted that the statements should not appear in the CFG. This is however not the case, since at least the clang::fallthrough annotation makes it through. This commit simply makes the analyzer ignore the statement attributes. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1030 llvm-svn: 185417
-
Eli Friedman authored
This commit rearranges the logic in CXXNameMangler::mangleLocalName and GetLocalClassDecl so that it doesn't accidentally skip over lambdas. It also reduces code duplication a bit. llvm-svn: 185402
-
Jordan Rose authored
The one bit of code that was using this is gone, and neither C nor C++ actually allows this. Add an assertion and remove dead code. Found by Matthew Dempsky! llvm-svn: 185401
-
- Jul 01, 2013
-
-
Eli Friedman authored
llvm-svn: 185384
-
Eli Friedman authored
The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before. llvm-svn: 185381
-
Eli Friedman authored
Sorry about that. llvm-svn: 185374
-
Eli Friedman authored
Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way. There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly. llvm-svn: 185372
-
Anton Korobeynikov authored
Patch by Job Noorman! llvm-svn: 185362
-
Daniel Jasper authored
This lead to weird formatting. Before: DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } }); After: DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } }); llvm-svn: 185346
-
Alexander Kornienko authored
Summary: Add penalty when an excessively long line in a block comment can not be broken on a leading whitespace. Lack of this addition can lead to severe column width violations when they can be easily avoided. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1071 llvm-svn: 185337
-
Daniel Jasper authored
This is not all bad, but people are often surprised by it. Before: namespace { int SomeVariable = 0; // comment } // namespace After: namespace { int SomeVariable = 0; // comment } // namespace llvm-svn: 185327
-
NAKAMURA Takumi authored
Cygwin does not accept the form /CYGDRIVE/X/PATH/TO/FILE against /cygdrive/X/PATH/TO/FILE. "cygdrive" must be lower-cased. llvm-svn: 185323
-
Daniel Jasper authored
Before (for styles where the pointer binds to the type): template <class... Ts> void Foo(Ts... ts) {} template <class... Ts> void Foo(Ts* ... ts) {} After: template <class... Ts> void Foo(Ts... ts) {} template <class... Ts> void Foo(Ts*... ts) {} llvm-svn: 185321
-
Daniel Jasper authored
Before: void f(int */* unused */) {} After: void f(int * /* unused */) {} The previous version seems to be valid C++ code but confuses many syntax highlighters. llvm-svn: 185320
-
Daniel Jasper authored
Before: DoSomethingWithVector({ } /* No data */); After: DoSomethingWithVector({} /* No data */); llvm-svn: 185319
-
Sylvestre Ledru authored
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. This kind of simplification is sometimes useful, but in general it's not correct. As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the build definitions used for FreeBSD, whereas for userland-related issues we want to match the definitions used for other systems with Glibc. The current modification adjusts the build system so that they can be distinguished, and explicitly adds GNU/kFreeBSD to the build checks in which it belongs. Fixes bug #16445. Patch by Robert Millan in the context of Debian. llvm-svn: 185312
-
Craig Topper authored
llvm-svn: 185306
-
Craig Topper authored
llvm-svn: 185305
-
Richard Smith authored
InitListExpr. llvm-svn: 185304
-
Craig Topper authored
llvm-svn: 185303
-
Craig Topper authored
llvm-svn: 185302
-