- May 03, 2012
-
-
Kaelyn Uhrain authored
llvm-svn: 156091
-
Richard Smith authored
cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the case of intentional fallthrough. Patch by Alexander Kornienko! The handling of C++11 attribute namespaces in this patch is temporary, and will be replaced with a cleaner mechanism in a subsequent patch. llvm-svn: 156086
-
Fariborz Jahanian authored
under -Wobjc-missing-property-synthesis which must be opted-in. // rdar://11295716 llvm-svn: 156078
-
Richard Trieu authored
#define TEST int y; int x = y; void foo() { TEST } -Wuninitialized gives this warning: invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here [-Wuninitialized] TEST ^~~~ invalid-loc.cc:2:29: note: expanded from macro 'TEST' #define TEST int y; int x = y; ^ note: initialize the variable 'y' to silence this warning 1 warning generated. The second note lacks filename, line number, and code snippet. This change will remove the fixit and only point to variable declaration. invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here [-Wuninitialized] TEST ^~~~ invalid-loc.cc:2:29: note: expanded from macro 'TEST' #define TEST int y; int x = y; ^ invalid-loc.cc:4:3: note: variable 'y' is declared here TEST ^ invalid-loc.cc:2:14: note: expanded from macro 'TEST' #define TEST int y; int x = y; ^ 1 warning generated. llvm-svn: 156045
-
Richard Smith authored
refactorings in that revision, and some of the subsequent bugfixes, which seem to be relevant even without delayed exception specification parsing. llvm-svn: 156031
-
DeLesley Hutchins authored
llvm-svn: 156030
-
- May 02, 2012
-
-
Rafael Espindola authored
them, otherwise we cannot produce an error for both struct HIDDEN test4; // canonical struct test4; struct DEFAULT test4; and struct test5; // canonical struct HIDDEN test5; struct DEFAULT test5; llvm-svn: 156016
-
DeLesley Hutchins authored
llvm-svn: 156005
-
Douglas Gregor authored
TableGen-generated StringMatcher, for a 1.2% speedup in -fparse-only time in <rdar://problem/11004361>. Thanks to Benjamin for pointing me at StringMatcher! llvm-svn: 156003
-
Douglas Gregor authored
we accept are not modeled somehow via Attr.td. llvm-svn: 155998
-
Douglas Gregor authored
as an AST node, and fold a number of such attributes into Attr.td. llvm-svn: 155995
-
Douglas Gregor authored
and const (as "__const") using tblgen, rather than explicitly hacking them in. llvm-svn: 155991
-
Douglas Gregor authored
Benjamin has suggested a better approach. llvm-svn: 155989
-
Douglas Gregor authored
IdentifierInfo *) with a static StringMap, improving -fsyntax-only performance by 1% for the example in <rdar://problem/11004361>. llvm-svn: 155987
-
Kaelyn Uhrain authored
of giving unhelpful errors about undeclared identifers and missing semicolons. llvm-svn: 155965
-
Douglas Gregor authored
folding its one check into the normal path for checking overridden Objective-C methods. Good for another 3.6% speedup on the test case in <rdar://problem/11004361>. llvm-svn: 155961
-
Douglas Gregor authored
declared in a subclass has consistent parameter types with a method having the same selector in a superclass performs a significant number of lookups into the class hierarchy. In the example in <rdar://problem/11004361>, we spend 4.7% of -fsyntax-only time in these lookups. Optimize away most of the calls to this routine (Sema::CompareMethodParamsInBaseAndSuper) by first checking whether we have ever seen *any* method with that selector (using the global selector table). Since most selectors are unique, we can avoid the cost of this name lookup in many cases, for a 3.3% speedup. llvm-svn: 155958
-
rdar://problem/11333367Eli Friedman authored
While I'm here, fix source locations for other diagnostics related to property synthesis. llvm-svn: 155953
-
- May 01, 2012
-
-
Patrick Beard authored
BuildObjCNumericLiteral() and BuildObjCBoxedExpr() now both using PerformCopyInitialization() rather than PerformImplicitConversion(), which suppresses errors. In BuildObjCBoxedExpr(): no longer calling .getCanonicalType(), ValueType->getAs() will remove the minimal amount of sugar. Using ValueType->isBuiltinType() instead of isa<BuiltinType>(ValueType). llvm-svn: 155949
-
Rafael Espindola authored
decls to work on function templates specializations. llvm-svn: 155943
-
David Blaikie authored
llvm-svn: 155938
-
Douglas Gregor authored
[basic.lookup.classref]p1 and p4, which concerns name lookup for nested-name-specifiers and template names, respectively, in a member access expression. C++98/03 forces us to look both in the scope of the object and in the current scope, then compare the results. C++11 just takes the result from the scope of the object, if something is found. Fixes <rdar://problem/11328502>. llvm-svn: 155935
-
David Blaikie authored
Based on Chandler Carruth's feedback on r155869. llvm-svn: 155929
-
David Blaikie authored
I broke this in r155838 by not actually instantiating non-dependent default arg expressions. The motivation for that change was to avoid producing duplicate conversion warnings for such default args (we produce them once when we parse the template - there's no need to produce them at each instantiation) but without actually instantiating the default arg, things break in weird ways. Technically, I think we could still get the right diagnostic experience without the bugs if we instantiated the non-dependent args (for non-dependent params only) immediately, rather than lazily. But I'm not sure if such a refactoring/ change would be desirable so here's the conservative fix for now. llvm-svn: 155893
-
Douglas Gregor authored
diagnostic, from Eitan Adler! llvm-svn: 155876
-
Kaelyn Uhrain authored
llvm-svn: 155871
-
Kaelyn Uhrain authored
llvm-svn: 155870
-
David Blaikie authored
Similar to r155808 - this mistake has been made in a few iterators. Based on Chandler Carruth's feedback to r155808 I added an implicit conversion to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the dyn_cast (due to template argument deduction causing the conversion not to be used) - there for future convenience, though. This idiom (op T* for iterators) seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I fix up the other iterators here. llvm-svn: 155869
-
Douglas Gregor authored
clang_getCursorLexicalParent should return a translation unit cursor for declarations at the global scope, from Evan P. Fixes PR9083. llvm-svn: 155858
-
Richard Smith authored
being used in an exception specification in a way which isn't otherwise ill-formed in C++98: this warning also incorrectly triggered on uses of 'this' inside thread-safety attributes, and the mechanism required to tell these cases apart is more complex than can be justified by the (minimal) value of this part of -Wc++98-compat. llvm-svn: 155857
-
Argyrios Kyrtzidis authored
of a local variable, make sure we don't infinitely recurse when the reference binds to itself. e.g: int* func() { int& i = i; // assign non-exist variable to a reference which has same name. return &i; // return pointer } rdar://11345441 llvm-svn: 155856
-
- Apr 30, 2012
-
-
David Blaikie authored
Reviewed by Doug Gregor. llvm-svn: 155839
-
David Blaikie authored
Apparently we weren't checking default arguments when they were instantiated. This adds the check, fixes the lack of instantiation caching (which seems like it was mostly implemented but just missed the last step), and avoids implementing non-dependent default args (for non-dependent parameter types) as uninstantiated default arguments (so that we don't warn once for every instantiation when it's not instantiation dependent). Reviewed by Richard Smith. llvm-svn: 155838
-
Douglas Gregor authored
when we're in an Objective-C container context. Fixes <rdar://problem/11286701>. llvm-svn: 155836
-
Richard Trieu authored
in the loop conditional do not change. llvm-svn: 155835
-
David Blaikie authored
filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
-
- Apr 29, 2012
-
-
Richard Smith authored
type. But a glvalue can be reinterpret_cast to either flavor of reference. llvm-svn: 155789
-
Richard Smith authored
diagnostic, add a test for this paragraph, and tighten up the diagnostic wording a little. llvm-svn: 155784
-
- Apr 28, 2012
-
-
Julien Lerouge authored
i32 __builtin_annotation(i32, string); Applying it to i64 (e.g., long long) generates the following IR. trunc i64 {{.*}} to i32 call i32 @llvm.annotation.i32 zext i32 {{.*}} to i64 The redundant truncation and extension make the result difficult to use. This patch makes __builtin_annotation() generic. type __builtin_annotation(type, string); For the i64 example, it simplifies the generated IR to: call i64 @llvm.annotation.i64 Patch by Xi Wang! llvm-svn: 155764
-
Benjamin Kramer authored
llvm-svn: 155757
-