summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [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-111-7/+0
| | | | | | | | | | 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-101-8/+8
| | | | | | | | 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-109-41/+61
| | | | | | | | | | | | | | | | 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-102-1/+2
| | | | | | Patch by Alex Crichton! llvm-svn: 205998
* [MS-ABI] Fixed __declspec(align()) on bitfields under #pragma pack.Warren Hunt2014-04-101-34/+31
| | | | | | | | | | | | | | | 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-101-9/+7
| | | | | | | 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
* When module umbrellas change, rebuild themBen Langmuir2014-04-101-59/+63
| | | | | | | 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
* ARM: Add command line option to select big or little endianChristian Pirker2014-04-101-0/+10
| | | | llvm-svn: 205967
* AArch64: Add command line option to select big or little endianChristian Pirker2014-04-101-3/+9
| | | | llvm-svn: 205966
* [SystemZ] Don't indent SystemZTargetInfo relative to its namespaceRichard Sandiford2014-04-101-91/+91
| | | | | | Whitespace only. No functional change intended. llvm-svn: 205960
* clang-format: Fix false positive in braced list detection in protos.Daniel Jasper2014-04-101-12/+19
| | | | llvm-svn: 205954
* Add global static variables for anonymous union fields. This makesEric Christopher2014-04-102-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sure that a debugger can find them when stepping through code, for example from the included testcase: 12 int test_it() { 13 c = 1; 14 d = 2; -> 15 a = 4; 16 return (c == 1); 17 } 18 (lldb) p a (int) $0 = 2 (lldb) p c (int) $1 = 2 (lldb) p d (int) $2 = 2 and a, c, d are all part of the file static anonymous union: static union { int c; int d; union { int a; }; struct { int b; }; }; Fixes PR19221. llvm-svn: 205952
* Avoid crashing when failing to emit a thunkReid Kleckner2014-04-101-2/+8
| | | | | | | | If we crash, we raise a crash handler dialog, and that's really annoying. Even though we can't emit correct IR until we have musttail, don't crash. llvm-svn: 205948
* Remove Unicode introduced in r205943David Majnemer2014-04-101-4/+4
| | | | llvm-svn: 205945
* AST: Implement proposal for dependent elaborated type specifiersDavid Majnemer2014-04-101-1/+28
| | | | | | | | | cxx-abi-dev came up with a way to disambiguate between different keywords used in elaborated type specifiers. This resolves certain collisions during mangling. llvm-svn: 205943
* Move search for header in umbrella directories into its own functionBen Langmuir2014-04-101-75/+83
| | | | | | No functional change intended. llvm-svn: 205942
* Thread Safety Analysis: reorganized SExpr header files. No change inDeLesley Hutchins2014-04-092-0/+9
| | | | | | functionality. llvm-svn: 205936
* [MS-ABI] Update to alias-avoidance paddingWarren Hunt2014-04-091-16/+15
| | | | | | | | | | This patch changes how we determine if padding is needed between two bases in msvc compatibility mode. Test cases included. In addition, a very minor change to the printing of structures to ease lit testing. llvm-svn: 205933
* Thread Safety Analysis: now with less includes. No functional changes.Aaron Ballman2014-04-091-1/+1
| | | | llvm-svn: 205929
* clang-cl: Disable TBAA by default for MSVC compatibilityReid Kleckner2014-04-091-1/+4
| | | | | | | MSVC doesn't have an option to enable TBAA, so make -fstrict-aliasing and -fno-strict-aliasing available in clang-cl. llvm-svn: 205924
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-095-2/+14
| | | | | | code-completion results. llvm-svn: 205917
* Thread Safety Analysis: some minor cleanups to the latest thread safety ↵Aaron Ballman2014-04-091-44/+34
| | | | | | | | | | | | changes. No functional changes intended. * Adds an iterator_range interface to CallExpr to get the arguments * Modifies SExpr such that it must be allocated in the Arena, and cannot be deleted * Minor const-correctness and nullptr updates * Adds some operator!= implementations to complement operator== * Removes unused functionality llvm-svn: 205915
* clang-format: Treat a trailing comment like a trailing comma in braced lists.Daniel Jasper2014-04-091-5/+7
| | | | | | | | | | | | | | | | | Before: static StructInitInfo module = {MODULE_BUILTIN, /* type */ "streams" /* name */ }; After: static StructInitInfo module = { MODULE_BUILTIN, /* type */ "streams" /* name */ }; This fixes llvm.org/PR19378. llvm-svn: 205851
* clang-format: Fix bug where clang-format would break the code.Daniel Jasper2014-04-091-0/+4
| | | | | | | | | | | | Before, it would turn: SomeFunction([]() { // Cool function.. return 43; }); Into this: SomeFunction([]() { // Cool function.. return 43; }); llvm-svn: 205849
* clang-format: Improve format of calls with several lambdas.Daniel Jasper2014-04-092-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Before: SomeFunction([]() { int i = 42; return i; }, []() { int j = 43; return j; }); After: SomeFunction([]() { int i = 42; return i; }, []() { int j = 43; return j; }); llvm-svn: 205848
* clang-format: Allow breaking between trailing annotations in more cases.Daniel Jasper2014-04-091-5/+5
| | | | | | | | | | | | Before: void aaaaaaaaaaaaaa(aaaaaaaa aaa) override AAAAAAAAAAAAAAAAAAAAAAAA( aaaaaaaaaaaaaaa); After: void aaaaaaaaaaaaaa(aaaaaaaa aaa) override AAAAAAAAAAAAAAAAAAAAAAAA(aaaaaaaaaaaaaaa); llvm-svn: 205846
* clang-format: Keep more trailing annotations on the same line.Daniel Jasper2014-04-091-4/+2
| | | | | | | | | | | | | | | | | | | | More precisely keep all short annotations (<10 characters) on the same line if possible. Previously, clang-format would only prefer to do so for "const", "override" and "final". However, it seems to be generally preferable, especially because some codebases have to wrap those in macros for backwards compatibility. Before: void someLongFunction(int someLongParameter) OVERRIDE {} After: void someLongFunction( int someLongParameter) OVERRIDE {} This fixes llvm.org/PR19363. llvm-svn: 205845
* clang-format: Recognize lists ending in trailing commas correctly.Daniel Jasper2014-04-091-7/+11
| | | | | | | Previously, this did not look through trailing comments leading to a few formatting oddities. llvm-svn: 205843
* Add missing include.Richard Trieu2014-04-091-0/+1
| | | | llvm-svn: 205828
* [analyzer] When checking Foundation method calls, match the selectors exactly.Jordan Rose2014-04-094-76/+154
| | | | | | | | | | This also includes some infrastructure to make it easier to build multi-argument selectors, rather than trying to use string matching on each piece. There's a bit more setup code, but less cost at runtime. PR18908 llvm-svn: 205827
* [MS-ABI] Add support for #pragma section and related pragmasWarren Hunt2014-04-088-14/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the msvc pragmas section, bss_seg, code_seg, const_seg and data_seg as well as support for __declspec(allocate()). Additionally it corrects semantics and adds diagnostics for __attribute__((section())) and the interaction between the attribute and the msvc pragmas and declspec. In general conflicts should now be well diganosed within and among these features. In supporting the pragmas new machinery for uniform lexing for msvc pragmas was introduced. The new machinery always lexes the entire pragma and stores it on an annotation token. The parser is responsible for parsing the pragma when the handling the annotation token. There is a known outstanding bug in this implementation in C mode. Because these attributes and pragmas apply _only_ to definitions, we process them at the time we detect a definition. Due to tentative definitions in C, we end up processing the definition late. This means that in C mode, everything that ends up in a BSS section will end up in the _last_ BSS section rather than the one that was live at the time of tentative definition, even if that turns out to be the point of actual definition. This issue is not known to impact anything as of yet because we are not aware of a clear use or use case for #pragma bss_seg but should be fixed at some point. Differential Revision=http://reviews.llvm.org/D3065#inline-16241 llvm-svn: 205810
* Thread Safety Analysis. Misc fixes to SExpr code, responding to code reviewDeLesley Hutchins2014-04-081-8/+2
| | | | | | by Aaron Ballman. llvm-svn: 205809
* Add support for MSVC's __FUNCSIG__Reid Kleckner2014-04-087-23/+34
| | | | | | | | | | | It is very similar to GCC's __PRETTY_FUNCTION__, except it prints the calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D3311 llvm-svn: 205780
* intrin.h: Fix up bugs in the cr3 and msr intrinsicsReid Kleckner2014-04-081-9/+6
| | | | | | | | | | | Don't include input and output regs in clobbers. Prefix some identifiers with __. Add a memory constraint to __readcr3 to prevent reordering. This constraint is heavy handed, but conservatively correct. Thanks to PaX Team for the suggestions. llvm-svn: 205778
* Have validate-system-headers override validate-once-per-build-sessionBen Langmuir2014-04-081-1/+1
| | | | llvm-svn: 205773
* clang-format: Fix incorrect multi-block-parameter computation.Daniel Jasper2014-04-081-3/+2
| | | | llvm-svn: 205763
* If a header is explicitly included in module A, and excluded from an umbrellaRichard Smith2014-04-082-7/+18
| | | | | | directory in module B, don't include it in module B! llvm-svn: 205762
* clang-format: Correctly understand arrays of pointers.Daniel Jasper2014-04-081-1/+1
| | | | | | | | | | | | Before: A<int * []> a; After: A<int *[]> a; This fixes llvm.org/PR19360. llvm-svn: 205761
* clang-format: Extend AllowShortFunctions.. to only merge inline functions.Daniel Jasper2014-04-082-7/+23
| | | | | | | | | | | | | | | | | Before AllowShortFunctionsOnASingleLine could either be true, merging all functions, or false, merging no functions. This patch adds a third value "Inline", which can be used to only merge short functions defined inline in a class, i.e.: void f() { return 42; } class C { void f() { return 42; } }; llvm-svn: 205760
* PR19346: Adding 0 to a null pointer has defined behavior in C++. Allow it in ↵Richard Smith2014-04-081-2/+2
| | | | | | constant expressions. llvm-svn: 205757
* intrin.h: Implement __readmsr, __readcr3, and __writecr3Reid Kleckner2014-04-081-0/+35
| | | | | | | | Fixes PR19301. Based on a patch from Steven Graf! llvm-svn: 205751
* Thread Safety Analysis: various fixes to new SExpr code.DeLesley Hutchins2014-04-071-20/+34
| | | | | | Implemented ownership policy, updated to use nullptr, const-cleanup. llvm-svn: 205745
* -fms-extensions: Don't define __PRETTY_FUNCTION__ to __FUNCTION__Reid Kleckner2014-04-071-4/+0
| | | | | | | This reverts r90596 from 2009. Having this macro definition makes Clang strictly less useful with -fms-extensions. llvm-svn: 205729
* Thread Safety Analysis: update to internal SExpr handling.DeLesley Hutchins2014-04-073-8/+423
| | | | | | | | | | This patch is the first part of a significant refactoring that seeks to restore sanity to way thread safety analysis deals with capability expressions. The current patch merely provides an outline of the structure of the new system. It's not yet connected to the actual analysis, so there's no change in functionality. llvm-svn: 205728
OpenPOWER on IntegriCloud