]> granicus.if.org Git - clang/log
clang
10 years agoDon't pull in setjmp.h in -ffreestanding compiles.
Nico Weber [Tue, 8 Jul 2014 18:34:46 +0000 (18:34 +0000)]
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().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212557 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace a few // comments with /**/ comments in headers, for consistency.
Nico Weber [Tue, 8 Jul 2014 18:29:27 +0000 (18:29 +0000)]
Replace a few // comments with /**/ comments in headers, for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212556 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSema: Don't allow CVR qualifiers before structors
David Majnemer [Tue, 8 Jul 2014 18:18:04 +0000 (18:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212555 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR20227: materialize a temporary when dynamic_casting a class prvalue to a
Richard Smith [Tue, 8 Jul 2014 17:25:14 +0000 (17:25 +0000)]
PR20227: materialize a temporary when dynamic_casting a class prvalue to a
reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212551 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate unit test for signature change.
Benjamin Kramer [Tue, 8 Jul 2014 16:07:39 +0000 (16:07 +0000)]
Update unit test for signature change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212545 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTurn some Twine locals into const char * variables.
Benjamin Kramer [Tue, 8 Jul 2014 16:07:36 +0000 (16:07 +0000)]
Turn some Twine locals into const char * variables.

No functionality change, just stylistic cleanup. Change made by clang-tidy
and clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212544 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImprove memory ownership of vfs::Files in the FileSystemStatCache by using std::uniqu...
David Blaikie [Tue, 8 Jul 2014 15:46:02 +0000 (15:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212541 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Allow ‘reduction’ clause on ‘omp simd’ directive.
Alexander Musman [Tue, 8 Jul 2014 11:33:21 +0000 (11:33 +0000)]
[OPENMP] Allow ‘reduction’ clause on ‘omp simd’ directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212525 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove misplaced x86_32 ABI code
Richard Sandiford [Tue, 8 Jul 2014 11:10:34 +0000 (11:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212524 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.
Alexey Bataev [Tue, 8 Jul 2014 08:12:03 +0000 (08:12 +0000)]
[OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212516 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHeaders: conditionalise more declarations
Saleem Abdulrasool [Tue, 8 Jul 2014 05:46:04 +0000 (05:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212512 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHeaders: mark arm_acle.h with extern "C"
Saleem Abdulrasool [Tue, 8 Jul 2014 05:46:00 +0000 (05:46 +0000)]
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++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212511 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: "Fix" passing non-POD structs by value to variadic functions
Reid Kleckner [Tue, 8 Jul 2014 02:24:27 +0000 (02:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212508 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ASan] Completely remove sanitizer blacklist file from instrumentation pass.
Alexey Samsonov [Tue, 8 Jul 2014 00:50:49 +0000 (00:50 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212505 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRename static function to better describe its purpose
Alp Toker [Tue, 8 Jul 2014 00:02:05 +0000 (00:02 +0000)]
Rename static function to better describe its purpose

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212502 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sanitizer] Remove brittle cache variable and slightly simplify blacklisting code.
Alexey Samsonov [Mon, 7 Jul 2014 23:59:57 +0000 (23:59 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212501 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule
Alexey Samsonov [Mon, 7 Jul 2014 23:34:34 +0000 (23:34 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212499 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agolibclang: pass return code out argument by reference
Alp Toker [Mon, 7 Jul 2014 22:42:03 +0000 (22:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212497 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.
Joe Groff [Mon, 7 Jul 2014 22:25:15 +0000 (22:25 +0000)]
ASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.

It is useful to get the property encoding for an ObjC type without a full
ObjCPropertyDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212496 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPlistSupport: make utility functions non-static inline to encourage linker dedup
Alp Toker [Mon, 7 Jul 2014 21:57:42 +0000 (21:57 +0000)]
PlistSupport: make utility functions non-static inline to encourage linker dedup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212494 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDriver: Produce crash diagnostics more often on Windows
Reid Kleckner [Mon, 7 Jul 2014 20:23:27 +0000 (20:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212481 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDriver: Fix think-o in adding -ivfsoverlay flag to crashdumps
Justin Bogner [Mon, 7 Jul 2014 17:34:40 +0000 (17:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212468 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse temporary module cache in test
Ben Langmuir [Mon, 7 Jul 2014 17:34:37 +0000 (17:34 +0000)]
Use temporary module cache in test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212467 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix memory leak in FileSystemStatCache.
Manuel Klimek [Mon, 7 Jul 2014 17:00:49 +0000 (17:00 +0000)]
Fix memory leak in FileSystemStatCache.

Patch by Guochun Shi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212466 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHandle __builtin_clzs and __builtin_ctzs in the constant expression evaluator.
Anders Carlsson [Mon, 7 Jul 2014 15:53:44 +0000 (15:53 +0000)]
Handle __builtin_clzs and __builtin_ctzs in the constant expression evaluator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212464 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Don't unnecessarily use CGM abstraction
David Majnemer [Mon, 7 Jul 2014 15:29:16 +0000 (15:29 +0000)]
MS ABI: Don't unnecessarily use CGM abstraction

If we are in MicrosoftCXXABI, we don't need to use CGM to get a
TypeDescriptor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212463 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix comment typo.
David Majnemer [Mon, 7 Jul 2014 15:29:10 +0000 (15:29 +0000)]
Fix comment typo.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212462 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPTHInternals.rst: PCH is now a thing, update docs to reflect it
Alp Toker [Mon, 7 Jul 2014 14:02:39 +0000 (14:02 +0000)]
PTHInternals.rst: PCH is now a thing, update docs to reflect it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212458 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPTH: use a variable instead of a macro
Alp Toker [Mon, 7 Jul 2014 14:01:37 +0000 (14:01 +0000)]
PTH: use a variable instead of a macro

Cleanup only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212457 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Added initial support for 'omp parallel for'.
Alexey Bataev [Mon, 7 Jul 2014 13:01:15 +0000 (13:01 +0000)]
[OPENMP] Added initial support for 'omp parallel for'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212453 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIncrease argument limit of anyOf, allOf and eachOf from 5 to 9.
Manuel Klimek [Mon, 7 Jul 2014 12:55:16 +0000 (12:55 +0000)]
Increase argument limit of anyOf, allOf and eachOf from 5 to 9.

Patch by Alexey Sokolov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212452 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove ChainedIncludesSource into the implementation
Alp Toker [Mon, 7 Jul 2014 11:07:10 +0000 (11:07 +0000)]
Move ChainedIncludesSource into the implementation

This doesn't need to be in the headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212451 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memory
Alp Toker [Mon, 7 Jul 2014 11:06:51 +0000 (11:06 +0000)]
ChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memory

Just reference the data instead with shallow MemoryBuffer instances.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212450 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPointerLoc does not exist anymore.
Yaron Keren [Mon, 7 Jul 2014 09:52:31 +0000 (09:52 +0000)]
PointerLoc does not exist anymore.
SourceLocation is available from TypeLoc member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212447 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt (r212445)"
Tobias Grosser [Mon, 7 Jul 2014 09:39:09 +0000 (09:39 +0000)]
Revert "Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt (r212445)"

I misidentified the problem and did not test suffifiently. The files had
correctly been removed, but for some reason they still remained in my git
checkout. Not adding the files back to CMakeLists.txt, but rather removing
the stale files was the solution. Sorry for the unnecessary noise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212446 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt
Tobias Grosser [Mon, 7 Jul 2014 09:23:06 +0000 (09:23 +0000)]
Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt

This fixes the cmake builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212445 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSwitch over a few uses of param_begin() to parameters()
Alp Toker [Mon, 7 Jul 2014 09:02:20 +0000 (09:02 +0000)]
Switch over a few uses of param_begin() to parameters()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212442 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove unused sys/stat.h includes
Alp Toker [Mon, 7 Jul 2014 08:37:15 +0000 (08:37 +0000)]
Remove unused sys/stat.h includes

The facility was abstracted to LLVM in r187364.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212441 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: Cleanup MS ABI RTTI LLVM IR
David Majnemer [Mon, 7 Jul 2014 08:09:15 +0000 (08:09 +0000)]
CodeGen: Cleanup MS ABI RTTI LLVM IR

The MS ABI RTTI emission code would choose names for IR types like
%"MSRTTITypeDescriptor\02".  This name is undesirable because it
requires escaping; the underlying reason for this is that the name is
unprintable.  Fix this by naming it %rtti.TypeDescriptor2.

While here, stop trying to do lookups in the LLVM Module's type table.
Instead, store the IR types in MicrosoftCXXABI.  Lookups by name aren't
particularly fast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212439 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPeel away old-style file remapping typedefs and cruft
Alp Toker [Mon, 7 Jul 2014 07:47:20 +0000 (07:47 +0000)]
Peel away old-style file remapping typedefs and cruft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212438 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix an iterator invalidation issue: deserializing a key function can write to
Richard Smith [Mon, 7 Jul 2014 06:38:20 +0000 (06:38 +0000)]
Fix an iterator invalidation issue: deserializing a key function can write to
the key functions table. Don't hold references to anything within that table
across such an access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212437 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoStaticAnalyzer: Silence a warning
David Majnemer [Mon, 7 Jul 2014 06:20:50 +0000 (06:20 +0000)]
StaticAnalyzer: Silence a warning

ExprEngine wasn't ready for SEHLeaveStmtClass.  Handle it like all the
other SEH constructs by aborting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212436 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: Refactor RTTI emission
David Majnemer [Mon, 7 Jul 2014 06:20:47 +0000 (06:20 +0000)]
CodeGen: Refactor RTTI emission

Let's not expose ABI specific minutia inside of CodeGenModule and Type.
Instead, let's abstract it through CXXABI.

This gets rid of:
CodeGenModule::getCompleteObjectLocator,
CodeGenModule::EmitFundamentalTypeDescriptor{s,},
CodeGenModule::getMSTypeDescriptor,
CodeGenModule::getMSCompleteObjectLocator,
CGCXXABI::shouldRTTIBeUnique,
CGCXXABI::classifyRTTIUniqueness.

CGRTTI was *almost* entirely centered around providing Itanium-style
RTTI information.  Instead of providing interfaces that only it
consumes, move it to the ItaniumCXXABI implementation file.  This allows
it to have access to Itanium-specific implementation details without
providing useless expansion points for the Microsoft ABI side.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212435 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix layering of file remapping and header search initialization
Alp Toker [Mon, 7 Jul 2014 06:05:00 +0000 (06:05 +0000)]
Fix layering of file remapping and header search initialization

These two functions initialize the source manager and header search objects and
shouldn't be in InitPreprocessor which is concerned with priming the
preprocessor itself and predefining macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212434 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd an explicit diagnostic for the case where an expression is not a constant
Richard Smith [Mon, 7 Jul 2014 06:00:13 +0000 (06:00 +0000)]
Add an explicit diagnostic for the case where an expression is not a constant
expression because it uses 'this'. Inspired by PR20219 comment#2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212433 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCleanup. No functionality change intended.
Richard Smith [Mon, 7 Jul 2014 05:36:14 +0000 (05:36 +0000)]
Cleanup. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212432 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agolibclang: refactor handling of unsaved_files
Alp Toker [Mon, 7 Jul 2014 01:23:14 +0000 (01:23 +0000)]
libclang: refactor handling of unsaved_files

Consolidate CXUnsavedFile argument handling in API functions to support a wider
cleanup of various file remapping schemes in the frontend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212427 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate internals manual on how to add AST nodes.
Nico Weber [Mon, 7 Jul 2014 00:50:39 +0000 (00:50 +0000)]
Update internals manual on how to add AST nodes.

StmtDumper.cpp is called ASTDumper.cpp these days, and usually works well
for new AST nodes without changes.  There's now DataRecursiveASTVisitor
in addition to RecursiveASTVisitor, and serialization wasn't mentioned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212426 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd an AST node for __leave statements, hook it up.
Nico Weber [Mon, 7 Jul 2014 00:12:30 +0000 (00:12 +0000)]
Add an AST node for __leave statements, hook it up.

Codegen is still missing (and I won't work on that), but __leave is now
as implemented as __try and friends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212425 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSema: Check that __leave is contained in a __try block.
Nico Weber [Sun, 6 Jul 2014 22:53:19 +0000 (22:53 +0000)]
Sema: Check that __leave is contained in a __try block.

Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema
walk the scope chain to find the SEHTry parent on __leave statements.
(They are rare enough that it seems better to do the walk instead of
giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212422 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd parser support for __leave (sema and onward still missing).
Nico Weber [Sun, 6 Jul 2014 22:32:59 +0000 (22:32 +0000)]
Add parser support for __leave (sema and onward still missing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212421 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGiving this test a triple to satisfy the build bots.
Aaron Ballman [Sun, 6 Jul 2014 20:07:16 +0000 (20:07 +0000)]
Giving this test a triple to satisfy the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212418 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThe MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed...
Aaron Ballman [Sun, 6 Jul 2014 20:04:10 +0000 (20:04 +0000)]
The MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212417 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis test case does not require -Wno-missing-declarations or -x objective-c++.
Aaron Ballman [Sun, 6 Jul 2014 19:44:38 +0000 (19:44 +0000)]
This test case does not require -Wno-missing-declarations or -x objective-c++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212416 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove InterlockedBitTestAndSet into its own test file
Ehsan Akhgari [Sun, 6 Jul 2014 18:45:44 +0000 (18:45 +0000)]
Move InterlockedBitTestAndSet into its own test file

Summary:
This gives us back the test coverage we lost when I made
MicrosoftExtensions.c x86-only.

Reviewers: majnemer

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212414 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 6 Jul 2014 17:43:24 +0000 (17:43 +0000)]
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212408 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix typo in comment.
Nick Lewycky [Sun, 6 Jul 2014 17:32:10 +0000 (17:32 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212404 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPlistSupport.h: avoid gcc 'defined but not used' warning
Alp Toker [Sun, 6 Jul 2014 07:59:14 +0000 (07:59 +0000)]
PlistSupport.h: avoid gcc 'defined but not used' warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212396 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agolibclang: make darwin pthread hacks conditional on LLVM_ENABLE_THREADS
Alp Toker [Sun, 6 Jul 2014 06:24:00 +0000 (06:24 +0000)]
libclang: make darwin pthread hacks conditional on LLVM_ENABLE_THREADS

Although these aren't strictly related to LLVM's core threading, it's
reasonable to avoid pthread usage in clang when building with
LLVM_ENABLE_THREADS disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212395 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoModernize a couple of loops
Alp Toker [Sun, 6 Jul 2014 06:09:20 +0000 (06:09 +0000)]
Modernize a couple of loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212394 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the MicrosoftExtensions.c target
Ehsan Akhgari [Sun, 6 Jul 2014 05:58:55 +0000 (05:58 +0000)]
Fix the MicrosoftExtensions.c target

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212393 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEnable the InterlockedBitTestAndSet test
Ehsan Akhgari [Sun, 6 Jul 2014 05:50:19 +0000 (05:50 +0000)]
Enable the InterlockedBitTestAndSet test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212392 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd support for nested blocks in Microsoft inline assembly
Ehsan Akhgari [Sun, 6 Jul 2014 05:26:54 +0000 (05:26 +0000)]
Add support for nested blocks in Microsoft inline assembly

This fixes http://llvm.org/PR20204.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212389 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse non-intrusive refcounting for TargetOptions
Alp Toker [Sun, 6 Jul 2014 05:26:44 +0000 (05:26 +0000)]
Use non-intrusive refcounting for TargetOptions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212388 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse non-intrusive refcounting for LangOptions
Alp Toker [Sun, 6 Jul 2014 05:26:07 +0000 (05:26 +0000)]
Use non-intrusive refcounting for LangOptions

This type is only refcounted in a couple of places so making ownership explicit
improves clarity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212387 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConstify a read-only parameter and give function a better name
Alp Toker [Sun, 6 Jul 2014 05:14:24 +0000 (05:14 +0000)]
Constify a read-only parameter and give function a better name

This makes it clear that TargetInfo doesn't capture the LangOptions object,
rather uses it to apply adjustments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212386 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agowriteARCDiagsToPlist(): make sure all diag levels get handled
Alp Toker [Sun, 6 Jul 2014 04:27:03 +0000 (04:27 +0000)]
writeARCDiagsToPlist(): make sure all diag levels get handled

Handle 'remark' level diagnostics as warnings instead of supplemental notes,
and use a covered switch to ensure the mapping is kept up to date.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212385 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse PlistSupport in a few more places
Alp Toker [Sun, 6 Jul 2014 04:26:52 +0000 (04:26 +0000)]
Use PlistSupport in a few more places

Switch over LogDiagnosticPrinter and introduce an integer helper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212384 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.
Nico Weber [Sun, 6 Jul 2014 03:04:24 +0000 (03:04 +0000)]
clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212383 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove leftovers of '-arcmt-modify-in-memory' from r133315
Alp Toker [Sat, 5 Jul 2014 22:12:36 +0000 (22:12 +0000)]
Remove leftovers of '-arcmt-modify-in-memory' from r133315

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212381 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: add support for a few MSVC ARM intrinsics
Saleem Abdulrasool [Sat, 5 Jul 2014 20:10:05 +0000 (20:10 +0000)]
CodeGen: add support for a few MSVC ARM intrinsics

This adds support for simple MSVC compatibility mode intrinsics.  These
intrinsics are simple in that they are either directly passed through to the
annotated MSBuiltin intrinsic or they mirror existing GCC builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212378 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a test case for the tilde operator in Microsoft inline assembly
Ehsan Akhgari [Sat, 5 Jul 2014 15:04:06 +0000 (15:04 +0000)]
Add a test case for the tilde operator in Microsoft inline assembly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212373 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTrack IntrusiveRefCntPtr::get() changes from LLVM r212366
Alp Toker [Sat, 5 Jul 2014 03:08:06 +0000 (03:08 +0000)]
Track IntrusiveRefCntPtr::get() changes from LLVM r212366

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212369 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: add support for MSBuiltin aliases
Saleem Abdulrasool [Fri, 4 Jul 2014 21:49:39 +0000 (21:49 +0000)]
CodeGen: add support for MSBuiltin aliases

This completes the infrastructure for the new MSBuiltin aliases in the
instruction definitions.  These behave similar to the GCCBuiltin in that they
can be implicitly constructed without special handling unless needed.

With this change it is possible to annotate an LLVM intrinsic in the backend
instruction definitions and indicate it as a builtin in the Builtin*.def files
in clang via LANGBUILTIN.  That will automatically pass through the instruction
much as a GCCBuiltin.

Note that there is no need for the special handling for ensuring that the
compatibility flag is enabled since the filtering on the LANGBUILTIN will
automatically prevent the intrinsic from bleeding into non-MS compatible
compiler invocations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212359 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPrune some ignored warning options
Alp Toker [Fri, 4 Jul 2014 20:42:50 +0000 (20:42 +0000)]
Prune some ignored warning options

These are forms that have either slipped in without being requested for
compatibility or that GCC doesn't support in the first place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212358 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix up the test that expects the failure fixed in r212352
Ehsan Akhgari [Fri, 4 Jul 2014 19:22:29 +0000 (19:22 +0000)]
Fix up the test that expects the failure fixed in r212352

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212353 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Driver][Mips] Support one more MIPS CPU name - octeon.
Simon Atanasyan [Fri, 4 Jul 2014 12:37:04 +0000 (12:37 +0000)]
[Driver][Mips] Support one more MIPS CPU name - octeon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212339 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Driver][Mips] Support more MIPS CPU names: mips1 - mips5.
Simon Atanasyan [Fri, 4 Jul 2014 12:36:56 +0000 (12:36 +0000)]
[Driver][Mips] Support more MIPS CPU names: mips1 - mips5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212338 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agogcc comptability: silent -fdefer-pop & -fno-defer-pop
Sylvestre Ledru [Fri, 4 Jul 2014 08:59:41 +0000 (08:59 +0000)]
gcc comptability: silent -fdefer-pop & -fno-defer-pop

Reviewers: rafael, rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212327 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLet test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.
NAKAMURA Takumi [Fri, 4 Jul 2014 05:11:55 +0000 (05:11 +0000)]
Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.

This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212316 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTrailing linefeed
NAKAMURA Takumi [Fri, 4 Jul 2014 04:20:49 +0000 (04:20 +0000)]
Trailing linefeed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212312 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixed test CodeGen/captured-statements.c for powerpc64-linux.
Alexey Bataev [Fri, 4 Jul 2014 04:06:11 +0000 (04:06 +0000)]
Fixed test CodeGen/captured-statements.c for powerpc64-linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212311 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake a small crash preventing change.
Fariborz Jahanian [Thu, 3 Jul 2014 21:06:20 +0000 (21:06 +0000)]
Make a small crash preventing change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212291 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRestore global static array in test case
Gerolf Hoflehner [Thu, 3 Jul 2014 19:30:33 +0000 (19:30 +0000)]
Restore global static array in test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212285 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThe RTTI fallback is no more. Remove outdated diagnostic.
Benjamin Kramer [Thu, 3 Jul 2014 18:43:26 +0000 (18:43 +0000)]
The RTTI fallback is no more. Remove outdated diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212281 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ARM] Implement ISB memory barrier intrinsic
Yi Kong [Thu, 3 Jul 2014 16:01:25 +0000 (16:01 +0000)]
[ARM] Implement ISB memory barrier intrinsic

Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions
modelling by adding has-side-effects property.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212277 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd the __qdbl intrinsic to the arm_acle.h header
Renato Golin [Thu, 3 Jul 2014 10:14:52 +0000 (10:14 +0000)]
Add the __qdbl intrinsic to the arm_acle.h header

Patch by: Moritz Roth

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212264 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove the calling of emitTargetMD() later.
Robert Lytton [Thu, 3 Jul 2014 09:30:33 +0000 (09:30 +0000)]
Move the calling of emitTargetMD() later.

Summary:
Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz:
  extern char a[];
  char f(){ return a[5];}
  char a[10];

Change MangledDeclNames to use a MapVector rather than a DenseMap so that the
Metadata is output in order of original declaration, so to make deterministic
and improve human readablity.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212263 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agorefactor for-loop as range-loop before making changes.
Robert Lytton [Thu, 3 Jul 2014 09:30:29 +0000 (09:30 +0000)]
refactor for-loop as range-loop before making changes.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212262 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARMEB: Fix function result return for composite types
Christian Pirker [Thu, 3 Jul 2014 09:28:12 +0000 (09:28 +0000)]
ARMEB: Fix function result return for composite types

Reviewed at http://reviews.llvm.org/D4364

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212261 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Driver][Mips] Check MIPS CPU name provided to the Clang driver.
Simon Atanasyan [Thu, 3 Jul 2014 08:31:23 +0000 (08:31 +0000)]
[Driver][Mips] Check MIPS CPU name provided to the Clang driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212260 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Get linkage of RTTI data correct
David Majnemer [Thu, 3 Jul 2014 05:51:27 +0000 (05:51 +0000)]
MS ABI: Get linkage of RTTI data correct

The Itanium rules are not appropriate for the MS ABI.  RTTI data is
_never_ imported and thus is never available_externally.  It is either
internal (if the type's linkage is internal) or linkonce_odr.

This also means that classes which inherit from dllimport'd bases force
their translation unit to duplicate the entirety of the RTTI data of
that base.

Interestingly, the complete object locator can never be referenced by
translation units which import the class.

This fixes PR20106.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212256 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: rename ARM builtins to use __builtin_arm prefix
Saleem Abdulrasool [Thu, 3 Jul 2014 02:43:20 +0000 (02:43 +0000)]
ARM: rename ARM builtins to use __builtin_arm prefix

This corrects SVN r212196's naming change to use the proper prefix of
`__builtin_arm_` instead of `__builtin_`.

Thanks to Yi Kong for pointing out the incorrect naming!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212253 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAddress review feedback for r212238.
Nico Weber [Thu, 3 Jul 2014 00:38:25 +0000 (00:38 +0000)]
Address review feedback for r212238.

Also, forgot to say in the commit message of r212238: Library authors will
see a warning about this issue if they build with -Wsystem-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212243 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEnable clang to continue to parse libstdc++4.6 and stlport after r210091.
Nico Weber [Wed, 2 Jul 2014 23:51:09 +0000 (23:51 +0000)]
Enable clang to continue to parse libstdc++4.6 and stlport after r210091.

r210091 made initialization checking more strict in c++11 mode. LWG2193 is
about changing standard libraries to still be valid under these new rules,
but older libstdc++ (e.g. libstdc++4.6 in -D_GLIBCXX_DEBUG=1 mode, or stlport)
do not implement that yet.  So fall back to the C++03 semantics for container
classes in system headers below the std namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212238 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the MSVC compatibilty document for class template parsing
Reid Kleckner [Wed, 2 Jul 2014 23:37:33 +0000 (23:37 +0000)]
Update the MSVC compatibilty document for class template parsing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212237 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix linkage bug that miscompiled variable templates instantiated from similarly named...
Larisse Voufo [Wed, 2 Jul 2014 23:08:34 +0000 (23:08 +0000)]
Fix linkage bug that miscompiled variable templates instantiated from similarly named local types. In essence, this bug ensures that the x<Foo> specialization in function foo() defined as follows differs between two distinct translation units.
    static int &foo() {
       struct Foo { };
       return x<Foo>;
    }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212233 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMore editorial issues in MSVCCompatibility.rst
David Majnemer [Wed, 2 Jul 2014 22:14:34 +0000 (22:14 +0000)]
More editorial issues in MSVCCompatibility.rst

Make the status text for lambdas green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212229 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix Typo in MSVCCompatibility.rst
Warren Hunt [Wed, 2 Jul 2014 21:46:03 +0000 (21:46 +0000)]
Fix Typo in MSVCCompatibility.rst
Also removed a sentance that was no longer relevant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212227 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixup typo in MSVCCompatibility.rst
David Majnemer [Wed, 2 Jul 2014 21:09:33 +0000 (21:09 +0000)]
Fixup typo in MSVCCompatibility.rst

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212219 91177308-0d34-0410-b5e6-96231b3b80d8