summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Recover from errors in enum definitionSerge Pavlov2013-12-311-5/+29
| | | | | | | | | | Previously any error in enum definition body stopped parsing it. With this change parser tries to recover from errors. The patch fixes PR10982. Differential Revision: http://llvm-reviews.chandlerc.com/D2018 llvm-svn: 198259
* Switch over more of the parser to err_expectedAlp Toker2013-12-304-29/+21
| | | | | | | Includes a fix for a missing highlight range caused by a ',' typo in the PP diagnostics. llvm-svn: 198252
* Update RecursiveASTVisitor so that it visits attributes. This is currentlyDeLesley Hutchins2013-12-301-0/+1
| | | | | | | | important for thread safety attributes, which contain expressions that were not being visited, and were thus invisible to various tools. There are now Visit*Attr methods that can be overridden for every attribute. llvm-svn: 198224
* [CMake][VS][XCode] Restruct the output directory layout more comfortable, ↵NAKAMURA Takumi2013-12-301-34/+1
| | | | | | | | | | | | | | | | | | ${BINARY_DIR}/${BUILD_MODE}/(bin|lib) We have been seeing nasty directory layout with CMake multiconfig, such as, bin/Release/clang.exe lib/clang/3.x/... lib/Release/clang/3.x/.. (duplicated) Move the layout similar to autoconf's; Release/bin/clang.exe Release/lib/clang/3.x/... Checked on Visual Studio 10. Could you guys please confirm my change on XCode(and other multiconfig builders)? Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more, or a certain builder, for eaxample, msbuild.exe, would be confused. llvm-svn: 198205
* Fix and reword some typosAlp Toker2013-12-301-1/+1
| | | | llvm-svn: 198191
* Cleanup: Switch the preprocessor to err_pp_expected_afterAlp Toker2013-12-302-6/+9
| | | | | | | | | | This is approaching consistency but the PP and Parse categories they still have slightly different wording: def err_pp_expected_after : Error<"missing %1 after %0">; def err_expected_after : Error<"expected %1 after %0">; llvm-svn: 198189
* Fixing a compile error that recently started happening for me in MSVC 2013. ↵Aaron Ballman2013-12-291-1/+1
| | | | | | CFGTerminator has an explicit conversion to bool operator that we can make use of instead of using == 0. llvm-svn: 198175
* Rename isBuiltinCall() to getBuiltinCallee()Alp Toker2013-12-285-16/+16
| | | | | | | | This better describes what the function does. Cleanup only. llvm-svn: 198127
* Tidy up CGCXXABI creationAlp Toker2013-12-282-7/+6
| | | | | | | | | | 'create' functions conventionally return a pointer, not a reference. Also use an OwningPtr to get replace the delete of a reference member. No functional change. llvm-svn: 198126
* 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
OpenPOWER on IntegriCloud