- May 31, 2013
-
-
Daniel Jasper authored
Before: x[(uint8) y]; x = (uint8) y; void f() { x = (uint8) y; } #define AA(X) sizeof(((X *) NULL)->a) After: x[(uint8)y]; x = (uint8)y; void f() { x = (uint8)y; } #define AA(X) sizeof(((X *)NULL)->a) llvm-svn: 183014
-
Daniel Jasper authored
If a "}" is found inside parenthesis, this is probably a case of missing parenthesis. This enables continuing to format after stuff code like: class A { void f( }; .. llvm-svn: 183009
-
Daniel Jasper authored
With this patch, the simplified rule is: If the block is part of a declaration (class, namespace, function, enum, ..), merge an empty block onto a single line. Otherwise (specifically for the compound statements of if, for, while, ...), keep the braces on two separate lines. The reasons are: - Mostly the formatting of empty blocks does not matter much. - Empty compound statements are really rare and are usually just inserted while still working on the code. If they are on two lines, inserting code is easier. Also, overlooking the "{}" of an "if (...) {}" can be really bad. - Empty declarations are not uncommon, e.g. empty constructors. Putting them on one line saves vertical space at no loss of readability. llvm-svn: 183008
-
Daniel Jasper authored
Before: bool aaaaaa = aaaaaaaaaaaaa // ? aaaaaaaaaaaaaaa : bbbbbbbbbbbbbbb // ? ccccccccccccccc : ddddddddddddddd; After: bool aaaaaa = aaaaaaaaaaaaa // ? aaaaaaaaaaaaaaa : bbbbbbbbbbbbbbb // ? ccccccccccccccc : ddddddddddddddd; llvm-svn: 183007
-
Daniel Jasper authored
Before: foo = aaaaaaaaaaa ? vector<int> { aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaa } : vector<int>{ bbbbbbbbbbbbbbbbbbbbbbbbbbb, bbbbbbbbbbbbbbbbbbbb, bbbbb }; After: foo = aaaaaaaaaaa ? vector<int>{ aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaa } : vector<int>{ bbbbbbbbbbbbbbbbbbbbbbbbbbb, bbbbbbbbbbbbbbbbbbbb, bbbbb }; llvm-svn: 182992
-
Ted Kremenek authored
[analyzer; new edges] in splitBranchConditionEdges() do not check that predecessor edge has source in the same lexical scope as the target branch. Fixes <rdar://problem/14031292>. llvm-svn: 182987
-
Ted Kremenek authored
llvm-svn: 182986
-
Richard Smith authored
initialization. Previously we would incorrectly require an extra set of braces around such initializers. llvm-svn: 182983
-
Argyrios Kyrtzidis authored
In a certain code-path we were not deserializing an anonymous field initializer correctly, leading to a crash when trying to IRGen it. This is a simpler version of a patch by Yunzhong Gao! llvm-svn: 182974
-
Richard Smith authored
syntactic form in template instantiation. Previously, this blocked the reversion and we ended up losing inner CXXBindTemporaryExprs (and thus forgetting to call destructors!). llvm-svn: 182969
-
- May 30, 2013
-
-
Fariborz Jahanian authored
llvm-svn: 182966
-
Fariborz Jahanian authored
which diagnoses type mismatches of identical selectors declared in classes throughout. // rdar://14007194 llvm-svn: 182964
-
Jordan Rose authored
...and make this work correctly in the current codebase. After living on this for a while, it turns out to look very strange for inlined functions that have only a single statement, and somewhat strange for inlined functions in general (since they are still conceptually in the middle of the path, and there is a function-entry path note). It's worth noting that this only affects inlined functions; in the new arrow generation algorithm, the top-level function still starts at the first real statement in the function body, not the enclosing CompoundStmt. This reverts r182078 / dbfa950abe0e55b173286a306ee620eff5f72ea. llvm-svn: 182963
-
Rafael Espindola authored
The testcase in PR16060 points out that while template arguments can show that a type is not externally visible, the standards still says they have external linkage. In terms of our implementation, it means that we should merge just the isExternallyVisible bit, not the formal linkage. llvm-svn: 182962
-
Argyrios Kyrtzidis authored
Fix potential infinite loop when iterating over redeclarations of an ObjMethodDecl, resulting from invalid code. Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration of an @implementation we would move to the @interface and not reach the original declaration again. Fixes rdar://14024851 llvm-svn: 182951
-
Jordan Rose authored
It is okay to declare a block without an argument list: ^ {} or ^void {}. In these cases, the BlockDecl's signature-as-written will just contain the return type, rather than the entire function type. It is unclear if this is intentional, but the analyzer shouldn't crash because of it. <rdar://problem/14018351> llvm-svn: 182948
-
Adrian Prantl authored
Do not reuse the debug location of the return value's store if there is autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups. rdar://problem/13977888 llvm-svn: 182947
-
Adrian Prantl authored
llvm-svn: 182946
-
Daniel Jasper authored
llvm-svn: 182940
-
Aaron Ballman authored
references. What's more, they use this language extension in their ATL header files (which come as part of MFC and the Win32 SDK). This patch implements support for the Microsoft extension, and addresses PR13737. llvm-svn: 182936
-
Daniel Jasper authored
This fixes: /* * * something long going over the column limit. */ llvm-svn: 182932
-
Manuel Klimek authored
llvm-svn: 182916
-
Daniel Jasper authored
Smallest reproduction: /* ** */ llvm-svn: 182913
-
Aaron Ballman authored
Add support to fallback on operator new when a placement operator new[] is called for which there is no valid declaration. This fallback only happens in Microsoft compatibility mode. This patch addresses PR13164, and improves support for the WDK. llvm-svn: 182905
-
Jordan Rose authored
Most loop notes (like "entering loop body") are attached to the condition expression guarding a loop or its equivalent. For loops may not have a condition expression, though. Rather than crashing, just use the entire ForStmt as the location. This is probably the best we can do. <rdar://problem/14016063> llvm-svn: 182904
-
Manuel Klimek authored
When trying to fall back to search from the end onwards, we would still find leading whitespace if the leading whitespace went on after the end of the line. llvm-svn: 182886
-
- May 29, 2013
-
-
Ted Kremenek authored
This change is motivated from user feedback that some APIs use void* as an opaque "context" object that may not really be a pointer. Such users want an ability to turn off the warning for casts to void* while preserving the warning for other cases. Implements <rdar://problem/14016721>. llvm-svn: 182884
-
Roman Divacky authored
users can disable those. Just like in autoconf generated makefiles. llvm-svn: 182881
-
Jordan Rose authored
In C, 'void' is treated like any other incomplete type, and though it is never completed, you can cast the address of a void-typed variable to do something useful. (In C++ it's illegal to declare a variable with void type.) Previously we asserted on this code; now we just treat it like any other incomplete type. And speaking of incomplete types, we don't know their extent. Actually check that in TypedValueRegion::getExtent, though that's not being used by any checkers that are on by default. llvm-svn: 182880
-
Rafael Espindola authored
llvm-svn: 182874
-
Argyrios Kyrtzidis authored
[libclang] For "@import .." code-completion results, associate a CXCursor_ModuleImportDecl cursor instead of CXCursor_NotImplemented. llvm-svn: 182871
-
Reid Kleckner authored
While we can't yet emit vbtables, this allows us to find virtual bases of objects constructed in other TUs. This make iostream hello world work, since basic_ostream virtually inherits from basic_ios. Differential Revision: http://llvm-reviews.chandlerc.com/D795 llvm-svn: 182870
-
Reid Kleckner authored
MSVC's class data is always comdat, so clang's should always be linkonce_odr in LLVM IR. Reviewers: pcc Differential Revision: http://llvm-reviews.chandlerc.com/D838 llvm-svn: 182865
-
Manuel Klimek authored
Now that the TokenAnnotator does not require stack space anymore, reconstructing the lines has become the limiting factor. This patch fixes that problem, allowing large files with multiple megabytes of single unwrapped lines to be formatted. llvm-svn: 182861
-
Manuel Klimek authored
Gets rid of AnnotatedToken, putting everything into FormatToken. FormatTokens are created once, and only referenced by pointer. This enables multiple future features, like having tokens shared between multiple UnwrappedLines (while there's still work to do to fully enable that). llvm-svn: 182859
-
Daniel Jasper authored
llvm-svn: 182856
-
Daniel Jasper authored
If an identifier is on its own line and it is all upper case, it is highly likely that this is a macro that is meant to stand on a line by itself. Before: class A : public QObject { Q_OBJECT A() {} }; Ater: class A : public QObject { Q_OBJECT A() {} }; llvm-svn: 182855
-
Daniel Jasper authored
With option enabled (e.g. in Google-style): template <typename T> void f() {} With option disabled: template <typename T> void f() {} Enabling this for Google-style and Chromium-style, not sure which other styles would prefer that. llvm-svn: 182849
-
Rafael Espindola authored
This brings the number of linkage computations in "clang -cc1" in SemaExpr.ii from 58426 to 43134. With -emit-llvm the number goes from 161045 to 145461. llvm-svn: 182823
-
Jakob Stoklund Olesen authored
llvm-svn: 182821
-