summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC doesReid Kleckner2013-09-103-7/+37
| | | | | | | | | | | | Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ. Reviewers: timurrrr CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1477 llvm-svn: 190434
* clang-cl: Support building DLLs (PR17083)Hans Wennborg2013-09-102-9/+42
| | | | | | | | This adds driver support for building DLLs (the /LD and /LDd flags). It basically does two things: runtime selection and passing -dll and -implib to the linker. llvm-svn: 190428
* [ms-cxxabi] Implement guard variables for static initializationReid Kleckner2013-09-1014-34/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | Static locals requiring initialization are not thread safe on Windows. Unfortunately, it's possible to create static locals that are actually externally visible with inline functions and templates. As a result, we have to implement an initialization guard scheme that is compatible with TUs built by MSVC, which makes thread safety prohibitively difficult. MSVC's scheme is that every function that requires a guard gets an i32 bitfield. Each static local is assigned a bit that indicates if it has been initialized, up to 32 bits, at which point a new bitfield is created. MSVC rejects inline functions with more than 32 static locals, and the externally visible mangling (?_B) only allows for one guard variable per function. On Eli's recommendation, I used MangleNumberingContext to track which bit each static corresponds to. Implements PR16888. Reviewers: rjmccall, eli.friedman Differential Revision: http://llvm-reviews.chandlerc.com/D1416 llvm-svn: 190427
* ObjectiveC migrator: rename inferred isXXX property,Fariborz Jahanian2013-09-101-1/+1
| | | | | | with a suitable 'getter' attribute. llvm-svn: 190420
* Don't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144Alexander Kornienko2013-09-101-0/+2
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1639 llvm-svn: 190408
* Correctly calculate OriginalColumn after multi-line tokens.Alexander Kornienko2013-09-103-36/+22
| | | | | | | | | | | | | | Summary: This also unifies the handling of escaped newlines for all tokens. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1638 llvm-svn: 190405
* clang-format: Understand function type typedefs with typeof.Daniel Jasper2013-09-101-0/+5
| | | | | | | | | | | Before: typedef typeof(int(int, int)) * MyFunc; After: typedef typeof(int(int, int)) *MyFunc; This fixes llvm.org/PR17178. llvm-svn: 190401
* Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.Alexander Kornienko2013-09-106-70/+67
| | | | | | | | | | | | | | | | Summary: This fixes various issues with mixed tabs and spaces handling, e.g. when realigning block comments. Reviewers: klimek, djasper Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1608 llvm-svn: 190395
* Delete unused static class membersAlexey Samsonov2013-09-101-2/+0
| | | | llvm-svn: 190394
* Rejected 190391, due to failures on ↵Stepan Dyatkovskiy2013-09-101-12/+65
| | | | | | clang-x86_64-darwin11-nobootstrap-RAincremental. llvm-svn: 190393
* Fix for PR16752. Second commit.Stepan Dyatkovskiy2013-09-101-65/+12
| | | | | | | | | | | | | | | | | | | | | PR16752: 'mode' attribute for unusual targets doesn't work properly Description: Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp). For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only. Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct. Please consider the next solution: 1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width. 2. Fix handleModeAttr according to new methods in TargetInfo. Fixes: 1st Commit (Done): Add new methods for TargetInfo: getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth 2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function. llvm-svn: 190391
* Fix minor coding style issue in r190296 pointed out by Richard Smith.David Tweed2013-09-101-4/+4
| | | | llvm-svn: 190390
* Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.Craig Topper2013-09-101-2/+11
| | | | | | | Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled. Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled. llvm-svn: 190387
* Generate code for the move assignment operator using memcpy, the same as we doNick Lewycky2013-09-101-1/+2
| | | | | | for the copy assignment operator. llvm-svn: 190385
* Make -Wunused warning rules more consistent.Eli Friedman2013-09-102-21/+27
| | | | | | | | | | | | | | | This patch does a few different things. This patch improves unused var diags for const vars: we no longer unconditionally suppress diagnostics for const vars, instead only suppressing the diagnostic when the declaration appears to be useful. This patch also makes us more consistently use whether a variable/function is declared in the main file to suppress diagnostics where appropriate. Fixes <rdar://problem/14907887>. llvm-svn: 190382
* clang-cl: use -fdiagnostics-format=msvc by defaultHans Wennborg2013-09-101-0/+5
| | | | | | | This allows for navigating to errors within the MSVC IDE by clicking on the diagnostics. llvm-svn: 190378
* Ignore calling conventions when checking function template specializationsReid Kleckner2013-09-101-3/+13
| | | | | | | | | | | | | | | | | | | | Summary: Calling conventions are inherited during decl merging. Before this change, deduction would fail due to a type mismatch between the template and the specialization. This change adjusts the CCs to match before deduction, and lets the decl merging logic diagnose mismatch or inherit the CC from the template. This allows specializations of static member function templates in the Microsoft C++ ABI. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1570 llvm-svn: 190377
* ObjectiveC migrator. Do not infer NS_RETURNS_INNER_POINTERFariborz Jahanian2013-09-091-0/+14
| | | | | | | annotation on methods which return typedef of pointer to an incomplete struct type. llvm-svn: 190372
* Adding a FIXME based on feedback from Richard Smith.Aaron Ballman2013-09-091-0/+3
| | | | llvm-svn: 190369
* Attribute tablegen now understands that attribute arguments can be optional. ↵Aaron Ballman2013-09-093-228/+52
| | | | | | This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required. llvm-svn: 190368
* Fix a crash introduced in r189828.Matt Beaumont-Gay2013-09-091-1/+1
| | | | | | | The predicates in CXXRecordDecl which test various properties of special members can't be called on incomplete decls. llvm-svn: 190353
* Modern ObjectiveC translator. Fix translation of Fariborz Jahanian2013-09-091-36/+26
| | | | | | | | message sent to aggregate-valued methods. Fix visibility of trampoline type used in translation of such expressions. // rdar://14932320 llvm-svn: 190341
* C++ modules: if a class is defined in multiple modules (for instance, becauseRichard Smith2013-09-093-99/+157
| | | | | | | | | | | | it is an implicit instantiation of a class template specialization), pick the first-loaded definition to be the canonical definition, and merge all other definitions into it. This is still rather incomplete -- we need to extend every form of declaration that can appear within a CXXRecordDecl to be redeclarable if it came from an AST file (this includes fields, enumerators, ...). llvm-svn: 190315
* CGDebugInfo: Hoist string allocation in a helper function. No functionality ↵Benjamin Kramer2013-09-092-32/+19
| | | | | | change. llvm-svn: 190314
* Sema: Don't crash on visibility attributes with an identifier argument.Benjamin Kramer2013-09-091-3/+4
| | | | | | PR17105. llvm-svn: 190312
* Fix constructor-related typos.Benjamin Kramer2013-09-098-34/+34
| | | | | | Noticed by Roman Divacky. llvm-svn: 190311
* Silencing an MSVC warning about an empty control statement (it dislikes ; ↵Aaron Ballman2013-09-091-2/+2
| | | | | | but is fine with {}). llvm-svn: 190305
* Removing the endian attribute and updating associated test cases. This ↵Aaron Ballman2013-09-091-22/+0
| | | | | | functionality was never completely implemented, and this is an improvement over silently eating the attribute. llvm-svn: 190303
* The OpenCL standard specifies the sizes and alignments of various types than ↵David Tweed2013-09-092-2/+31
| | | | | | | | | | | other C-family languages, as well as specifying errno is not set by the math functions. Make the clang front-end set those appropriately when the OpenCL language option is set. Patch by Erik Schnetter! llvm-svn: 190296
* Additional fix for PR16752 and for commit 190044:Stepan Dyatkovskiy2013-09-091-1/+2
| | | | | | -- For TargetInfo::getRealTypeByWidth also added support for IEEEQuad float type. llvm-svn: 190294
* C++ modules: fix a bug where loading a declaration with some name would preventRichard Smith2013-09-092-14/+28
| | | | | | | | | | | | | | | | | name lookup from lazily deserializing the other declarations with the same name, by tracking a bit to indicate whether a name in a DeclContext might have additional external results. This also allows lazier reconciling of the lookup table if a module import adds decls to a pre-existing DC. However, this exposes a pre-existing bug, which causes a regression in test/Modules/decldef.mm: if we have a reference to a declaration, and a later-imported module adds a redeclaration, nothing causes us to load that redeclaration when we use or emit the reference (which can manifest as a reference to an undefined inline function, a use of an incomplete type, and so on). decldef.mm has been extended with an additional testcase which fails with or without this change. llvm-svn: 190293
* Implement aarch64 neon instruction set AdvSIMD (3V Diff), covering the ↵Jiangning Liu2013-09-091-0/+16
| | | | | | | | following 26 instructions, SADDL, UADDL, SADDW, UADDW, SSUBL, USUBL, SSUBW, USUBW, ADDHN, RADDHN, SABAL, UABAL, SUBHN, RSUBHN, SABDL, UABDL, SMLAL, UMLAL, SMLSL, UMLSL, SQDMLAL, SQDMLSL, SMULL, UMULL, SQDMULL, PMULL llvm-svn: 190289
* clang-format: Keep empty lines and format 1-line nested blocks.Daniel Jasper2013-09-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Let clang-format consistently keep up to one empty line (configured via FormatStyle::MaxEmptyLinesToKeep) in nested blocks, e.g. lambdas. Also, actually format single statements in nested blocks. Before: DEBUG({ int i; }); DEBUG({ int i; // an empty line here would just be removed. int j; }); After: DEBUG({ int i; }); DEBUG({ int i; int j; }); llvm-svn: 190278
* Debug Info: pass in DIScope instead of DIDescriptor in createFieldType.Manman Ren2013-09-082-2/+2
| | | | | | Improve readability. No functionality change. llvm-svn: 190268
* Correct typo.David Majnemer2013-09-071-2/+2
| | | | llvm-svn: 190257
* Fixed bug in call to CXXTemporaryObjectExpr ctor.Enea Zaffanella2013-09-071-1/+1
| | | | llvm-svn: 190249
* 'return' before 'else' is bad styleDavid Majnemer2013-09-071-6/+8
| | | | llvm-svn: 190241
* AST: __uuidof should leak through templated typesDavid Majnemer2013-09-072-13/+64
| | | | | | | | | | | | | | | Summary: __uuidof on templated types should exmaine if any of its template parameters have a uuid declspec. If exactly one does, then take it. Otherwise, issue an appropriate error. Reviewers: rsmith, thakis, rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1419 llvm-svn: 190240
* Fix missing source location in CXXTemporaryObjectExpr nodes.Enea Zaffanella2013-09-076-21/+30
| | | | | | | | For clarity, renamed (get/set)ParenRange as (get/set)ParenOrBraceRange in CXXConstructExpr nodes. Added testcase. llvm-svn: 190239
* ObjectiveC migrator: When inferring a property,Fariborz Jahanian2013-09-061-60/+75
| | | | | | | | preserve getter's attribute. Also, do not attach an inferred NS_RETURNS_INNER_POINTER to the inferred property (it is illegal). llvm-svn: 190223
* Remove error-prone 'list initialization' flag from an implicit conversionRichard Smith2013-09-061-22/+10
| | | | | | | sequence. All that matters here is whether we're doing the std::initializer_list special case thing. llvm-svn: 190213
* clang-format: Fix regression introduced by r190038.Daniel Jasper2013-09-061-1/+6
| | | | | | | | | | | | | Before: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } After: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } llvm-svn: 190209
* clang-format: Format typed enums with nested names.Daniel Jasper2013-09-061-1/+2
| | | | | | | | | The explicit type specified for an enum can actually have a nested name specifier. This fixes llvm.org/PR17125. llvm-svn: 190208
* clang-format: Don't confuse operator[] with lambdas.Daniel Jasper2013-09-061-1/+2
| | | | | | | | | | | | | Before: double &operator[](int i) { return 0; } int i; After: double &operator[](int i) { return 0; } int i; This fixes llvm.org/PR17134. llvm-svn: 190207
* Preserve exception specs in function decl merging.Eli Friedman2013-09-061-2/+4
| | | | | | | | | Exception specs are not part of the canonical type, but we shouldn't drop them just because we merged a noreturn attribute. Fixes PR17110. llvm-svn: 190206
* Unbreak the Clang -Werror build after r190183.David Blaikie2013-09-061-0/+2
| | | | | | | Best guess at the right answer here - no guarantees of fitness for any particular purpose. llvm-svn: 190203
* Add Intrin.h to the cmake files.Eric Christopher2013-09-061-0/+1
| | | | llvm-svn: 190199
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-0610-18/+638
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Don't remove trailing escaped newline from line comments.Alexander Kornienko2013-09-061-1/+1
| | | | llvm-svn: 190175
* Remove unused method Job::AddCommand.Hans Wennborg2013-09-061-5/+0
| | | | | | | | I was going to update the comment referring to PipedJob, which was removed some time ago, but then it turned out that this method is not actually used at all. llvm-svn: 190171
OpenPOWER on IntegriCloud