Commit Graph

51820 Commits

Author SHA1 Message Date
Reid Kleckner 9df1d975b8 Avoid crashing when failing to emit a thunk
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
2014-04-10 01:40:15 +00:00
Reid Kleckner eb2ecff166 Fix the build with LLVM_DELETED_FUNCTION instead of '= delete'
MSVC 2012 doesn't understand '= delete', but 2013 does.

llvm-svn: 205946
2014-04-10 01:05:01 +00:00
David Majnemer 61182a89e8 Remove Unicode introduced in r205943
llvm-svn: 205945
2014-04-10 00:59:44 +00:00
David Majnemer 64e40c56fb AST: Implement proposal for dependent elaborated type specifiers
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
2014-04-10 00:49:24 +00:00
Ben Langmuir 4469138e98 Move search for header in umbrella directories into its own function
No functional change intended.

llvm-svn: 205942
2014-04-10 00:39:10 +00:00
DeLesley Hutchins 7e615c2f65 Thread Safety Analysis: reorganized SExpr header files. No change in
functionality.

llvm-svn: 205936
2014-04-09 22:39:43 +00:00
Reid Kleckner b49fee0b41 Thread safety: move the inline function back into a namespace
Moving it into a struct makes things work because it implicitly marks
the function as inline.  The struct is unnecessary if you explicitly
mark the function inline.

llvm-svn: 205935
2014-04-09 22:17:06 +00:00
Warren Hunt 39a907b1c2 [MS-ABI] Update to alias-avoidance padding
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
2014-04-09 21:57:24 +00:00
Aaron Ballman 8dbbbcd246 Switching back from a static namespace-scoped function to a static class-scope function. No functional change, but resolves a warning.
llvm-svn: 205931
2014-04-09 21:40:14 +00:00
Aaron Ballman 28347a72c9 Thread Safety Analysis: now with less includes. No functional changes.
llvm-svn: 205929
2014-04-09 21:12:04 +00:00
Reid Kleckner 2a24e3ad86 clang-cl: Disable TBAA by default for MSVC compatibility
MSVC doesn't have an option to enable TBAA, so make -fstrict-aliasing
and -fno-strict-aliasing available in clang-cl.

llvm-svn: 205924
2014-04-09 20:07:39 +00:00
Anders Waldenborg 12da50a8e1 Handle difference in signedness of 'char' in test/Index/print-type.c{,pp}
llvm-svn: 205922
2014-04-09 19:39:07 +00:00
Anders Waldenborg ddce74f6f8 Make c-index-test -test-print-type include pointeekind for pointer types
The idea is to give visibility to more type kinds, especially for getting
a better grasp of what appears as unexposed type kind with libclang.

Differential Revision: http://reviews.llvm.org/D3325

llvm-svn: 205921
2014-04-09 19:16:08 +00:00
Bob Wilson 0e011f201d Add a -triple argument so that this new test passes on Darwin.
The section names used here are not valid for Mach-O.

llvm-svn: 205920
2014-04-09 18:51:19 +00:00
Argyrios Kyrtzidis 9ef53ceb51 [Preprocessor/CodeComplete] Don't add include guard macros to code-completion results.
llvm-svn: 205917
2014-04-09 18:21:23 +00:00
Aaron Ballman 91b079a9fc Cannot have the base class destructor be private (or explicitly deleted); fixing the build bots.
llvm-svn: 205916
2014-04-09 17:55:04 +00:00
Aaron Ballman 3f993c1320 Thread Safety Analysis: some minor cleanups to the latest thread safety 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
2014-04-09 17:45:44 +00:00
Daniel Jasper b55248278f clang-format: Update flag documentation, and generation script.
llvm-svn: 205853
2014-04-09 14:05:49 +00:00
Daniel Jasper f9fc215f82 clang-format: Treat a trailing comment like a trailing comma in braced lists.
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
2014-04-09 13:18:49 +00:00
Daniel Jasper 21397a3232 clang-format: Fix bug where clang-format would break the code.
Before, it would turn:
  SomeFunction([]() { // Cool function..
    return 43;
  });

