aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
AgeCommit message (Collapse)Author
2012-11-14Make template diffing handle integral expressions of various widths correctly.Eli Friedman
PR14342. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14objective-C blocks: under cc1 flag -encode-extended-block-signature,Fariborz Jahanian
generate expanded signature encoding to include types as we already do this for protocol method lists. // rdar://12109031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167997 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14Teach the AST importer to merge enumerator constants. FixesDouglas Gregor
<rdar://problem/12676166>, and tested on the LLDB side of the world. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14objective-C blocks: Provide layout map for byrefFariborz Jahanian
variables captured in a block. // rdar://12184410 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14PR14279: Work around this major miscompilation by treating move operations asRichard Smith
non-trivial if they would not call a move operation, even if they would in fact call a trivial copy operation. A proper fix is to follow, but this small directed fix is intended for porting to the 3.2 release branch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14Remove debugging assert.David Blaikie
Found by Richard Smith in post-commit review of r167906. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167911 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14Provide the correct mangling and linkage for certain unnamed nested classes.David Blaikie
This corrects the mangling and linkage of classes (& their member functions) in cases like this: struct foo { struct { void func() { ... } } x; }; we were accidentally giving this nested unnamed struct 'no' linkage where it should've had the linkage of the outer class. The mangling was incorrecty too, mangling as TU-wide unnamed type mangling of $_X rather than class-scoped mangling of UtX_. This also fixes -Wunused-member-function which would incorrectly diagnose 'func' as unused due to it having no linkage & thus appearing to be TU-local when in fact it might be correctly used in another TU. Similar mangling should be applied to function local classes in similar cases but I've deferred that for a subsequent patch. Review/discussion by Richard Smith, John McCall, & especially Eli Friedman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14Remove another questionable use of hasTrivial*. The relevant thing for thisRichard Smith
test was whether the /selected/ operator= was trivial, not whether the class had any trivial (or any non-trivial) operator=s. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13[ms] Make mangleIntegerLiteral less aware of exact type of the literal.Nico Weber
Integer literal mangling does not actually depend on exact type of the literal. This will simplify calling mangleIntegerLiteral when literal type is not known, for example, when sizes or offsets are mangled as integer literals. Also, call mangleNumber instead of directly printing mangled values of 0/1, to avoid this knowledge from being in multiple places. Patch from Evgeny Eltsin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167878 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12Remove abuse of hasTrivial*, and fix miscompile wherein global arrays withRichard Smith
internal linkage, no uses, trivial construction, and nontrivial destruction were not emitted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167756 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-1280 cols & unnecessary braces from r167736.David Blaikie
Post-commit review feedback by Eli Friedman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167739 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12Correct printing of nested anonymous type member accesses.David Blaikie
Patch by Florent Bruneau! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12Remove calls to getMostRecentDecl. The case they were added for in r117526 areRafael Espindola
now covered by attribute merging. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167714 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12In Sema::MergeVarDecl we handle merging of storage classes and visibilityRafael Espindola
attributes. In cases where the merged declaration is fully equivalent to the two original ones, some of the code was getLVForDecl was duplicated. Cases that are still handled in getLVForDecl are things like __private_extern__ int N; int N; For which we cannot produce a single merged decl with all the information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-10Rework my implementation of circular-reference finding to not useDouglas Gregor
CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the failure introduced in r167651. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-10Diagnostic circular inheritance involving dependent base classes. WeDouglas Gregor
would have diagnosed this at instantiation time anyway, if only we didn't hang on all of these test cases. Fixes <rdar://problem/12629723> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167651 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-09Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBufferArgyrios Kyrtzidis
for completeness and use it in CompilerInstance::InitializeSourceManager if the input is a memory buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167628 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-09[ms] Implement int64_t version of mangleNumber() in terms of the APSInt version.Nico Weber
No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167602 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08[Windows] Fix mangling of number literal '0'Nico Weber
Do this by making the mangleNumber(APSInt) overload look like the int64_t version. (The latter should probably just delegate to the former). Test from Evgeny Eltsin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08Fix a source range regression in C++ new expressions with call initializers.David Blaikie
Introduced in r167507, discovered in review by Abramo Bagnara. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167597 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08Allow to pass from syntactic form of InitListExpr to semantic form (just as ↵Abramo Bagnara
viceversa). No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08Fixed range of implicit MemberExpr.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-07Create helper functions in StmtDumper for outputting the indentation, ↵Manuel Klimek
newlines, and brackets. This is preparation for adding Decl dumping. Patch by Philip Craig. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167509 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-07PR13552: Fix the end location of a CXXNewExpr.David Blaikie
Spent longer than reasonable looking for a nice way to test this & decided to give up for now. Open to suggestions/requests. Richard Smith suggested adding something to ASTMatchers but it wasn't readily apparent how to test this with that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167507 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-03Remove a const_cast by propagating constness to the member function.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167357 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Fix the template type diffing to handle integral template arguments.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Fix an incorrect assert, the LHS can be an LValue.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167232 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType forArgyrios Kyrtzidis
the receiver of an ObjC message expression. rdar://12578643 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167201 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31Address Jordan's review: comments, spaces.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27Move two helper functions to AST so that sema can use them.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Fix indentation.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26When an externally-supplied record layout has a size that clearlyDouglas Gregor
doesn't include padding up to the alignment of the record, take this as a cue that the alignment of the record should (conservatively) be set to 1. This is similar to other the other cues we use to determine that the record has a lower alignment, e.g., that the externally-supplied layout places fields at lower offsets than we would. Fixes <rdar://problem/12582052>; test case in LLDB. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Match up anonymous structs/unions in the ASTImporter. Previously, we'dDouglas Gregor
only actually get the answer right if there was only a single anonymous struct/union at that level. This is part of <rdar://problem/11904570>; the test will go into LLDB itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166781 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Eliminate some longstanding FIXMEs regarding variadic templates in theDouglas Gregor
ASTImporter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166777 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26In the ASTImporter, don't try to emit a diagnostic if we're notDouglas Gregor
allowed to complain about a failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166776 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25CommentDumper: reorder members and add a comment.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Don't print scope qualifiers for references to a type defined locally in a ↵Eli Friedman
function. Patch by Grzegorz Jablonski. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166617 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Address feedback from Eli Friedman on r166522.Matt Beaumont-Gay
In particular, we do want to warn on some unused cast subexpressions within macros. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166534 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Don't emit -Wunused-value warnings from macro expansions.Matt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166522 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor
the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Fix pretty-printing pseudo-destructor calls. Patch by Grzegorz Jablonski.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Fix -Wunused-value to not warn on expressions that have unresolved lookups dueMatt Beaumont-Gay
to dependent arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-21PR14141 (part of DR1351): An implicitly-deduced "any" exception specificationRichard Smith
produces an exception of 'noexcept(false)' and is thus compatible with an explicit exception specification of 'noexcept(false)'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166404 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Pretty-print a ParenListExpr in a variable initializer correctly. Patch by ↵Eli Friedman
Grzegorz Jablonski. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166311 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Remove const_casts by propagating constness down to called functions.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19DR1511: A const volatile global does not implicitly get internal linkage like aRichard Smith
const non-volatile global does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166269 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Use the type as written when pretty-printing C-style casts. Patch by ↵Eli Friedman
Grzegorz Jablonski. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18[doc parsing] use getParamName to access parameter Fariborz Jahanian
for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Remove check which incorrectly suppressed printing an identifier in type ↵Eli Friedman
printing. Patch by Benoit Perrot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Fix AST pretty-printing for C++ new expressions with placement arguments ↵Eli Friedman
with default values. Based on patch by Grzegorz Jablonski. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166226 91177308-0d34-0410-b5e6-96231b3b80d8