Commit Graph

53507 Commits

Author SHA1 Message Date
David Majnemer 837d5de330 Sema: Allow aliases to have incomplete type
gcc supports this behavior and it is pervasively used inside the Linux
kernel.

Note that both gcc and clang will reject code that attempts to do this
in a C++ language mode.

This fixes PR17998.

llvm-svn: 212631
2014-07-09 17:15:52 +00:00
Daniel Sanders 0c8d95ab85 [mips][mips64r6] Implement -mips32r6 and -mips64r6 aliases to -march=mips32r6 and -march=mips64r6
Differential Revision: http://reviews.llvm.org/D4434

llvm-svn: 212625
2014-07-09 14:21:18 +00:00
Alp Toker 5d4b87ab50 Prospective legacy build system fix following r212620
llvm-svn: 212624
2014-07-09 14:12:55 +00:00
Alp Toker 532e5b97d4 Remove dead code from r212620
llvm-svn: 212622
2014-07-09 14:09:52 +00:00
Alp Toker 9907f08e61 Fix 'source-level' hyphenations
llvm-svn: 212621
2014-07-09 14:06:35 +00:00
Alp Toker 61dad75b10 cc1as: consolidate option flags with cc1 and eliminate duplication
The clang -cc1as options are nearly a strict subset of -cc1. Instead of
duplicating the definitions and documentation, let's go ahead and share the
definitions in a similar way the current handling of combined driver and
frontend flags, eliminating some of the vestigial legacy surrounding the
assembler subcommand.

llvm-svn: 212620
2014-07-09 14:05:11 +00:00
Daniel Sanders 9500d2d751 [mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 correctly on MIPS32r6/MIPS64r6
Summary:
This removes the need to pass -mnan=2008 explicitly to be able to compile
the test-suite for MIPS32r6/MIPS64r6.

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

llvm-svn: 212619
2014-07-09 13:56:23 +00:00
Daniel Sanders cfbb71dfb6 [mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.
Summary:
While debugging another issue, I noticed that Mips currently specifies that the
count leading zero builtins are undefined when the input is zero. The
architecture specifications say that the clz and dclz instructions write 32 or
64 respectively when given zero.

This doesn't fix any bugs that I'm aware of but it may improve optimisation in
some cases.

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

llvm-svn: 212618
2014-07-09 13:43:19 +00:00
Daniel Jasper 85bcadcdc6 clang-format: Fix behavior around pointer-to-member invocations.
Before:
  (aaaaaaaaaa->*
   bbbbbbb)(aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa));

After:
  (aaaaaaaaaa->*bbbbbbb)(
      aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa));

llvm-svn: 212617
2014-07-09 13:07:57 +00:00
Alexey Bataev 4c8c903b59 Fixed incompatibility with MSVC builds in range-based for loops in DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs.
llvm-svn: 212601
2014-07-09 10:00:31 +00:00
Alexey Bataev 3b2fb0af40 Revert commit 212599.
llvm-svn: 212600
2014-07-09 09:50:46 +00:00
Alexey Bataev e73fe94ac8 [OPENMP] Fixed incompatibility in [Data]RecursiveASTVisitor::TraverseOMPExecutableDirective method with MSVC for range-based loops.
llvm-svn: 212599
2014-07-09 09:33:29 +00:00
Tim Northover e8c3721165 ARM: use LLVM's atomicrmw instructions when ldrex/strex are available.
Having some kind of weird kernel-assisted ABI for these when the
native instructions are available appears to be (and should be) the
exception; OSs have been gradually opting in for years and the code
was getting silly.

So let LLVM decide whether it's possible/profitable to inline them by
default.

Patch by Phoebe Buckheister.

llvm-svn: 212598
2014-07-09 09:24:43 +00:00
Daniel Jasper c75e1effed clang-format: Add new option to indent wrapped function declarations.
Though not completely identical, make former
IndentFunctionDeclarationAfterType change this flag for backwards
compatibility (it is somewhat close in meaning and better the err'ing on
an unknown config flag).

llvm-svn: 212597
2014-07-09 08:42:42 +00:00
Daniel Jasper 7fe6a18141 clang-format: Update flag documentation.
llvm-svn: 212594
2014-07-09 08:19:11 +00:00
Alexey Bataev 69efdd8cc8 [OPENMP] Improved code of DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs per Tobias Grosser comments.
llvm-svn: 212592
2014-07-09 08:00:46 +00:00
Daniel Jasper 4355e7f0ef clang-format: Revamp function declaration/definition indentation.
Key changes:
- Correctly (well ...) distinguish function declarations and variable
  declarations with ()-initialization.
- Don't indent when breaking function declarations/definitions after the
  return type.
- Indent variable declarations and typedefs when breaking after the
  type.

This fixes llvm.org/PR17999.

llvm-svn: 212591
2014-07-09 07:50:33 +00:00
Nikola Smiljanic 1c1256830d Fix typos.
llvm-svn: 212589
2014-07-09 05:42:35 +00:00
Alp Toker ed412dac65 clang-interpreter: don't check input file existence, we're in-process
This flag is set by most other tools and avoids extra stat() calls. The
frontend will diagnose anyway as it performs the check atomically while opening
files at point of use.