Into this:
  SomeFunction([]() { // Cool function.. return 43; });

llvm-svn: 205849
2014-04-09 12:21:48 +00:00
Daniel Jasper 3ae6f5a47b clang-format: Improve format of calls with several lambdas.
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
2014-04-09 12:08:39 +00:00
Daniel Jasper f9a0906b98 clang-format: Allow breaking between trailing annotations in more cases.
Before:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override AAAAAAAAAAAAAAAAAAAAAAAA(
      aaaaaaaaaaaaaaa);

After:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override
      AAAAAAAAAAAAAAAAAAAAAAAA(aaaaaaaaaaaaaaa);

llvm-svn: 205846
2014-04-09 10:29:11 +00:00
Daniel Jasper b48d3afcd5 clang-format: Keep more trailing annotations on the same line.
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
2014-04-09 10:01:49 +00:00
Daniel Jasper b175d57edc clang-format: Recognize lists ending in trailing commas correctly.
Previously, this did not look through trailing comments leading to a few
formatting oddities.

llvm-svn: 205843
2014-04-09 09:53:23 +00:00
Daniel Jasper dfacecbd31 clang-format: Add proto files and JavaScript to git-clang-format.
llvm-svn: 205842
2014-04-09 09:22:35 +00:00
NAKAMURA Takumi f605f76519 Sema::SectionInfo() should have an empty body. Sorry for the breakage.
llvm-svn: 205841
2014-04-09 08:26:33 +00:00
NAKAMURA Takumi cdb365000d Sema::SectionInfo: Prune "default" for now. Defaulted function is unavailable on msc17.
llvm-svn: 205840
2014-04-09 07:59:55 +00:00
Richard Trieu c65a56901f Add missing include.
llvm-svn: 205828
2014-04-09 03:31:44 +00:00
Jordan Rose 0675c87395 [analyzer] When checking Foundation method calls, match the selectors exactly.
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
2014-04-09 01:39:22 +00:00
Warren Hunt 975d58c0f9 [MS-ABI] Lit fix for r205810
On linux strings have different linkage than on windows.  This 
patch makes the lit test more general.

llvm-svn: 205812
2014-04-08 22:49:38 +00:00
Warren Hunt c3b18967ed [MS-ABI] Add support for #pragma section and related pragmas
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
2014-04-08 22:30:47 +00:00
DeLesley Hutchins f7813c56b4 Thread Safety Analysis. Misc fixes to SExpr code, responding to code review
by Aaron Ballman.

llvm-svn: 205809
2014-04-08 22:21:22 +00:00
Reid Kleckner 10847c3ed1 Fix the funcsig test with an explicit triple
llvm-svn: 205781
2014-04-08 18:28:09 +00:00
Reid Kleckner 52edddaea5 Add support for MSVC's __FUNCSIG__
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
2014-04-08 18:13:24 +00:00
Reid Kleckner 6df5254d6f intrin.h: Fix up bugs in the cr3 and msr intrinsics
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
2014-04-08 17:49:16 +00:00
Ben Langmuir 1e25822f4d Have validate-system-headers override validate-once-per-build-session
llvm-svn: 205773
2014-04-08 15:36:28 +00:00
Daniel Jasper b77105d2ce clang-format: Fix incorrect multi-block-parameter computation.
llvm-svn: 205763
2014-04-08 14:04:31 +00:00
Richard Smith 50996ce1e3 If a header is explicitly included in module A, and excluded from an umbrella
directory in module B, don't include it in module B!

llvm-svn: 205762
2014-04-08 13:13:04 +00:00
Daniel Jasper 139d4a3875 clang-format: Correctly understand arrays of pointers.
Before:
  A<int * []> a;

After:
  A<int *[]> a;

This fixes llvm.org/PR19360.

llvm-svn: 205761
2014-04-08 13:07:41 +00:00
Daniel Jasper d74cf40386 clang-format: Extend AllowShortFunctions.. to only merge inline functions.
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
2014-04-08 12:46:38 +00:00
Richard Smith 6c6bbfab19 PR19346: Adding 0 to a null pointer has defined behavior in C++. Allow it in constant expressions.
llvm-svn: 205757
2014-04-08 12:19:28 +00:00
Reid Kleckner 592dc61acf intrin.h: Implement __readmsr, __readcr3, and __writecr3
Fixes PR19301.

Based on a patch from Steven Graf!

llvm-svn: 205751
2014-04-08 00:28:22 +00:00
DeLesley Hutchins 11bb308739 Thread Safety Analysis: various fixes to new SExpr code.
Implemented ownership policy, updated to use nullptr, const-cleanup.

llvm-svn: 205745
2014-04-07 22:56:24 +00:00
DeLesley Hutchins 43fd21a045 Thread Safety Analysis: fix warning.
llvm-svn: 205733
2014-04-07 19:51:32 +00:00
Reid Kleckner 0dc06b9a3d -fms-extensions: Don't define __PRETTY_FUNCTION__ to __FUNCTION__
This reverts r90596 from 2009. Having this macro definition makes Clang
strictly less useful with -fms-extensions.

llvm-svn: 205729
2014-04-07 19:27:58 +00:00
DeLesley Hutchins b2213910de Thread Safety Analysis: update to internal SExpr handling.
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
2014-04-07 18:09:54 +00:00
Reid Kleckner bf94e6e14d Mangle the vbptr offset into pointers to member functions
This can actually be non-zero if you override a function from a virtual
base and you have forced the most_general pointer to member
representation.

llvm-svn: 205727
2014-04-07 18:07:03 +00:00
Jordan Rose 7f07fc1fee [analyzer] Fix mistake in example for potential checker "posix.Errno".
Found by Richard Osbourne!

llvm-svn: 205721
2014-04-07 16:36:15 +00:00
Jordan Rose 9c8a5ff161 [analyzer] Re-enable test I accidentally committed commented-out.
Thanks, Alex!

llvm-svn: 205720
2014-04-07 16:36:08 +00:00
Fariborz Jahanian 148c8c8ec2 Revert r205646 (keeping the test in its modified form) as
it is subsumed by r205521.

llvm-svn: 205718
2014-04-07 16:32:54 +00:00