summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant code.Rafael Espindola2012-11-211-6/+4
| | | | llvm-svn: 168411
* Remove redundant code.Rafael Espindola2012-11-211-24/+3
| | | | llvm-svn: 168410
* Don't walk a linked list twice in the same function. On my machine this takesRafael Espindola2012-11-201-2/+2
| | | | | | | | "clang -cc1" on a file with 10k repetitions of extern int no_such_variable; from 1.434s to 1.133s. llvm-svn: 168394
* Update method calls to the new interface re r168354.Bill Wendling2012-11-202-3/+4
| | | | llvm-svn: 168355
* Fix some trailing whitespace (on a blank line) to cycle/test bots.David Blaikie2012-11-191-1/+1
| | | | llvm-svn: 168340
* PR14381: Never skip constexpr function bodies when code-completing. We may needRichard Smith2012-11-194-2/+42
| | | | | | them in order to parse the rest of the file. llvm-svn: 168327
* When adding a NamedDecl to a correction, add the underlying Decl (viaKaelyn Uhrain2012-11-192-1/+15
| | | | | | | | getUnderlyingDecl()) so that derivatives of CorrectionCandidateCallback::ValidateCandidate(...) don't have to worry about being thrown by UsingDecls and such. llvm-svn: 168317
* Add -ldl for non-static libgcc in Android.Logan Chien2012-11-192-3/+14
| | | | | | | | | | | According to Android ABI, we have to link with libdl.so, if we are linking with non-static libgcc. Besides, this also fixes MIPS link error of undefined references to `_Unwind_Find_FDE' and `dl_iterate_phdr'. llvm-svn: 168310
* Enable -fuse-init-array for Android X86/MIPS.Logan Chien2012-11-192-2/+19
| | | | | | | | | | | | The dynamic linker of Android does not support .ctors/.dtors. We should emit .init_array and .fini_array regardless the gcc version. NOTE: This patch does not affect the ARM backend, because it is required to generate .init_array and .fini_array for program targeting ARM AAPCS and AEABI. llvm-svn: 168309
* clang/test: Suppress two tests on LLP64 target, Windows x64.NAKAMURA Takumi2012-11-192-0/+4
| | | | llvm-svn: 168303
* Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth2012-11-197-188/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were numerous issues here that were all entangled, and so I've tried to do a general simplification of the logic. 1) The logic was mimicing actual GCC bugs, rather than "features". These have been fixed in trunk GCC, and this fixes Clang as well. Notably, the logic was always intended to be last-match-wins like any other flag. 2) The logic for handling '-mdynamic-no-pic' was preposterously unclear. It also allowed the use of this flag on non-Darwin platforms where it has no actual meaning. Now this option is handled directly based on tests of how llvm-gcc behaves, and it is only supported on Darwin. 3) The APIs for the Driver's ToolChains had the implementation ugliness of dynamic-no-pic leaking through them. They also had the implementation details of the LLVM relocation model flag names leaking through. 4) The actual results of passing these flags was incorrect on Darwin in many cases. For example, Darwin *always* uses PIC level 2 if it uses in PIC level, and Darwin *always* uses PIC on 64-bit regardless of the flags specified, including -fPIE. Darwin never compiles in PIE mode, but it can *link* in PIE mode. 5) Also, PIC was not always being enabled even when PIE was. This isn't a supported mode at all and may have caused some fallout in builds with complex PIC and PIE interactions. The result is (I hope) cleaner and clearer for readers. I've also left comments and tests about some of the truly strage behavior that is observed on Darwin platforms. We have no real testing of Windows platforms and PIC, but I don't have the tools handy to figure that out. Hopefully others can beef up our testing here. Unfortunately, I can't test this for every platform. =/ If folks have dependencies on these flags that aren't covered by tests, they may break. I've audited and ensured that all the changes in behavior of the existing tests are intentional and good. In particular I've tried to make sure the Darwin behavior (which is more suprising than the Linux behavior) also matches that of 'gcc' on my mac. llvm-svn: 168297
* Remove a no-op 'const' from a by-value return type.Chandler Carruth2012-11-191-1/+1
| | | | llvm-svn: 168296
* RecursiveASTVisitor.h: Rework Doug's r160404, "Eliminating the GCC_CAST ↵NAKAMURA Takumi2012-11-191-12/+6
| | | | | | | | | | hack, take two." With this, ARCMT tests would not crash on certain hosts with g++ -O2, eg. cygwin g++-4.5.3. r160404 crashed mingw32-g++-4.4.0. I guess method's pointer in conditional expression could not be handled. llvm-svn: 168295
* Remove redundant (duplicated) check.Dmitri Gribenko2012-11-181-1/+1
| | | | llvm-svn: 168293
* clang/test/Sema/warn-documentation.cpp: Try to fix up the testcase in r168277.NAKAMURA Takumi2012-11-181-1/+1
| | | | llvm-svn: 168278
* Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.Dmitri Gribenko2012-11-183-0/+32
| | | | | | | | We actually used to assert on this. Thanks to NAKAMURA Takumi for noticing this! llvm-svn: 168277
* Fix Doxygen comment start sequence.Dmitri Gribenko2012-11-171-1/+1
| | | | llvm-svn: 168276
* Clean up code according to coding standardsAndy Gibbs2012-11-171-3/+2
| | | | llvm-svn: 168274
* objective-C: Do not issue deprecated warning about implementationFariborz Jahanian2012-11-172-4/+26
| | | | | | | of a deprecated method in original class (or category), only in overrides. // rdar://12717705 llvm-svn: 168270
* Fix crash on end-of-file after \ in a char literal, fixes PR14369.Nico Weber2012-11-174-6/+32
| | | | | | | This makes LexCharConstant() look more like LexStringLiteral(), which doesn't have this bug. Add tests for eof after \ for several other cases. llvm-svn: 168269
* Prevent premature macro expansion in __has_builtin, __has_feature,Andy Gibbs2012-11-172-3/+23
| | | | | | | __has_attribute, __has_extension, making them behave more akin to conventional macros. llvm-svn: 168268
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-1714-15/+33
| | | | llvm-svn: 168267
* Refactored duplicate string literal lexing code within Preprocessor, into aAndy Gibbs2012-11-1711-154/+132
| | | | | | | | | | | | | common LexStringLiteral function. In doing so, some consistency problems have been ironed out (e.g. where the first token in the string literal was lexed with macro expansion, but subsequent ones were not) and also an erroneous diagnostic has been corrected. LexStringLiteral is complemented by a FinishLexStringLiteral function which can be used in the situation where the first token of the string literal has already been lexed. llvm-svn: 168266
* Fix handling of invalid uses of the __has_warning builtin macroAndy Gibbs2012-11-174-3/+19
| | | | llvm-svn: 168265
* Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.Benjamin Kramer2012-11-173-6/+45
| | | | | | Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size. llvm-svn: 168260
* Remove copy ctor that provides no value over the default.Benjamin Kramer2012-11-171-2/+0
| | | | | | It's also simpler to just copy the words than mangling bits like this ctor did. llvm-svn: 168258
* Further reduce "-fsyntax-only -Wuninitialized" time on sqlite3.c by another ↵Ted Kremenek2012-11-171-12/+52
| | | | | | 2.5% using intelligent pruning of blocks during the final reporting pass. llvm-svn: 168257
* Switch -Wuninitialized to use a reverse-post order traversal asTed Kremenek2012-11-171-15/+33
| | | | | | | | | an initial baseline for enqueued blocks, but use a simple DFS stack for propagating changes quickly up back edges. This provides a 3.5% reduction in -fsyntax-only time on sqlite3.c. llvm-svn: 168241
* Add missing features for misc x86 CPUs to CPU feature translation. Patch by ↵Eli Friedman2012-11-172-2/+174
| | | | | | Jung-uk Kim. llvm-svn: 168239
* Clean up X86 target feature translation code slightly. No intended ↵Eli Friedman2012-11-171-14/+3
| | | | | | functional change. Patch by Jung-uk Kim. llvm-svn: 168237
* Typo.Chad Rosier2012-11-161-1/+1
| | | | llvm-svn: 168222
* Revert r167799. It's not really correct, and it doesn't fix the problem that ↵Bill Wendling2012-11-161-16/+9
| | | | | | it was intended to fix. llvm-svn: 168217
* Testcase overriding-ftemplate-comments.cpp: use [[@LINE]] to make it less ↵Dmitri Gribenko2012-11-161-19/+26
| | | | | | fragile. llvm-svn: 168213
* [driver] Add the missing TY_PP_ObjCXX_Alias case to the isCXX function.Chad Rosier2012-11-162-1/+7
| | | | | | | | | This was causing different behavior when using -x objective-c++-cpp-output as compared to -x objc++-cpp-output. Specifically, the driver was not adding the -fcxx-exceptions flag in the latter case. rdar://12680312 llvm-svn: 168212
* StmtDumper: remove incomplete support for limiting the maximum dump depth.Dmitri Gribenko2012-11-162-40/+7
| | | | | | | | | There are better ways of limiting the amount of information if there is a need for that. Patch by Philip Craig. llvm-svn: 168206
* Fix partial-match-bind-behavior with forEachDescendant() matchers.Daniel Jasper2012-11-162-2/+21
| | | | | | | | | | | | | | | | The problem is that a partial match of an (explicit or implicit) allOf matcher binds results, i.e. recordDecl(decl().bind("x"), hasName("A")) can very well bind a record that is not named "A". With this fix, the common cases of stumbling over this bug are fixed by the BoundNodesMap overwriting the results of a partial match. An error can still be created with a weird combination of anyOf and allOf (see inactive test). We need to decide whether this is worth fixing, as the fix will have performance impact. Review: http://llvm-reviews.chandlerc.com/D124 llvm-svn: 168177
* [analyzer] SATestBuild.py: fix broken string concatenationJordan Rose2012-11-161-2/+2
| | | | | | | | This has been broken for a while, but the branch was never being taken. (We were trying to do 'str + floatVal'; now we do 'str % intVal' and use the '%d' format.) llvm-svn: 168174
* Make libASTMatchers link its dependencies. libRewriteFrontend depends on ↵Benjamin Kramer2012-11-162-1/+6
| | | | | | | | libRewriteCore. LLVM_USED_LIBS does nothing here. llvm-svn: 168172
* UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ↵Alexey Samsonov2012-11-163-7/+26
| | | | | | ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas. llvm-svn: 168168
* Store this Decl* as a Decl* instead of a uintptr_t. No functionality change.Nick Lewycky2012-11-163-24/+22
| | | | llvm-svn: 168145
* clang/unittests: Fixup corresponding to Doug's r168136.NAKAMURA Takumi2012-11-164-4/+4
| | | | llvm-svn: 168137
* Since CreateTargetInfo is taking ownership of the target options, passDouglas Gregor2012-11-165-26/+26
| | | | | | it as a pointer. llvm-svn: 168136
* Remove unused diagnosticsDouglas Gregor2012-11-161-6/+0
| | | | llvm-svn: 168135
* Revert r168132, "clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for ↵NAKAMURA Takumi2012-11-161-1/+1
| | | | | | now." I missed Daniel's r168095 by my accident. llvm-svn: 168134
* [libclang] When caching code-completion results, pass the ↵Argyrios Kyrtzidis2012-11-161-4/+5
| | | | | | | | | | | | | | CachedCompletionAllocator to the CodeCompletionTUInfo that is going to be used to get the results. Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator that will go away when we reparse. That could result in a use-after-free bug when getting the parent context name from a CodeCompletionString. Addresses rdar://12568377. llvm-svn: 168133
* clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now.NAKAMURA Takumi2012-11-161-1/+1
| | | | | | None of my buildhost (centos6 x86-64 and cygwin) is passing. Investigating. llvm-svn: 168132
* CPP Output: Do not emit an enter file marker for the main file.Daniel Dunbar2012-11-162-0/+15
| | | | | | | | - This diverges from gcc, and confuses tools (like dtrace) which track # line markers as a way to determine which content is in the context of the main file. llvm-svn: 168128
* Take into account the zero sign bit for positive numbers when computing the bitRichard Trieu2012-11-162-1/+15
| | | | | | | width of an enum with negative values in IntRange. Include a test for -Wtautological-constant-out-of-range-compare where this had manifested. llvm-svn: 168126
* Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.Matt Beaumont-Gay2012-11-161-1/+1
| | | | | | | | | GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary lifetime bugs. No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp. llvm-svn: 168124
* A step towards sorting out handling of triviality of special members in C++11.Richard Smith2012-11-1610-74/+126
| | | | | | | | | | | | | | Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
OpenPOWER on IntegriCloud