summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement most of the remaining logic in __is_literal type trait. ThisChandler Carruth2011-04-244-25/+56
| | | | | | | should now support all of the C++98 types, and all of the C++0x types Clang supports. llvm-svn: 130079
* Add support for '__is_literal_type' spelling of the existingChandler Carruth2011-04-243-0/+3
| | | | | | | | '__is_literal' type trait for GCC compatibility. At least one relased version if libstdc++ uses this name for the trait despite it not being documented anywhere. llvm-svn: 130078
* Begin tracking trivialness of move constructors and move assignmentChandler Carruth2011-04-233-52/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operators in C++ record declarations. This patch starts off by updating a bunch of the standard citations to refer to the draft 0x standard so that the semantics intended for move varianst is clear. Where necessary these are duplicated so they'll be available in doxygen. It adds bit fields to keep track of the state for the move constructs, and updates all the code necessary to track this state (I think) as members are declared for a class. It also wires the state into the various trait-like accessors in the AST's API, and tests that the type trait expressions now behave correctly in the presence of move constructors and move assignment operators. This isn't complete yet due to these glaring FIXMEs: 1) No synthesis of implicit move constructors or assignment operators. 2) I don't think we correctly enforce the new logic for both copy and move trivial checks: that the *selected* copy/move constructor/operator is trivial. Currently this requires *all* of them to be trivial. 3) Some of the trait logic needs to be folded into the fine-grained trivial bits to more closely match the wording of the standard. For example, many of the places we currently set a bit to track POD-ness could be removed by querying other more fine grained traits on demand. llvm-svn: 130076
* Teach the AST reader and writer to preserve the __DEPRECATED bit inChandler Carruth2011-04-232-0/+3
| | | | | | | | | | | language options, and warn when reading an AST with a different value for the bit. There doesn't appear to be a good way to test this (commenting out similar other language options doesn't break anything) but if folks have suggestions on tests I'm happy to add them. llvm-svn: 130071
* Remove unused STL header includes.Jay Foad2011-04-235-6/+0
| | | | llvm-svn: 130068
* Move all of the logic for __DEPRECATED to the driver based on commentsChandler Carruth2011-04-233-12/+11
| | | | | | from dgregor. llvm-svn: 130066
* "note" location of forward class used as receiver ofFariborz Jahanian2011-04-233-5/+8
| | | | | | | a 'deprecated' selector in the diagnostics for the selector. // rdar://9309223 llvm-svn: 130062
* Remove unnecessary const away cast in LateTemplateParserCallback.Francois Pichet2011-04-232-3/+3
| | | | llvm-svn: 130058
* Implement basic __is_trivial type-trait support, enough to close PR9472.Chandler Carruth2011-04-238-0/+51
| | | | | | | | | | | | | | | | | | This introduces a few APIs on the AST to bundle up the standard-based logic so that programmatic clients have access to exactly the same behavior. There is only one serious FIXME here: checking for non-trivial move constructors and move assignment operators. Those bits need to be added to the declaration and accessors provided. This implementation should be enough for the uses of __is_trivial in libstdc++ 4.6's C++98 library implementation. Ideas for more thorough test cases or any edge cases missing would be appreciated. =D llvm-svn: 130057
* Sort the type traits in a few places where they weren't previouslyChandler Carruth2011-04-234-8/+8
| | | | | | sorted in order to prepare for adding some new ones. llvm-svn: 130056
* Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. ThisChandler Carruth2011-04-233-1/+20
| | | | | | | | | | | | | | | | | | matches GCC behavior which libstdc++ uses to limit #warning-based messages about deprecation. The machinery involves threading this through a new '-fdeprecated-macro' flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We turn the flag off in the driver when the warning is turned off (modulo matching some GCC bugs). We record this as a language option, and key the preprocessor on the option when introducing the define. A separate flag rather than a '-D' flag allows us to properly represent the difference between C and C++ builds (only C++ receives the define), and it allows the specific behavior of following -Wdeprecated without potentially impacting the set of user-provided macro flags. llvm-svn: 130055
* Like the coding standards say, do not use "using namespace std".Jay Foad2011-04-232-5/+2
| | | | llvm-svn: 130054
* There were some frustrating problems with the implementation ofChandler Carruth2011-04-232-2/+12
| | | | | | | | | | | | | | | | | | | | -Wwrite-strings. First and foremost, once the positive form of the flag was passed, it could never be disabled by passing -Wno-write-strings. Also, the diagnostic engine couldn't in turn use -Wwrite-strings to control diagnostics (as GCC does) because it was essentially hijacked to drive the language semantics. Fix this by giving CC1 a clean '-fconst-strings' flag to enable const-qualified strings in C and ObjC compilations. Corresponding '-fno-const-strings' is also added. Then the driver is taught to introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings' dominates. This entire flag is basically GCC-bug-compatibility driven, so we also match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm open to changing this though as it seems insane. llvm-svn: 130051
* Diagnose C++ abstract parameters for Objective-C methods.John McCall2011-04-231-11/+3
| | | | llvm-svn: 130045
* Exhaust the cases.Argyrios Kyrtzidis2011-04-231-1/+2
| | | | llvm-svn: 130043
* Fix an assertion when code-completing, rdar://9288730 & http://llvm.org/PR9728.Argyrios Kyrtzidis2011-04-231-1/+6
| | | | llvm-svn: 130042
* Tie debug information for method declaration with debug information for ↵Devang Patel2011-04-232-3/+32
| | | | | | method definition. llvm-svn: 130037
* Don't allow reinterpret_cast to reference of vector element and property ↵Argyrios Kyrtzidis2011-04-221-3/+12
| | | | | | expression. Thanks goes to Eli Friedman! llvm-svn: 130036
* don't warn about empty macro arguments in c++'0x mode, since it sucked inChris Lattner2011-04-221-2/+2
| | | | | | the c99 preprocessor. Patch by Jonathan Sauer! llvm-svn: 130031
* Correctly emit a diagnostic for multiple templated function definitions in ↵Francois Pichet2011-04-223-18/+20
| | | | | | -flate-template-parsing mode. llvm-svn: 130030
* reinterpret_cast to reference of a bit-field is not allowed.Argyrios Kyrtzidis2011-04-221-0/+7
| | | | | | Fixes rdar://9202628 & http://llvm.org/PR9564. llvm-svn: 130024
* At the end of the translation unit, defining a vtable can introduceDouglas Gregor2011-04-223-18/+35
| | | | | | | | new templates that need to be instantiated and vice-versa. Iterate until we've instantiated all required templates and defined all required vtables. Fixed PR9325 / <rdar://problem/9055177>. llvm-svn: 130023
* Add -fdelayed-template-parsing option. Using this option all templated ↵Francois Pichet2011-04-2212-4/+286
| | | | | | | | | function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup. Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
* Fixes an instance method meta-data generation bug inFariborz Jahanian2011-04-223-2/+10
| | | | | | | | | | | ObjC NeXt runtime where method pointer registered in metadata belongs to an unrelated method. Ast part of this fix, I turned at @end missing warning (for class implementations) into an error as we can never be sure that meta-data being generated is correct. // rdar://9072317 llvm-svn: 130019
* Do not return true from MergeFunctionDecl for a warn_static_non_static ↵Francois Pichet2011-04-221-6/+8
| | | | | | warning in Microsoft mode. llvm-svn: 130010
* For -Wlogical-op-parentheses, point at '&&', not '||'. Fixes rdar://9125333.Argyrios Kyrtzidis2011-04-221-6/+5
| | | | llvm-svn: 130009
* I concur with DPG here. This does indeed apply in 0x mode. Added testChandler Carruth2011-04-221-2/+1
| | | | | | | | | cases that demonstrates exactly why this does indeed apply in 0x mode. If isPOD is currently broken in 0x mode, we should fix that directly rather than papering over it here. llvm-svn: 130007
* Don't enter a qualified scope for an invalid decl.Argyrios Kyrtzidis2011-04-221-2/+2
| | | | | | Fixes assertion later on. rdar://9122937 & http://llvm.org/PR9459 llvm-svn: 130006
* Add static analyzer support for C++'0X nullptr. Patch by Jim Goodnow II.Ted Kremenek2011-04-222-1/+4
| | | | llvm-svn: 130003
* Replace a couple of literal 8s with ASTContext::getCharWidth(). No change inKen Dyck2011-04-221-4/+8
| | | | | | functionality intended. llvm-svn: 130002
* Eliminate some literal 8s from EmitNullInitialization() by convertingKen Dyck2011-04-221-7/+9
| | | | | | variables to CharUnits. No change in functionality intended. llvm-svn: 130001
* In IsUserDefinedConversion try to recover from RequireCompleteType returning ↵Argyrios Kyrtzidis2011-04-221-1/+5
| | | | | | | | true. Fixes an assertion later on, rdar://9122862 & http://llvm.org/PR9460. llvm-svn: 130000
* Eliminate some literal 8s from EmitDeclare by converting to CharUnits. NoKen Dyck2011-04-221-5/+5
| | | | | | change in functionality intended. llvm-svn: 129999
* Use CharUnits to eliminate some literal 8s inKen Dyck2011-04-221-9/+11
| | | | | | EmitTypeForVarWithBlocksAttr(). No change in functionality intended. llvm-svn: 129998
* Replace some literal 8s with char width and char align. No change inKen Dyck2011-04-221-2/+2
| | | | | | functionality intended. llvm-svn: 129996
* PTX: Add default PTX calling conventionsJustin Holewinski2011-04-221-0/+72
| | | | llvm-svn: 129987
* For consistency, change suffix from war_ to warn_ for some Microsoft ↵Francois Pichet2011-04-224-5/+5
| | | | | | warnings I introduced lately. llvm-svn: 129986
* Downgrade error "static declaration of 'foo' follows non-static declaration" ↵Francois Pichet2011-04-221-2/+4
| | | | | | to a warning in Microsoft mode. llvm-svn: 129985
* ForArgyrios Kyrtzidis2011-04-222-10/+28
| | | | | | | | double data[20000000] = { [19999999] = 1 }; Don't serialize the filler multiple times. llvm-svn: 129983
* Fix crashing rdar://9122854 & http://llvm.org/PR9461.Argyrios Kyrtzidis2011-04-221-1/+3
| | | | llvm-svn: 129967
* Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (atNick Lewycky2011-04-215-3/+28
| | | | | | | | | compile time) and .gcda emission (at runtime). --coverage enables both. This does not yet add the profile_rt library to the link step if -fprofile-arcs is enabled when linking. llvm-svn: 129956
* Fix indentation. No functional change.Nick Lewycky2011-04-211-2/+2
| | | | llvm-svn: 129954
* Don't hide #warnings in a system header, same as gcc. Fixes rdar://8495837.Argyrios Kyrtzidis2011-04-211-0/+6
| | | | llvm-svn: 129951
* Move the check whether a diagnostic must be ignored because it is in a ↵Argyrios Kyrtzidis2011-04-211-26/+13
| | | | | | | | system header inside DiagnosticIDs::getDiagnosticLevel. llvm-svn: 129950
* Fix gcc warning. Add parens to this assert, incidentally reassociating it, ↵Richard Smith2011-04-211-1/+1
| | | | | | but the condition is the same either way. llvm-svn: 129948
* Add a fixit suggest for missing case keywords inside a switch scope. For ↵Richard Trieu2011-04-212-5/+31
| | | | | | | | | | | instance, in the following code, 'case ' will be suggested before the '1:' switch (x) { 1: return 0; default: return 1; } llvm-svn: 129943
* Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though theyDaniel Dunbar2011-04-212-5/+9
| | | | | | can't be represented in the environment define. llvm-svn: 129939
* Use the ArrayFiller to fill out "holes" in the array initializer due to ↵Argyrios Kyrtzidis2011-04-212-1/+15
| | | | | | | | designated initializers, avoiding to create separate Exprs for each one. llvm-svn: 129933
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-215-7/+8
| | | | llvm-svn: 129929
* Adds a function to run FrontendActions over in-memory code. This isManuel Klimek2011-04-213-0/+224
| | | | | | | | the first step towards a standalone Clang tool infrastructure. The plan is to make it easy to build command line tools that run over the AST of source files in a project outside of the build system. llvm-svn: 129924
OpenPOWER on IntegriCloud