summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use a single note diagnostic for all the precedent/parentheses warnings.David Blaikie2012-10-081-8/+10
| | | | llvm-svn: 165384
* StringRef-ify Binary/UnaryOperator::getOpcodeStrDavid Blaikie2012-10-084-7/+7
| | | | llvm-svn: 165383
* Use getArch instead of getArchName + string compare.Rafael Espindola2012-10-073-22/+22
| | | | llvm-svn: 165370
* Use getArch instead of getArchName.Rafael Espindola2012-10-072-8/+2
| | | | | | | | | | | | The darwin change should be a nop since Triple::getArchTypeForDarwinArchName doesn't know about amd64. If things like amd64-mingw32 are to be rejected, we should print a error earlier on instead of silently using the wrong abi. Remove old comment that looks out of place, this is "in clang". llvm-svn: 165368
* Expose __builtin_bswap16.Benjamin Kramer2012-10-062-0/+2
| | | | | | | GCC has always supported this on PowerPC and 4.8 supports it on all platforms, so it's a good idea to expose it in clang too. LLVM supports this on all targets. llvm-svn: 165362
* ParentMap: Restore the ability to update an existing map.Jordan Rose2012-10-061-14/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | The Clang ASTs are a DAG, not a pure tree. However, ParentMap has to choose a single parent for each object. In the main (only?) cases in which the AST forms a DAG, it protects from multiple traversal by using OpaqueValueExprs. Previously, ParentMap would just unconditionally look through all OpaqueValueExprs when building its map. In order to make this behavior better for the analyzer's diagnostics, ParentMap was changed to not set a statement's parent if there already was one in the map. However, ParentMap is supposed to allow updating existing mappings by calling addStmt once again. This change makes the "transparency" of OpaqueValueExprs explicit, and disables it when it is not desired, rather than checking the current contents of the map. This new code seems like a big change, but it should actually have essentially the same performance as before. Only OpaqueValueExprs and their users (PseudoObjectExpr and BinaryConditionalOperator) will have any different behavior. There should be no user-visible functionality change, though a test has been added for the current behavior of BinaryConditionalOperator source locations and accompanying Xcode arrows (which are not so great...). llvm-svn: 165355
* [analyzer] Handle implicit statements used for end-of-path nodes' source locs.Jordan Rose2012-10-061-8/+13
| | | | | | | | | | | Some implicit statements, such as the implicit 'self' inserted for "free" Objective-C ivar access, have invalid source locations. If one of these statements is the location where an issue is reported, we'll now look at the enclosing statements for a valid source location. <rdar://problem/12446776> llvm-svn: 165354
* Propagate calling convention for aliases and weakrefs.Alex Rosenberg2012-10-051-2/+3
| | | | llvm-svn: 165343
* Thread-safety analysis: allow attributes on constructors to refer to 'this'.DeLesley Hutchins2012-10-051-16/+31
| | | | llvm-svn: 165339
* Add intrinsic of MULX in BMI2 headerMichael Liao2012-10-051-0/+19
| | | | llvm-svn: 165325
* Added forgotten break.Abramo Bagnara2012-10-051-2/+2
| | | | llvm-svn: 165298
* Make sure to generate the right kind of MDNode for enum forward declarations.Eli Friedman2012-10-051-9/+22
| | | | | | PR14029, clang part. llvm-svn: 165289
* Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about ↵Richard Smith2012-10-051-2/+7
| | | | | | what's going on, per Sean Silva's suggestion. llvm-svn: 165286
* Implement -Wshift-op-parentheses for: a << b + cDavid Blaikie2012-10-051-0/+21
| | | | | | | | | | | | This appears to be consistent with GCC's implementation of the same warning under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user defined type for compatibility with C++ stream IO. Otherwise suggest parentheses around the addition or subtraction subexpression. (this came up when MSVC was complaining (incorrectly, so far as I can tell) about a perceived violation of this within the LLVM codebase, PR14001) llvm-svn: 165283
* [Modules] Introduce Module::TopHeaders which is a set of top-level headersArgyrios Kyrtzidis2012-10-054-4/+37
| | | | | | that are associated with a (sub)module. llvm-svn: 165279
* [preprocessing record] Have PPEntityID be independent of the size of theArgyrios Kyrtzidis2012-10-051-14/+18
| | | | | | | loaded entities vector, otherwise its meaning will change when a module is imported and the vector size changes. llvm-svn: 165278
* [libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a moduleArgyrios Kyrtzidis2012-10-051-0/+3
| | | | | | import declaration. llvm-svn: 165277
* If we flow off the end of a value-returning function:Richard Smith2012-10-041-0/+14
| | | | | | | | - outside C++, return undef (behavior is not undefined unless the value is used) - in C++, with -fcatch-undefined-behavior, perform an appropriate trap - in C++, produce an 'unreachable' (behavior is undefined immediately) llvm-svn: 165273
* Egriegious hack to support libstdc++4.6's broken <atomic> header, which definesRichard Smith2012-10-041-24/+41
| | | | | | | | a non-inline namespace, then reopens it as inline to try to add its symbols to the surrounding namespace. In this one special case, permit the namespace to be reopened as inline, and patch up the name lookup tables to match. llvm-svn: 165263
* Fixed FunctionTypeLoc source range.Abramo Bagnara2012-10-0410-71/+181
| | | | llvm-svn: 165259
* Fixed instantiated operators source range.Abramo Bagnara2012-10-041-1/+1
| | | | llvm-svn: 165258
* Fixed ParamDecl source range for implicit typed k&r parameters.Abramo Bagnara2012-10-041-0/+3
| | | | llvm-svn: 165256
* Driver: Link crtfastmath.o if it's available and -ffast-math is specified.Benjamin Kramer2012-10-042-0/+25
| | | | | | | | | | | | crtfastmath.o contains routines to set the floating point flags to a faster, unsafe mode. Linking it in speeds up code dealing with denormals significantly (PR14024). For now this is only enabled on linux where I can test it and crtfastmath.o is widely available. We may want to provide a similar file with compiler-rt eventually and/or enable it on other platforms too. llvm-svn: 165240
* Fix scope location when parsing GNU attributes.Michael Han2012-10-042-6/+6
| | | | | | | | For GNU attributes, instead of reusing attribute source location for the scope location, use SourceLocation() since GNU attributes don not have scope tokens. llvm-svn: 165234
* Prefer StringRef::startswith to the strncmp/strlen contraption.Benjamin Kramer2012-10-041-1/+2
| | | | | | This may be slightly more efficient and is definitely more readable. llvm-svn: 165217
* Fix typo in comments.Logan Chien2012-10-041-2/+2
| | | | llvm-svn: 165216
* Fix r165005: The lexical DeclContext is not the right place to make a ↵Axel Naumann2012-10-041-4/+6
| | | | | | decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit. llvm-svn: 165215
* Add missing comment for mangling.Nick Lewycky2012-10-041-0/+1
| | | | llvm-svn: 165202
* Fail early with a clear assert if an operation with multiple uses somehow endsLang Hames2012-10-041-0/+4
| | | | | | up being contracted during codegen. llvm-svn: 165197
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-045-100/+259
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* [libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis2012-10-031-0/+36
| | | | llvm-svn: 165161
* Fix invalid reads by memcmp.Benjamin Kramer2012-10-031-1/+1
| | | | | | | Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the end. Found by valgrind. llvm-svn: 165157
* Always initialize FPContractable.Benjamin Kramer2012-10-031-0/+3
| | | | | | | false is used as a baseline here, we may want to allow contraction in some of the cases. Found by valgrind. llvm-svn: 165156
* [Options] Store the owning OptTable in Option so it can construct Group and ↵Michael J. Spencer2012-10-032-11/+8
| | | | | | Alias. llvm-svn: 165150
* Remove useless parameter "WantFile" from Driver::GetProgramPath().Simon Atanasyan2012-10-032-14/+8
| | | | | | | | | This parameter is useless because nowhere used explicitly and always gets its default value - "false". The patch reviewed by Rafael Espindola. llvm-svn: 165149
* This patch enables general varargs support for the 64-bit PPC SVR4 ABI.Bill Schmidt2012-10-031-4/+102
| | | | | | | | | | | | | | Most of the pieces for this were already in place, but a proper EmitVAArg is needed for aggregates and complex numbers to be handled. Although the va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with the overflow portion of the parameter save area, we can treat va_list as pointing to contiguous memory for all parameters, since the back end forces the parameter GPRs to memory for varargs functions. There is no need at this time to model parameters and return values beyond what the DefaultABIInfo provides. llvm-svn: 165143
* Remove ASTReader::needPendingInstantiation(), introduced in r164993,Douglas Gregor2012-10-031-57/+0
| | | | | | | which is neither correct nor necessary. The use of this routine was eliminated by r165137. llvm-svn: 165139
* Add some FIXMEs to the ASTReader codeDouglas Gregor2012-10-031-0/+2
| | | | llvm-svn: 165138
* Revert most of the functionality in r165001. Instead, make sure thatDouglas Gregor2012-10-032-16/+7
| | | | | | | the ASTReader doesn't attach a body to a function that is already defined elsewhere. llvm-svn: 165137
* objective-C arc: Warn under arc about a use of an ivar inside a blockFariborz Jahanian2012-10-031-0/+3
| | | | | | | that doesn't have a 'self' as this implicitly captures 'self' and could create retain cycles. Provide fixit. // rdar://11194874 llvm-svn: 165133
* Implement Adnroid MIPS toolchain support:Simon Atanasyan2012-10-031-4/+33
| | | | | | | | | | 1. Add mipsel-linux-android to the list of valid MIPS target triples. 2. Add <gcc install path>/mips-r2 to the list of toolchain specific path prefixes if target is mipsel-linux-android. The patch reviewed by Logan Chien. llvm-svn: 165131
* CodeGen: Fix a silly typo when emitting subs of block addresses.Benjamin Kramer2012-10-031-1/+1
| | | | | | Part of PR14005. llvm-svn: 165117
* When mangling an APSInt with the ms abi, make sure to look at all nibbles.Nico Weber2012-10-031-1/+1
| | | | | | Currently, it's ignored if the number of set bits isn't divisible by 4. llvm-svn: 165116
* Fix typo in comments.Logan Chien2012-10-031-1/+1
| | | | llvm-svn: 165105
* While I'm here, resync a %select with the enum definition it selects on.Nico Weber2012-10-031-2/+2
| | | | | | | | | | | | | * nullptr used to be mapped to ERROR, now mapped to nullptr * integral was missing * expressions now have their own error message, so they won't reach this. Map them to ERROR. Note that clang usually crashes before emitting this diagnostic anyway (see PR13984), so this change alone doesn't have an observable effect. It makes the code more correct though. llvm-svn: 165095
* Move expression mangling in the microsoft mangler to its own function.Nico Weber2012-10-031-10/+21
| | | | | | | | | | This matches what's done in ItaniumMangle and makes it a bit easier to implement mangling for more expressions. Also use the slightly nicer "not yet implemented" error message from there. No functionality change (except for the different error message). llvm-svn: 165093
* Replace a default: with an explicit list of cases. No functionality change.Nico Weber2012-10-031-1/+6
| | | | llvm-svn: 165091
* [PCH] Fix serialization of an ImportDecl.Argyrios Kyrtzidis2012-10-032-0/+2
| | | | | | | | ImportDecl's module ID was not written out and the reader accepted as module ID the serialized: Record.push_back(!IdentifierLocs.empty()); llvm-svn: 165087
* Set the file entry for a Module* that was created during deserializationArgyrios Kyrtzidis2012-10-033-3/+6
| | | | | | of a module file. llvm-svn: 165086
* Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invokedArgyrios Kyrtzidis2012-10-032-3/+11
| | | | | | when an ImportDecl that was implicitly created due to an inclusion directive. llvm-svn: 165084
OpenPOWER on IntegriCloud