summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Integers which are too large should be an error.Eli Friedman2013-07-233-10/+10
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Add a -fno-math-builtin option to the Clang -cc1Eli Bendersky2013-07-232-3/+19
| | | | llvm-svn: 186899
* Implement a better fix for r186894 by setting the appropriate type for ↵Adrian Prantl2013-07-231-2/+3
| | | | | | | | __byref_variable_layout. rdar://problem/14386148 llvm-svn: 186898
* ObjectiveC migration. Better handle migration to conformingFariborz Jahanian2013-07-221-4/+10
| | | | | | | protocols by ignoring cases where all protocol properties and methods are optional. llvm-svn: 186895
* Debug Info: Acknowledge the alignment when locating byref block variables.Adrian Prantl2013-07-221-0/+1
| | | | | | Fixes rdar://problem/14386148 llvm-svn: 186894
* Don't emit open-paren fixit without close-paren.Eli Friedman2013-07-221-0/+4
| | | | | | | | | | getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure we do something sane. Fixes PR16673. I'm not sure how to write a testcase for this short of grepping through the diagnostic output. llvm-svn: 186889
* Make modules depend on the compiler's own module.map, as a proxy for the ↵Douglas Gregor2013-07-221-2/+17
| | | | | | | | | | | compiler itself. The headers in the compiler's own resource include directory are system headers, which means we don't stat() them eagerly when loading a module. Use module.map as a proxy for these headers and the compiler itself. Fixes <rdar://problem/13856838>. llvm-svn: 186870
* Use the updated name for the attribute.Bill Wendling2013-07-221-1/+1
| | | | llvm-svn: 186864
* Fixed implementation of C89 6.5.7 p3.Enea Zaffanella2013-07-221-0/+1
| | | | | | Warning should be emitted only for InitListExpr nodes. llvm-svn: 186859
* Objective-C migration: Use NS_OPTIONS when enumeratorsFariborz Jahanian2013-07-221-11/+42
| | | | | | have shift/bitwise operators or are power of 2. llvm-svn: 186856
* [arcmt] Only disable ARC in the second compilation if there were actually ↵Argyrios Kyrtzidis2013-07-221-10/+21
| | | | | | | | ARC errors in the checking phase. rdar://14490204 llvm-svn: 186850
* Update comment to refer to core issue number.Richard Smith2013-07-221-4/+2
| | | | llvm-svn: 186848
* Add support for overloaded matchers. ie different matcher function ↵Samuel Benzaquen2013-07-222-15/+109
| | | | | | | | | | | | | | | | signatures with the same name. Summary: Add support for overloaded matchers. This composes with other features, like supporting polymorphic matchers. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1188 llvm-svn: 186836
* [ms-cxxabi] Emit linkonce complete dtors in TUs that need themReid Kleckner2013-07-229-49/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on Peter Collingbourne's destructor patches. Prior to this change, clang was considering ?1 to be the complete destructor and the base destructor, which was wrong. This lead to crashes when clang tried to emit two LLVM functions with the same name. In this ABI, TUs with non-inline dtors might not emit a complete destructor. They are emitted as inline thunks in TUs that need them, and they always delegate to the base dtors of the complete class and its virtual bases. This change uses the DeferredDecls machinery to emit complete dtors as needed. Currently in clang try body destructors can catch exceptions thrown by virtual base destructors. In the Microsoft C++ ABI, clang may not have the destructor definition, in which case clang won't wrap the virtual virtual base destructor calls in a try-catch. Diagnosing this in user code is TODO. Finally, for classes that don't use virtual inheritance, MSVC always calls the base destructor (?1) directly. This is a useful code size optimization that avoids emitting lots of extra thunks or aliases. Implementing it also means our existing tests continue to pass, and is consistent with MSVC's output. We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but it will require further testing. Reviewers: rjmccall CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1066 llvm-svn: 186828
* Rename D to GD to match the type, which is GlobalDeclReid Kleckner2013-07-221-8/+10
| | | | | | Now we can save GD.getDecl() in D and shorten some casts. llvm-svn: 186826
* Implement the part of C89 6.5.7 p3 requiring a constant initializer listEnea Zaffanella2013-07-221-3/+13
| | | | | | when initializing aggregate/union types, no matter if static or not. llvm-svn: 186817
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-228-43/+47
| | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename llvm-svn: 186816
* Remove superfluous cast.Robert Wilhelm2013-07-221-2/+1
| | | | llvm-svn: 186807
* PR16288: A template is only missing a default template argument if it providesRichard Smith2013-07-221-4/+1
| | | | | | any default template arguments, not if it inherits some. llvm-svn: 186804
* Implement DR257 / fix PR16659:Richard Smith2013-07-221-7/+36
| | | | | | | | | | | | | | | A constructor for an abstract class does not call constructors for virtual base classes, so it is not an error if no initializer is present for the virtual base and the virtual base cannot be default initialized. Also provide a (disabled by default, for now) warning for the case where a virtual base class's initializer is ignored in an abstract class's constructor, and address a defect in DR257 where it was not carried through to C++11's rules for implicit deletion of special member functions. Based on a patch by Maurice Bos. llvm-svn: 186803
* SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. ↵NAKAMURA Takumi2013-07-221-2/+0
| | | | | | [-Wdocumentation] llvm-svn: 186802
* Tighten up the set of operator new/operator delete calls we're permitted toRichard Smith2013-07-213-18/+91
| | | | | | | | | optimize, to follow the permissions granted in N3664. Under those rules, only calls generated by new-expressions and delete-expressions are permitted to be optimized, and direct calls to ::operator new and ::operator delete must be treated as normal calls. llvm-svn: 186799
* Replace 'unsigned short' with 'uint16_t' in a packed data structure for ↵Craig Topper2013-07-211-1/+1
| | | | | | consistency with other fields and to be explicit about bit count. llvm-svn: 186796
* Revert r186649 because it wasn't unnecessary and add a comment.Craig Topper2013-07-211-7/+11
| | | | llvm-svn: 186795
* Convert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.Robert Wilhelm2013-07-213-70/+43
| | | | llvm-svn: 186794
* report unused-value warning also for warn_unused typesLubos Lunak2013-07-211-1/+10
| | | | llvm-svn: 186793
* Added preproc callback for pragma directives.Enea Zaffanella2013-07-202-5/+9
| | | | llvm-svn: 186770
* Add missing check for creating an instance of an abstract class through anRichard Smith2013-07-201-1/+5
| | | | | | implicit conversion sequence. llvm-svn: 186769
* add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)Lubos Lunak2013-07-202-2/+16
| | | | | | | | | The functionality is equivalent to the GCC attribute. Variables of tagged types will be warned about as unused if they are not used in any way except for possible (even non-trivial) ctors/dtors called. Useful for tagging classes like std::string (which is not part of this commit). llvm-svn: 186765
* avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)Lubos Lunak2013-07-201-0/+8
| | | | llvm-svn: 186764
* fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)Lubos Lunak2013-07-201-3/+30
| | | | | | | | Every #include is surrounded by #if 0 in order to comment it out, which adds lines. That is fixed up right after, but that all can be inside #if part that is not processed, so fix up also after every end of a conditional part. llvm-svn: 186763
* Silence GCC warning for using both enum and unsigned in a ternary expr.Benjamin Kramer2013-07-201-1/+1
| | | | llvm-svn: 186762
* DiagnosticIDs: Forbid Diag ID from being validDavid Majnemer2013-07-201-8/+4
| | | | | | | | | | Diag ID is used throughout clang as a sentinel id meaning "this is an invalid diagnostic id." Confusingly, Diag ID maps to a valid, usable, diagnostic id. Instead, start diagnostic ids at ID one. Incidently, remove an unused element from StaticDiagInfo. llvm-svn: 186760
* If a default argument is a dependent type, get the real type from the desugaredRichard Trieu2013-07-201-3/+7
| | | | | | | template. Passing around dependent types can lead to integral arguments that cannot be evaluated. llvm-svn: 186757
* Fix bug in computing POD-for-layout.Eli Friedman2013-07-201-1/+1
| | | | | | | | | | | | A class with a field of non-POD-for-layout type is not POD-for-layout. This computation should not depend on whether the field is of POD type in the language sense. Fixes PR16537. Patch by Josh Magee. llvm-svn: 186741
* Make IgnoreParens() look through ChooseExprs.Eli Friedman2013-07-2014-98/+61
| | | | | | | | | | | | | This is the same way GenericSelectionExpr works, and it's generally a more consistent approach. A large part of this patch is devoted to caching the value of the condition of a ChooseExpr; it's needed to avoid threading an ASTContext into IgnoreParens(). Fixes <rdar://problem/14438917>. llvm-svn: 186738
* FIXME fix: improving diagnostics for template arguments deduction of class ↵Larisse Voufo2013-07-195-147/+302
| | | | | | | | templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info. llvm-svn: 186730
* Revert "Use function overloading instead of template specialization for ↵Larisse Voufo2013-07-194-302/+143
| | | | | | | | diagnosis of bad template argument deductions." This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95. llvm-svn: 186729
* Fix pack instantiation with function types.Eli Friedman2013-07-191-0/+4
| | | | | | | Make sure we correctly expand packs which expand to another pack in a function type. llvm-svn: 186728
* Use function overloading instead of template specialization for diagnosis of ↵Larisse Voufo2013-07-194-143/+302
| | | | | | bad template argument deductions. llvm-svn: 186727
* Correctly handle packs for variadic type traits.Eli Friedman2013-07-191-0/+13
| | | | | | | | | | | | | | | I'm not sure how to write a test for this; the following shows the difference in -ast-dump: template <int x> struct A {}; template <class T> struct B { }; template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>; template <class ...Args> using D = C<B<Args>...>; However, I can't seem to write a test that triggers a visible difference in behavior. llvm-svn: 186726
* Add a cl.exe compatible driver modeHans Wennborg2013-07-191-0/+1
| | | | | | | The mode doesn't actually do anything yet, but this provides a way to get into it. llvm-svn: 186720
* Fix another place where clang check objc selector name instead of checking ↵Jean-Daniel Dupas2013-07-191-3/+1
| | | | | | | | | | | | the selector family Summary: In ARC mode, clang emits a warning if the result of an 'init' method is unused but miss cases where the method does not follows the Cocoa naming convention but is properly declared as an init family method. CC: cfe-commits, eli.friedman Differential Revision: http://llvm-reviews.chandlerc.com/D1163 llvm-svn: 186718
* ObjectiveC migrator: Another use case of enumFariborz Jahanian2013-07-191-3/+32
| | | | | | declaration which can be migrated to NS_ENUM. llvm-svn: 186716
* Add support for raw_ostream on the printing methods of Diagnostics.Samuel Benzaquen2013-07-191-32/+42
| | | | | | | | | | | | | | Summary: Add printToStream*(llvm::raw_ostream&) methods to Diagnostics, and reimplement everything based on streams instead of concatenating strings. Also, fix some functions to start with lowercase to match the style guide. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1187 llvm-svn: 186715
* Create calling convention AttributedType sugar nodesReid Kleckner2013-07-193-38/+121
| | | | | | | | | | | | Canonical types are unchanged. The type printer had to be changed to avoid printing any non-default implicit calling convention as well as the calling convention attribute. Reviewers: rjmccall Differential Revision: http://llvm-reviews.chandlerc.com/D1132 llvm-svn: 186714
* Fix for template substitution with packs.Eli Friedman2013-07-191-38/+27
| | | | | | | | | | When we see a pack, and replace it with a template argument which is also a pack, we want to use the pack pattern, not the expanded pack. The caller should take care of expanding the pack afterwards. Fixes PR16646. llvm-svn: 186713
* [mips] Add support for command-line options -mno-check-zero-division andAkira Hatanaka2013-07-191-0/+8
| | | | | | -mcheck-zero-division. llvm-svn: 186710
* [arcmt] After checking is successful disable auto-synthesize to avoid ↵Argyrios Kyrtzidis2013-07-191-0/+3
| | | | | | | | | | "@synthesize of 'weak' property is only allowed in ARC" errors. rdar://14461559 llvm-svn: 186709
* Replace some existing type attribute diagnostics with aAaron Ballman2013-07-191-17/+16
| | | | | | single diagnostic that selects. No functional changes intended. llvm-svn: 186708
OpenPOWER on IntegriCloud