Diego Novillo [Thu, 29 May 2014 16:19:27 +0000 (16:19 +0000)]
Fix spurious remarks when -Weverything is used.
With -Weverything, the backend remarks are enabled. This was
causing spurious diagnostics for remarks that we don't yet
handle (cf http://reviews.llvm.org/D3683).
This will stop being a problem once http://reviews.llvm.org/D3683
is committed.
Aaron Ballman [Thu, 29 May 2014 12:59:11 +0000 (12:59 +0000)]
Fixing a test case which was failing the MSVC build bots. When -std isn't specified with an MSVC build, it defaults to -std=c++11, which overrides the -x cuda option. In turn, this causes all CUDA language option checks to fail.
This fix is possibly temporary while we determine whether -x cuda should be considered along with -std=c++11 when setting language options.
Richard Smith [Thu, 29 May 2014 03:15:31 +0000 (03:15 +0000)]
When merging functions across modules (and in particular, instantiations of
member functions), ensure that the redecl chain never transitions from 'inline'
to 'not inline', since that violates an AST invariant.
Eli Bendersky [Thu, 29 May 2014 02:35:27 +0000 (02:35 +0000)]
Implement a convenience recursive walk method over a cursor and its descendants.
Before r160106 there was a way to recursively visit all descendants of a cursor
via Cursor_visit, but it was removed. Since then, every user needs to
reimplement the recursive descent into get_children.
Adding a walk_preorder() method to Cursor that conveniently implements recursive
walking in a Pythonic way. This also greatly simplifies get_cursor and
get_cursors in tests/cindex/util.py (walk_preorder is now tested through these
utility functions, since they are used in many tests).
Alexey Samsonov [Thu, 29 May 2014 01:43:53 +0000 (01:43 +0000)]
[ASan] Hoist blacklisting globals from init-order checking to Clang.
Clang knows about the sanitizer blacklist and it makes no sense to
add global to the list of llvm.asan.dynamically_initialized_globals if it
will be blacklisted in the instrumentation pass anyway. Instead, we should
do as much blacklisting as possible (if not all) in the frontend.
Warren Hunt [Wed, 28 May 2014 19:17:45 +0000 (19:17 +0000)]
Reverting 209503 - Breaks asan blacklists
I opened a discussion on cfe-commits. Ideally we've got a few things
that need to happen. CompilerRT should probably have blacklists tests.
Asan should probably not depend on that specific field.
Adrian Prantl [Wed, 28 May 2014 19:10:59 +0000 (19:10 +0000)]
Debug Info: Fix the source range for IfStmt's ConditionScope.
Since the continuation block of the if statement is emitted within the
condition scope this had the undesirable effect of creating a line table
entry at the end of the then or else statement, a line that may have never
been executed.
PR19864 / rdar://problem/17052973
Nick Lewycky [Wed, 28 May 2014 09:56:42 +0000 (09:56 +0000)]
Add 'nonnull' parameter or return attribute when producing an llvm pointer type in a function type where the C++ type is a reference. Update the tests.
Richard Trieu [Wed, 28 May 2014 02:16:01 +0000 (02:16 +0000)]
Move the logic for testing for namespace std into one location. This check can
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace
Hans Wennborg [Wed, 28 May 2014 01:52:23 +0000 (01:52 +0000)]
Don't dllimport/export destructor variants implemented by thunks.
MSVC doesn't export these functions, so trying to import them doesnt' work.
Also, don't let any dll attributes on the CXXDestructorDecl influence the
thunk's linkage -- they should always be linkonce_odr.
This takes care of the FIXME's for this in Nico's tests.
Ben Langmuir [Tue, 27 May 2014 19:57:48 +0000 (19:57 +0000)]
Add a test that we don't store stale modtime in modules
The change from r209195 turned out to be important to avoid saving stale
modification time/expected size information in a module file when there
are 3 or more modules in a dependency chain and the bottom one is
rebuilt. So add a test for that.
James Dennett [Tue, 27 May 2014 19:13:04 +0000 (19:13 +0000)]
Add range accessors for captures of a LambdaExpr.
Summary:
This adds LambdaExpr::captures(), LambdaExpr::explicit_captures()
and LambdaExpr::implicit_captures() as simple wrappers over the underlying
*_begin()/*_end() functions.
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://17024681
Aaron Ballman [Mon, 26 May 2014 17:03:54 +0000 (17:03 +0000)]
Rejecting the mutable specifier on a freestanding type declaration, instead of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers.
Tim Northover [Sat, 24 May 2014 12:51:25 +0000 (12:51 +0000)]
AArch64/ARM64: update Clang after AArch64 removal.
A few (mostly CodeGen) parts of Clang were tightly coupled to the
AArch64 backend. Now that it's gone, they will not even compile.
I've also deduplicated RUN lines in many of the AArch64 tests. This
might improve "make check-all" time noticably: some of those NEON
tests were monsters.
Yaron Keren [Sat, 24 May 2014 07:19:25 +0000 (07:19 +0000)]
CXXInfo memory should be released after calling the destructor
instead of before. The wrong order had no effect since Deallocate()
does nothing right now, but we may replace allocator in the future.
Hans Wennborg [Fri, 23 May 2014 23:29:44 +0000 (23:29 +0000)]
This test doesn't need -O2 -disable-llvm-optzns
I forgot to fix this one in r209145. We use these flags on dllimport tests
to make sure we emit code for available_externaly functions and don't inline
the IR.
Reid Kleckner [Fri, 23 May 2014 21:13:45 +0000 (21:13 +0000)]
Use comdats to avoid double initialization of weak data
Initializers of global data that can appear multiple TUs (static data
members of class templates or __declspec(selectany) data) are now in a
comdat group keyed on the global variable being initialized. On
non-Windows platforms, this is a code size and startup time
optimization. On Windows, this is necessary for ABI compatibility with
MSVC.
Richard Smith [Fri, 23 May 2014 21:00:28 +0000 (21:00 +0000)]
[modules] If a referenced-but-not-instantiated class template specialization
gets explicitly specialized, don't reuse the previous class template
specialization declaration as a new declaration. The benefit here is fairly
marginal, it harms source fidelity, and this is horrible to model if the
specialization was imported from another module (without this change, it
asserts or worse).
Hans Wennborg [Fri, 23 May 2014 20:37:38 +0000 (20:37 +0000)]
Emit used/dllexport inline method definitions in nested classes (PR19743, PR11170)
The previous code that was supposed to handle this didn't work
since parsing of inline method definitions is delayed to the end
of the outer class definition. Thus, when HandleTagDeclDefinition()
got called for the inner class, the inline functions in that class
had not been parsed yet.
Richard suggested that the way to do this is by handling inline
method definitions through a new ASTConsumer callback.
I really wanted to call ASTContext::DeclMustBeEmitted() instead of
checking for attributes, but doing that causes us to compute linkage,
and then we fail with "error: unsupported: typedef changes linkage
of anonymous type, but linkage was already computed" on tests like
this: (from SemaCXX/undefined-internal.cpp) :-/
Hans Wennborg [Fri, 23 May 2014 20:16:41 +0000 (20:16 +0000)]
Don't suppress warning about dllimport on typedefs etc. in MicrosoftExt mode
It's true the MSVC doesn't warn about dllimport when applied to e.g. a typedef,
but that applies to dllexport too. I'd like us to be consistent, and I think
the right thing to do is to warn.
The original test that came with implementing the old behaviour doesn't provide
a good motivation, and it said it was checking that we're not repoting an *error*,
which is still true since this is just a warning.
There are plenty of tests e.g. in Sema/dllimport.c to check that we do warn
about dllimport on non functions or variables.
Ben Langmuir [Fri, 23 May 2014 18:15:47 +0000 (18:15 +0000)]
Stopgap fix for finding module for a file mapped in the VFS
If we lookup a path using its 'real' path first, we need to ensure that
when we run header search we still use the VFS-mapped path or we will
not be able to find the corresponding module for the header.
The real problem is that we tie the name of a file to its underlying
FileEntry, which is uniqued by inode, so we only ever get the first name
it is looked up by. This doesn't work with modules, which rely on a
specific file system structure. I'm hoping to have time to write up a
proposal for fixing this more permanently soon, but as a stopgap this
patch updates the name of the file's directory if it comes from a VFS
mapping.
Manuel Klimek [Fri, 23 May 2014 17:09:56 +0000 (17:09 +0000)]
Make dead return statement detection more robust against changes in the CFG.
This change is a precondition to the proposed change to handle temporary
dtors correctly.
The idea is to explicitly search for the next return that doesn't have other
paths into it (that is, if the current block is dead, the block containing the
return must be dead, too). Thus, introducing non-control-flow block
transitions will not break the logic.
Warren Hunt [Fri, 23 May 2014 16:07:43 +0000 (16:07 +0000)]
[MS-ABI] Implements MS-compatible RTTI
Enables the emission of MS-compatible RTTI data structures for use with
typeid, dynamic_cast and exceptions. Does not implement dynamic_cast
or exceptions. As an artiface, typeid works in some cases but proper
support an testing will coming in a subsequent patch.
majnemer has fuzzed the results. Test cases included.
Dario Domizioli [Fri, 23 May 2014 12:13:25 +0000 (12:13 +0000)]
Implemented support for "pragma clang optimize on/off", based on attribute 'optnone'.
This patch implements support for selectively disabling optimizations on a
range of function definitions through a pragma. The implementation is that
all function definitions in the range are decorated with attribute
'optnone'.
#pragma clang optimize off
// All function definitions in here are decorated with 'optnone'.
#pragma clang optimize on
// Compilation resumes as normal.
Robert Lytton [Fri, 23 May 2014 07:34:08 +0000 (07:34 +0000)]
Fix '-main-file-name <name>' so that it is used for the ModuleID.
Summary:
Previously, you could not specify the original file name when passing a preprocessed file into the compiler
Now you can use 'clang -Xclang -main-file-name -Xclang <original file name> ...'
Or 'clang -cc1 -main-file-name <original file name> ...'
Akira Hatanaka [Fri, 23 May 2014 00:38:07 +0000 (00:38 +0000)]
Fix a bug in xmmintrin.h.
The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
that reads two __m64 values and packs four 32-bit values into four 16-bit
values.
Rafael Espindola [Thu, 22 May 2014 23:33:27 +0000 (23:33 +0000)]
Don't set unnamed_addr in CreateRuntimeVariable.
This was fairly broken. For example,
@__dso_handle would or would not get an unnamed_addr depending on how many
global destructors were used in a translation unit.
The consensus was that not every runtime variable is unnamed_addr and that
__dso_handle handle should not be, so just don't add unnamed_addr in
CreateRuntimeVariable.