summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Warn when attribute 'optnone' conflicts with attributes on aPaul Robinson2014-12-153-3/+59
| | | | | | different declaration of the same function. llvm-svn: 224256
* Add voidType() matcher.Samuel Benzaquen2014-12-151-0/+1
| | | | | | | | | | | | Summary: Add voidType() matcher. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6656 llvm-svn: 224250
* Sema: Don't diagnose string + int if the int is value dependentDavid Majnemer2014-12-151-1/+1
| | | | | | | | | | | Don't send a value dependent expression into the expression evaluator, HandleSizeof would crash. Making HandleSizeof handle dependent types would noisily warn about the operation even if everything turns out OK after instantiation. This fixes PR21848. llvm-svn: 224240
* Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacroDavid Majnemer2014-12-151-4/+10
| | | | | | | | | | | We would CreateString on arbitrary garbage instead of just skipping to the end of the builtin macro. Eventually, this would cause us to crash because we would end up replacing the contents of a character token with a numeric literal. This fixes PR21825. llvm-svn: 224238
* Sema: Don't leave switch stack inconsistent when recoveringDavid Majnemer2014-12-151-1/+2
| | | | | | | | | We would exit Sema::ActOnFinishSwitchStmt early if we didn't have a body. This would leave an extra SwitchStmt on the SwitchStack. This fixes PR21841. llvm-svn: 224237
* First patch with codegen of the 'omp for' directive. It implementsAlexander Musman2014-12-158-171/+597
| | | | | | | | | | | | | | | the simplest case, which is used when no chunk_size is specified in the schedule(static) or no 'schedule' clause is specified - the iteration space is divided by the library into chunks that are approximately equal in size, and at most one chunk is distributed to each thread. In this case, we do not need an outer loop in each thread - each thread requests once which iterations range it should handle (using __kmpc_for_static_init runtime call) and then runs the inner loop on this range. Differential Revision: http://reviews.llvm.org/D5865 llvm-svn: 224233
* Bugfix for Codegen of atomic load/store/other ops.Alexey Bataev2014-12-153-82/+161
| | | | | | | Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations. Differential Revision: http://reviews.llvm.org/D6499 llvm-svn: 224230
* MSVC: A wide string literal from L#macro_arg in a macroAlexey Bataev2014-12-151-3/+19
| | | | | | | | Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode. Fix for http://llvm.org/PR9984. Differential Revision: http://reviews.llvm.org/D6604 llvm-svn: 224228
* Don't break single-line raw string literals.Alexander Kornienko2014-12-141-20/+1
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6636 llvm-svn: 224223
* DebugInfo: More accurate line information for placement new.David Blaikie2014-12-141-0/+3
| | | | | | | | | | | This actually came up as a break in UBSan tests (look for a follow-up commit to this one to see the UBSan test fallout) when I tried a broader fix to location information. I have some other ideas about how to do that broader change & will keep looking into it. llvm-svn: 224221
* CodeGen: Compound literals with funny types shouldn't crashDavid Majnemer2014-12-142-3/+6
| | | | | | | | | | | | | | | | | CodeGen assumed that a compound literal with array type should have a corresponding LLVM IR array type. We had two bugs in this area: - Zero sized arrays in compound literals would lead to the creation of an opaque type. This is unnecessary, we should just create an array type with a bound of zero. - Funny record types (like unions) lead to exotic IR types for compound literals. In this case, CodeGen must be prepared to deal with the possibility that it might not have an array IR type. This fixes PR21912. llvm-svn: 224219
* AST: Limit zero-sized constexpr behavior to array typesDavid Majnemer2014-12-141-1/+3
| | | | | | | Restricting this "extension" to array types maximizes our standards conformance while not miscompiling real-world programs. llvm-svn: 224215
* Lex: Don't crash if both conflict markers are on the same lineDavid Majnemer2014-12-141-2/+2
| | | | | | | | | | We would check if the terminator marker is on a newline. However, the logic would end up out-of-bounds if the terminator marker immediately follows the start marker. This fixes PR21820. llvm-svn: 224210
* If a non-template constructor instantiated to X(X),John McCall2014-12-142-11/+20
| | | | | | | | | | | | | | | | | | | | | | | ignore it during overload resolution when initializing X from a value of type cv X. Previously, our rule here only ignored specializations of constructor templates. That's probably because the standard says that constructors are outright ill-formed if their first parameter is literally X and they're callable with one argument. However, Clang only enforces that prohibition against non-implicit instantiations; I'm not sure why, but it seems to be deliberate. Given that, the most sensible thing to do is to just ignore the "illegal" constructor regardless of where it came from. Also, stop ignoring such constructors silently: print a note explaining why they're being ignored. Fixes <rdar://19199836>. llvm-svn: 224205
* Sema: attribute((annotate)) must have at least one argumentDavid Majnemer2014-12-141-1/+1
| | | | | | | | | | Sema::handleAnnotateAttr expects that some basic validation is done on the given AttributeList. However, ProcessAccessDeclAttributeList called it directly. Instead, pass the list to ProcessDeclAttribute. This fixes PR21847. llvm-svn: 224204
* Parse: MS property members cannot have an in-class initializerDavid Majnemer2014-12-132-5/+9
| | | | | | | | | We would crash trying to treat a property member as a field. These shoudl be forbidden anyway, reject programs which contain them. This fixes PR21840. llvm-svn: 224193
* Sema: Constexpr functions must have return statements which have an exprDavid Majnemer2014-12-131-4/+16
| | | | | | | | | | | | | | | clang lets programmers be pretty cavalier when it comes to void return statements in functions which have non-void return types. However, we cannot be so forgiving in constexpr functions: evaluation will go off the rails very quickly. Instead, keep the return statement in the AST but mark the function as invalid. Doing so gives us nice diagnostics while making constexpr evaluation halt. This fixes PR21859. llvm-svn: 224189
* NFC: Minor formatting fixWill Wilson2014-12-131-1/+1
| | | | llvm-svn: 224185
* Pretty print support for template arg enum constantsWill Wilson2014-12-131-2/+13
| | | | llvm-svn: 224184
* Fix two small bugs in typo correction. One assertion failure building member ↵Nick Lewycky2014-12-132-1/+4
| | | | | | | | expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression. The testcase shows a third bug with a FIXME in it. llvm-svn: 224183
* Implement feedback on r224172 in PR21899Reid Kleckner2014-12-131-1/+1
| | | | | | Based on suggestions from Kaelyn. llvm-svn: 224173
* Typo correction: Ignore temporary binding exprs after overload resolutionReid Kleckner2014-12-131-2/+7
| | | | | | | | Transformation of a CallExpr doesn't always result in a new CallExpr. Fixes PR21899. llvm-svn: 224172
* Implement the __builtin_call_with_static_chain GNU extension.Peter Collingbourne2014-12-1210-69/+187
| | | | | | | | | | | | | | | | The extension has the following syntax: __builtin_call_with_static_chain(Call, Chain) where Call must be a function call expression and Chain must be of pointer type This extension performs a function call Call with a static chain pointer Chain passed to the callee in a designated register. This is useful for calling foreign language functions whose ABI uses static chain pointers (e.g. to implement closures). Differential Revision: http://reviews.llvm.org/D6332 llvm-svn: 224167
* Frontend: Canonicalize to native paths when dumping module dependenciesJustin Bogner2014-12-121-0/+4
| | | | | | | | | | | | Mixed path separators (ie, both / and \\) can mess up the sort order of the VFS map when dumping module dependencies, as was recently exposed by r224055 and papered over in r224145. Instead, we should simply use native paths for consistency. This also adds a TODO to add handling of .. in paths. There was some code for this before r224055, but it was untested and probably broken. llvm-svn: 224164
* Fix the issue of mangling of local anonymous unions (Itanium C++ ABI):Evgeny Astigeevich2014-12-123-27/+54
| | | | | | | | | | | | | | | | | | | | | | A discriminator is used for the first occurrence of a name. inline int f1 () { static union { int a; long int b; }; static union { int c; double d; }; return a+c; } The name of the second union is mangled as _ZZ2f1vE1c_0 instead of _ZZ2f1vE1c. Differential Revision: http://reviews.llvm.org/D6295 llvm-svn: 224131
* Don't break string literals in Java and JavaScript.Alexander Kornienko2014-12-121-0/+6
| | | | | | | | The proper way to break string literals in these languages is by inserting a "+" between parts which we don't support yet. So we disable string literal breaking until then. llvm-svn: 224120
* clang-format: Revamp nested block formatting.Daniel Jasper2014-12-124-84/+53
| | | | | | | | | | | | | | | | | | | | | | This fixed llvm.org/PR21804 and hopefully a few other strange cases. Before: if (blah_blah(whatever, whatever, [] { doo_dah(); doo_dah(); })) { } } After: if (blah_blah(whatever, whatever, [] { doo_dah(); doo_dah(); })) { } } llvm-svn: 224112
* CodeGen: Loads/stores to allocas for atomic ops shouldn't be volatileDavid Majnemer2014-12-121-7/+10
| | | | | | | | | Don't inherit the volatile-ness of the input pointer to the volatile operation for memory allocated on the side. This fixes PR17306. llvm-svn: 224110
* Do not warn on keyword undefSerge Pavlov2014-12-121-11/+6
| | | | | | | #undef a keyword is generally harmless but used often in configuration scripts. Also added tests that I forgot to include to commit in r223114. llvm-svn: 224100
* [Objective-C]. This patch extends objc_bridge attribute to support ↵Fariborz Jahanian2014-12-112-0/+4
| | | | | | | | | | objc_bridge(id). This means that a pointer to the struct type to which the attribute appertains is a CF type (and therefore an Objective-C object of some type), but not of any specific class. rdar://19157264 llvm-svn: 224072
* [modules] When constructing paths relative to a module, strip out /./ directoryRichard Smith2014-12-114-56/+76
| | | | | | | components. These sometimes get synthetically added, and we don't want -Ifoo and -I./foo to be treated fundamentally differently here. llvm-svn: 224055
* Instead of having -Os/-Oz add OptimizeForSize/MinSize first, and laterPaul Robinson2014-12-112-6/+16
| | | | | | | | | | having OptimizeNone remove them again, just don't add them in the first place if the function already has OptimizeNone. Note that MinSize can still appear due to attributes on different declarations; a future patch will address that. llvm-svn: 224047
* AST: Incomplete types might be zero sizedDavid Majnemer2014-12-111-3/+7
| | | | | | | | Comparing the address of an object with an incomplete type might return true with a 'distinct' object if the former has a size of zero. However, such an object should compare unequal with null. llvm-svn: 224040
* When checking for nonnull parameter attributes, also check the ParmVarDecl ↵Aaron Ballman2014-12-112-2/+3
| | | | | | since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668. llvm-svn: 224039
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-112-2/+96
| | | | | | Recommit of r223114, reverted in r223120. llvm-svn: 224012
* MS ABI: Fix mangling of unsigned int template paramsWill Wilson2014-12-111-1/+3
| | | | llvm-svn: 223999
* Parse: Concatenated string literals should be verified in inline asmDavid Majnemer2014-12-112-28/+17
| | | | | | | | | | While we would correctly handle asm("foo") and reject asm(L"bar"), we weren't careful to handle cases where an ascii literal could be concatenated with a wide literal. This fixes PR21822. llvm-svn: 223992
* Revert r223578, perf data collection depends on the old symbol name.Paul Robinson2014-12-103-11/+11
| | | | llvm-svn: 223987
* Diagnose attributes 'optnone' and 'minsize' on the same declaration.Paul Robinson2014-12-101-1/+13
| | | | | | | Eventually we'll diagnose them on different declarations, but let's get this part out of the way first. llvm-svn: 223985
* Revert r223980 as it had wrong commit message.Paul Robinson2014-12-101-13/+1
| | | | llvm-svn: 223984
* Rename a couple of preprocessor symbols to be more descriptive. NFC.Paul Robinson2014-12-101-1/+13
| | | | | | Review feedback from recent changes to GetSVN.cmake. llvm-svn: 223980
* Add a FIXME for unifying ARM target abi handling.Eric Christopher2014-12-101-0/+1
| | | | llvm-svn: 223977
* Revert the default changing behavior part of r216662 until weEric Christopher2014-12-101-4/+3
| | | | | | | | can change the backend to be the same default. Leave the modified/new testcases with the exception of the default behavior since it increases our testing footprint. llvm-svn: 223976
* AST: Properly calculate the linkage of a IndirectFieldDeclDavid Majnemer2014-12-101-2/+5
| | | | | | | | | | | getLVForNamespaceScopeDecl believed that it wasn't possible for it to ever see an IndirectFieldDecl. However, this can occur when determining whether or not something is a redeclaration of a member of an anonymous static union. This fixes PR21858. llvm-svn: 223975
* Fixed an 80-column violation.Sean Callanan2014-12-101-6/+7
| | | | | | Thanks to Nico Weber for spotting this. llvm-svn: 223966
* DebugInfo: Location information for scalar new expressionsDavid Blaikie2014-12-101-5/+7
| | | | llvm-svn: 223937
* clang-format: Factor out UnwrappedLineFormatter into a separate file.Daniel Jasper2014-12-104-773/+869
| | | | | | No functional changes intended. llvm-svn: 223936
* Objective-C SDK modernizer. When modernizing an enum to Fariborz Jahanian2014-12-101-4/+13
| | | | | | | NS_ENUM/NS_OPTIONS use the underlying type if there is no associated type. rdar://19198042 llvm-svn: 223934
* clang-format: Remove a few else after return statements.Daniel Jasper2014-12-101-19/+12
| | | | | | | They are against the LLVM coding conventions. No functional changes intended. llvm-svn: 223930
* OpenCL C: Add support for a set of floating point Pekka Jaaskelainen2014-12-102-4/+15
| | | | | | | | | | | | | | arithmetic relaxation flags: -cl-no-signed-zeros -cl-unsafe-math-optimizations -cl-finite-math-only -cl-fast-relaxed-math Propagate the info to FP instruction flags as well as function attributes where they are available. llvm-svn: 223928
OpenPOWER on IntegriCloud