summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] As a simple heuristic don't emit a swap fixit that would createBenjamin Kramer2014-07-162-1/+6
| | | | | | | | | negative-sized memsets. memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit a warning. llvm-svn: 213157
* [clang-tidy] Also emit a warning for memset(x, 0, 0)Benjamin Kramer2014-07-162-4/+10
| | | | | | | It doesn't make sense to suggest swapping the arguments here but it's still useless code llvm-svn: 213156
* [clang-tidy] Add a checker for zero-length memset.Benjamin Kramer2014-07-165-0/+176
| | | | | | | | | | | | If there's memset(x, y, 0) in the code it's most likely a mistake. The checker suggests a fix-it to swap 'y' and '0'. I think this has the potential to be promoted into a general clang warning after some testing in clang-tidy. Differential Revision: http://reviews.llvm.org/D4535 llvm-svn: 213155
* [clang-tidy] Add namespaces checkers.Benjamin Kramer2014-07-168-0/+181
| | | | | | | | | | This change contains of two checkers that warn about 1. anonymous namespaces in header files. 2. 'using namespace' directives everywhere. Differential Revision: http://reviews.llvm.org/D4523 llvm-svn: 213153
* [ASTMatchers] Add a usingDirectiveDecl matcher.Benjamin Kramer2014-07-162-0/+19
| | | | | | | | This matches 'using namespace' declarations. Differential Revision: http://reviews.llvm.org/D4517 llvm-svn: 213152
* [ASan/Win] Handle situations when the client app has used DbgHelp beforeTimur Iskhodzhanov2014-07-162-5/+35
| | | | | | Reviewed at http://reviews.llvm.org/D4533 llvm-svn: 213151
* clang/test/Driver/crash-report.c: This requires rewriter for ↵NAKAMURA Takumi2014-07-161-0/+3
| | | | | | -frewrite-includes. [PR20321] llvm-svn: 213150
* Avoid adding redundant parens.Alexander Kornienko2014-07-162-10/+28
| | | | | | | | | | | | Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, sbenza Differential Revision: http://reviews.llvm.org/D4534 llvm-svn: 213149
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-1623-0/+29
| | | | llvm-svn: 213148
* Added documentation on how clang diagnostics are reported by clang-tidy.Alexander Kornienko2014-07-161-2/+13
| | | | llvm-svn: 213147
* Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/NAKAMURA Takumi2014-07-1621-1/+1
| | | | llvm-svn: 213146
* Trailing linefeed.NAKAMURA Takumi2014-07-161-2/+0
| | | | llvm-svn: 213145
* [ASan] Adjust 'sed' invocation to work on OS XTimur Iskhodzhanov2014-07-162-2/+2
| | | | | | This is a follow-up to r213053 llvm-svn: 213144
* [Driver][Mips] Reduce code duplication - use existing functionSimon Atanasyan2014-07-163-25/+24
| | | | | | | | getMipsCPUAndABI() to get MIPS ABI name during multi-library selection. No functional changes. llvm-svn: 213143
* [Driver][Mips] Remove flags which is not used in multi-library selection.Simon Atanasyan2014-07-161-2/+0
| | | | | | No functional changes. llvm-svn: 213142
* [Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.Simon Atanasyan2014-07-161-6/+2
| | | | | | Use the tools::mips::isNaN2008() routine instead. llvm-svn: 213141
* clang/test: Introduce the feature "staticanalyzer" for ↵NAKAMURA Takumi2014-07-163-0/+8
| | | | | | --enable-clang-static-analyzer. llvm-svn: 213140
* clang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.NAKAMURA Takumi2014-07-161-3/+2
| | | | llvm-svn: 213139
* [mips] Correct the invocation of GAS in several cases.Daniel Sanders2014-07-164-59/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As a result of this patch, assembling an empty file with GCC and Clang (using GAS as the assembler) now produces identical objects. -mfp32/-mfpxx/-mfp64 now form a trinity of options. -mfpxx is the default when the triple vendor is 'img' or 'mti', the ABI is O32, and the CPU is between mips2 and mips32r2/mips64r2 (inclusive). -mno-shared is always given to the assembler to match the effect of -mabicalls (currently unimplemented but Clang acts as if it is given). Similarly, -call_nonpic is always given to match the effect of -mplt (also unimplemented and acts as if given) except when the ABI is 64 in which case -mplt has no effect so -KPIC is given instead. -mhard-float/-msoft-float are now passed on. -modd-spreg/-mno-odd-spreg are now passed on. -mno-mips16 is correctly passed on. The assembler option is -no-mips16 not -mno-mips16 Differential Revision: http://reviews.llvm.org/D4515 llvm-svn: 213138
* [X86] Add a check for 'isMOVHLPSMask' within method 'isShuffleMaskLegal'.Andrea Di Biagio2014-07-163-26/+35
| | | | | | | | | | | | | | | | Before this change, method 'isShuffleMaskLegal' didn't know that shuffles implementing a 'movhlps' operation were perfectly legal for SSE targets. This patch adds the missing check for 'isMOVHLPSMask' inside method 'isShuffleMaskLegal' to fix the problem. The reason why it is important to do this is because the DAGCombiner conservatively avoids combining a pair of shuffles if the resulting shuffle node has an illegal mask. Before this patch, shuffles with a MOVHLPS mask were wrongly considered not to be legal. This was the root cause of some poor-code generation bugs. llvm-svn: 213137
* [ASan] Factor out SymbolizationLoop.process_line() function to let PythonAlexander Potapenko2014-07-161-25/+31
| | | | | | scripts that import asan_symbolize to symbolize their reports line by line. llvm-svn: 213136
* Add FreeBSD support to the address sanitizer's ↵Viktor Kutuzov2014-07-161-2/+3
| | | | | | | | assign_large_valloc_to_global.cc test case Differential Revision: http://reviews.llvm.org/D4525 llvm-svn: 213135
* Add FreeBSD support to the address sanitizer's atexit_stats.cc test caseViktor Kutuzov2014-07-161-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D4524 llvm-svn: 213134
* [clang-tidy] Add a checker that warns on const string & members.Benjamin Kramer2014-07-165-0/+152
| | | | | | | | | | | | | | Summary: Those are considered unsafe and should be replaced with simple pointers or full copies. It recognizes both std::string and ::string. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4522 llvm-svn: 213133
* [mips] Add support for -mfpxx and -mno-fpxx.Daniel Sanders2014-07-163-0/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D4464 llvm-svn: 213132
* Remove explicit references to libdl from Asan test casesViktor Kutuzov2014-07-166-13/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D4499 llvm-svn: 213131
* Add FreeBSD support to the address sanitizer's null_deref.cc test caseViktor Kutuzov2014-07-161-7/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D4421 llvm-svn: 213130
* Don't add -Bsymbolic by default on Android.Evgeniy Stepanov2014-07-162-4/+1
| | | | | | | -Bsymbolic is not a platform requirement and should not be added unconditionally. llvm-svn: 213126
* unittests: Actually test reverse iterators in Path testsJustin Bogner2014-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | This re-enables some #if 0'd code (since 2010) in the Path unittests and makes at least a weak effort at testing sys::path's rbegin/rend. This change was inspired by some test failures near uses of rbegin and rend here: http://lab.llvm.org:8011/builders/clang-x86_64-linux-vg/builds/3209 The "valgrind was whining" comment looked promising in terms of a simpler to debug case of the same errors. However, it appears that the valgrind complaints the comment was referring to are distinct from the ones in the frontend, since this updated test isn't complaining for me under valgrind. In any case, the disabled tests weren't helping anybody. llvm-svn: 213125
* MS ABI: Up the required alignment after inserting padding between vbasesDavid Majnemer2014-07-162-1/+58
| | | | | | | | | | We would correctly insert sufficiently aligned padding between vbases when our leading base was empty, however we would neglect to increase the required alignment of the most derived class. This fixes PR20315. llvm-svn: 213123
* AST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilderDavid Majnemer2014-07-161-4/+4
| | | | | | No functionality changed, it just makes the code a little less brittle. llvm-svn: 213122
* AST: Cleanup RecordLayoutBuilderDavid Majnemer2014-07-161-90/+77
| | | | | | | | | | | No functionality changed, just some cleanups: - Switch some loops to range-based for. - Name some iterators with a more creative name than "I". - Reduce dependence on auto. Does RD->bases() give you a list of CXXBaseSpecifiers or CXXRecordDecls? It's more clear to just say which upfront. llvm-svn: 213121
* Improve error recovery around colon.Serge Pavlov2014-07-165-24/+157
| | | | | | | | | | | | Recognize additional cases, when '::' is mistyped as ':'. This is a fix to RP18587 - colons have too much protection in member-declarations Review is tracked by http://reviews.llvm.org/D3653. This is an attempt to recommit the fix, initially committed as r212957 but then reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator turns on colon protection in for context as well. llvm-svn: 213120
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-1612-66/+121
| | | | | | | | | | | | | | | | | | | | | | | This restores the original behaviour of -fmsc-version. The older option remains as a mechanism for specifying the basic version information. A secondary option, -fms-compatibility-version permits the user to specify an extended version to the driver. The new version takes the value as a dot-separated value rather than the major * 100 + minor format that -fmsc-version format. This makes it easier to specify the value as well as a more flexible manner for specifying the value. Specifying both values is considered an error. The older parameter is left solely as a driver option, which is normalised into the newer parameter. This allows us to retain a single code path in the compiler itself whilst preserving the semantics of the old parameter as well as avoid having to determine which of two formats are being used by the invocation. The test changes are due to the fact that the compiler no longer supports the old option, and is a direct conversion to the new option. llvm-svn: 213119
* Roundtrip the inalloca bit on allocas through bitcodeReid Kleckner2014-07-164-5/+34
| | | | | | | | | | | | | This was an oversight in the original support. As it is, I stuffed this bit into the alignment. The alignment is stored in log2 form, so it doesn't need more than 5 bits, given that Value::MaximumAlignment is 1 << 29. Reviewers: nicholas Differential Revision: http://reviews.llvm.org/D3943 llvm-svn: 213118
* Fix comment in InstCombiner::visitAddrSpaceCast.Manuel Jacob2014-07-161-3/+3
| | | | | | | | In the original version of the patch the behaviour was like described in the comment. This behaviour was changed before committing it without updating the comment. llvm-svn: 213117
* Change Windows decoration on some base classesSaleem Abdulrasool2014-07-161-2/+2
| | | | | | | | | | | Mark the base classes for time_get_byname and time_get as _LIBCPP_TYPE_VIS_ONLY rather than _LIBCPP_TYPE_VIS. These base classes are templated types and cannot be stored with export dll storage. Fixes compilation with _LIBCPP_DLL for Windows when the time_get and time_get_byname classes are used. llvm-svn: 213116
* Add a test for wildcard expansion on WindowsHans Wennborg2014-07-163-0/+6
| | | | | | This depends on LLVM r213114 llvm-svn: 213115
* Perform wildcard expansion in Process::GetArgumentVector on Windows (PR17098)Hans Wennborg2014-07-161-19/+71
| | | | | | | | | | | | | | On Windows, wildcard expansion isn't performed by the shell, but left to the program itself. The common way to do this is to link with setargv.obj, which performs the expansion on argc/argv before main is entered. However, we don't use argv in Clang on Windows, but instead call GetCommandLineW so we can handle unicode arguments. This means we have to do wildcard expansion ourselves. A test case will be added on the Clang side. Differential Revision: http://reviews.llvm.org/D4529 llvm-svn: 213114
* Fixed the an objective C test case so it passes correctly.Greg Clayton2014-07-161-4/+4
| | | | | | | | Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly. Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods. llvm-svn: 213113
* Handle diagnostic warnings in Frontend diagnostic handler.Tyler Nowicki2014-07-163-13/+32
| | | | | | | | | | | | Clang uses a diagnostic handler to grab diagnostic messages so it can print them with the line of source code they refer to. This patch extends this to handle diagnostic warnings that were added to llvm to produce a warning when loop vectorization is explicitly specified (using a pragma clang loop directive) but fails. Reviewed by: Aaron Ballman llvm-svn: 213112
* TestObjCMethods.FoundationTestCase was failing due to an error, fixed now.Greg Clayton2014-07-161-13/+16
| | | | | | | <rdar://problem/16322133> llvm.org/pr20267 llvm-svn: 213111
* Emit warnings if vectorization is forced and fails.Tyler Nowicki2014-07-166-28/+199
| | | | | | | | | | | This patch modifies the existing DiagnosticInfo system to create a generic base class that is inherited to produce diagnostic-based warnings. This is used by the loop vectorizer to trigger a warning when vectorization is forced and fails. Several tests have been added to verify this behavior. Reviewed by: Arnold Schwaighofer llvm-svn: 213110
* Avoid referencing the vtable when calling the ctor without emitting itReid Kleckner2014-07-162-4/+52
| | | | | | | | | | | | | | This fixes compilation errors about incomplete types used with WebKit's RefPtr template. Simply calling an out of line constructor should not instantiate all inline and defaulted virtual methods. Tested by building and testing several big piles of code on Linux. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4429 llvm-svn: 213109
* Remove TLI from isInTailCallPosition's arguments. NFC.Juergen Ributzka2014-07-164-7/+6
| | | | | | | There is no need to pass on TLI separately to the function. As Eric pointed out the Target Machine already provides everything we need. llvm-svn: 213108
* R600/SI: Allow using f32 rcp / rsq when denormals not handled.Matt Arsenault2014-07-156-27/+45
| | | | | | | These are precise enough to use for OpenCL unless denormals are handled. llvm-svn: 213107
* Fix compile warning.Greg Clayton2014-07-151-1/+1
| | | | llvm-svn: 213106
* Use the integrated assembler by default on OpenBSD/sparc.Brad Smith2014-07-152-4/+10
| | | | llvm-svn: 213105
* X86: Simplify X86WindowsTargetObjectFile::getSectionForConstantDavid Majnemer2014-07-151-9/+3
| | | | | | | | | There exists a helper function to abstract away the various differences between ConstantVector, ConstantDataVector, ConstantAggregateZero, etc. Use it to simplify X86WindowsTargetObjectFile::getSectionForConstant. llvm-svn: 213104
* Move Post RA Scheduling flag bit into SchedMachineModelSanjay Patel2014-07-1517-110/+100
| | | | | | | | | | | | | | | | | | | | | Refactoring; no functional changes intended Removed PostRAScheduler bits from subtargets (X86, ARM). Added PostRAScheduler bit to MCSchedModel class. This bit is set by a CPU's scheduling model (if it exists). Removed enablePostRAScheduler() function from TargetSubtargetInfo and subclasses. Fixed the existing enablePostMachineScheduler() method to use the MCSchedModel (was just returning false!). Added methods to TargetSubtargetInfo to allow overrides for AntiDepBreakMode, CriticalPathRCs, and OptLevel for PostRAScheduling. Added enablePostRAScheduler() function to PostRAScheduler class which queries the subtarget for the above values. Preserved existing scheduler behavior for ARM, MIPS, PPC, and X86: a. ARM overrides the CPU's postRA settings by enabling postRA for any non-Thumb or Thumb2 subtarget. b. MIPS overrides the CPU's postRA settings by enabling postRA for everything. c. PPC overrides the CPU's postRA settings by enabling postRA for everything. d. X86 is the only target that actually has postRA specified via sched model info. Differential Revision: http://reviews.llvm.org/D4217 llvm-svn: 213101
OpenPOWER on IntegriCloud