summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Properly diagnose Microsoft __declspec attributes which have optional ↵Aaron Ballman2014-04-142-2/+19
| | | | | | | | | | argument lists when the arguments are elided. eg) __declspec(deprecated()) // error __declspec(deprecated) // OK __declspec(deprecated("")) // OK llvm-svn: 206191
* OnDiskHashTable: Make the iterable version separate.Justin Bogner2014-04-146-32/+70
| | | | | | | | | | | | | | | Currently the on disk hash table's key_iterator and data_iterator make the assumption that the table data starts exactly four bytes after the base of the table. This happens to be true for all of the tables we currently iterate over, but not for all of the OnDiskHashTables we currently use. For example, key_ and data_iterator would iterate over meaningless data if they were used on the hash tables in PTHLexer. We make the API safer by breaking this into two types. One doesn't have the iterators, and the other must be told where the payload starts. llvm-svn: 206189
* OnDiskHashTable: clang-format and consistent namingJustin Bogner2014-04-141-80/+83
| | | | | | | No functional change. Style cleanups in OnDiskChainedHashTable in preparation for some other changes here. llvm-svn: 206188
* Properly diagnose standard C++ attributes which have optional argument lists ↵Aaron Ballman2014-04-146-21/+51
| | | | | | | | | | | when the arguments are elided. eg) [[deprecated()]] // error [[deprecated]] // OK [[deprecated("")]] // OK [[gnu::deprecated()]] // OK llvm-svn: 206186
* Add support for named values in the parser.Samuel Benzaquen2014-04-1410-69/+175
| | | | | | | | | | | | Summary: Add support for named values in the parser. Reviewers: pcc CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D3276 llvm-svn: 206176
* clang-format: Fix regression caused by r206165.Daniel Jasper2014-04-142-1/+13
| | | | llvm-svn: 206173
* clang-format: Fix incorrect &&-detection in macros.Daniel Jasper2014-04-142-0/+4
| | | | | | | | | | | | Before: #define A(a, b) (a &&b) After: #define A(a, b) (a && b) This fixes llvm.org/PR19343. llvm-svn: 206165
* clang-format: Improve array literal formatting fix in r206161.Daniel Jasper2014-04-142-7/+16
| | | | | | | Instead of choosing based on the number of elements, simply respect the user's choice of where to wrap array literals. llvm-svn: 206162
* clang-format: With ColumnLimit=0, keep short array literals on a line.Daniel Jasper2014-04-142-0/+15
| | | | | | | | | | | | | | | | Before: NSArray* a = [[NSArray alloc] initWithArray:@[ @"a" ] copyItems:YES]; After: NSArray* a = [[NSArray alloc] initWithArray:@[ @"a" ] copyItems:YES]; This fixed llvm.org/PR19080. llvm-svn: 206161
* clang-format: Don't allow hanging indentation for operators on new linesDaniel Jasper2014-04-144-21/+52
| | | | | | | | | | | | | | | | Before: if (aaaaaaaa && bbbbbbbbbbbbbbb // need to wrap == cccccccccccccc) ... After: if (aaaaaaaa && bbbbbbbbbbbbbbb // need to wrap == cccccccccccccc) ... The same rule has already be implemented for BreakBeforeBinaryOperators set to false in r205527. llvm-svn: 206159
* Format code around VCS conflict markers.Manuel Klimek2014-04-145-31/+224
| | | | | | | | | | | | | | | | | | | | | Now correctly formats: { int a; void f() { callme(some(parameter1, <<<<<<< text by the vcs parameter2), ||||||| text by the vcs parameter2), parameter3, ======= text by the vcs parameter2, parameter3), >>>>>>> text by the vcs otherparameter); } } llvm-svn: 206157
* clang-format: Improve formatting of annotated variables.Daniel Jasper2014-04-142-6/+8
| | | | | | | | | | | | Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY( aaaaaaaaaaaa) = aaaaaaaa::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) = aaaaaaaa::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 206155
* Improve error recovery around colon.Serge Pavlov2014-04-1310-33/+200
| | | | | | | | | | Parse of nested name spacifier is modified so that it properly recovers if colon is mistyped as double colon in case statement. This patch fixes PR15133. Differential Revision: http://llvm-reviews.chandlerc.com/D2870 llvm-svn: 206135
* Fix diagnostics for C-style cast to function type.Logan Chien2014-04-132-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | If the C-style type cast is applied to the overloaded function and the destination type is function type, then Clang will crash with assertion failure. For example, void foo(int); void foo(int, int); void bar() { typedef void (ft)(int); ft p = (ft)foo; } In this case, the overloaded function foo will be cast to a function type, which should be considered as an error. But, unfortunately, since the function resolution is using canonical type, the matched function will be returned, and result in SEGV. This patch fixes this issue by removing the assertion and add some error diagnostics as the one in static_cast. llvm-svn: 206133
* MS ABI: Bitfields FielDecls only align if they allocateDavid Majnemer2014-04-132-5/+29
| | | | | | | | | Don't consider a __declspec(align) on a bitfield's declaration if it didn't allocate any underlying storage. This fixes PR19414. llvm-svn: 206132
* PR19339: Disambiguate lambdas with init-captures from designated initializersRichard Smith2014-04-133-40/+32
| | | | | | properly. llvm-svn: 206128
* [-fms-extensions] Add tests for __FUNCDNAME__David Majnemer2014-04-131-0/+32
| | | | | | | __FUNCDNAME__ was introduced way back in r194181 but I forgot to add these tests. llvm-svn: 206125
* MS ABI: #pragma vtordisp(0) only disables new vtordispsDavid Majnemer2014-04-132-12/+45
| | | | | | | | | | | Previously, it was believed that #pragma vtordisp(0) would prohibit the generation of any and all vtordisps. In actuality, it only disables the generation of additional vtordisps. This fixes PR19413. llvm-svn: 206124
* Tests for DR501-525.Richard Smith2014-04-133-22/+203
| | | | llvm-svn: 206123
* Replace llvm::array_endof with C++11's std::end.Benjamin Kramer2014-04-122-6/+4
| | | | | | No functionality change. llvm-svn: 206111
* Fix test/Modules/cxx-irgen.cpp for PPC64Hal Finkel2014-04-121-3/+3
| | | | | | Target ABI code might add signext to the return types. llvm-svn: 206107
* Add description about the __is_identifier() macroYunzhong Gao2014-04-121-0/+20
| | | | llvm-svn: 206099
* CodeGen: Test instrumentation based profiling of templatesJustin Bogner2014-04-122-0/+58
| | | | | | | Make sure that templates are handled correctly by profile instrumentation. llvm-svn: 206091
* [MS-ABI] Fix warning introduced in r206087Warren Hunt2014-04-121-2/+2
| | | | | | No functional change. llvm-svn: 206090
* Follow-up to r205999: Emit an artificial location (valid scope, line 0)Adrian Prantl2014-04-112-44/+56
| | | | | | | | | for CXXGlobalInit/Dtor helper functions. This makes _GLOBAL__I_a regain its DW_AT_high/low_pc in the debug info. Thanks to echristo for catching this! llvm-svn: 206088
* [MS-ABI] Fixed alias-avoidance padding in the presence of vtordispsWarren Hunt2014-04-112-4/+32
| | | | | | | If a vtordisp exists between two bases, then there is no need for additional alias avoidance padding. Test case included. llvm-svn: 206087
* CodeGen: Fix handling of C++11 lambdas in profilingJustin Bogner2014-04-113-3/+86
| | | | | | | | | Until now we were generating duplicate counters for lambdas: one set in the function where the lambda was declared and another for the lambda itself. Instead, we should skip over the bodies of lambdas in their containing contexts. llvm-svn: 206081
* [MS-ABI] Update to vtordisp computationWarren Hunt2014-04-112-34/+95
| | | | | | | | | | A portion of the vtordisp computation that was previously unguarded by a test for the declaration of user defined constructors/destructors was erroniously adding vtordisps to things that shouldn't have them. This patch correctly guards that codepath. In addition, it updates the comments to make them more clear. Test case is included. llvm-svn: 206077
* Add a test to distinguish between reserved tokens and normal identifiers.Yunzhong Gao2014-04-113-0/+34
| | | | | | | | | | | | The -fms-extensions option affects a number of subtle front-end C/C++ behaviors, and it would be useful to be able to distinguish MS keywords from regular identifiers in the ms-extensions mode even if the triple does not define a Windows target. It should make life easier if anyone needs to port their Windows codes to elsewhere. Differential Revision: http://reviews.llvm.org/D3034 llvm-svn: 206069
* [PGO] Change MapRegionCounters to be a RecursiveASTVisitor.Bob Wilson2014-04-111-132/+75
| | | | | | | This avoids the overhead of specifying all the traversal code when using ConstStmtVisitor and makes it a lot easier to maintain this. llvm-svn: 206039
* Simplify RecordLayoutBuilder with getAsCXXRecordDecl()Reid Kleckner2014-04-111-57/+34
| | | | | | No functionality change. llvm-svn: 206038
* Correctly handle escaped newlines when the next token starts without a space.Manuel Klimek2014-04-114-6/+14
| | | | | | | We will need this to correctly handle conflict markers inside macro definitions. llvm-svn: 206029
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-116-2/+31
| | | | | Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
* CodeGen: Handle binary conditional operators in PGO instrumentationJustin Bogner2014-04-113-2/+33
| | | | | | | This treats binary conditional operators in the same way as ternary conditional operators for instrumentation based profiling. llvm-svn: 206021
* Cleanup: Add default arguments to CodeGenFunction::StartFunction.Adrian Prantl2014-04-114-16/+12
| | | | | | Thanks dblaikie for the suggestion! llvm-svn: 206012
* Fix handling of redeclaration lookup for using declarations, where the priorRichard Smith2014-04-113-3/+47
| | | | | | | | | | | declaration is not visible. Previously we didn't find hidden friend names in this redeclaration lookup, because we forgot to treat it as a redeclaration lookup. Conversely, we did find some local extern names, but those don't actually conflict with a namespace-scope using declaration, because the only conflicts we can get are scope conflicts, not conflicts due to the entities being members of the same namespace. llvm-svn: 206011
* [MS-ABI] Update Comments in RecordLayoutBuilder - no functional changeWarren Hunt2014-04-111-31/+67
| | | | | | | | This patch updates the comments in RecordLayoutBuilder about record layout in the MS-ABI. Also, I added a section about known incompatibilities. llvm-svn: 206010
* Switch from constexpr to const char *constDuncan P. N. Exon Smith2014-04-111-2/+2
| | | | | | Responding to Richard Smith's review of r205037. llvm-svn: 206008
* [MS-ABI] Update virtual base padding rules to match MSVC 10+Warren Hunt2014-04-113-31/+24
| | | | | | | | | | In version 9 (VS2010) (and prior)? versions of msvc, if the last field in a record was a bitfield padding equal to the size of the storage class of that bitfield was added before each vbase and vtordisp. This patch removes that feature from clang and updates the lit tests to reflect it. llvm-svn: 206004
* InstrProf: Rename Decl parameters from S to DDuncan P. N. Exon Smith2014-04-101-21/+21
| | | | | | | | No functionality change. <rdar://problem/16435801> llvm-svn: 206002
* InstrProf: Read unsigned numbers with strtoul and strtoullDuncan P. N. Exon Smith2014-04-101-6/+6
| | | | | | | | | | | | | | | | | | Fixes a bug where unsigned numbers are read using strtol and strtoll. I don't have a testcase because this bug is effectively unobservable right now. To expose the problem in the hash, we would need a function with greater than INT64_MAX counters, which we don't handle anyway. To expose the problem in the function count, we'd need a function with greater than INT32_MAX counters; this is theoretically observable, but it isn't a practical testcase to check in. An upcoming commit changes the hash to be non-trivial, so we'll get some coverage eventually. <rdar://problem/16435801> llvm-svn: 206001
* [MS-ABI] Fix to vbptr injection site calculation.Warren Hunt2014-04-103-117/+158
| | | | | | | | The vbptr is injected after the last non-virtual base lexographically rather than the last non-virtual base in layout order. Test case included. Also, some line ending fixes. llvm-svn: 206000
* Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_aAdrian Prantl2014-04-1010-41/+83
| | | | | | | | | | | | | | | | are not associated with any source lines. Previously, if the Location of a Decl was empty, EmitFunctionStart would just keep using CurLoc, which would sometimes be correct (e.g., thunks) but in other cases would just point to a hilariously random location. This patch fixes this by completely eliminating all uses of CurLoc from EmitFunctionStart and rather have clients explicitly pass in a SourceLocation for the function header and the function body. rdar://problem/14985269 llvm-svn: 205999
* Update Clang for LLVM split stack API changes in r205997Reid Kleckner2014-04-103-1/+20
| | | | | | Patch by Alex Crichton! llvm-svn: 205998
* [MS-ABI] Fixed __declspec(align()) on bitfields under #pragma pack.Warren Hunt2014-04-102-48/+184
| | | | | | | | | | | | | | | When __declspec(align()) is applied to a bitfield it affects the alignment rather than the required alignment of the struct. The major feature that this patch adds is that the alignment of the structure obeys the alignment of __declspec(align()) from the bitfield over the value specified in pragma pack. Test cases are included. The patch also includes some small cleanups in recordlayoutbuilder and some cleanups to some lit tests, including line endings (but no functionality change to lit tests) llvm-svn: 205994
* inalloca: Pad the struct *after* inserting each argReid Kleckner2014-04-102-11/+23
| | | | | | | This ensures that the overall struct size will be a multiple of 4, as required by the ABI. llvm-svn: 205981
* CodeGen: Move PGO initialization into Release()Justin Bogner2014-04-102-7/+5
| | | | | | | | Emitting the PGO initialization in EmitGlobalFunctionDefinition is inefficient, since this only has an effect once per module. We move this to Release() with the rest of the once-per-module logic. llvm-svn: 205977
* Some minor improvements to the thread safety intermediate language -- mostly ↵Aaron Ballman2014-04-101-82/+57
| | | | | | const correctness and reformatting. Fixes the types involved with castOpcode(). llvm-svn: 205976
* When module umbrellas change, rebuild themBen Langmuir2014-04-107-61/+80
| | | | | | | With the VFS, it is easy to hit modified umbrellas by overriding the umbrella header, and what we want is to rebuild, not to fail. llvm-svn: 205975
* CodeGen: Clean up CommonLinkage calculationDavid Majnemer2014-04-101-10/+35
| | | | | | No functionality change. llvm-svn: 205972
OpenPOWER on IntegriCloud