summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* objective-C modern translator. More fixups for Fariborz Jahanian2013-02-072-2/+71
| | | | | | | modern meta-data abi translation. Still wip. // rdar://13138459 llvm-svn: 174672
* clang-format: Don't put useless space in f( ::g()).Daniel Jasper2013-02-072-2/+4
| | | | llvm-svn: 174662
* Add missing header from r174648Douglas Gregor2013-02-071-0/+3
| | | | llvm-svn: 174649
* Retain all hidden methods in the global method pool, because they may become ↵Douglas Gregor2013-02-075-0/+18
| | | | | | visible <rdar://problem/13172858>. llvm-svn: 174648
* libclang: reduce CXString abuseDmitri Gribenko2013-02-071-25/+20
| | | | | | | | | ContainerUSR is not really a CXString, but it should own the underlying memory buffer. Thus, it is better to change the type to std::string. This will not introduce extra copying overhead, since the workaround that is being removed was already making a copy. llvm-svn: 174647
* Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor2013-02-0752-133/+135
| | | | | | consistency. llvm-svn: 174645
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-072-0/+14
| | | | | | in an unevaluated context. llvm-svn: 174644
* Testcase for r174477.Chad Rosier2013-02-071-0/+11
| | | | llvm-svn: 174640
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-074-0/+24
| | | | | | OpenCL builtin functions. llvm-svn: 174630
* FileCheckize volatile testTim Northover2013-02-071-3/+37
| | | | llvm-svn: 174627
* Only check for volatile memcpys in test.Tim Northover2013-02-071-1/+1
| | | | | | | | AArch64 handles aggFct's return struct slightly differently, leading to an extra memcpy. This test is fortunately only concerned about volatile copies, so we can modify the grep text to filter it. llvm-svn: 174621
* Add AArch64 wchar definition to testTim Northover2013-02-071-1/+1
| | | | | | This should allow it to pass if the default triple is AArch64 llvm-svn: 174620
* XFAIL test that's inappropriate for AArch64 ABITim Northover2013-02-071-0/+8
| | | | | | | | Only some ABIs require the "signext" attribute on parameters. On most platforms, however, it's a useful test so it's best not to limit it to some random arbitrary platform. llvm-svn: 174619
* Permit ABIs where the caller extends the result (test change).Tim Northover2013-02-071-1/+1
| | | | | | | | | This test was written to make sure *something* sane is generated, not to test any ABI's signedness semantics. This should allow the test to pass if AArch64 is the default target. llvm-svn: 174618
* Documentation: fix typo: stdard -> stdargDmitri Gribenko2013-02-071-2/+2
| | | | llvm-svn: 174613
* Documentation: add information about builtin includes to FAQDmitri Gribenko2013-02-072-0/+14
| | | | llvm-svn: 174612
* libclang: CursorVisitor::VisitBuiltinTypeLoc(): Add OCLSampler. [-Wswitch]NAKAMURA Takumi2013-02-071-0/+1
| | | | llvm-svn: 174606
* Implements equalsNode for Decl and Stmt.Manuel Klimek2013-02-073-0/+66
| | | | | | | | | This is a powerful tool when doing iterative refined matches, where another match is started inside the match callback of the first one; this allows for example to find out whether the node was in the condition or body of its parent if-statement. llvm-svn: 174605
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-0736-5/+169
| | | | | | restrictions. llvm-svn: 174601
* Apply the pure-virtual odr rule to other constructs which can call overloadedNick Lewycky2013-02-072-25/+52
| | | | | | operators. llvm-svn: 174584
* Fix handling of module imports adding names to a DeclContext after qualifiedRichard Smith2013-02-077-29/+117
| | | | | | | | | | | | | | | | name lookup has been performed in that context (this probably only happens in C++). 1) Whenever we add names to a context, set a flag on it, and if we perform lookup and discover that the context has had a lookup table built but has the flag set, update all entries in the lookup table with additional names from the external source. 2) When marking a DeclContext as having external visible decls, mark the context in which lookup is performed, not the one we are adding. These won't be the same if we're adding another copy of a pre-existing namespace. llvm-svn: 174577
* Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith2013-02-079-71/+32
| | | | | | | | | | | | if it found any decls, rather than returning a list of found decls. This removes a returning-ArrayRef-to-deleted-storage bug from MultiplexExternalSemaSource (in code not exercised by any of the clang binaries), reduces the work required in the found-no-decls case with PCH, and importantly removes the need for DeclContext::lookup to be reentrant. No functionality change intended! llvm-svn: 174576
* -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in ↵Alexander Kornienko2013-02-072-14/+45
| | | | | | | | | | | | | | | | | | | | | | unreachable code" was issued incorrectly. Summary: -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly: 1. In actual unreachable code, but not immediately on a fall-through execution path "fallthrough annotation does not directly precede switch label" is better; 2. After default: in a switch with covered enum cases. Actually, these shouldn't be treated as unreachable code for our purpose. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D374 llvm-svn: 174575
* objective-C modern translator. Fix up the translatedFariborz Jahanian2013-02-073-34/+327
| | | | | | | metadata to handle ivar bitfields. This is wip. // rdar://13138459 llvm-svn: 174573
* AST dumping: indicate the previous declaration for a redeclaration, andRichard Smith2013-02-072-1/+40
| | | | | | | indicate the semantic DC if it's not the lexical DC. In passing, correct the ascii-art child marker for a child of a FriendDecl. llvm-svn: 174570
* Be a little more permissive with -fmodules-ignore-macro= by removing ↵Douglas Gregor2013-02-073-16/+13
| | | | | | everything after the second '=' if it is there. llvm-svn: 174567
* Add a *San + modules FIXME.Richard Smith2013-02-071-0/+2
| | | | llvm-svn: 174565
* Introduce -fmodules-ignore-macro=NNN to ignore a macro when building/loading ↵Douglas Gregor2013-02-076-6/+87
| | | | | | | | | | | | | | | | | | | | | modules. The use of this flag enables a modules optimization where a given set of macros can be labeled as "ignored" by the modules system. Definitions of those macros will be completely ignored when building the module hash and will be stripped when actually building modules. The overall effect is that this flag can be used to drastically reduce the number of Eventually, we'll want modules to tell us what set of macros they respond to (the "configuration macros"), and anything not in that set will be excluded. However, that requires a lot of per-module information that must be accurate, whereas this option can be used more readily. Fixes the rest of <rdar://problem/13165109>. llvm-svn: 174560
* Formatter: Move ObjC literal tests to its own test case.Nico Weber2013-02-071-13/+21
| | | | | | | Slightly expand the boxed expressions test with a few more snippets from http://clang.llvm.org/docs/ObjectiveCLiterals.html llvm-svn: 174559
* Detect when we end up trying to load conflicting module files.Douglas Gregor2013-02-066-4/+68
| | | | | | | | | | | | This can happen when one abuses precompiled headers by passing more -D options when using a precompiled hedaer than when it was built. This is intentionally permitted by precompiled headers (and is exploited by some build environments), but causes problems for modules. First part of <rdar://problem/13165109>, detecting when something when horribly wrong. llvm-svn: 174554
* Fix bug in the alignment of comments.Daniel Jasper2013-02-062-1/+11
| | | | | | | | | | | | | | | | | | | | Before: const char *test[] = { // A "aaaa", // B "aaaaa", }; After: const char *test[] = { // A "aaaa", // B "aaaaa", }; llvm-svn: 174549
* Become a little smarter with formatting long chains of pipes.Daniel Jasper2013-02-062-1/+16
| | | | | | | | | | | | | | | | | | | | | Assign a high penalty to breaking before "<<" if the previous token is a string literal ending in ":" or "=". Before: llvm::outs() << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa << "bbbbbbbbbbbbbbbbb = " << bbbbbbbbbbbbbbbbb << "ccccccccccccccccc = " << ccccccccccccccccc << "ddddddddddddddddd = " << ddddddddddddddddd << "eeeeeeeeeeeeeeeee = " << eeeeeeeeeeeeeeeee; After: llvm::outs() << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa << "bbbbbbbbbbbbbbbbb = " << bbbbbbbbbbbbbbbbb << "ccccccccccccccccc = " << ccccccccccccccccc << "ddddddddddddddddd = " << ddddddddddddddddd << "eeeeeeeeeeeeeeeee = " << eeeeeeeeeeeeeeeee; llvm-svn: 174545
* Cleanup of ASTMatcher macros and adding support for overloaded matchers.Manuel Klimek2013-02-065-194/+164
| | | | | | | | | | This is in preparation for adding other overloaded matchers. This change alone is a net win in LOC. I went through all matchers and looked whether we could now encode them as macro, or simplify them with the matcher atoms that were not available before. llvm-svn: 174540
* Align trailing block comments like trailing line comments.Daniel Jasper2013-02-062-8/+14
| | | | llvm-svn: 174537
* Remove unneeded test. We have plenty of subgroup relations between warnings,Ted Kremenek2013-02-061-16/+0
| | | | | | and for those we care about we should have a general way of testing them. llvm-svn: 174531
* Accept and ignore the -fextended-identifiers option.Jordan Rose2013-02-062-0/+10
| | | | | | | | | | | | This was GCC's option to turn on UCN support, which we always have on now in C99 and C++ modes. Additionally, mark the -fno-extended-identifiers option as unsupported, since we don't support disabling UCNs in C99 and C++ modes. PR11538 llvm-svn: 174530
* Eliminate a race condition with the global module index.Douglas Gregor2013-02-061-1/+2
| | | | | | | | Essentially, a module file on disk could change size between the time we stat() it and the time we open it, and we need to be robust against such a problem. llvm-svn: 174529
* Formatter: Correctly detect ObjC message expressions preceded by a comment.Nico Weber2013-02-062-11/+20
| | | | llvm-svn: 174521
* Fix handling of comments in macros.Manuel Klimek2013-02-062-3/+29
| | | | | | | | | | | | | | | | We now correctly format: // Written as a macro, it is reformatted from: #define foo(a) \ do { \ /* Initialize num to zero. */ \ int num = 10; \ /* This line ensures a is never zero. */ \ int i = a == 0 ? 1 : a; \ i = num / i; /* This division is OK. */ \ return i; \ } while (false) llvm-svn: 174517
* Much semicolon after namespaces.Manuel Klimek2013-02-062-0/+13
| | | | | | | | | We now leave the semicolon in the line of the closing brace in: namespace { ... }; llvm-svn: 174514
* Fix formatting of ObjC method calls.Daniel Jasper2013-02-062-1/+7
| | | | | | | | | | | | | | This fixes llvm.org/PR15165. We now correctly align: [image_rep drawInRect:drawRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0 ssssssssdd:NO hints:nil]; llvm-svn: 174513
* Parse record declarations with token pasted identifiers.Manuel Klimek2013-02-062-2/+5
| | | | | | | This is pretty common in macros: #define A(X, Y) class X##Y {}; llvm-svn: 174512
* Fix a formatting bug caused by comments in expressions.Daniel Jasper2013-02-062-0/+16
| | | | | | | | | | | | | | | | | This fixes llvm.org/PR15162. Before: bool aaaaaaaaaaaaa = // comment aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaa; After: bool aaaaaaaaaaaaa = // comment aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 174508
* Optionally derive formatting information from the input file.Daniel Jasper2013-02-065-64/+149
| | | | | | | | | | | | | With this patch, clang-format can analyze the input file for two properties: 1. Is "int *a" or "int* a" more common. 2. Are non-C++03 constructs used, e.g. A<A<A>>. With Google-style, clang-format will now use the more common style for (1) and format C++03 compatible, unless it finds C++11 constructs in the input. llvm-svn: 174504
* Fix an issue with the formatting of stars in default values.Daniel Jasper2013-02-062-1/+2
| | | | | | Before: void f(int *a = d *e, int b = 0); After: void f(int *a = d * e, int b = 0); llvm-svn: 174500
* Adds a convenience function selectFirst to simplify matching.Manuel Klimek2013-02-062-12/+39
| | | | | | | | A very common use case is to search for the first occurrence of a certain node that is a descendant of another node. In that case, selectFirst significantly simplifies the code at the client side. llvm-svn: 174499
* Handle nested ObjC calls.Daniel Jasper2013-02-062-85/+112
| | | | | | | | | | | | | | Properly handle annotation contexts while calculating extra information for each token. This enable nested ObjC calls and thus solves (most of) llvm.org/PR15164. E.g., we can now format: [contentsContainer replaceSubview:[subviews objectAtIndex:0] with:contentsNativeView]; Also fix a problem with the formatting of types in casts as this was trivial now. llvm-svn: 174498
* Formatter: No space after & and * in front of ObjC message expressions.Nico Weber2013-02-062-9/+12
| | | | | | | | | | | | | | 1. let determineStarAmp() check of unary operators before checking for "is next '['". That check was added in r173150, and the test from that revision passes either way. 2. change determineStarAmp() to categorize '*' and '&' after '=' as unary operator. 3. don't let parseSquare() overwrite the type of a '*' or '&' before the start of an objc message expression if has the role of unary operator. llvm-svn: 174489
* Don't check whether a friend declaration is correctly formed when instantiating,Nick Lewycky2013-02-062-33/+42
| | | | | | we already checked it when parsing. llvm-svn: 174486
* Use a dyn_cast to avoid a crash when the TypeLoc is not a ConstantArrayTypeLoc.Chad Rosier2013-02-061-4/+5
| | | | | | rdar://13153516 llvm-svn: 174477
OpenPOWER on IntegriCloud