We could probably make Driver::CheckInputsExist default to false and only
enable it in the main 'clang' binary, or even better only perform the checks if
we know the tool is external but that needs more thought.

llvm-svn: 212585
2014-07-09 01:37:36 +00:00
Alp Toker 4ea0d2389b Simplify warning flag value handling from r206826
Also give the field it a more appropriate name and improve the docs.

llvm-svn: 212584
2014-07-09 01:37:24 +00:00
Nico Weber 9709ebfaf0 rewrap to 80 cols, no behavior change
llvm-svn: 212578
2014-07-08 23:54:25 +00:00
Nico Weber 3c68ee95ca rewrap to 80 cols, no behavior change
llvm-svn: 212574
2014-07-08 23:46:20 +00:00
Reid Kleckner fd068271e6 MS compat: Allow lookup of types from dependent bases in functions
If we want to resolve the remaining FIXMEs here, we probably want to
extend the main lookup mechanism to perform lookup into dependent bases,
but we would have to tread lightly.  Adding more name lookup has major
impact on compile time.

If we did extend the main mechanism, we would add a flag to LookupResult
that allows us to find names from dependent base classes where the base
is a specialization of a known template.  The final LookupResult would
still return LookupResult::NotFoundInCurrentInstantiation, but it would
have a collection of Decls.  If we find a real lookup result, we would
clear the flag and the existing lookup results and begin accumulating
only real lookup results.

We would structure the lookup as a secondary lookup between normal
lookup and typo correction for normal compilation, but for MSVC
compatibility mode, we would always enable this extra lookup into
dependent bases.

llvm-svn: 212566
2014-07-08 21:35:03 +00:00
Alexey Samsonov cb1ad6f582 Remove unnecessary check for NULL
llvm-svn: 212564
2014-07-08 20:23:18 +00:00
Saleem Abdulrasool 074736f576 test: merge arm-intrin into ms-intrin, fix invocation
This merges the two tests into one since there is no real reason to separate
them.  It also fixes the test invocation to specify -fms-compatibility without
which we would end up without an Intrin.h header.

llvm-svn: 212563
2014-07-08 20:21:29 +00:00
Reid Kleckner 1ba38f8879 Allow more lookup of types in dependent base classes
MSVC appears to perform name lookup into dependent base classes when the
dependent base class has a known primary template.  This allows them to
know whether some unqualified ids are types or not, which allows them to
parse more class templates without typename keywords.

We can do the same thing when type name lookup fails, and if we find a
single type decl in one of our dependent base classes, recover as though
the user wrote 'typename MyClass::TypeFromBase'.

This allows us to parse some COM smart pointer classes in wrl/client.h
from the Windows 8 SDK.

Reviewers: rsmith

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

llvm-svn: 212561
2014-07-08 20:05:48 +00:00
Nico Weber a62cffae52 Don't pull in setjmp.h in -ffreestanding compiles.
Also provide _setjmpex(). r200243 put in _setjmp() and _setjmpex() behind a
comment since jmp_buf wasn't available. r200344 added jmp_buf and put in
_setjmp(), but missed _setjmpex().

llvm-svn: 212557
2014-07-08 18:34:46 +00:00
Nico Weber 1287091373 Replace a few // comments with /**/ comments in headers, for consistency.
llvm-svn: 212556
2014-07-08 18:29:27 +00:00
David Majnemer 03f705fe92 Sema: Don't allow CVR qualifiers before structors
We would silently accept volatile ~S() when the user probably intended
to write virtual ~S().

This fixes PR20238.

llvm-svn: 212555
2014-07-08 18:18:04 +00:00
Richard Smith 1133085461 PR20227: materialize a temporary when dynamic_casting a class prvalue to a
reference type.

llvm-svn: 212551
2014-07-08 17:25:14 +00:00
Benjamin Kramer 46741758c1 Update unit test for signature change.
llvm-svn: 212545
2014-07-08 16:07:39 +00:00
Benjamin Kramer ce416398ef Turn some Twine locals into const char * variables.
No functionality change, just stylistic cleanup. Change made by clang-tidy
and clang-format.

llvm-svn: 212544
2014-07-08 16:07:36 +00:00
David Blaikie 326ffb3683 Improve memory ownership of vfs::Files in the FileSystemStatCache by using std::unique_ptr
Spotted after a memory leak (due to the complexities of manual memory
management) was fixed in 212466.

llvm-svn: 212541
2014-07-08 15:46:02 +00:00
Alexander Musman af89c4e51f [OPENMP] Allow ‘reduction’ clause on ‘omp simd’ directive.
llvm-svn: 212525
2014-07-08 11:33:21 +00:00
Richard Sandiford dcb8d9cc80 Move misplaced x86_32 ABI code
r184166 added an X86_32 function in the middle of the SystemZ code.
The SystemZ port had been added only a couple of weeks earlier and
the original patch probably predated that.

