summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* objective-C modern translator. More fixups for Fariborz Jahanian2013-02-071-2/+23
| | | | | | | 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-071-1/+2
| | | | llvm-svn: 174662
* Retain all hidden methods in the global method pool, because they may become ↵Douglas Gregor2013-02-071-0/+4
| | | | | | visible <rdar://problem/13172858>. llvm-svn: 174648
* Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor2013-02-072-18/+20
| | | | | | consistency. llvm-svn: 174645
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-071-0/+1
| | | | | | in an unevaluated context. llvm-svn: 174644
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-072-0/+12
| | | | | | OpenCL builtin functions. llvm-svn: 174630
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-0721-2/+95
| | | | | | restrictions. llvm-svn: 174601
* Apply the pure-virtual odr rule to other constructs which can call overloadedNick Lewycky2013-02-071-25/+14
| | | | | | operators. llvm-svn: 174584
* Fix handling of module imports adding names to a DeclContext after qualifiedRichard Smith2013-02-072-14/+48
| | | | | | | | | | | | | | | | 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-075-20/+20
| | | | | | | | | | | | 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-071-3/+16
| | | | | | | | | | | | | | | | | | | | | | 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-071-28/+265
| | | | | | | 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-071-1/+27
| | | | | | | 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-072-16/+6
| | | | | | 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-073-2/+55
| | | | | | | | | | | | | | | | | | | | | 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
* Detect when we end up trying to load conflicting module files.Douglas Gregor2013-02-062-4/+30
| | | | | | | | | | | | 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-061-1/+4
| | | | | | | | | | | | | | | | | | | | 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-061-1/+9
| | | | | | | | | | | | | | | | | | | | | 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
* Align trailing block comments like trailing line comments.Daniel Jasper2013-02-061-8/+7
| | | | llvm-svn: 174537
* 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-061-11/+14
| | | | llvm-svn: 174521
* Fix handling of comments in macros.Manuel Klimek2013-02-061-3/+3
| | | | | | | | | | | | | | | | 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-061-0/+4
| | | | | | | | | 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-061-1/+1
| | | | | | | | | | | | | | 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-061-2/+4
| | | | | | | 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-061-0/+1
| | | | | | | | | | | | | | | | | 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-063-60/+112
| | | | | | | | | | | | | 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-061-1/+1
| | | | | | Before: void f(int *a = d *e, int b = 0); After: void f(int *a = d * e, int b = 0); llvm-svn: 174500
* Handle nested ObjC calls.Daniel Jasper2013-02-061-83/+88
| | | | | | | | | | | | | | 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-061-6/+10
| | | | | | | | | | | | | | 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-061-33/+35
| | | | | | 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
* [Headers] Use standard builtin defines instead of typeof trickery.Daniel Dunbar2013-02-061-2/+2
| | | | | | | - The trickery can confuse more basic source processors, in particular the Unix conformance tool that wants to scan headers. llvm-svn: 174475
* [analyzer]Revert part of r161511; suppresses leak false positives in C++Anna Zaks2013-02-061-0/+6
| | | | | | | | | | | This is a "quick fix". The underlining issue is that when a const pointer to a struct is passed into a function, we do not invalidate the pointer fields. This results in false positives that are common in C++ (since copy constructors are prevalent). (Silences two llvm false positives.) llvm-svn: 174468
* Adding armv7l default to cortex-a8Renato Golin2013-02-051-0/+1
| | | | llvm-svn: 174466
* Changed CGObjCMac.cpp to add the marker externally_initialized to ↵Michael Gottesman2013-02-051-0/+2
| | | | | | | | | | | | | SELECTOR_REFERENCES in both the fragile and non-fragile API. This is to ensure that GlobalOpt in LLVM does not attempt to look through a selector reference to a method var name at compile time. I also added a test/updated old tests that need to recognize the new keyword. rdar://12580965. llvm-svn: 174461
* Add note why we used a switch.Ted Kremenek2013-02-051-0/+1
| | | | llvm-svn: 174449
* Change subexpressions to be visited in the CFG from left-to-right.Ted Kremenek2013-02-053-38/+108
| | | | | | | | | | | | | | | | | This is a more natural order of evaluation, and it is very important for visualization in the static analyzer. Within Xcode, the arrows will not jump from right to left, which looks very visually jarring. It also provides a more natural location for dataflow-based diagnostics. Along the way, we found a case in the analyzer diagnostics where we needed to indicate that a variable was "captured" by a block. -fsyntax-only timings on sqlite3.c show no visible performance change, although this is just one test case. Fixes <rdar://problem/13016513> llvm-svn: 174447
* [analyzer] Teach the analyzer to use a symbol for p when evaluatingAnna Zaks2013-02-051-11/+16
| | | | | | | | (void*)p. Addresses the false positives similar to the test case. llvm-svn: 174436
* [analyzer] add commentAnna Zaks2013-02-051-1/+5
| | | | llvm-svn: 174435
* [arcmt] Make sure the objc migrators work fine when used with a PCH.Argyrios Kyrtzidis2013-02-051-2/+19
| | | | | | rdar://13140508 llvm-svn: 174386
* [frontend] Don't put a PCH/PTH filename into the set of includes in the ↵Argyrios Kyrtzidis2013-02-053-18/+10
| | | | | | | | | | | | | preprocessor options; since only one of them is allowed in command-line, process them separately. Otherwise, if more than one is specified in the command-line, one is processed normally and the others are going to be treated and included as header files. Related to radar://13140508 llvm-svn: 174385
* Formatter: Detect ObjC method expressions after unary operators.Nico Weber2013-02-051-6/+20
| | | | llvm-svn: 174384
* Initial support for formatting ObjC method declarations/calls.Daniel Jasper2013-02-053-18/+72
| | | | | | | | | | | | | | | | We can now format stuff like: - (void)doSomethingWith:(GTMFoo *)theFoo rect:(NSRect)theRect interval:(float)theInterval { [myObject doFooWith:arg1 // name:arg2 error:arg3]; } This seems to fix everything mentioned in llvm.org/PR14939. llvm-svn: 174364
* Fix some linebreak decisions in Google format.Daniel Jasper2013-02-051-8/+10
| | | | | | | | | | | | | | | | | | Before: f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaa); aaaaaaa(aaaaaaaaaaaaa, aaaaaaaaaaaaa, aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaa)); After: f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaa); aaaaaaa(aaaaaaaaaaaaa, aaaaaaaaaaaaa, aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaa)); llvm-svn: 174363
* Fix formatting regression introduced by r174307.Daniel Jasper2013-02-051-0/+2
| | | | | | | | | | In preprocessor definitions, we would not parse all the tokens and thus not annotate them anymore. This led to a wrong formatting of comments in google style: #endif // HEADER_GUARD -- requires two spaces llvm-svn: 174361
* Fix typo in commentArnaud A. de Grandmaison2013-02-051-2/+2
| | | | llvm-svn: 174359
* TextDiagnostic.cpp: Suppress a warning to use ptrdiff_t on i686-clang. ↵NAKAMURA Takumi2013-02-051-1/+1
| | | | | | [-Wsign-compare] llvm-svn: 174353
* Driver and option support for -gsplit-dwarf. This is a part ofEric Christopher2013-02-056-9/+97
| | | | | | the DWARF5 split dwarf proposal. llvm-svn: 174349
OpenPOWER on IntegriCloud