summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Propagate "-arch x86_64h" setting to the linker. <rdar://problem/15711488>Bob Wilson2013-12-281-6/+13
| | | | | | | | | This is a follow-up to r194907, which added a new -arch setting to make it easier to specify AVX2 targets. The "-arch x86_64h" option needs to be passed on to the linker, but it was getting canonicalized to x86_64 by the code in getArchTypeForDarwinArchName. llvm-svn: 198096
* Silence a dubious GCC warning about a set but unused global. Indeed, theChandler Carruth2013-12-281-1/+1
| | | | | | purpose of this global is to be set and not used. =] llvm-svn: 198094
* Reduce indentation of some VFTableBuilder code.Reid Kleckner2013-12-271-24/+24
| | | | | | No functionality change. llvm-svn: 198085
* Silence compile warning by removing unused SourceMgr memberWill Wilson2013-12-271-3/+2
| | | | llvm-svn: 198083
* Implement MSVC header search algorithm in MicrosoftMode.Will Wilson2013-12-273-69/+88
| | | | | | Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx llvm-svn: 198082
* Fix incorrect copy-pasted method decl that MSVC allowed.Reid Kleckner2013-12-271-1/+1
| | | | llvm-svn: 198081
* [ms-cxxabi] Emit fewer trivial return adjusting thunksReid Kleckner2013-12-271-2/+23
| | | | | | | | | | | Most importantly, this makes our vtable layout match MSVC's. Previously we would emit a return adjusting thunk whenever the return types differed, even if the adjustment would have been trivial. MSVC does emit some trivial return adjusting thunks, but only if there was already an overridden method that required a return adjustment. llvm-svn: 198080
* Removed a string literal for a diagnostic, and updated the diagnostic to not ↵Aaron Ballman2013-12-271-1/+1
| | | | | | manually quote. No functional changes intended. llvm-svn: 198076
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-274-4/+23
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 llvm-svn: 198073
* clang-format: Break default arguments less eagerly.Daniel Jasper2013-12-271-0/+2
| | | | | | | | | | | | Before: void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1); After: void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( int aaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1); llvm-svn: 198070
* Warn on mismatched parentheses in memcmp and friends.Nico Weber2013-12-261-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thisadds a new warning that warns on code like this: if (memcmp(a, b, sizeof(a) != 0)) The warning looks like: test4.cc:5:30: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison] if (memcmp(a, b, sizeof(a) != 0)) ~~~~~~~~~~^~~~ test4.cc:5:7: note: did you mean to compare the result of 'memcmp' instead? if (memcmp(a, b, sizeof(a) != 0)) ^ ~ ) test4.cc:5:20: note: explicitly cast the argument to size_t to silence this warning if (memcmp(a, b, sizeof(a) != 0)) ^ (size_t)( ) 1 warning generated. This found 2 bugs in chromium and has 0 false positives on both chromium and llvm. The idea of triggering this warning on a binop in the size argument is due to rnk. llvm-svn: 198063
* [ms-abi] Fixes improperly sized vfptrs with pragma packWarren Hunt2013-12-261-5/+4
| | | | | | | | With pragma pack, the layout engine would produce vfptrs that were packed width rather than pointer width. This patch addresses the issue and adds a test case. llvm-svn: 198059
* Teach the diagnostics engine about the Attr type to make reporting on ↵Aaron Ballman2013-12-264-13/+21
| | | | | | semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting. llvm-svn: 198055
* Removed a string literal for an attribute name, which means the attribute ↵Aaron Ballman2013-12-262-2/+2
| | | | | | name will be quoted in the diagnostic. Manually added some quotes to a diagnostic for consistency. Updated the test cases as appropriate. llvm-svn: 198054
* This diagnostic did not accept arguments, and did not have any test ↵Aaron Ballman2013-12-261-2/+2
| | | | | | | | coverage. Parameterized the diagnostic, and made it more consistent with other attribute diagnostic wordings. Added test coverage. Since this warning was generalized, it was also given a sensible warning group flag and the corresponding test was updated to reflect this. llvm-svn: 198053
* s/getter_setter/accessor No functional changes intended.Aaron Ballman2013-12-261-4/+4
| | | | | | Thanks to Alp Toker for the naming suggestion! llvm-svn: 198052
* Simplifying some diagnostics so that they don't need to work with ↵Aaron Ballman2013-12-262-26/+19
| | | | | | StringRefs. No functional changes intended. llvm-svn: 198051
* Getting rid of a string literal in favor of the generalized diagnostic.Aaron Ballman2013-12-261-1/+1
| | | | llvm-svn: 198050
* Parameterizing some MS property-related diagnostics. No functional changes ↵Aaron Ballman2013-12-261-6/+8
| | | | | | intended. llvm-svn: 198049
* No need for the manual quotes and extra getName() call. No functional ↵Aaron Ballman2013-12-261-1/+1
| | | | | | changes intended. llvm-svn: 198047
* Removing some unneeded code, and a diagnostic that was obsoleted. The type ↵Aaron Ballman2013-12-261-19/+15
| | | | | | | | has already been determined to be a ValueDecl by virtue of the attribute subjects. Added some test case coverage as well. llvm-svn: 198046
* Don't reserve __builtin_types_compatible_p as a C++ keywordAlp Toker2013-12-251-10/+1
| | | | | | | | | Even g++ considers this a valid C++ identifier and it should only have been visible in C mode. Also drop the associated low-value diagnostic. llvm-svn: 197995
* clang-format: (WebKit) Disallow 1-line constructors with initializers.Daniel Jasper2013-12-241-5/+16
| | | | | | | | | | | | | | | Before: Constructor() : a(a) {} After: Constructor() : a(a) { } This style guide is pretty precise about this. llvm-svn: 197980
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-2416-156/+192
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
* Document the Message parameter of getCustomDiagID()Alp Toker2013-12-231-0/+3
| | | | | | A lot of callers have been using this facility incorrectly. llvm-svn: 197920
* remove dead code.Adrian Prantl2013-12-231-1/+1
| | | | llvm-svn: 197916
* Fix another misuse of getCustomDiagID()Alp Toker2013-12-231-25/+13
| | | | | | There's no need to escape strings and generate new DiagIDs for each message. llvm-svn: 197915
* Consolidating some mode attribute diagnostics. No functional changes intended.Aaron Ballman2013-12-231-2/+2
| | | | llvm-svn: 197911
* clang-format: Fix invalid write discovered by ASAN.Daniel Jasper2013-12-231-1/+2
| | | | | | Introduced in r197900. llvm-svn: 197906
* TextDiagnosticBuffer: Fix copy-paste mistake in r197856Alp Toker2013-12-231-6/+3
| | | | | | | | | | | | | The TextDiagnosticBuffer is meant to scrub SourceLocations as the input/output SourceManagers may be different. To be safe this commit restores the original behaviour though in practice all current users seem to share a single SM. Would be nice to replace TextDiagnosticBuffer now that more capable interfaces like CaptureDiagnosticConsumer / StoredDiagnosticConsumer exist. llvm-svn: 197902
* clang-format: Fix various problems in formatting ObjC blocks.Daniel Jasper2013-12-236-31/+134
| | | | | | Among other things, this fixes llvm.org/PR15269. llvm-svn: 197900
* [AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' ↵Hao Liu2013-12-231-1/+1
| | | | | | and 'sext' not 'zext'. Modify the implementation by replacing zext with sext. llvm-svn: 197898
* Removing the alloc_size attribute. The attribute was semantically handled, ↵Aaron Ballman2013-12-211-42/+0
| | | | | | but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over. llvm-svn: 197866
* The const and nothrow attributes can be handled by the simple attribute ↵Aaron Ballman2013-12-211-24/+4
| | | | | | handler. This removes a silent dropping of the attributes when they are duplicated on a Decl. llvm-svn: 197864
* Fix getCustomDiagID() usage in CodeGen and TextDiagnosticBufferAlp Toker2013-12-212-39/+13
| | | | | | | | | | DiagIDs are a cached resource generally only constructed from compile-time constant or stable format strings. Escaping arbitrary messages and constructing DiagIDs from them didn't make sense. llvm-svn: 197856
* Add -Winfinite-recursion to ClangRichard Trieu2013-12-211-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | This new warning detects when a function will recursively call itself on every code path though that function. This catches simple recursive cases such as: void foo() { foo(); } As well as more complex functions like: void bar() { if (test()) { bar(); return; } else { bar(); } return; } This warning uses the CFG. As with other CFG-based warnings, this is off by default. Due to false positives, this warning is also disabled for templated functions. llvm-svn: 197853
* [CMake] clang/lib/Headers: Install just-generated ↵NAKAMURA Takumi2013-12-211-6/+7
| | | | | | ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h, instead of copied arm_neon.h. llvm-svn: 197852
* Assert that tag decls are never marked (in)valid after definition is completeAlp Toker2013-12-211-0/+1
| | | | | | | | Sema relies on this assumption. Follow-up to r197848. llvm-svn: 197850
* Use this one little trick to prevent optimizers from removing anRichard Trieu2013-12-211-2/+3
| | | | | | intentional stack overflow. llvm-svn: 197849
* Don't mark record decls invalid when one of its methods is invalid, PR18284.Nico Weber2013-12-211-6/+1
| | | | | | | | | | | | | | | Without this patch, record decls with invalid out-of-line method delcs would sometimes be marked invalid, but not always. With this patch, they are consistently never marked invalid. (The code to do this was added in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100809/033154.html , but the test from that revision is still passing.) As far as I can tell, this was the only place where a class was marked invalid after its definition was complete. llvm-svn: 197848
* Eliminate the ItaniumVTableContext object from CodeGenVTablesReid Kleckner2013-12-204-26/+17
| | | | | | | | | | | | | Now CodeGenVTables has only one VTableContext object, which is either Itanium or Microsoft. Fixes a FIXME with no functionality change intended. Ideally we could avoid the downcasts by pushing the things that reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're not there yet. llvm-svn: 197845
* DebugInfo: Do not include implicit members (implicit special members, ↵David Blaikie2013-12-201-2/+0
| | | | | | | | | | | | | | template instantiations, etc) in the list of members of a structure. These members will still be lazily added to the relevant DWARF DIEs in LLVM but when enumerating the members they will not appear. This allows DWARF type units to be more consistent - the type unit will never contain these special members (so all instances of the type should have the same DIEs without some having some special members and others having others) and the special members will be added to the skeletal declaration that appears in the relevant compile_unit. llvm-svn: 197844
* Remove obsolete preamble FIXMEAlp Toker2013-12-201-2/+0
| | | | | | | The MD5 is checked since r197755 which is as good as comparing buffer contents in this context. llvm-svn: 197842
* Override the datalayout in a module with -triple.Rafael Espindola2013-12-201-1/+10
| | | | | | | | | This matches llc's behavior. Before this patch clang would create a TargetInfo base on -triple but a llvm CodeGen based on the triple in the module. llvm-svn: 197837
* Compare canonical return types when generating MS C++ ABI vtable thunksReid Kleckner2013-12-201-1/+2
| | | | | | | | This was part of the cause for PR17655. We were generating thunks when we shouldn't have. I suspect that if we tweak the test case for PR17655 to actually require thunks, we can reproduce the same crash. llvm-svn: 197836
* Move the TargetMachine instance into EmitAssemblyHelperAlp Toker2013-12-201-19/+21
| | | | | | Cleanup in preparation for enhanced DataLayout checking. llvm-svn: 197832
* clang-cl: Support /P and /E (preprocess to file or stdout)Hans Wennborg2013-12-201-2/+11
| | | | llvm-svn: 197827
* Enable layering check in unavailable modules.Daniel Jasper2013-12-202-83/+106
| | | | | | | | | | | | | | | If a header file belonging to a certain module is not found on the filesystem, that header gets marked as unavailable. Now, the layering warning (-fmodules-decluse) should still warn about headers of this module being wrongfully included. Currently, headers belonging to those modules are just treated as not belonging to modules at all which means they can be included freely from everywhere. To implement this (somewhat) cleanly, I have moved most of the layering checks into the ModuleMap. This will also help with showing FixIts later. llvm-svn: 197805
* clang-format: Better support for multi-line wide string literals.Daniel Jasper2013-12-203-18/+12
| | | | | | | | | | | Before: SomeFunction(L"A" L"B"); After: SomeFunction(L"A" L"B"); llvm-svn: 197785
* [analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.Argyrios Kyrtzidis2013-12-201-2/+2
| | | | llvm-svn: 197767
OpenPOWER on IntegriCloud