No behavioral change intended.

llvm-svn: 212524
2014-07-08 11:10:34 +00:00
Alexey Bataev 84d0b3efee [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.
llvm-svn: 212516
2014-07-08 08:12:03 +00:00
Saleem Abdulrasool c4ebb129b7 Headers: conditionalise more declarations
Protect MMX specific declarations under a __MMX__ guard.  This header can be
included on non-x86 architectures (e.g. ARM) which do not support the MMX ISA.
Use the preprocessor to prevent these declarations from being processed.

llvm-svn: 212512
2014-07-08 05:46:04 +00:00
Saleem Abdulrasool 60df0615b6 Headers: mark arm_acle.h with extern "C"
Although the functions are marked as always_inline, the compiler with which they
are used may not honour the extended attributes and emit them as functions.  In
such a case, indicate that they should have extern "C" linkage and should not be
mangled in C++ style if used within C++.

llvm-svn: 212511
2014-07-08 05:46:00 +00:00
Reid Kleckner afba553ede MS ABI: "Fix" passing non-POD structs by value to variadic functions
Of course, such code is horribly broken and will explode on impact.
That said, ATL does it, and we have to support them, at least a little
bit.

Fixes PR20191.

llvm-svn: 212508
2014-07-08 02:24:27 +00:00
Alexey Samsonov c94285a1a0 [ASan] Completely remove sanitizer blacklist file from instrumentation pass.
All blacklisting logic is now moved to the frontend (Clang).
If a function (or source file it is in) is blacklisted, it doesn't
get sanitize_address attribute and is therefore not instrumented.
If a global variable (or source file it is in) is blacklisted, it is
reported to be blacklisted by the entry in llvm.asan.globals metadata,
and is not modified by the instrumentation.

The latter may lead to certain false positives - not all the globals
created by Clang are described in llvm.asan.globals metadata (e.g,
RTTI descriptors are not), so we may start reporting errors on them
even if "module" they appear in is blacklisted. We assume it's fine
to take such risk:
  1) errors on these globals are rare and usually indicate wild memory access
  2) we can lazily add descriptors for these globals into llvm.asan.globals
     lazily.

llvm-svn: 212505
2014-07-08 00:50:49 +00:00
Alp Toker d920b7fc85 Rename static function to better describe its purpose
llvm-svn: 212502
2014-07-08 00:02:05 +00:00
Alexey Samsonov ac4afe49e7 [Sanitizer] Remove brittle cache variable and slightly simplify blacklisting code.
Now CodeGenFunction is responsible for looking at sanitizer blacklist
(in CodeGenFunction::StartFunction) and turning off instrumentation,
if necessary.

No functionality change.

llvm-svn: 212501
2014-07-07 23:59:57 +00:00
Alexey Samsonov e7a8ccfaad [Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule
Get rid of cached CodeGenModule::SanOpts, which was used to turn off
sanitizer codegen options if current LLVM Module is blacklisted, and use
plain LangOpts.Sanitize instead.

1) Some codegen decisions (turning TBAA or writable strings on/off)
   shouldn't depend on the contents of blacklist.

2) llvm.asan.globals should *always* be created, even if the module
   is blacklisted - soon Clang's CodeGen where we read sanitizer
   blacklist files, so we should properly report which globals are
   blacklisted to the backend.

llvm-svn: 212499
2014-07-07 23:34:34 +00:00
Alp Toker 5c53298c1e libclang: pass return code out argument by reference
r212427 formalized the message-passing pattern by making these argument
structures const. This commit changes output arguments to get passed by
reference so we can eliminate mutable fields.

llvm-svn: 212497
2014-07-07 22:42:03 +00:00
Joe Groff 98ac7d2d35 ASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.
It is useful to get the property encoding for an ObjC type without a full
ObjCPropertyDecl.

llvm-svn: 212496
2014-07-07 22:25:15 +00:00
Alp Toker 9b6d8a217f PlistSupport: make utility functions non-static inline to encourage linker dedup
llvm-svn: 212494
2014-07-07 21:57:42 +00:00
Reid Kleckner 3b5c639f48 Driver: Produce crash diagnostics more often on Windows
Assertion failures call abort(), which return an exit code of 3 on
Windows.  The 'not' utility has the same check.

Unfortunately, the crash-report.c test requires a shell, so it does not
run for me locally, so I can only test this manually.

There's still more work to be done here: we should generate a batch
script instead of a shell script on Windows.

llvm-svn: 212481
2014-07-07 20:23:27 +00:00
Justin Bogner 761439962b Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps
If there isn't a VFS to overlay we shouldn't be adding a -ivfsoverlay
flag.

llvm-svn: 212468
2014-07-07 17:34:40 +00:00
Ben Langmuir e218cd77b4 Use temporary module cache in test
llvm-svn: 212467
2014-07-07 17:34:37 +00:00
Manuel Klimek 1f6f6e60ad Fix memory leak in FileSystemStatCache.
Patch by Guochun Shi.

llvm-svn: 212466
2014-07-07 17:00:49 +00:00