summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: Simplify CodeGenFunction::EmitCaseStmtJustin Bogner2014-01-153-52/+0
| | | | | | | | | | | | | Way back in r129652 we tried to avoid emitting an empty block at -O0 for switch cases that did nothing but break. This led to a poor debugging experience as reported in PR9796, so we disabled the optimization for -O0 but left it in for higher optimization levels in r154420. Since the whole point of this was to improve -O0, it's silly to keep the complexity at all. llvm-svn: 199302
* Fix cxx_variable_templates feature check and documentationAlp Toker2014-01-151-1/+1
| | | | | | | | | | This C++ feature has been marked complete since r191549, but the documentation claimed it wasn't supported at all and the extension check misreported it as being available in C. No regression test; this was a short-lived typo. llvm-svn: 199292
* Fixed error recovery if sizeof is used without parenthesisSerge Pavlov2014-01-151-2/+1
| | | | | | | | | | | Changes made in r192200 fixed PR16992, which requested fixit suggesting parenthesis if sizeof is followed by type-id. However expression in form T() followed by ')' was incorrectly considered as a type-id if 'T' is typedef name. This change fixes this case. Differential Revision: http://llvm-reviews.chandlerc.com/D2440 llvm-svn: 199284
* Teach DeadStoresChecker about attribute objc_precise_lifetime.Ted Kremenek2014-01-151-3/+6
| | | | llvm-svn: 199277
* Improve comment.Fariborz Jahanian2014-01-141-3/+3
| | | | llvm-svn: 199258
* ObjectiveC. add comment.Fariborz Jahanian2014-01-141-3/+3
| | | | llvm-svn: 199257
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-147-24/+5
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Remove unused function to fix clang -Werror buildReid Kleckner2014-01-141-7/+0
| | | | llvm-svn: 199230
* Simplifying the OpenCL image attribute. It does not need a semantic integer ↵Aaron Ballman2014-01-144-75/+10
| | | | | | parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place. llvm-svn: 199229
* CFG: use Visit instead of VisitStmt to look through parens.Jordan Rose2014-01-141-3/+4
| | | | | | PR18472 llvm-svn: 199227
* [analyzer] Use synthesized ASTs for property getters when available.Jordan Rose2014-01-141-6/+18
| | | | | | | This allows the analyzer to handle properties with C++ class type, finishing up the FIXME from r198953. llvm-svn: 199226
* Use a proper lvalue-to-rvalue conversion in Objective-C++ property accessors.Jordan Rose2014-01-141-4/+10
| | | | | | | | | | | Previously, the synthesized AST contained an rvalue DeclRefExpr for 'self'. Now, it has an lvalue DeclRefExpr wrapped in an lvalue-to-rvalue ImplicitCastExpr, which is what's generated when an ivar access is written in the source. No (intended) functionality change. llvm-svn: 199225
* Update CodeGen to use DLL storage class for dllimport/dllexportNico Rieck2014-01-141-9/+17
| | | | | | | With the old linkage types removed, set the linkage to external for both dllimport and dllexport to reflect what's currently supported. llvm-svn: 199220
* Switch around the order of MSVCCompat and MicrosoftExtAlp Toker2014-01-141-2/+1
| | | | | | | | | | | | Full language modes usually get listed before minor language extensions in LangOpts, so that subsequent sub-modes can predicate on the major modes. This also lends to a cleanup in CompilerInvocation to better indicate to the reader that MSVCCompat is a superset of MicrosoftExt. Cleanup only. llvm-svn: 199210
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-1419-47/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
* [OpenCL] Disallow casts between address spaces.Joey Gouly2014-01-141-0/+15
| | | | llvm-svn: 199208
* Remove trailing spacesSylvestre Ledru2014-01-141-2/+2
| | | | llvm-svn: 199199
* clang-format: Fix bug introduced in r198871.Daniel Jasper2014-01-142-2/+8
| | | | | | | | | | | | We cannot simply change the start column to accomodate for the @ in an ObjC string literal as that will make clang-format happily violate the column limit. Use a different workaround instead. However, a better long-term solution might be to join the @ and the rest of the literal into a single token. llvm-svn: 199198
* Sema: Predefine size_t in MSVC Compatibility modeDavid Majnemer2014-01-141-0/+2
| | | | | | | | MSVC defines size_t without any explicit declarations. This change allows us to be compatible with TUs that depend on this declaration appearing from nowhere. llvm-svn: 199190
* Remove a temporary workaround that is no longer relevant.Bob Wilson2014-01-141-20/+3
| | | | llvm-svn: 199176
* Removing some attribute magic related to the OpenCL keyword attributes. ↵Aaron Ballman2014-01-143-79/+70
| | | | | | Instead of mapping them to their semantics as a custom part of the parser, they instead map declaratively through the rest of the attribute system. llvm-svn: 199175
* [ms-abi] Small Change to pack+alignment interaction.Warren Hunt2014-01-141-4/+7
| | | | | | | | | This patch makes a small behavioral change to the interaction between pack and alignment. Specifically it makes __declspec(align()) on a field change that field's alignment without respect to pack but the alignment change to the record alignment as a whole still obeys pack. llvm-svn: 199172
* [ms-abi] Remove duplicated vbptr offset codeReid Kleckner2014-01-141-39/+5
| | | | | | | | | Record layout will tell us the offset of a shared vbptr inside a non-virtual base. No functionality change. llvm-svn: 199171
* Consumed analysis: add two new attributes which fine-tune the behavior ofDeLesley Hutchins2014-01-142-221/+229
| | | | | | | | consumable objects. These are useful for implementing error codes that must be checked. Patch also includes some significant refactoring, which was necesary to implement the new behavior. llvm-svn: 199169
* [ms-abi] Report VBPtrOffset correctlyWarren Hunt2014-01-141-6/+5
| | | | | | | | | | Although VBPtrs were being placed correctly by the ms-abi layout engine, their offsets were being improperly reported to the ASTRecordLayout builder due to a bug. This patch fixes that and fixes the test cases to use the correct values. y llvm-svn: 199168
* [ms-abi] Always generate complete constructors in the Microsoft C++ ABIReid Kleckner2014-01-132-5/+11
| | | | | | | | Fixes PR18435, where we generated a base ctor instead of a complete ctor, and so failed to construct virtual bases when constructing the complete object. llvm-svn: 199160
* [ms-abi] Reordering __declspec(align) pragma pack handlingWarren Hunt2014-01-131-3/+3
| | | | | | | | This patch moves the check for pragma pack until after the application of __declspec align to before pragma pack. This causes observable changes in the use of tail padding for bases. A test case is included. llvm-svn: 199154
* clang-cl: Ignore /fallback when not actually compiling (PR18456)Hans Wennborg2014-01-131-1/+2
| | | | | | For example, don't fall back in /P (preprocess) mode. llvm-svn: 199153
* When determining the attribute's parsed kind, pay attention to the syntax ↵Aaron Ballman2014-01-131-1/+1
| | | | | | used. This fixes bugs where an attribute has differing GNU and Declspec spellings, but they are treated as the same. Eg) __declspec(aligned) when it should be __attribute__((aligned)), and __attribute__((align)) when it should be __declspec(align). llvm-svn: 199144
* __forceinline is a keyword, and not a GNU-style attribute. This FIXME ↵Aaron Ballman2014-01-131-3/+1
| | | | | | appears to be out-dated, and the attribute syntax is becoming more important these days. llvm-svn: 199143
* CodeGen: Clarify a comment about PGO in case statement rangesJustin Bogner2014-01-131-3/+4
| | | | llvm-svn: 199140
* CodeGen: Rename adjustFallThroughCount -> adjustForControlFlowJustin Bogner2014-01-137-24/+24
| | | | | | | | adjustFallThroughCount isn't a good name, and the documentation was even worse. This commit attempts to clarify what it's for and when to use it. llvm-svn: 199139
* CodeGen: Introduce CodeGenPGO::setCurrentRegionUnreachableJustin Bogner2014-01-133-9/+13
| | | | | | | | There are a number of places where we do PGO.setCurrentRegionCount(0) directly after an unconditional branch. Give this operation a name so that it's clearer why we're doing this. llvm-svn: 199138
* CodeGen: Remove a superfluous setCurrentRegionCountJustin Bogner2014-01-131-1/+0
| | | | | | | | This call looks like it was an artifact of an earlier change, and doesn't actually make sense. We begin a new region immediately anyway, so it was mostly harmless. llvm-svn: 199137
* CodeGen: Remove some unnecessary bracesJustin Bogner2014-01-131-2/+1
| | | | llvm-svn: 199136
* [ms-abi] Leading VFPtrs don't suppress the leading zero sized flagWarren Hunt2014-01-131-1/+3
| | | | | | | | | | The MS-ABI tracks a bit that asserts that the first sub-object is zero sized. This bit is used to add padding between objects if there's the potential for zero sized objects to alias. The bit is still true even if the zero sized base is lead by a VFPtr. This patch makes clang mimic that behavior. llvm-svn: 199132
* Use the MS ABI for Win32 targets by defaultHans Wennborg2014-01-131-2/+5
| | | | | | | | | | In addition to being a sensible default, this is a huge improvement in test coverage for the MS ABI: any bot that targets Win32 will now run the test suite using the MS ABI by default. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199131
* [ms-abi] Quick fix layout of an array of recordsReid Kleckner2014-01-131-4/+2
| | | | | | | This fixes llvm::SmallVector, which fixes lots of TUs in the MS ABI self host. llvm-svn: 199129
* Follow-up to r199120: don't try referencing the dtor if the param decl isn't ↵Hans Wennborg2014-01-131-8/+10
| | | | | | | | valid. This was caught by running test/SemaCXX/destructor.cpp in MS ABI mode. llvm-svn: 199128
* Update for getLazyBitcodeModule API change.Rafael Espindola2014-01-131-3/+5
| | | | llvm-svn: 199126
* Hook up NetBSD/aarch64.Joerg Sonnenberger2014-01-131-0/+2
| | | | llvm-svn: 199124
* [analyzer] Add a CFG node for the allocator call in a C++ 'new' expression.Jordan Rose2014-01-135-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | In an expression like "new (a, b) Foo(x, y)", two things happen: - Memory is allocated by calling a function named 'operator new'. - The memory is initialized using the constructor for 'Foo'. Currently the analyzer only models the second event, though it has special cases for both the default and placement forms of operator new. This patch is the first step towards properly modeling both events: it changes the CFG so that the above expression now generates the following elements. 1. a 2. b 3. (CFGNewAllocator) 4. x 5. y 6. Foo::Foo The analyzer currently ignores the CFGNewAllocator element, but the next step is to treat that as a call like any other. The CFGNewAllocator element is not added to the CFG for analysis-based warnings, since none of them take advantage of it yet. llvm-svn: 199123
* [ms-cxxabi] Elide dtor access checks for pass-by-val objects in calleesHans Wennborg2014-01-131-3/+12
| | | | | | | | | | | | | | | The ABI requires the destructor to be invoked in the callee, but the standard does not require access checks here so we avoid doing direct access checks on the destructor. If we end up needing to define an implicit destructor, we don't skip access checks for the base class, etc. Those checks are effectively part of generating the destructor definition, and aren't affected by which TU the check is performed in. Differential Revision: http://llvm-reviews.chandlerc.com/D2409 llvm-svn: 199120
* clang-format: Fix corner case with comment in ctor initializer.Daniel Jasper2014-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | Formatting: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} Before: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} After: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} llvm-svn: 199107
* clang-format: Don't indent relative to ./->.Daniel Jasper2014-01-131-2/+0
| | | | | | | | | | | | | | | Before: SomeThing // break .SomeFunction( // break param); After: SomeThing // break .SomeFunction( // break param); Seems to be more common in editors and codebases I have looked at. llvm-svn: 199105
* [cleanup] Update the include of Dominators.h to reflect its move to theChandler Carruth2014-01-131-1/+1
| | | | | | IR library in LLVM r199082. llvm-svn: 199083
* [PM] Update Clang to reflect the new header for the bitcode writer passChandler Carruth2014-01-131-1/+1
| | | | | | added in LLVM r199078. llvm-svn: 199079
* Rename target i386-linux-android to i686-linux-androidAlexey Bataev2014-01-131-1/+1
| | | | llvm-svn: 199073
* Delete inaccurate doc comment - isVariadic is long goneAlp Toker2014-01-121-2/+0
| | | | | | The canonical documentation in the header is up-to-date. llvm-svn: 199054
* [PM] Update the creation of an IR printing pass to reflect the APIChandler Carruth2014-01-121-1/+1
| | | | | | update in LLVM r199044. llvm-svn: 199045
OpenPOWER on IntegriCloud