summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add SourceRange to PPCallbacks::Defined callback.John Thompson2013-07-192-10/+16
| | | | llvm-svn: 186707
* Fix source range of implicitly instantiated friend declaration.Enea Zaffanella2013-07-191-0/+1
| | | | llvm-svn: 186702
* Fixes an ObjC migrator crash when last declFariborz Jahanian2013-07-191-3/+4
| | | | | | in file is an enum. llvm-svn: 186700
* This patch implements __get_cpuid_max() as an inline and __cpuid() andRoman Divacky2013-07-191-2/+124
| | | | | | | | | | | | | __cpuid_count() as macros to be compatible with GCC's cpuid.h. It also adds bit_<foo> constants for the various feature bits as described in version 039 (May 2011) of Intel's SDM Volume 2 in the description of the CPUID instruction. The list of bit_<foo> constants is a bit exhaustive (GCC doesn't do near this many). More bits could be added from a newer version of SDM if desired. Patch by John Baldwin! llvm-svn: 186696
* [SystemZ] Add -march= command-line optionRichard Sandiford2013-07-193-2/+34
| | | | llvm-svn: 186694
* [SystemZ] Enable frame-pointer elimination for -O1 and aboveRichard Sandiford2013-07-191-4/+6
| | | | | | Copies the x86 behavior. llvm-svn: 186674
* Allow clang tools to display an overview when using the CommonOptionsParser.Manuel Klimek2013-07-191-2/+3
| | | | | | Patch by Guillaume Papin. llvm-svn: 186671
* Simplify the CodeGenFunction::Build*Virtual*Call family of functionsTimur Iskhodzhanov2013-07-194-65/+40
| | | | llvm-svn: 186657
* Remove trailing whitespace.Craig Topper2013-07-191-5/+4
| | | | llvm-svn: 186652
* Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.Craig Topper2013-07-191-11/+7
| | | | llvm-svn: 186649
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-1914-12/+987
| | | | llvm-svn: 186647
* ObjectiveC migrator: add support to migrate toFariborz Jahanian2013-07-191-5/+12
| | | | | | NS_OPTIONS. llvm-svn: 186641
* [analyzer] Include analysis stack in crash traces.Jordan Rose2013-07-195-9/+73
| | | | | | | | | | | | | Sample output: 0. Program arguments: ... 1. <eof> parser at end of file 2. While analyzing stack: #0 void inlined() #1 void test() 3. crash-trace.c:6:3: Error evaluating statement llvm-svn: 186639
* Update createCompileUnit call for llvm changes.Eric Christopher2013-07-191-5/+4
| | | | llvm-svn: 186638
* Clean up diagnostics for inheriting constructors.Eli Friedman2013-07-182-6/+21
| | | | | | | No new diagnostics, just better wording and notes pointing at more relevant locations. llvm-svn: 186629
* ObjectiveC migrator: Remove semicolon after the typedefFariborz Jahanian2013-07-182-96/+101
| | | | | | | declaration when converting to NS_ENUM. This required some code refactoring. llvm-svn: 186619
* Address -Wreorder warning in Driver.cppHans Wennborg2013-07-181-2/+2
| | | | llvm-svn: 186617
* Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,Hans Wennborg2013-07-182-29/+59
| | | | | | | | | | | | and add a new option --driver-mode= to control it explicitly. The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there are currently really three modes that Clang can run in: gcc, g++ or cpp, so it makes sense to represent them as an enum. Having a command line flag to control it helps testing. llvm-svn: 186605
* ObjectiveC migration. migration to NS_ENUM/SN_OPTIONFariborz Jahanian2013-07-182-0/+40
| | | | | | - wip. llvm-svn: 186604
* Separate the notion of 'context' when recursing down in the parser and ↵Samuel Benzaquen2013-07-184-59/+98
| | | | | | | | | | | | | | | | | actual errors. Summary: Change how error messages are constructed and stored in Diagnostics. Separate the notion of 'context' when recursing down in the parser and actual errors. This will simplify adding some new features, like argument overloading and error recovery. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1168 llvm-svn: 186602
* Switching to use checkAttributeNumArgs for trivial cases. No functional ↵Aaron Ballman2013-07-181-10/+4
| | | | | | changes intended. llvm-svn: 186591
* Replacing a morally duplicate diagnostic by adding it to an existing ↵Aaron Ballman2013-07-181-3/+6
| | | | | | diagnostic's select list. Updates the tests for the more consistent diagnostic. llvm-svn: 186584
* clang-format: Fix bad line break with pointers to members.Daniel Jasper2013-07-181-1/+1
| | | | | | | | | | | | | | | | | | | Before: void f() { (a->* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb); } After: void f() { (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)( aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb); } Also add missing test case. llvm-svn: 186583
* Fix crash in libclang if code completion is used with unknown flags.Manuel Klimek2013-07-181-1/+1
| | | | | | | Use CaptureDroppedDiagnostics to make sure that there is a diagnostic client installed when warning flags are parsed. llvm-svn: 186582
* Removed a parameter from handleAttrWithMessage to make it more consistent ↵Aaron Ballman2013-07-181-5/+5
| | | | | | with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case. llvm-svn: 186578
* s/BuiltinLocation/ArtificialLocation/Adrian Prantl2013-07-183-10/+10
| | | | llvm-svn: 186557
* Instead of checking against some version of "isType()" go ahead andEric Christopher2013-07-181-14/+14
| | | | | | | use the conversion to bool to check if we've managed to get a type that isn't default constructed - as we meant to in the first place. llvm-svn: 186556
* Fix a compile error caught by bb-chapuni.Adrian Prantl2013-07-181-2/+3
| | | | llvm-svn: 186555
OpenPOWER on IntegriCloud