summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* When generating printf fixits, preserve the original formating for unsigned ↵Ted Kremenek2011-04-251-1/+3
| | | | | | integers (e.g., 'x', 'o'). llvm-svn: 130164
* Ir-gen the side-effect(s) when __builtin_expect isFariborz Jahanian2011-04-251-0/+9
| | | | | | constant-folded. // rdar://9330105 llvm-svn: 130163
* Fix a crash when ASTReader emits diagnostic when another one is in flight. ↵Argyrios Kyrtzidis2011-04-251-4/+11
| | | | | | Fixes rdar//9334563. llvm-svn: 130162
* Implements the strncmp() checker just like the strcmp() checker, but with ↵Lenny Maiorani2011-04-251-2/+32
| | | | | | bounds. Requires LLVM svn r129582. llvm-svn: 130161
* 'extern' variables in functions don't shadow externs in global scope. Fixes ↵Argyrios Kyrtzidis2011-04-251-14/+4
| | | | | | rdar://8883302, this time for C++ as well. llvm-svn: 130157
* Add libstdc++ search paths for GCC 4.6.0 on Arch Linux. Patch by Jakub ↵Nico Weber2011-04-251-0/+7
| | | | | | Wieczorek. llvm-svn: 130152
* Driver: When compilation fails, don't try to remove output files we don't haveDaniel Dunbar2011-04-251-0/+6
| | | | | | write access to. llvm-svn: 130150
* don't use compound literals in MM macros, since they will be instantiatedChris Lattner2011-04-251-3/+5
| | | | | | into user code which may warn about them with -pedantic. Patch by Jonathan Sauer! llvm-svn: 130149
* fix PR9474, a crash with -fshort-enum and C++ templates: when instantiatingChris Lattner2011-04-252-12/+10
| | | | | | | the enum decl, we need to use an integer type the same size as the enumerator, which may not be the promoted type with packed enums. llvm-svn: 130148
* Recognize gcc's ms_struct pragma (and ignore for now).Fariborz Jahanian2011-04-255-2/+53
| | | | | | This is wip. llvm-svn: 130138
* Minor tweak to avoid having to dig through canonical types multiple times ↵Douglas Gregor2011-04-251-3/+6
| | | | | | when checking a qualification conversion llvm-svn: 130136
* When Sema::ClassifyName() finds an invalid ivar reference, return anDouglas Gregor2011-04-252-12/+3
| | | | | | | invalid expression rather than the far-more-generic "error". Fixes a mild regression in error recovery uncovered by the GCC testsuite. llvm-svn: 130128
* Remove some more hard CR-LF lines. These were particularly weird as they wereChandler Carruth2011-04-251-1/+1
| | | | | | | only a few lines of the file. Also set their properties to have explicitly native eol sytle. llvm-svn: 130124
* t/clang/expr-traitsJohn Wiegley2011-04-2513-0/+164
| | | | | | | | | Patch authored by David Abrahams. These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for parsing code that employs certain features of the Embarcadero C++ compiler. llvm-svn: 130122
* Let clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.Nico Weber2011-04-251-2/+5
| | | | llvm-svn: 130119
* PR4304: Add warning for designators in strict c89 mode.Eli Friedman2011-04-241-0/+3
| | | | llvm-svn: 130117
* Use template magic to make dumping of vectors slightly less fragile.Benjamin Kramer2011-04-241-27/+18
| | | | | | No intended functionality change. llvm-svn: 130114
* Convert size and alignment variables to CharUnits in EmitAggregateCopy(). NoKen Dyck2011-04-241-7/+10
| | | | | | change in functionality intended. llvm-svn: 130113
* Convert type size and alignment to CharUnits in CheckAggExprForMemSetUse().Ken Dyck2011-04-241-8/+9
| | | | | | No change in functionality intended. llvm-svn: 130112
* Convert the return type of GetNumNonZeroBytesInInit() to CharUnits. NoKen Dyck2011-04-241-7/+8
| | | | | | change in functionality intended. llvm-svn: 130111
* Eliminate some literal 8s by converting size variables in EmitGCMove() andKen Dyck2011-04-241-4/+4
| | | | | | EmitFinalDestCopy() to CharUnits. No change in functionality intended. llvm-svn: 130110
* Replace calls to ASTContext::getTypeInfo() with calls toKen Dyck2011-04-241-6/+2
| | | | | | | ASTContext::getTypeSize() when only the size part is used. No change in functionality intended. llvm-svn: 130109
* Simplify AppendTailPadding() by converting its parameter to CharUnits. NoKen Dyck2011-04-241-11/+7
| | | | | | change in functionality intended. llvm-svn: 130108
* Eliminate literal 8s from LayoutUnionField by converting NumBytesToAppend toKen Dyck2011-04-241-4/+5
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 130107
* Eliminate literal 8s from LayoutBitField(), converting variables toKen Dyck2011-04-241-10/+16
| | | | | | | CharUnits or replacing the 8s with char align. No change in functionality intended. llvm-svn: 130106
* Set the correct anonymous namespace (must be last reopening), and behave ↵Sebastian Redl2011-04-242-9/+16
| | | | | | correctly in the presence of the ever-annoying linkage specifications. llvm-svn: 130105
* Fix adding an anonymous namespace in a chained PCH to a namespace from a ↵Sebastian Redl2011-04-243-1/+26
| | | | | | | | previous PCH. Fix anonymous namespaces in PCH. llvm-svn: 130104
* Synthesizing the definition of an implicit member is an AST modification, so ↵Sebastian Redl2011-04-244-0/+36
| | | | | | notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug. llvm-svn: 130103
* On reading DeclContexts from PCH, check for visible updates even if the ↵Sebastian Redl2011-04-241-14/+18
| | | | | | context was empty in the original version. Also, if there are any, tell the context that it has external visible decls. This fixes the problem that a namespace that was empty in the initial PCH (could also happen if the initial PCH didn't include any std header but caused implicit creation of namespace std, e.g. due to implicit declaration of a virtual destructor) never found any declaration declared in *any* chained PCH. Very ugly when the chained PCH includes all that std stuff, as the errors were effectively the same as not including std headers. llvm-svn: 130102
* Make the invalid declarator recovery when parsing members work the same as ↵Sebastian Redl2011-04-241-1/+1
| | | | | | when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case. llvm-svn: 130101
* Store the full list of pending instantiations in a chained PCH. Previously ↵Sebastian Redl2011-04-242-15/+13
| | | | | | we attempted to store only new pending instantiations, but our filter was incorrect, dropping implicit instantiations of class template members. It's just not worth coming up with a complex filter that is correct, when the only cost is PCH files that are a few hundred bytes (at most) larger. llvm-svn: 130098
* Downgrade unnecessary "typename" from error to warning in Microsoft mode. Francois Pichet2011-04-241-1/+4
| | | | | | | | This fixes 1 error when parsing MSVC 2008 headers with clang. Must "return true;" even if it is a warning because the rest of the code path assumes that SS is set to something. The parser will get back on its feet and continue parsing the rest of the declaration correctly so it is not a problem. llvm-svn: 130088
* Convert AccessInfo::AccessAlignment to CharUnits. No change in functionalityKen Dyck2011-04-243-9/+10
| | | | | | intended. llvm-svn: 130087
* PR9214: Convert the DIBuilder API to use ArrayRef.Jay Foad2011-04-241-29/+17
| | | | llvm-svn: 130086
* Convert CGBitFieldInfo::FieldByteOffset to CharUnits. No change inKen Dyck2011-04-243-9/+13
| | | | | | functionality intended. llvm-svn: 130085
* GCC seems to create address-of expression manglings when passing *any*John McCall2011-04-241-2/+1
| | | | | | | function as a template argument where a pointer to function is wanted. Just extend the existing hack. llvm-svn: 130084
* Update the mangler for some of the "new" unresolved-name manglings.John McCall2011-04-241-77/+206
| | | | | | | | | | I've sent off an email requesting clarification on a few things that I wasn't sure how to handle. This also necessitated making prefixes and unresolved-prefixes get mangled separately. llvm-svn: 130083
* Implement a new identifier-classification scheme where SemaDouglas Gregor2011-04-246-63/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performs name lookup for an identifier and resolves it to a type/expression/template/etc. in the same step. This scheme is intended to improve both performance (by reducing the number of redundant name lookups for a given identifier token) and error recovery (by giving Sema a chance to correct type names before the parser has decided that the identifier isn't a type name). For example, this allows us to properly typo-correct type names at the beginning of a statement: t.c:6:3: error: use of undeclared identifier 'integer'; did you mean 'Integer'? integer *i = 0; ^~~~~~~ Integer t.c:1:13: note: 'Integer' declared here typedef int Integer; ^ Previously, we wouldn't give a Fix-It because the typo correction occurred after the parser had checked whether "integer" was a type name (via Sema::getTypeName(), which isn't allowed to typo-correct) and therefore decided to parse "integer * i = 0" as an expression. By typo-correcting earlier, we typo-correct to the type name Integer and parse this as a declaration. Moreover, in this context, we can also typo-correct identifiers to keywords, e.g., t.c:7:3: error: use of undeclared identifier 'vid'; did you mean 'void'? vid *p = i; ^~~ void and recover appropriately. Note that this is very much a work-in-progress. The new Sema::ClassifyName is only used for expression-or-declaration disambiguation in C at the statement level. The next steps will be to make this work for the same disambiguation in C++ (where functional-style casts make some trouble), then push it further into the parser to eliminate more redundant name lookups. Fixes <rdar://problem/7963833> for C and starts us down the path of <rdar://problem/8172000>. llvm-svn: 130082
* The ABI settled on mangling float literals with lowercase hex dumps.John McCall2011-04-241-5/+18
| | | | | | | APInt::toString doesn't do those, but it's easy to postprocess that output, and that's probably better than adding another knob to that method. llvm-svn: 130081
* 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
OpenPOWER on IntegriCloud